:root {
    --ink: #10231b;
    --muted: #65736c;
    --line: #dce5df;
    --paper: #f6f8f5;
    --white: #ffffff;
    --green: #08783f;
    --green-dark: #055c31;
    --green-soft: #e7f5ec;
    --yellow: #f5c518;
    --yellow-soft: #fff7cf;
    --blue: #1769aa;
    --red: #bd3535;
    --shadow: 0 16px 45px rgba(16, 35, 27, .08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

.icon {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
}

.shell {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid rgba(220, 229, 223, .88);
    background: rgba(255, 255, 255, .93);
    backdrop-filter: blur(14px);
}

.header-inner {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 18px;
    font-weight: 800;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    background: var(--green);
    color: var(--yellow);
    transform: rotate(6deg);
}

.brand-mark .icon {
    transform: rotate(-6deg);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 7px;
}

.nav-link,
.nav-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 650;
}

.nav-link:hover,
.nav-button:hover,
.nav-link.active {
    background: var(--green-soft);
    color: var(--green-dark);
}

.page {
    padding: 34px 0 64px;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 7px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
}

h2 {
    margin-bottom: 7px;
    font-size: 22px;
    line-height: 1.2;
}

h3 {
    margin-bottom: 5px;
    font-size: 16px;
}

.subtle {
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.stat {
    min-height: 126px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stat-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 7px;
    background: var(--green-soft);
    color: var(--green);
}

.stat-value {
    margin-top: 13px;
    font-size: 28px;
    font-weight: 850;
    line-height: 1;
}

.content-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(270px, .75fr);
    align-items: start;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.panel + .panel {
    margin-top: 18px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head p {
    margin-bottom: 0;
}

.panel-body {
    padding: 22px;
}

.status-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    padding: 24px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--white);
}

.status-band.paid {
    background: var(--green-dark);
}

.status-band h2 {
    margin-bottom: 6px;
}

.status-band p {
    max-width: 620px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, .73);
}

.price {
    color: var(--yellow);
    font-size: 31px;
    font-weight: 900;
    white-space: nowrap;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: var(--green);
    color: var(--white);
    cursor: pointer;
    font-weight: 800;
    transition: transform .15s ease, background .15s ease;
}

.button:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
}

.button.secondary {
    border-color: var(--line);
    background: var(--white);
    color: var(--ink);
}

.button.secondary:hover {
    background: var(--paper);
}

.button.yellow {
    background: var(--yellow);
    color: var(--ink);
}

.button.danger {
    background: var(--red);
}

.button.small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

.button.icon-only {
    width: 40px;
    padding: 0;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}

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

.field {
    display: grid;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    color: #38483f;
    font-size: 13px;
    font-weight: 750;
}

.input,
.select {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #cad6cf;
    border-radius: 7px;
    outline: none;
    background: var(--white);
    color: var(--ink);
}

.input:focus,
.select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(8, 120, 63, .12);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-weight: 650;
}

