:root {
    --lottery-color: #8e0b9f;
    --lottery-color-light: #b000a5;
}

body.app-body {
    background: #f3f4f6;
    color: #0f172a;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.app-navbar {
    background: #fff;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #0f172a
}

.app-brand strong {
    display: block;
    font-size: 1.9rem;
    line-height: 1.05
}

.app-brand small {
    display: block;
    color: #64748b;
    font-size: .75rem
}

.app-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #00bcd4, #1d4ed8);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 10px 22px rgba(29, 78, 216, .2)
}

.home-hero {
    padding: .8rem 0 1rem
}

.home-hero h1 {
    font-size: 2.65rem;
    font-weight: 800;
    margin-bottom: .35rem
}

.home-hero p {
    margin: 0;
    color: #475569;
    font-size: 1.1rem
}

.home-card,
.panel-card,
.resource-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02), 0 4px 18px rgba(15, 23, 42, .05)
}

.home-card {
    padding: 1.25rem;
    position: relative;
    height: 100%;
    transition: .18s transform ease, .18s box-shadow ease
}

.home-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .09)
}

.home-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem
}

.home-card-title {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: .25rem
}

.home-card-desc {
    font-size: .95rem;
    color: #475569;
    line-height: 1.45;
    min-height: 50px
}

.home-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .95rem;
    color: #64748b;
    margin-top: .75rem
}

.resources-panel {
    background: linear-gradient(180deg, #eef4ff, #f8fbff);
    border: 1px solid #d7e3fb;
    border-radius: 24px;
    padding: 2rem 1rem 1.5rem;
    text-align: center;
    overflow: hidden;
}

.resources-icon {
    font-size: 2.1rem;
    color: #2563eb;
    margin-bottom: .8rem;
}

.resources-panel h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: .3rem;
}

.resources-subtitle {
    color: #64748b;
    margin: 0 0 1.25rem;
    font-size: .98rem;
}

.resources-carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.resources-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: .35rem .15rem .75rem;
    scrollbar-width: none;
    width: 100%;
}

.resources-carousel::-webkit-scrollbar {
    display: none;
}

.resource-card {
    flex: 0 0 240px;
    padding: 1.2rem .95rem;
    min-height: 190px;
    height: 100%;
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .10);
    border-color: #c7d7f7;
}

.resource-card i {
    font-size: 2rem;
    display: block;
    margin-bottom: .65rem;
}

.resource-card h3 {
    font-size: 1.12rem;
    font-weight: 800;
    margin-bottom: .4rem;
}

.resource-card p {
    font-size: .93rem;
    color: #475569;
    margin: 0;
    line-height: 1.45;
}

.resources-nav {
    width: 42px;
    height: 42px;
    border: 1px solid #dbe3f2;
    background: #fff;
    color: #0f172a;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
    transition: .18s ease;
    flex: 0 0 auto;
}

.resources-nav:hover {
    transform: translateY(-1px);
    background: #f8fbff;
}

.resources-nav:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.text-purple {
    color: #9333ea
}

.page-head h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0
}

.page-head p {
    margin: 0;
    color: #475569
}

.back-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    text-decoration: none;
    font-size: 1.2rem
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 600
}

.status-success {
    background: #dcfce7;
    color: #15803d
}

.app-btn {
    border-radius: 12px;
    padding: .75rem 1.15rem
}

.btn-primary-gradient {
    background: linear-gradient(135deg, #d100b1, #8e0b9f);
    border: 0;
    color: #fff;
    border-radius: 12px;
    padding: .8rem 1.2rem;
    font-weight: 700
}

.btn-secondary-gradient {
    background: linear-gradient(135deg, #c026d3, #9333ea);
    border: 0;
    color: #fff;
    border-radius: 12px;
    padding: .8rem 1.2rem;
    font-weight: 700
}

.btn-primary-gradient:hover,
.btn-secondary-gradient:hover {
    color: #fff;
    filter: brightness(.98)
}

.loading-state {
    min-height: 55vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: .6rem
}

.loading-state h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0
}

.loading-state p {
    color: #64748b;
    margin: 0
}

.panel-card-body {
    padding: 1.25rem 1.2rem
}

.period-title,
.filter-header,
.tip-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1rem
}

