:root {
    color-scheme: light;
    --bg: #f3f6f2;
    --surface: #ffffff;
    --surface-soft: #f7faf7;
    --text: #17231a;
    --muted: #647168;
    --line: #dce5dd;
    --primary: #08783f;
    --primary-dark: #055d31;
    --primary-soft: #e8f6ed;
    --accent: #d7b542;
    --hot: #bc3e4b;
    --hot-soft: #fff0f1;
    --cold: #2673b8;
    --cold-soft: #eef7ff;
    --danger: #a72f3b;
    --danger-soft: #fff0f1;
    --warning: #8b5b00;
    --warning-soft: #fff8df;
    --success: #116a3a;
    --success-soft: #eaf7ef;
    --shadow: 0 22px 70px rgba(21, 50, 30, 0.12);
    --shadow-soft: 0 10px 30px rgba(21, 50, 30, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(8, 120, 63, 0.12), transparent 30rem),
        linear-gradient(180deg, #f8faf7 0%, var(--bg) 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button:focus-visible,
input:focus-visible,
label:focus-within {
    outline: 3px solid rgba(8, 120, 63, 0.24);
    outline-offset: 3px;
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 48px;
    color: #ffffff;
    background:
        linear-gradient(130deg, rgba(5, 75, 40, 0.98), rgba(8, 120, 63, 0.93)),
        #08783f;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
    position: absolute;
    content: "";
    border-radius: 999px;
    pointer-events: none;
}

.hero::before {
    width: 260px;
    height: 260px;
    top: -130px;
    right: -40px;
    background: rgba(255, 255, 255, 0.09);
}

.hero::after {
    width: 180px;
    height: 180px;
    right: 120px;
    bottom: -120px;
    background: rgba(215, 181, 66, 0.22);
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.hero__eyebrow {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.3rem, 7vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero__lead {
    max-width: 640px;
    margin: 20px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(1rem, 2.5vw, 1.22rem);
}

.hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.hero__chips span {
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.84rem;
    font-weight: 700;
    background: rgba(3, 45, 24, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.content {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.panel {
    padding: 32px;
    background: var(--surface);
    border: 1px solid rgba(220, 229, 221, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.section-heading {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.45rem, 4vw, 2rem);
    letter-spacing: -0.025em;
}

.section-heading p {
    max-width: 650px;
    margin: 8px 0 0;
    color: var(--muted);
}

.status-pill {
    flex: 0 0 auto;
    padding: 8px 12px;
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 800;
    background: var(--success-soft);
    border-radius: 999px;
}

.alert {
    padding: 15px 18px;
    font-weight: 650;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.alert-danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(167, 47, 59, 0.16);
}

.alert-warning {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(139, 91, 0, 0.16);
}

.alert-success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(17, 106, 58, 0.16);
}

.form-group {
    margin-bottom: 24px;
}

.form-label,
.group-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 800;
}

.file-control {
    width: 100%;
    padding: 14px;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px dashed #b8c7bb;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.file-control::file-selector-button {
    margin-right: 14px;
    padding: 10px 14px;
    color: #ffffff;
    font-weight: 750;
    background: var(--primary);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.form-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.mode-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.mode-card {
    position: relative;
    display: block;
    min-height: 156px;
    padding: 22px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mode-card:hover {
    border-color: rgba(8, 120, 63, 0.52);
    box-shadow: 0 10px 24px rgba(21, 50, 30, 0.08);
    transform: translateY(-2px);
}

.mode-card:has(input:checked) {
    background: var(--primary-soft);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 120, 63, 0.1);
}

.mode-card input {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 19px;
    height: 19px;
    accent-color: var(--primary);
}

.mode-card__title {
    display: block;
    padding-right: 34px;
    font-size: 1.05rem;
    font-weight: 850;
}

.mode-card__tag {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 850;
    text-transform: uppercase;
    background: rgba(8, 120, 63, 0.1);
    border-radius: 999px;
}

.mode-card__description {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.88rem;
}

.submit-row {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
}

.primary-button {
    min-width: 240px;
    padding: 14px 22px;
    color: #ffffff;
    font-weight: 850;
    background: var(--primary);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(8, 120, 63, 0.2);
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
    background: var(--primary-dark);
    box-shadow: 0 15px 28px rgba(8, 120, 63, 0.26);
    transform: translateY(-2px);
}

.responsibility-note {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.summary-item {
    padding: 9px 12px;
    color: var(--muted);
    font-size: 0.82rem;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.summary-item strong {
    color: var(--text);
}

.stat-card {
    padding: 24px;
    border-radius: var(--radius-md);
}

.stat-card--hot {
    background: var(--hot-soft);
    border: 1px solid rgba(188, 62, 75, 0.16);
}

.stat-card--cold {
    background: var(--cold-soft);
    border: 1px solid rgba(38, 115, 184, 0.16);
}

.stat-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.stat-card p {
    margin: 7px 0 18px;
    color: var(--muted);
    font-size: 0.84rem;
}

.number-grid,
.game-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.number-ball {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    background: #ffffff;
    border: 2px solid var(--primary);
    border-radius: 999px;
    box-shadow: 0 5px 12px rgba(21, 50, 30, 0.08);
}

.number-ball--hot {
    color: #ffffff;
    background: var(--hot);
    border-color: var(--hot);
}

.number-ball--cold {
    color: #ffffff;
    background: var(--cold);
    border-color: var(--cold);
}

.metric {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.82rem;
}

.games-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.game-card {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.game-card__label {
    min-width: 72px;
    font-weight: 850;
}

.game-card .number-ball {
    width: 43px;
    height: 43px;
}

.footer {
    padding: 26px 16px 10px;
    color: var(--muted);
    text-align: center;
    font-size: 0.8rem;
}

.footer strong {
    color: var(--text);
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 20px, 1120px);
        margin: 10px auto 22px;
    }

    .hero,
    .panel {
        padding: 26px 20px;
        border-radius: 20px;
    }

    .section-heading,
    .submit-row,
    .game-card {
        align-items: stretch;
        flex-direction: column;
    }

    .mode-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .primary-button {
        width: 100%;
        min-width: 0;
    }

    .game-numbers {
        justify-content: flex-start;
    }
}

@media (max-width: 420px) {
    .number-ball,
    .game-card .number-ball {
        width: 40px;
        height: 40px;
        font-size: 0.86rem;
    }

    .game-card {
        padding: 16px;
    }
}