:root {
    color-scheme: dark;
    --bg: #07111f;
    --bg-soft: #0d1c32;
    --card: rgba(255, 255, 255, 0.09);
    --card-strong: rgba(255, 255, 255, 0.14);
    --border: rgba(255, 255, 255, 0.16);
    --text: #f7fbff;
    --muted: #a7bad1;
    --primary: #31e4a7;
    --primary-dark: #10a978;
    --secondary: #65a8ff;
    --danger: #ff5d7a;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(49, 228, 167, 0.26), transparent 32rem),
        radial-gradient(circle at 80% 10%, rgba(101, 168, 255, 0.22), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 1.2rem clamp(1rem, 3vw, 3rem) 4rem;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -12rem -18rem auto;
    width: 34rem;
    height: 34rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(49, 228, 167, 0.28), rgba(101, 168, 255, 0.08));
    filter: blur(12px);
    pointer-events: none;
}

.topbar,
.hero__content,
.section {
    width: min(1180px, 100%);
    margin-inline: auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
}

.brand,
.topbar__links {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand__mark {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    place-items: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #04101f;
    box-shadow: 0 14px 40px rgba(49, 228, 167, 0.24);
}

.topbar__links a {
    color: var(--muted);
    font-weight: 700;
}

.hero__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: clamp(2rem, 6vw, 6rem);
    align-items: center;
    padding-top: clamp(3rem, 8vw, 7rem);
}

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 820px;
    margin-bottom: 1.2rem;
    font-size: clamp(2.5rem, 6vw, 5.8rem);
    line-height: 0.94;
    letter-spacing: -0.07em;
}

h2 {
    margin-bottom: 0.8rem;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

h3 {
    margin-bottom: 1rem;
    font-size: 1.35rem;
}

.hero__lead,
.section__intro p,
.roadmap p {
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.7;
}

.hero__actions,
.score-inputs,
.section__intro--row,
.match-card__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.8rem 1.1rem;
    border: 0;
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button--primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #04101f;
    box-shadow: 0 16px 40px rgba(49, 228, 167, 0.24);
}

.button--secondary,
.button--ghost {
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid var(--border);
}

.button--danger {
    background: rgba(255, 93, 122, 0.18);
    border: 1px solid rgba(255, 93, 122, 0.38);
}

.button--full {
    width: 100%;
}

.glass-card,
.card,
.match-card,
.bonus-card,
.roadmap {
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--card), rgba(255, 255, 255, 0.045));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero__panel,
.card,
.match-card,
.bonus-card,
.roadmap {
    border-radius: 1.6rem;
    padding: 1.4rem;
}

.hero__panel ul {
    margin: 1rem 0 0;
    padding-left: 1.2rem;
    color: var(--muted);
    line-height: 1.8;
}

.live-pill,
.chip {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 1rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(49, 228, 167, 0.14);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
}

main {
    padding: 0 clamp(1rem, 3vw, 3rem) 4rem;
}

.section {
    padding: 4rem 0 0;
}

.flash {
    width: min(1180px, calc(100% - 2rem));
    margin: 1rem auto 0;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    font-weight: 800;
}

.flash--success {
    background: rgba(49, 228, 167, 0.13);
    border: 1px solid rgba(49, 228, 167, 0.35);
}

.flash--error {
    background: rgba(255, 93, 122, 0.14);
    border: 1px solid rgba(255, 93, 122, 0.4);
}

.account-grid,
.ranking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.2rem;
}

.section__intro {
    grid-column: span 1;
}

.form-card,
.account-card {
    display: grid;
    gap: 0.9rem;
}

label {
    display: grid;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: rgba(3, 10, 21, 0.58);
    color: var(--text);
    outline: none;
    padding: 0.82rem 0.95rem;
}

input:focus,
select:focus {
    border-color: rgba(49, 228, 167, 0.7);
    box-shadow: 0 0 0 4px rgba(49, 228, 167, 0.12);
}

.metric {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--muted);
}

.metric span {
    color: var(--primary);
    font-size: 2.5rem;
    font-weight: 800;
}

.section__intro--row {
    justify-content: space-between;
    align-items: flex-end;
}

.matches-grid,
.bonus-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.match-card {
    display: grid;
    gap: 1rem;
}