.period-title small {
    font-size: .88rem;
    color: #64748b;
    font-weight: 500
}

.period-summary {
    background: #edf3ff;
    border: 1px solid #c8d7ff;
    border-radius: 12px;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
    text-align: center
}

.period-summary span {
    display: block;
    font-size: .9rem;
    color: #2563eb
}

.period-summary b {
    display: block;
    font-size: 1.55rem;
    color: #1e3a8a
}

.block-title {
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0 0 1rem
}

.big-number {
    font-size: 3rem;
    font-weight: 800
}

.text-primary-gradient {
    background: linear-gradient(135deg, #a21caf, #7e22ce);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.kpi-card {
    height: 100%;
    padding: 1.05rem 1rem
}

.kpi-card .icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    margin-bottom: .8rem
}

.kpi-card .label {
    font-size: 1rem;
    color: #1e3a8a
}

.kpi-card .value {
    font-size: 2.05rem;
    font-weight: 800;
    line-height: 1.1
}

.kpi-card .sub {
    font-size: .82rem;
    color: #64748b;
    margin-top: .25rem
}

.icon-blue {
    background: #dbeafe;
    color: #2563eb
}

.icon-pink {
    background: #fce7f3;
    color: #db2777
}

.icon-green {
    background: #dcfce7;
    color: #16a34a
}

.icon-orange {
    background: #ffedd5;
    color: #f97316
}

.icon-purple {
    background: #f3e8ff;
    color: #9333ea
}

.icon-indigo {
    background: #e0e7ff;
    color: #4f46e5
}

.icon-cyan {
    background: #cffafe;
    color: #0f766e
}

.icon-red {
    background: #ffe4e6;
    color: #f43f5e
}

.repeat-bar-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: .8rem;
    margin-bottom: .55rem
}

.repeat-bar-track {
    height: 20px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden
}

.repeat-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--lottery-color-light), var(--lottery-color));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    padding-right: .45rem;
    min-width: 34px
}

.chart-wrap {
    position: relative;
    height: 320px
}

.chart-wrap.short {
    height: 250px
}

.stat-grid-balls {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .9rem
}

.stat-ball-card {
    background: linear-gradient(180deg, var(--lottery-color-light), var(--lottery-color));
    color: #fff;
    border-radius: 10px;
    padding: 1.2rem .5rem;
    text-align: center;
    font-weight: 800;
    font-size: 2rem
}

.stat-grid-balls.cold .stat-ball-card {
    background: #98a2b3
}

.stat-ball-freq {
    display: none
}

.pair-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 1rem
}

.pair-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    text-align: center
}

.pair-card .freq {
    font-size: .95rem;
    color: #475569;
    margin-top: .45rem
}

.table-ball,
.ball,
.clover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    padding: 0 .55rem;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(180deg, var(--lottery-color-light), var(--lottery-color));
    margin-right: .35rem;
    margin-bottom: .35rem
}

.recent-row {
    background: #f8fafc;
    border-radius: 12px;
    padding: .9rem 1rem;
    margin-bottom: .9rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap
}

.recent-meta {
    min-width: 88px
}

.recent-meta b {
    display: block;
    font-size: 1.25rem
}

.recent-meta span {
    display: block;
    color: #64748b;
    font-size: .9rem
}

.filter-accordion .accordion-item {
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0
}

.filter-accordion .accordion-button {
    padding: 1rem .35rem;
    background: #fff;
    font-weight: 700
}

.filter-accordion .accordion-button:not(.collapsed) {
    color: #1e293b;
    background: #fff;
    box-shadow: none
}

.filter-accordion .accordion-button:focus {
    box-shadow: none
}

.seed-box {
    margin-top: .75rem;
    border-radius: 10px;
    padding: .55rem .75rem;
    font-size: .9rem
}

.seed-blue {
    background: #edf3ff;
    color: #1d4ed8
}

.seed-green {
    background: #e7f6ee;
    color: #15803d
}

.form-hint {
    font-size: .8rem;
    color: #64748b;
    margin-top: .35rem
}

.tip-card {
    background: #eef0ff;
    border-color: #d6dbff
}

.tip-card p {
    color: #475569
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: .55rem
}

