:root {
    --bg: #eef3f0;
    --surface: #ffffff;
    --surface-soft: #f7faf8;
    --text: #15201b;
    --muted: #60706a;
    --line: #dce7e1;
    --green: #167a4a;
    --green-dark: #0e5133;
    --gold: #c99a1a;
    --blue: #2563eb;
    --shadow: 0 22px 60px rgba(19, 42, 32, 0.13);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(22, 122, 74, 0.09), transparent 34%),
        linear-gradient(315deg, rgba(37, 99, 235, 0.08), transparent 30%),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 24px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
}

.sidebar {
    position: sticky;
    top: 28px;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 16px 10px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.brand-mark,
.sidebar a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
}

.brand-mark {
    color: #fff;
    background: var(--green);
    font-weight: 900;
}

.brand-logo {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

.brand-logo circle {
    fill: var(--green);
}

.brand-logo text {
    fill: var(--green);
    font-size: 13px;
    font-weight: 900;
}

.brand-logo .logo-ball-line {
    fill: none;
    stroke: #fff;
    stroke-linecap: round;
    stroke-width: 1.4;
}

.sidebar nav {
    display: grid;
    gap: 12px;
}

.sidebar a {
    color: var(--muted);
    text-decoration: none;
    background: var(--surface-soft);
    font-size: 20px;
    font-weight: 800;
}

.sidebar a.active {
    color: var(--muted);
    background: var(--surface-soft);
}

.nav-icon {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.nav-home-icon {
    stroke-width: 2.35;
}

.content {
    min-width: 0;
}

.topbar,
.hero-panel,
.section-heading,
.match-body,
.bet-row,
.ranking-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar {
    margin-bottom: 18px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 12px;
}

.bolao-switch {
    display: grid;
    gap: 4px;
    min-width: 190px;
}

.bolao-switch label {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.bolao-switch select {
    height: 38px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    padding: 0 10px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--green);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 5vw, 4.2rem);
    line-height: 0.95;
}

h2 {
    margin-bottom: 6px;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1;
}

h3 {
    margin-bottom: 0;
    font-size: 1.2rem;
}

.status-pill,
.notice,
.points-badge,
.history-count,
.match-card .section-heading > span {
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.status-pill {
    color: var(--green-dark);
    background: #dff4e9;
    padding: 10px 14px;
}

.notice {
    display: inline-flex;
    margin: 0 0 18px;
    color: #7c5d08;
    background: #fff4cc;
    padding: 10px 14px;
}

.history-count {
    color: var(--green-dark);
    background: #dff4e9;
    padding: 8px 11px;
    white-space: nowrap;
}

.hero-panel,
.stats-grid article,
.match-card,
.panel {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-panel {
    min-height: 210px;
    padding: clamp(22px, 4vw, 42px);
    background:
        linear-gradient(135deg, rgba(14, 81, 51, 0.96), rgba(22, 122, 74, 0.88)),
        var(--green-dark);
    color: #fff;
}

.hero-panel .eyebrow,
.hero-subtitle {
    color: rgba(255, 255, 255, 0.76);
}

.hero-subtitle {
    margin-bottom: 0;
    font-weight: 700;
}

.score-orbit {
    display: grid;
    place-items: center;
    width: clamp(112px, 22vw, 158px);
    aspect-ratio: 1;
    color: var(--green-dark);
    background: #fff;
    border-radius: 50%;
    box-shadow: inset 0 0 0 10px #dff4e9;
}

.score-orbit span {
    font-size: clamp(2.4rem, 6vw, 4.3rem);
    font-weight: 900;
    line-height: 0.9;
}

.score-orbit small {
    color: var(--muted);
    font-weight: 900;
}

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

.stats-grid article {
    padding: 18px;
}

.stats-grid span,
.match-body small,
.bet-row small {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.stats-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 1.8rem;
}

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
    gap: 16px;
}

.left-column {
    display: grid;
    gap: 16px;
}

.ranking-column {
    display: grid;
    gap: 16px;
    align-content: start;
}

.match-card,
.panel {
    padding: 20px;
}

.match-card .section-heading > span,
.match-title-line > span {
    color: #fff;
    background: var(--blue);
    padding: 7px 11px;
}

.match-body,
.match-list {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.match-list {
    display: grid;
    gap: 10px;
    max-height: 430px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-color: rgba(96, 112, 106, 0.55) transparent;
    scrollbar-width: thin;
}

.match-list::-webkit-scrollbar {
    width: 8px;
}

.match-list::-webkit-scrollbar-thumb {
    background: rgba(96, 112, 106, 0.38);
    border-radius: 999px;
}

.match-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    min-height: 74px;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.match-row.needs-bet {
    border-color: rgba(201, 154, 26, 0.55);
    background: #fffaf0;
}

.match-row-main,
.match-pick {
    display: grid;
    gap: 5px;
}

.match-title-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.match-title-line > span {
    font-size: 0.72rem;
    padding: 6px 9px;
}

.match-pick {
    min-width: 142px;
    justify-items: end;
    text-align: right;
}

.match-pick strong {
    font-size: 1.08rem;
}

.match-pick span {
    color: var(--green-dark);
    background: #dff4e9;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 6px 9px;
}

.match-row.needs-bet .match-pick span {
    color: #7c5d08;
    background: #fff0b8;
}

.match-vote {
    display: flex;
    align-items: end;
    justify-content: end;
    gap: 10px;
}

.score-inputs {
    display: flex;
    align-items: end;
    gap: 6px;
}

.score-inputs label {
    display: grid;
    gap: 4px;
}

.score-inputs span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.score-inputs input {
    width: 56px;
    height: 38px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-weight: 900;
    text-align: center;
}

.score-inputs strong {
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.match-vote button {
    height: 38px;
    color: #fff;
    background: var(--green);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 900;
    padding: 0 13px;
}

.match-vote button:hover,
.match-vote button:focus-visible {
    background: var(--green-dark);
}

.empty-state {
    color: var(--muted);
    font-weight: 800;
}

.match-body strong {
    display: block;
    margin-top: 6px;
    font-size: 1.35rem;
}

.bets-list,
.ranking-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.bets-list {
    max-height: 398px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-color: rgba(96, 112, 106, 0.55) transparent;
    scrollbar-width: thin;
}

.bets-list::-webkit-scrollbar {
    width: 8px;
}

.bets-list::-webkit-scrollbar-thumb {
    background: rgba(96, 112, 106, 0.38);
    border-radius: 999px;
}

.bet-row,
.ranking-list li {
    min-height: 68px;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.bet-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(116px, 132px) 54px;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.bet-row > div:first-child,
.bet-score {
    display: grid;
    gap: 4px;
}

.bet-row > div:first-child {
    min-width: 0;
}

.bet-score {
    min-width: 116px;
    justify-items: end;
    text-align: right;
}

.points-badge {
    min-width: 48px;
    justify-self: end;
    color: var(--green-dark);
    background: #dff4e9;
    padding: 8px 10px;
    text-align: center;
}

.ranking-list {
    list-style: none;
    padding: 0;
    max-height: 278px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-color: rgba(96, 112, 106, 0.55) transparent;
    scrollbar-width: thin;
}

.ranking-list::-webkit-scrollbar {
    width: 8px;
}

.ranking-list::-webkit-scrollbar-thumb {
    background: rgba(96, 112, 106, 0.38);
    border-radius: 999px;
}

.ranking-panel {
    min-height: 370px;
}

.ranking-list li {
    min-height: 50px;
    padding: 8px 10px;
    gap: 10px;
}

.ranking-list li.current {
    border-color: rgba(22, 122, 74, 0.55);
    background: #eaf8f0;
}

.position {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: var(--green-dark);
    background: #dff4e9;
    border-radius: 50%;
    font-size: 0.86rem;
    font-weight: 900;
    flex: 0 0 auto;
}

.ranking-list strong {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.2;
}

.ranking-list li > span:last-child {
    color: var(--muted);
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: right;
}

.ranking-list-general li {
    align-items: flex-start;
}

.ranking-list-general li > span:last-child {
    max-width: 132px;
}

.ranking-empty {
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.ranking-empty strong {
    flex: 0 1 auto;
}

.toast {
    position: fixed;
    z-index: 30;
    top: 18px;
    right: 18px;
    width: min(320px, calc(100vw - 36px));
    overflow: hidden;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(19, 42, 32, 0.18);
    animation: toast-hide 4.2s ease forwards;
}

.toast span {
    display: block;
    padding: 12px 14px 13px;
    font-size: 0.88rem;
    font-weight: 850;
}

.toast.sucesso {
    border-color: rgba(22, 122, 74, 0.35);
}

.toast.erro {
    border-color: rgba(138, 31, 17, 0.3);
}

.toast-progress {
    height: 3px;
    background: var(--green);
    transform-origin: left;
    animation: toast-progress 3.8s linear forwards;
}

.toast.erro .toast-progress {
    background: #c2412f;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@keyframes toast-hide {
    0%,
    86% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-8px);
        visibility: hidden;
    }
}

@media (max-width: 820px) {
    .shell {
        display: block;
        width: min(100% - 24px, 560px);
        padding: 18px 0 92px;
    }

    .sidebar {
        position: fixed;
        z-index: 10;
        inset: auto 12px 12px;
        height: 64px;
        flex-direction: row;
        justify-content: space-between;
        padding: 10px;
    }

    .sidebar nav {
        display: flex;
    }

    .brand-mark,
    .sidebar a {
        width: 42px;
        height: 42px;
    }

    .topbar {
        align-items: flex-start;
    }

    .topbar-actions {
        display: grid;
        justify-items: end;
    }

    .status-pill {
        white-space: nowrap;
    }

    .hero-panel {
        align-items: flex-start;
        min-height: 0;
    }

    .score-orbit {
        width: 112px;
    }

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

    .bet-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .bet-score {
        grid-column: 1 / -1;
        justify-items: start;
        text-align: left;
    }

    .match-row {
        grid-template-columns: 1fr;
    }

    .match-pick {
        min-width: 0;
        justify-items: start;
        text-align: left;
    }

    .match-vote {
        justify-content: start;
        flex-wrap: wrap;
    }

    .toast {
        top: 12px;
        right: 12px;
        width: min(320px, calc(100vw - 24px));
    }
}

@media (max-width: 480px) {
    .topbar {
        display: grid;
    }

    .topbar-actions {
        justify-items: start;
    }

    .hero-panel {
        display: grid;
    }

    .score-orbit {
        width: 100%;
        max-width: 132px;
        justify-self: end;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .stats-grid article {
        padding: 12px 10px;
    }

    .stats-grid strong {
        font-size: 1.25rem;
    }
}