.match-card__meta {
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.versus {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.8rem;
    align-items: center;
}

.versus div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.versus div:last-child {
    text-align: right;
}

.versus strong {
    font-size: 1.8rem;
}

.versus span:not(.versus__separator),
.venue {
    color: var(--muted);
}

.versus__separator {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
}

.bet-form {
    display: grid;
    gap: 0.8rem;
}

.score-inputs input {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
}

.bonus-section {
    position: relative;
}

.bonus-card span {
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 800;
}

.bonus-card p {
    margin: 0.7rem 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.ranking-card {
    grid-column: span 2;
}

.ranking-card ol {
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ranking-card li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.07);
}

.roadmap {
    margin-top: 4rem;
}

@media (max-width: 980px) {
    .hero__content,
    .account-grid,
    .ranking-grid,
    .matches-grid,
    .bonus-grid {
        grid-template-columns: 1fr 1fr;
    }

    .section__intro,
    .ranking-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .topbar,
    .topbar__links,
    .hero__actions,
    .section__intro--row {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero__content,
    .account-grid,
    .ranking-grid,
    .matches-grid,
    .bonus-grid {
        grid-template-columns: 1fr;
    }

    .hero__actions .button {
        width: 100%;
    }
}

/* RUSG Sinsin personalization */
:root {
    --bg: #120707;
    --bg-soft: #132619;
    --primary: #21c064;
    --primary-dark: #0d7c3d;
    --secondary: #d22d2d;
    --gold: #d8b15f;
}

body {
    background:
        linear-gradient(rgba(8, 10, 8, 0.74), rgba(8, 10, 8, 0.9)),
        url('../images/chevaliers-bg-1.svg') center top / cover fixed,
        url('../images/chevaliers-bg-2.svg') center bottom / cover fixed,
        var(--bg);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 14% 12%, rgba(210, 45, 45, 0.34), transparent 30rem),
        radial-gradient(circle at 84% 8%, rgba(33, 192, 100, 0.28), transparent 32rem);
    pointer-events: none;
}

.hero {
    min-height: 82vh;
    background: linear-gradient(180deg, rgba(75, 10, 10, 0.38), rgba(7, 14, 9, 0.68));
}

.brand__mark,
.button--primary {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #fff8e2;
}

h1,
h2,
.brand {
    font-family: Cinzel, Inter, system-ui, sans-serif;
}

.glass-card,
.card,
.match-card,
.bonus-card,
.roadmap {
    background: linear-gradient(145deg, rgba(18, 45, 25, 0.72), rgba(80, 13, 13, 0.42));
    border-color: rgba(216, 177, 95, 0.28);
}

.supporter-badge,
.bet-state {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: .4rem;
    margin: 0;
    padding: .45rem .7rem;
    border: 1px solid rgba(216, 177, 95, .28);
    border-radius: 999px;
    color: #ffe7ac;
    background: rgba(216, 177, 95, .12);
    font-weight: 800;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.2rem;
}

.filter-tabs,
.filters-card {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.filter-tab {
    border: 1px solid rgba(216, 177, 95, .3);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    padding: .7rem 1rem;
}

.filter-tab.is-active {
    background: linear-gradient(135deg, rgba(210,45,45,.88), rgba(33,192,100,.88));
}

.filters-card {
    margin: 1.2rem 0;
}

.filters-card label {
    min-width: min(100%, 220px);
    flex: 1;
}

.flag {
    filter: drop-shadow(0 3px 8px rgba(0,0,0,.35));
}

.bet-state {
    color: #ffb3b3;
    border-color: rgba(210,45,45,.36);
    background: rgba(210,45,45,.15);
}

.bet-state--done {
    color: #b9ffd1;
    border-color: rgba(33,192,100,.36);
    background: rgba(33,192,100,.16);
}

.match-card[hidden] {
    display: none;
}

.calendar-card {
    overflow: auto;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: .7rem;
    min-width: 820px;
}

.calendar-day,
.calendar-weekday {
    border-radius: 1rem;
    padding: .8rem;
    background: rgba(255,255,255,.07);
}

.calendar-weekday {
    color: var(--gold);
    font-weight: 900;
    text-align: center;
}

.calendar-day {
    min-height: 8.5rem;
    border: 1px solid rgba(255,255,255,.08);
}

.calendar-day.is-empty {
    opacity: .28;
}

.calendar-day__number {
    display: block;
    margin-bottom: .55rem;
    color: var(--gold);
    font-weight: 900;
}

.calendar-match {
    display: block;
    margin-top: .35rem;
    padding: .4rem;
    border-radius: .65rem;
    background: rgba(210,45,45,.2);
    font-size: .78rem;
    font-weight: 800;
}

.calendar-match.is-done {
    background: rgba(33,192,100,.22);
}

@media (max-width: 980px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Multi-page layout additions */
.page-section {
    scroll-margin-top: 1rem;
}

.brand__logo {
    width: 3.4rem;
    height: 3.4rem;
    object-fit: contain;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    padding: .25rem;
    box-shadow: 0 14px 40px rgba(216, 177, 95, .24);
}

.hero__logo {
    display: block;
    width: min(100%, 260px);
    margin: 0 auto 1.2rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, .92);
    padding: .6rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.32);
}

.team-flag,
.mini-flag {
    display: inline-block;
    object-fit: cover;
    border-radius: .25rem;
    vertical-align: middle;
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

.team-flag {
    width: 2.2rem;
    height: 1.55rem;
    margin-right: .35rem;
}

.mini-flag {
    width: 1.45rem;
    height: 1rem;
    margin-right: .35rem;
}

.standings-strip,
.rules-grid,
.club-gallery {
    display: grid;
    gap: 1rem;
}

.standings-strip {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin: 1.2rem 0 1.5rem;
}

.standings-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.standings-card th,
.standings-card td {
    padding: .5rem .35rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-align: left;
}

.standings-card th:not(:first-child),
.standings-card td:not(:first-child) {
    text-align: right;
}

.match-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.icon-button,
.points-button {
    border: 1px solid rgba(216, 177, 95, .3);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
    padding: .55rem .8rem;
}

.icon-button--pen {
    background: rgba(216, 177, 95, .2);
}

.match-details,
.points-detail {
    display: grid;
    gap: .45rem;
    padding: .85rem;
    border: 1px dashed rgba(216, 177, 95, .35);
    border-radius: 1rem;
    color: var(--muted);
    background: rgba(0,0,0,.16);
}

.match-details p {
    margin: 0;
    white-space: pre-line;
}

textarea {
    width: 100%;
    min-height: 4rem;
    border: 1px solid var(--border);
    border-radius: .9rem;
    background: rgba(3, 10, 21, 0.58);
    color: var(--text);
    outline: none;
    padding: .82rem .95rem;
    resize: vertical;
    font: inherit;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.bet-form.is-locked {
    border: 1px solid rgba(216, 177, 95, .18);
    border-radius: 1rem;
    padding: .8rem;
    background: rgba(255,255,255,.04);
}

.bonus-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.bet-state--todo,
.calendar-match.is-todo {
    color: #e5e8ee;
    border-color: rgba(229,232,238,.25);
    background: rgba(132, 142, 155, .25);
}

.bet-state--done,
.calendar-match.is-done {
    color: #cce2ff;
    border-color: rgba(101,168,255,.36);
    background: rgba(101,168,255,.24);
}

.bet-state--win,
.calendar-match.is-win {
    color: #b9ffd1;
    border-color: rgba(33,192,100,.36);
    background: rgba(33,192,100,.24);
}

.bet-state--lost,
.calendar-match.is-lost {
    color: #ffb3b3;
    border-color: rgba(210,45,45,.36);
    background: rgba(210,45,45,.24);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: 1rem;
}

.calendar-legend .calendar-match {
    display: inline-flex;
    margin: 0;
}

.ranking-card li {
    align-items: stretch;
    flex-wrap: wrap;
}

.points-detail {
    flex-basis: 100%;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rules-grid li {
    margin-bottom: .55rem;
    color: var(--muted);
    line-height: 1.55;
}

.bonus-card-list p {
    color: var(--muted);
    line-height: 1.55;
}

.club-gallery {
    grid-template-columns: 1fr repeat(3, minmax(140px, 220px));
    align-items: center;
}

.club-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid rgba(216, 177, 95, .28);
    border-radius: 1.3rem;
    background: rgba(255,255,255,.9);
    padding: .35rem;
    box-shadow: var(--shadow);
}

@media (max-width: 980px) {
    .rules-grid,
    .club-gallery {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .bonus-fields,
    .rules-grid,
    .club-gallery {
        grid-template-columns: 1fr;
    }

    .topbar__links {
        width: 100%;
    }
}