.number-chip {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-weight: 800;
    color: #334155;
    transition: .14s ease
}

.number-chip.active {
    background: var(--lottery-color);
    color: #fff;
    border-color: var(--lottery-color);
    box-shadow: 0 10px 18px rgba(0, 0, 0, .12)
}

.generator-empty {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center
}

.generator-empty-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--lottery-color) 14%, white);
    color: var(--lottery-color);
    font-size: 1.6rem;
    margin-bottom: 1rem
}

.generated-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02), 0 4px 18px rgba(15, 23, 42, .05)
}

.analysis-badges {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .8rem
}

.analysis-badges span {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: .3rem .65rem;
    font-size: .82rem
}

.quality-pill {
    font-weight: 700
}

.quality-excelente {
    background: #dcfce7 !important;
    color: #15803d
}

.quality-boa {
    background: #dbeafe !important;
    color: #2563eb
}

.quality-equilibrada {
    background: #fef3c7 !important;
    color: #b45309
}

.quality-regular {
    background: #f3f4f6 !important;
    color: #475569
}

.score-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:88px;
    padding:.45rem .8rem;
    border-radius:12px;
    font-size:1.5rem;
    font-weight:800;
    line-height:1;
    color:#fff;
}

.score-excelente{
    background:linear-gradient(135deg,#16a34a,#22c55e);
}

.score-bom{
    background:linear-gradient(135deg,#2563eb,#60a5fa);
}

.score-medio{
    background:linear-gradient(135deg,#f59e0b,#fbbf24);
}

.score-baixo{
    background:linear-gradient(135deg,#ef4444,#f87171);
}

@media (max-width: 991px) {
    .home-hero h1 {
        font-size: 2rem
    }

    .page-head h1 {
        font-size: 2rem
    }

    .period-summary {
        grid-template-columns: 1fr
    }

    .stat-grid-balls {
        grid-template-columns: repeat(5, minmax(0, 1fr))
    }

    .chart-wrap,
    .chart-wrap.short {
        height: 240px
    }
    
    .resource-card {
        flex: 0 0 220px;
        min-height: 180px;
    }    
}

@media (max-width: 575px) {
    .app-brand strong {
        font-size: 1.4rem
    }

    .period-summary b {
        font-size: 1.2rem
    }

    .stat-grid-balls {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .pair-grid {
        grid-template-columns: 1fr
    }

    .resources-panel {
        padding: 1.4rem .85rem 1.1rem;
    }

    .resources-panel h2 {
        font-size: 1.45rem;
    }

    .resources-subtitle {
        font-size: .9rem;
        margin-bottom: 1rem;
    }

    .resource-card {
        flex: 0 0 82%;
        min-height: 170px;
        border-radius: 16px;
    }

    .resources-nav {
        display: none;
    }    
}

/* =========================================================
   GERADOR V2 - Filtros / Análise IA
   ========================================================= */

.generator-layout-v2 .panel-card {
    overflow: hidden;
}

.generator-control-card {
    position: sticky;
    top: 1rem;
}

.generator-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #d8dee8;
    border-radius: 11px;
    overflow: hidden;
    background: #fff;
}

.generator-mode-tab {
    border: 0;
    min-height: 46px;
    padding: .65rem .8rem;
    background: #fff;
    color: #334155;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
}

.generator-mode-tab + .generator-mode-tab {
    border-left: 1px solid #d8dee8;
}

.generator-mode-tab.active {
    background: var(--lottery-color);
    color: #fff;
}

.generator-tab-pane {
    display: none;
}

.generator-tab-pane.active {
    display: block;
}

.generator-common-box {
    border: 1px solid #dfe4ec;
    border-radius: 14px;
    padding: 1rem;
    background: #fff;
}

.generator-section-title {
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .8rem;
}

.number-selection-legend,
.selection-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .78rem;
    color: #64748b;
}

.legend-fixed,
.legend-excluded {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .7rem;
    margin-right: .3rem;
}

.legend-fixed {
    background: var(--lottery-color);
}

.legend-excluded {
    background: #ef4444;
}

.number-grid-selector {
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: .42rem;
}

.number-selector-chip {
    min-height: 36px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: .84rem;
    box-shadow: none;
}

.number-selector-chip.is-fixed {
    background: var(--lottery-color);
    border-color: var(--lottery-color);
    color: #fff;
    box-shadow: 0 5px 12px color-mix(in srgb, var(--lottery-color) 22%, transparent);
}

.number-selector-chip.is-excluded {
    background: #fff1f2;
    border-color: #fb7185;
    color: #be123c;
    text-decoration: line-through;
    box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .08);
}

.number-selector-chip.is-excluded::after {
    content: "×";
    font-size: .72rem;
    margin-left: 2px;
}

.generator-switch-row {
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    padding: .8rem .9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
}

.generator-switch-row span {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.generator-switch-row small {
    color: #64748b;
    font-size: .76rem;
    font-weight: 400;
}

.generator-main-button {
    min-height: 46px;
    border: 0;
    background: var(--lottery-color);
}

.generator-main-button:hover,
.generator-main-button:focus {
    background: color-mix(in srgb, var(--lottery-color) 88%, black);
}

.ai-strategy-list {
    display: grid;
    gap: .6rem;
}

.ai-strategy-card {
    width: 100%;
    border: 1px solid #dce2eb;
    border-radius: 11px;
    padding: .8rem .85rem;
    background: #fff;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: .7rem;
    text-align: left;
    color: #334155;
    transition: .14s ease;
}

.ai-strategy-card:hover {
    border-color: color-mix(in srgb, var(--lottery-color) 45%, #dce2eb);
}

.ai-strategy-card.active {
    border-color: var(--lottery-color);
    background: color-mix(in srgb, var(--lottery-color) 5%, white);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lottery-color) 12%, transparent);
}

.ai-strategy-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--lottery-color);
    background: color-mix(in srgb, var(--lottery-color) 9%, white);
}