.check input {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.games {
    display: grid;
}

.game-row {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
    align-items: center;
    gap: 18px;
    padding: 22px;
    border-bottom: 1px solid var(--line);
}

.game-row:last-child {
    border-bottom: 0;
}

.team {
    display: flex;
    align-items: center;
    gap: 13px;
}

.team.away {
    flex-direction: row-reverse;
    text-align: right;
}

.flag {
    display: grid;
    width: 42px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(16, 35, 27, .12);
    border-radius: 4px;
    background: var(--green);
    color: var(--yellow);
    font-size: 19px;
    font-weight: 900;
}

.flag.other {
    background: #edf1ee;
    color: var(--muted);
}

.flag.has-image {
    background: var(--white);
    padding: 0;
}

.flag.has-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flag-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.flag-preview img {
    width: 42px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 4px;
    object-fit: cover;
}

.score-control {
    display: grid;
    grid-template-columns: 54px 15px 54px;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.score-input {
    width: 54px;
    height: 50px;
    padding: 0;
    border: 1px solid #becdc4;
    border-radius: 7px;
    outline: none;
    text-align: center;
    font-size: 20px;
    font-weight: 850;
    appearance: textfield;
}

.score-input::-webkit-inner-spin-button {
    appearance: none;
}

.score-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(8, 120, 63, .12);
}

.game-meta {
    color: var(--muted);
    font-size: 12px;
}

.badge {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.badge.pending {
    background: var(--yellow-soft);
    color: #705a00;
}

.badge.cancelled {
    background: #f9e5e5;
    color: var(--red);
}

.badge.neutral {
    background: #eef1ef;
    color: var(--muted);
}

.ranking {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ranking li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.ranking li:last-child {
    border-bottom: 0;
}

.rank-position {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.rank-score {
    color: var(--green);
    font-weight: 900;
}

.report-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 15px;
    border-radius: 7px;
    background: var(--green-soft);
    color: var(--green-dark);
}

.report-total strong {
    font-size: 20px;
}

.report-list {
    display: grid;
    gap: 12px;
}

.report-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, .9fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fbfdfb;
}

.report-lines {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 13px;
}

.report-points {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.report-points strong {
    color: var(--green);
    font-size: 20px;
}

.pix-box {
    margin-top: 17px;
    padding: 17px;
    border: 1px dashed #9caf9f;
    border-radius: 7px;
    background: #fbfdfb;
}

.pix-admin-preview {
    display: inline-grid;
    gap: 8px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.pix-admin-preview img {
    width: 150px;
    height: 150px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: contain;
    background: var(--white);
}

.pix-code {
    display: block;
    max-height: 88px;
    margin: 12px 0;
    overflow: auto;
    padding: 11px;
    border-radius: 6px;
    background: #edf2ee;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.pix-qr {
    display: block;
    width: 180px;
    height: 180px;
    margin: 0 auto 16px;
    object-fit: contain;
}

.payment-dialog .pix-qr {
    width: min(260px, 100%);
    height: auto;
}

.pix-loading {
    display: grid;
    min-height: 260px;
    place-items: center;
    align-content: center;
    gap: 12px;
    text-align: center;
}

.loader {
    width: 46px;
    height: 46px;
    border: 4px solid var(--green-soft);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin .85s linear infinite;
}

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

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

.prediction-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fbfdfb;
}

.prediction-score {
    color: var(--green-dark);
    font-weight: 900;
    white-space: nowrap;
}

.receipt-preview {
    display: block;
    width: min(100%, 620px);
    max-height: 72vh;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: contain;
    background: var(--white);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid #b5dfc3;
    border-radius: 7px;
    background: var(--green-soft);
    color: var(--green-dark);
}

.alert.error {
    border-color: #edbcbc;
    background: #fff0f0;
    color: #842b2b;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.table th,
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.table th {
    background: #f8faf8;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.table tr:last-child td {
    border-bottom: 0;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

dialog {
    width: min(620px, calc(100% - 28px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .25);
}

dialog::backdrop {
    background: rgba(8, 25, 17, .55);
    backdrop-filter: blur(3px);
}

.dialog-head {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
}

.dialog-head h2 {
    margin-bottom: 0;
}

.dialog-body {
    padding: 20px;
}

.empty {
    padding: 38px 22px;
    color: var(--muted);
    text-align: center;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr);
    background: var(--white);
}

.auth-scene {
    position: relative;
    display: flex;
    min-height: 100vh;
    align-items: flex-end;
    overflow: hidden;
    padding: 64px;
    background:
        linear-gradient(180deg, rgba(6, 72, 38, .08), rgba(6, 72, 38, .9)),
        radial-gradient(circle at 70% 20%, rgba(245, 197, 24, .88) 0 7%, transparent 7.3%),
        linear-gradient(135deg, #0d9a54 0 45%, #08783f 45% 100%);
    color: var(--white);
}

.field-lines {
    position: absolute;
    inset: 8%;
    border: 2px solid rgba(255, 255, 255, .28);
    border-radius: 48%;
    transform: rotate(-12deg) scale(1.4);
}

.field-lines::before,
.field-lines::after {
    position: absolute;
    content: "";
}

.field-lines::before {
    inset: 20%;
    border: 2px solid rgba(255, 255, 255, .24);
    border-radius: 50%;
}

.field-lines::after {
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 2px solid rgba(255, 255, 255, .22);
}

.auth-message {
    position: relative;
    z-index: 1;
    max-width: 590px;
}

.auth-message h1 {
    max-width: 520px;
    margin-bottom: 18px;
    font-size: clamp(43px, 6vw, 76px);
}

.auth-message p {
    max-width: 520px;
    color: rgba(255, 255, 255, .78);
    font-size: 18px;
}

.auth-content {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 40px;
}

.auth-form {
    width: min(100%, 420px);
}

.auth-form .brand {
    margin-bottom: 48px;
}

.auth-form h2 {
    margin-bottom: 9px;
    font-size: 30px;
}

.auth-form form {
    margin-top: 28px;
}

.auth-form .field + .field {
    margin-top: 15px;
}

.auth-form .button {
    width: 100%;
    margin-top: 20px;
}

.auth-switch {
    margin-top: 22px;
    color: var(--muted);
    text-align: center;
}

.auth-switch a {
    color: var(--green);
    font-weight: 800;
}

.mobile-nav {
    display: none;
}

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

    .content-grid {
        grid-template-columns: 1fr;
    }

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-scene {
        min-height: 300px;
        padding: 36px;
    }

    .auth-message h1 {
        font-size: 43px;
    }

    .auth-content {
        min-height: auto;
        padding: 42px 24px;
    }
}

@media (max-width: 700px) {
    body.authenticated {
        padding-bottom: 70px;
    }

    .shell {
        width: min(100% - 24px, 1180px);
    }

    .site-header .desktop-nav {
        display: none;
    }

    .header-inner {
        min-height: 60px;
    }

    .page {
        padding-top: 22px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: 30px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat {
        min-height: 112px;
        padding: 15px;
    }

    .stat-value {
        font-size: 23px;
    }

    .status-band {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px;
    }

    .panel-head,
    .panel-body {
        padding: 17px;
    }

    .game-row {
        grid-template-columns: 1fr auto;
        gap: 16px 8px;
        padding: 18px 16px;
    }

    .game-row .team.away {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .score-control {
        grid-row: 1;
        grid-column: 2;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field.full {
        grid-column: auto;
    }

    .mobile-nav {
        position: fixed;
        z-index: 60;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        min-height: 64px;
        border-top: 1px solid var(--line);
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(12px);
    }

    .mobile-nav form {
        display: flex;
        min-width: 0;
        min-height: 64px;
        margin: 0;
    }

    .mobile-nav a,
    .mobile-nav button {
        display: grid;
        width: 100%;
        min-height: 64px;
        min-width: 0;
        place-items: center;
        gap: 1px;
        padding: 7px 4px;
        border: 0;
        background: transparent;
        color: var(--muted);
        font-size: 10px;
        font-weight: 750;
    }

    .mobile-nav .icon {
        width: 21px;
        height: 21px;
    }

    .auth-scene {
        min-height: 250px;
        padding: 28px 24px;
    }

    .auth-message h1 {
        margin-bottom: 12px;
        font-size: 36px;
    }

    .auth-message p {
        margin-bottom: 0;
        font-size: 15px;
    }

    .auth-form .brand {
        margin-bottom: 34px;
    }

    .ranking li {
        grid-template-columns: 30px minmax(0, 1fr) auto;
    }

    .ranking li .button {
        grid-column: 2 / -1;
        width: 100%;
    }

    .report-item {
        grid-template-columns: 1fr;
    }

    .report-points {
        justify-items: start;
    }
}