.ai-strategy-card strong,
.ai-strategy-card small {
    display: block;
}

.ai-strategy-card strong {
    color: #0f172a;
    font-size: .92rem;
}

.ai-strategy-card small {
    color: #64748b;
    margin-top: .12rem;
    font-size: .75rem;
}

.ai-window-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
}

.ai-window-button {
    min-height: 38px;
    border: 1px solid #dce2eb;
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font-weight: 700;
}

.ai-window-button.active {
    background: var(--lottery-color);
    color: #fff;
    border-color: var(--lottery-color);
}

.ai-structure-note {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    border-radius: 10px;
    padding: .75rem;
    background: #f8fafc;
    color: #475569;
    font-size: .78rem;
}

.ai-structure-note i {
    color: var(--lottery-color);
    font-size: 1rem;
}

.generator-results-header .panel-card-body {
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.generator-results-title {
    font-weight: 800;
    color: #0f172a;
}

.generated-card-v2 {
    padding: 1.25rem;
    border-radius: 14px;
}

.game-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-left: .4rem;
    padding: .18rem .45rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: .68rem;
    font-weight: 600;
    vertical-align: middle;
}

.generated-number-row {
    display: flex;
    flex-wrap: wrap;
    gap: .48rem;
}

.generated-number {
    min-width: 44px;
    height: 44px;
    padding: 0 .55rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--lottery-color);
    color: #fff;
    font-weight: 800;
}

.ai-quality-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .34rem .7rem;
    color: #fff;
    font-size: .76rem;
    font-weight: 800;
}

.ai-quality-excellent {
    background: #10b981;
}

.ai-quality-good {
    background: #3b82f6;
}

.ai-quality-regular {
    background: #f59e0b;
}

.ai-quality-low {
    background: #ef4444;
}

.ai-analysis-box {
    background: color-mix(in srgb, var(--lottery-color) 5%, #f8fafc);
    border-radius: 10px;
    padding: .8rem .9rem;
    color: #475569;
}

.ai-analysis-title {
    color: var(--lottery-color);
    font-size: .76rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .4rem;
}

.ai-analysis-box ul {
    margin: 0;
    padding-left: 1.05rem;
    font-size: .75rem;
    line-height: 1.55;
}

.ai-analysis-box li::marker {
    color: var(--lottery-color);
}

.ai-analysis-summary,
.normal-analysis-grid {
    display: grid;
    gap: .55rem;
}

.ai-analysis-summary {
    grid-template-columns: repeat(4, 1fr);
}

.normal-analysis-grid {
    grid-template-columns: repeat(6, 1fr);
}

.ai-analysis-summary span,
.normal-analysis-grid span {
    min-height: 52px;
    border-radius: 7px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #0f172a;
}

.ai-analysis-summary b,
.normal-analysis-grid b {
    font-size: .64rem;
    color: #64748b;
    margin-bottom: .1rem;
}

.ai-analysis-summary span:nth-child(1),
.normal-analysis-grid span:nth-child(1) {
    background: #eff6ff;
    color: #1d4ed8;
}

.ai-analysis-summary span:nth-child(2),
.normal-analysis-grid span:nth-child(2) {
    background: #fdf2f8;
    color: #db2777;
}

.ai-analysis-summary span:nth-child(3),
.normal-analysis-grid span:nth-child(3) {
    background: #f0fdf4;
    color: #16a34a;
}

.ai-analysis-summary span:nth-child(4),
.normal-analysis-grid span:nth-child(4) {
    background: #fff7ed;
    color: #ea580c;
}

@media (max-width: 1199px) {
    .generator-control-card {
        position: static;
    }
}

@media (max-width: 767px) {
    .normal-analysis-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ai-analysis-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* =========================================================
   SUPER GERADOR v2.1 - Progresso IA e cards no padrão Figma
   ========================================================= */

.ai-progress-shell {
    border: 1px solid color-mix(in srgb, var(--lottery-color) 24%, #e2e8f0);
    border-radius: 18px;
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--lottery-color) 7%, #ffffff),
            color-mix(in srgb, var(--lottery-color) 3%, #ffffff)
        );
    padding: 1.4rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.ai-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.ai-progress-heading {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.ai-progress-brain {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--lottery-color);
    font-size: 1.45rem;
}

.ai-progress-heading strong {
    display: block;
    font-size: 1.22rem;
    color: #0f172a;
}

.ai-progress-heading small {
    display: block;
    color: #64748b;
    margin-top: .12rem;
}

.ai-stop-button {
    border: 0;
    border-radius: 12px;
    background: #ff3344;
    color: #fff;
    font-weight: 800;
    padding: .75rem 1rem;
}

.ai-stop-button:hover,
.ai-stop-button:focus {
    background: #e52235;
    color: #fff;
}

.ai-progress-stages {
    display: grid;
    gap: .85rem;
}

.ai-progress-stage {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: .75rem;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .9);
}

.ai-progress-stage-icon {
    color: var(--lottery-color);
    font-size: 1.3rem;
    line-height: 1;
    padding-top: .14rem;
}

.ai-progress-stage.is-active .ai-progress-stage-icon i {
    display: inline-block;
    animation: generatorSpin 1s linear infinite;
}

.ai-progress-stage.is-complete .ai-progress-stage-icon {
    color: #00bf63;
}

.ai-progress-stage.is-complete .ai-progress-stage-icon i::before {
    content: "\f26b";
}

@keyframes generatorSpin {
    to { transform: rotate(360deg); }
}

.ai-progress-stage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.ai-progress-stage-row strong {
    font-size: 1.04rem;
    color: #0f172a;
}

.ai-progress-percent {
    color: var(--lottery-color);
    font-size: .94rem;
}

.ai-progress-message {
    margin: .45rem 0 .55rem;
    color: #475569;
    font-size: .9rem;
}

.ai-progress-track {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}

.ai-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--lottery-color) 82%, #ffffff),
        var(--lottery-color)
    );
    transition: width .3s ease;
}

.ai-progress-counters {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    margin-top: .65rem;
    color: #64748b;
    font-size: .76rem;
}

.ai-progress-counters b {
    color: #0f172a;
}

.generator-results-header.is-intelligent-result {
    border: 0;
    background:
        linear-gradient(
            110deg,
            var(--lottery-color),
            color-mix(in srgb, var(--lottery-color) 64%, #6257ff)
        );
    color: #fff;
}

.generator-results-header.is-intelligent-result .panel-card-body {
    padding: 1rem 1.2rem;
}

.generator-results-header.is-intelligent-result .generator-results-title {
    color: #fff;
    display: flex;
    align-items: center;
    gap: .7rem;
}

.generator-results-header.is-intelligent-result .generator-results-title > span:last-child {
    display: flex;
    flex-direction: column;
}

.generator-results-header.is-intelligent-result .generator-results-title strong {
    font-size: 1.1rem;
}

.generator-results-header.is-intelligent-result .generator-results-title small {
    font-size: .78rem;
    font-weight: 500;
    opacity: .9;
    margin-top: .1rem;
}

.figma-result-title-icon {
    font-size: 1.5rem;
}

.generator-results-header.is-intelligent-result .btn {
    background: #fff;
    border-color: #fff;
    color: var(--lottery-color);
    font-weight: 800;
    border-radius: 10px;
}

.figma-game-card {
    border: 1px solid color-mix(in srgb, var(--lottery-color) 14%, #e5e7eb);
    border-radius: 17px;
    background: #fff;
    padding: 1.35rem 1.45rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

.figma-game-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.figma-game-number {
    font-size: .96rem;
    font-weight: 800;
    color: #0f172a;
}

.figma-score-badge {
    display: inline-flex;
    align-items: center;
    margin-left: .55rem;
    padding: .28rem .7rem;
    border-radius: 999px;
    color: #fff;
    font-size: .78rem;
    font-weight: 900;
}

.score-excellent { background: #0abc73; }
.score-good { background: #2f80ed; }
.score-medium { background: #ff8500; }
.score-low { background: #ef4444; }

.figma-number-row {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1rem;
}

.figma-number-ball {
    min-width: 60px;
    height: 60px;
    border-radius: 11px;
    padding: 0 .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--lottery-color);
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    box-shadow: 0 7px 12px rgba(15, 23, 42, .08);
}

.figma-component-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .65rem;
    margin-top: 1.1rem;
}

.figma-component-card {
    min-height: 76px;
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: .55rem;
}

.figma-component-card span {
    font-size: .75rem;
    margin-bottom: .25rem;
}

.figma-component-card strong {
    font-size: 1.2rem;
}

.component-probability {
    background: #f7f0ff;
    color: #8a2be2;
}

.component-patterns {
    background: #eef5ff;
    color: #1f5eff;
}

.component-diversity {
    background: #edfff3;
    color: #009c46;
}

.component-statistical {
    background: #fff4e8;
    color: #a43b00;
}

.component-last-digit {
    background: #fff0f6;
    color: #b00055;
}

.figma-stat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1rem;
}

.figma-stat-pills > span {
    border-radius: 999px;
    padding: .34rem .75rem;
    font-size: .76rem;
}

.pill-even { background: #edf5ff; color: #1261d6; }
.pill-odd { background: #fff0f6; color: #d81b60; }
.pill-low { background: #edfff3; color: #0a9e4b; }
.pill-high { background: #fff4e8; color: #ef6500; }
.pill-sum { background: #f7f0ff; color: #8a2be2; }

.figma-validation-box {
    border-radius: 12px;
    margin-top: .95rem;
    padding: .85rem 1rem;
}

.figma-validation-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-weight: 800;
    margin-bottom: .4rem;
}

.figma-validation-box ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: .78rem;
    line-height: 1.65;
}

.figma-warning-box {
    background: #fffceb;
    border: 1px solid #f6d64a;
    color: #a65600;
}

.figma-recommendation-box {
    background: #eef6ff;
    border: 1px solid #8ec3ff;
    color: #174ed1;
}

@media (max-width: 900px) {
    .figma-component-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .figma-number-ball {
        min-width: 46px;
        height: 46px;
    }
}

@media (max-width: 620px) {
    .ai-progress-head {
        align-items: stretch;
        flex-direction: column;
    }

    .ai-stop-button {
        width: 100%;
    }

    .figma-component-grid {
        grid-template-columns: 1fr 1fr;
    }

    .figma-game-card {
        padding: 1rem;
    }
}

@media print {
    body {
        background: #fff !important;
    }

    .page-head,
    .generator-control-card,
    #generatorAlert,
    #aiProgressPanel,
    .generator-results-header .btn,
    header,
    footer {
        display: none !important;
    }

    .generator-results-header {
        display: block !important;
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
    }

    .generator-results-header .generator-results-title {
        color: #000 !important;
    }

    .figma-game-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        margin-bottom: 12px;
    }
}
