:root {
    color-scheme: dark;
    --ink: #f6f3e8;
    --muted: #b9c6b8;
    --line: rgba(246, 243, 232, 0.14);
    --field: #10251d;
    --surface: #06140f;
    --surface-2: #0a1e16;
    --card: #10251d;
    --accent: #ff7a1a;
    --accent-2: #2fbf71;
    --gold: #f6d36b;
    --deep: #03100b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        linear-gradient(90deg, rgba(255, 122, 26, 0.06) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 122, 26, 0.04) 1px, transparent 1px),
        var(--surface);
    background-size: 44px 44px;
}

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

.text-link {
    color: var(--gold);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

nav {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 20px;
}

nav a:not(.brand-main):not(.brand-byline) {
    color: rgba(246, 243, 232, 0.82);
    font-weight: 650;
}

nav a:not(.brand-main):not(.brand-byline):hover,
.nav-login:hover {
    color: var(--accent);
}

.nav-login {
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 122, 26, 0.55);
    border-radius: 999px;
    color: var(--gold);
    background: rgba(255, 122, 26, 0.08);
    font-size: 0.94rem;
    font-weight: 850;
    box-shadow: 0 0 14px rgba(255, 122, 26, 0.18), inset 0 0 12px rgba(255, 122, 26, 0.06);
    white-space: nowrap;
}

.nav-login.is-authenticated {
    border-color: rgba(47, 191, 113, 0.52);
    color: var(--ink);
    background: rgba(47, 191, 113, 0.12);
    box-shadow: 0 0 14px rgba(47, 191, 113, 0.16), inset 0 0 12px rgba(47, 191, 113, 0.06);
}

.modal-open {
    overflow: hidden;
}

.auth-modal[hidden] {
    display: none;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: start center;
    padding: 96px 18px 18px;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
}

.auth-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 13px;
    width: min(720px, 100%);
    padding: 18px;
    border: 1px solid rgba(255, 122, 26, 0.34);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(16, 37, 29, 0.98), rgba(6, 20, 15, 0.98));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.auth-dialog h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.35rem;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    font-size: 1.7rem;
    line-height: 1;
}

.brand {
    display: grid;
    gap: 2px;
    margin-right: auto;
    color: #fff;
    font-weight: 850;
}

.brand-main {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: inline-block;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    color: inherit;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: 0;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.34));
}

.brand-copy {
    display: grid;
    gap: 1px;
}

.brand-copy strong {
    color: #fff;
    font-size: clamp(1.55rem, 2.4vw, 2.25rem);
    line-height: 0.98;
    letter-spacing: 0.02em;
}

.brand-copy em {
    color: var(--accent);
    font-style: normal;
}

.brand small {
    color: var(--gold);
    font-size: clamp(0.68rem, 1vw, 0.95rem);
    font-weight: 900;
    letter-spacing: 0.12em;
}

.brand-byline {
    justify-self: start;
    margin-left: calc(2rem + 12px);
    color: rgba(246, 243, 232, 0.92);
    font-size: clamp(0.62rem, 0.9vw, 0.82rem);
    font-weight: 650;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.brand-byline:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-header,
.compact-header {
    color: #fff;
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 122, 26, 0.22), transparent 32%),
        linear-gradient(135deg, #03100b 0%, #0d2f20 52%, #071711 100%);
    border-bottom: 1px solid rgba(255, 122, 26, 0.24);
}

.hero {
    display: block;
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 20px 16px;
}

.hero-title-group {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 12px;
    width: 100%;
}

.nation-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    width: 100%;
    overflow: hidden;
    padding: 7px 9px;
    border: 1px solid rgba(246, 211, 107, 0.2);
    border-radius: 999px;
    background: rgba(3, 16, 11, 0.42);
    box-shadow: inset 0 0 18px rgba(255, 122, 26, 0.05);
}

.nation-flag {
    display: inline-grid;
    place-items: center;
    width: auto;
    min-width: 0;
    height: 18px;
    color: rgba(246, 243, 232, 0.86);
    font-size: clamp(0.62rem, 1.15vw, 0.9rem);
    line-height: 1;
    opacity: 0.62;
    filter: saturate(0.82);
}

.nation-flag.is-active {
    width: auto;
    min-width: 0;
    height: 23px;
    font-size: clamp(0.9rem, 1.55vw, 1.18rem);
    opacity: 1;
    filter: saturate(1.15) drop-shadow(0 0 6px rgba(255, 122, 26, 0.35));
}

.flag-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    margin-right: 0.26em;
    border-radius: 2px;
    object-fit: cover;
    vertical-align: -0.16em;
}

.flag-icon-neutral {
    margin-right: 0.26em;
    font-size: 1em;
    line-height: 1;
}

.nation-flag .flag-icon {
    width: 1.15em;
    height: 1.15em;
    margin-right: 0;
}

.nation-flag.is-active .flag-icon {
    width: 1.2em;
    height: 1.2em;
}

.hero .hero-quote {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    color: rgba(246, 243, 232, 0.78);
    font-size: clamp(0.78rem, 1vw, 0.95rem);
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
}

.title-chance-box {
    position: relative;
    display: grid;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid rgba(246, 211, 107, 0.18);
    border-radius: 8px;
    background: rgba(3, 16, 11, 0.36);
}

.swipe-hint {
    justify-self: center;
    margin: -2px 0 0;
    color: rgba(246, 243, 232, 0.58);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.swipe-hint.inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0 0 0 8px;
    font-size: 0.68rem;
    vertical-align: middle;
    white-space: nowrap;
}

.swipe-hint span {
    display: inline-block;
    color: var(--gold);
    animation: swipe-nudge 1.8s ease-in-out infinite;
}

.swipe-hint span:first-child {
    animation-direction: reverse;
}

@keyframes swipe-nudge {
    0%, 100% {
        transform: translateX(0);
        opacity: 0.55;
    }
    50% {
        transform: translateX(4px);
        opacity: 1;
    }
}

.title-chance-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    color: var(--ink);
}

.title-chance-head strong {
    font-size: 0.95rem;
}

.title-chance-head span {
    color: var(--muted);
    font-size: 0.74rem;
    text-align: right;
}

.title-chance-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 0 2px 8px;
    scroll-snap-type: x proximity;
    scrollbar-color: rgba(246, 211, 107, 0.45) rgba(246, 243, 232, 0.08);
}

.title-chance-box::before {
    display: none;
}

.title-chance-box::before,
.title-chance-box::after,
.tournament-panel::before,
.tournament-panel::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 48px;
    bottom: 10px;
    width: 24px;
    pointer-events: none;
}

.title-chance-box::before,
.tournament-panel::before {
    left: 0;
    background: linear-gradient(90deg, rgba(3, 16, 11, 0.78), transparent);
}

.title-chance-box::after,
.tournament-panel::after {
    right: 0;
    background: linear-gradient(270deg, rgba(3, 16, 11, 0.78), transparent);
}

.title-chance-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 7px;
    align-items: center;
    min-width: 0;
    scroll-snap-align: start;
}

.title-chance-team {
    min-width: 0;
    overflow: visible;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 850;
    line-height: 1.16;
    text-overflow: clip;
    white-space: nowrap;
}

.title-trophies {
    display: inline-block;
    gap: 1px;
    margin-left: 3px;
    font-size: 0.74rem;
    letter-spacing: 0;
    vertical-align: baseline;
    white-space: nowrap;
}

.title-chance-item strong {
    color: var(--gold);
    font-size: 0.9rem;
}

.title-chance-value {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.title-movement {
    color: rgba(246, 243, 232, 0.62);
    font-size: 0.62rem;
    font-weight: 850;
}

.title-movement.is-up {
    color: var(--accent-2);
}

.title-movement.is-down {
    color: #ff9b62;
}

.title-movement.is-new {
    color: var(--gold);
}

.title-chance-meter {
    grid-column: 1 / -1;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(246, 243, 232, 0.12);
}

.title-chance-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent-2));
}

.title-chance-item small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.67rem;
    line-height: 1.2;
}

.tournament-layout {
    max-width: 1280px;
}

.tournament-panel {
    position: relative;
    overflow: hidden;
}

.tournament-scroll {
    overflow-x: auto;
    padding: 6px 2px 16px;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-color: rgba(246, 211, 107, 0.45) rgba(246, 243, 232, 0.08);
}

.tournament-bracket {
    display: grid;
    grid-template-columns: 300px 280px 260px 250px 240px 240px;
    gap: 14px;
    min-width: 1640px;
    align-items: start;
}

.bracket-round {
    display: grid;
    gap: 10px;
    scroll-snap-align: start;
}

.bracket-round > header {
    position: sticky;
    left: 0;
    z-index: 1;
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid rgba(246, 211, 107, 0.22);
    border-radius: 8px;
    background: rgba(3, 16, 11, 0.82);
}

.bracket-round > header strong {
    color: var(--gold);
    font-size: 0.95rem;
}

.bracket-round > header span {
    color: var(--muted);
    font-size: 0.75rem;
}

.bracket-matches {
    display: grid;
    gap: 10px;
}

.bracket-match {
    display: grid;
    gap: 5px;
    padding: 9px;
    border: 1px solid rgba(246, 243, 232, 0.12);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(20, 50, 37, 0.96), rgba(8, 26, 19, 0.96));
}

.bracket-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
}

.bracket-team {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 7px;
    border-radius: 6px;
    background: rgba(246, 243, 232, 0.07);
}

.bracket-team-copy {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bracket-team b {
    color: var(--gold);
    font-size: 0.9rem;
}

.bracket-team small {
    grid-column: 1 / -1;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 750;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bracket-team.is-winner {
    border: 1px solid rgba(47, 191, 113, 0.34);
    background: rgba(47, 191, 113, 0.14);
}

.bracket-team.is-loser {
    opacity: 0.72;
}

.bracket-status {
    margin: 0;
    color: var(--muted);
    font-size: 0.7rem;
    text-align: right;
}

.hero h1,
.compact-header h1 {
    max-width: none;
    margin: 0;
    font-size: clamp(1.65rem, 2.5vw, 2.45rem);
    line-height: 1.08;
    letter-spacing: 0;
    white-space: nowrap;
}

.hero p {
    max-width: none;
    margin: 0;
    font-size: clamp(0.92rem, 1.1vw, 1rem);
    line-height: 1.35;
    color: rgba(246, 243, 232, 0.86);
    text-align: right;
    white-space: nowrap;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-weight: 850;
    text-transform: uppercase;
}

.compact-header h1 {
    max-width: 1120px;
    padding: 24px 20px 50px;
    margin: 0 auto;
    font-size: clamp(1.65rem, 2.5vw, 2.45rem);
}

.site-footer {
    max-width: 1120px;
    margin: -38px auto 0;
    padding: 0 20px 30px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.layout,
.stats-grid {
    max-width: 1120px;
    margin: 22px auto 60px;
    padding: 0 20px;
}

.panel,
.game-card {
    background: linear-gradient(180deg, rgba(20, 50, 37, 0.98), rgba(10, 30, 22, 0.98));
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.player-panel,
.panel {
    padding: 22px;
}

.player-panel {
    border-color: rgba(255, 122, 26, 0.38);
}

.name-warning {
    grid-column: 1 / -1;
    margin: 10px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
}

.verify-session-note {
    margin: 12px 0 0;
    padding: 11px 12px;
    border: 1px solid rgba(47, 191, 113, 0.3);
    border-radius: 8px;
    color: rgba(246, 243, 232, 0.88);
    background: rgba(47, 191, 113, 0.1);
    font-size: 0.92rem;
    line-height: 1.4;
    text-align: center;
}

.auth-admin-link {
    margin: 0;
    font-size: 0.86rem;
    text-align: right;
}

.field-hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 750;
}

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

.admin-status-grid div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(246, 243, 232, 0.05);
}

.admin-status-grid small {
    color: var(--muted);
}

.admin-status-grid strong {
    color: var(--gold);
}

label {
    display: grid;
    gap: 8px;
    font-weight: 750;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px 13px;
    font: inherit;
    background: var(--field);
    color: var(--ink);
    caret-color: var(--accent);
}

input::placeholder {
    color: rgba(246, 243, 232, 0.46);
}

button {
    border: 0;
    border-radius: 6px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 800;
    color: #201006;
    background: var(--accent);
    cursor: pointer;
}

button:hover {
    filter: brightness(0.95);
}

fieldset {
    min-width: 0;
    border: 0;
    padding: 0;
    margin: 0;
}

.player-dashboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.auth-strip {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(320px, 1.6fr);
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}

.auth-state {
    min-width: 0;
}

.panel-kicker {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
    text-transform: uppercase;
}

.name-row {
    display: grid;
    grid-template-columns: minmax(140px, auto) 1fr auto;
    align-items: end;
    gap: 12px;
    margin-top: 8px;
}

.auth-row {
    grid-template-columns: minmax(110px, 0.8fr) minmax(160px, 1fr) auto auto;
    align-items: center;
    margin-top: 0;
}

.auth-row input,
.rename-row input {
    min-height: 42px;
    padding: 10px 12px;
}

.rename-panel {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    margin-top: 0;
    padding: 11px;
    border: 1px solid rgba(246, 243, 232, 0.12);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.14);
}

.rename-panel .panel-kicker {
    color: var(--gold);
}

.rename-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) minmax(160px, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.rename-row label {
    color: var(--muted);
    font-weight: 850;
}

.active-player {
    margin: 0;
    color: var(--ink);
    font-weight: 750;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
}

.active-player-name {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 2px 8px;
    border-radius: 999px;
    color: #1e1005;
    background: var(--accent);
    box-shadow: 0 0 0 1px rgba(255, 122, 26, 0.35);
    font-weight: 800;
}

.player-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.player-metrics div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.14);
}

.player-metrics span {
    display: block;
    color: var(--accent);
    font-size: 1.55rem;
    font-weight: 950;
}

.player-metrics small {
    color: var(--muted);
    font-weight: 750;
}

.status {
    min-height: 1.4em;
    color: var(--gold);
    font-weight: 750;
}

.status.error {
    color: #ff9a6a;
}

.games-list {
    display: grid;
    gap: 26px;
    margin-top: 22px;
}

.game-section {
    display: grid;
    gap: 14px;
}

.section-heading,
.archive-section summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--ink);
}

.section-heading h2 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: 0;
}

.section-heading span,
.archive-section small {
    color: var(--gold);
    font-weight: 850;
}

.empty-state {
    margin: 0;
    padding: 18px 20px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(246, 243, 232, 0.04);
}

.matchday-subsection {
    display: grid;
    gap: 12px;
}

.matchday-subsection + .matchday-subsection {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(246, 243, 232, 0.14);
}

.matchday-subsection h3 {
    margin: 0;
    padding: 9px 12px;
    border-left: 4px solid var(--accent-2);
    border-radius: 6px;
    color: var(--ink);
    background: rgba(47, 191, 113, 0.1);
    font-size: 1rem;
}

.matchday-subsection-finished h3 {
    border-left-color: var(--gold);
    background: rgba(246, 211, 107, 0.09);
}

.archive-section,
.all-games-section,
.matchday-accordion {
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.archive-section summary,
.matchday-accordion > summary,
.all-games-section > summary,
.all-games-accordion details > summary,
.sub-accordion > summary {
    cursor: pointer;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 122, 26, 0.08);
    font-size: 1.1rem;
    font-weight: 900;
}

.matchday-accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.matchday-accordion > summary small {
    color: var(--gold);
    font-size: 0.9rem;
}

.matchday-accordion > .game-card,
.matchday-accordion > .empty-state,
.matchday-accordion > .matchday-subsection {
    margin-top: 14px;
}

.archive-list {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.all-games-accordion,
.all-games-inner {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.all-games-accordion details,
.sub-accordion {
    display: grid;
    gap: 12px;
}

.is-hidden-extra {
    display: none;
}

.scoring-info {
    display: grid;
    gap: 12px;
}

.scoring-info h2 {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
}

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

.scoring-grid div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid rgba(246, 211, 107, 0.16);
    border-radius: 8px;
    background: rgba(246, 243, 232, 0.055);
}

.scoring-grid strong {
    color: var(--gold);
    font-size: 0.78rem;
}

.scoring-grid span {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.25;
}

.show-all-upcoming {
    justify-self: center;
    min-width: 260px;
}

.game-card {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 16px;
    align-items: center;
    padding: 20px;
}

.game-card-open {
    border-color: rgba(47, 191, 113, 0.38);
    box-shadow: inset 4px 0 0 rgba(47, 191, 113, 0.95);
}

.game-card-readonly {
    background: linear-gradient(180deg, rgba(17, 42, 31, 0.9), rgba(8, 25, 18, 0.92));
}

.game-card-readonly.is-finished {
    border-color: rgba(246, 211, 107, 0.32);
    box-shadow: inset 4px 0 0 rgba(246, 211, 107, 0.9);
}

.game-card-readonly.is-closed {
    border-color: rgba(255, 122, 26, 0.28);
    box-shadow: inset 4px 0 0 rgba(255, 122, 26, 0.75);
}

.game-card-readonly.is-waiting {
    border-color: rgba(246, 211, 107, 0.32);
    box-shadow: inset 4px 0 0 rgba(246, 211, 107, 0.78);
}

.game-card-readonly.is-live {
    border-color: rgba(26, 214, 111, 0.5);
    box-shadow:
        inset 4px 0 0 rgba(26, 214, 111, 0.95),
        0 0 22px rgba(26, 214, 111, 0.16);
}

.next-game-section .section-heading h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.next-game-section .section-heading span {
    color: var(--accent);
}

.next-game-card .game-card {
    border-color: rgba(255, 122, 26, 0.42);
    background:
        radial-gradient(circle at 90% 12%, rgba(255, 122, 26, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(25, 62, 45, 0.98), rgba(9, 33, 24, 0.98));
}

.game-meta {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.game-round {
    color: var(--ink);
}

.game-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #06140f;
    background: var(--muted);
    font-size: 0.76rem;
    font-weight: 950;
    text-transform: uppercase;
}

.game-status-badge.is-open {
    background: var(--accent-2);
}

.game-status-badge.is-finished {
    background: var(--gold);
}

.game-status-badge.is-closed {
    background: var(--accent);
}

.game-status-badge.is-waiting {
    color: #06140f;
    background: var(--gold);
}

.game-status-badge.is-live {
    color: var(--ink);
    background: #1ad66f;
    box-shadow: 0 0 0 0 rgba(26, 214, 111, 0.8), 0 0 18px rgba(26, 214, 111, 0.45);
    animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(26, 214, 111, 0.65), 0 0 14px rgba(26, 214, 111, 0.4);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(26, 214, 111, 0), 0 0 20px rgba(26, 214, 111, 0.55);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(26, 214, 111, 0), 0 0 14px rgba(26, 214, 111, 0.4);
    }
}

.live-score-box,
.group-table-box {
    grid-column: 2;
}

.live-score-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(47, 191, 113, 0.35);
    border-radius: 8px;
    background: rgba(47, 191, 113, 0.1);
}

.live-score-box strong {
    color: var(--ink);
}

.live-score-box span:last-child {
    color: var(--gold);
    font-weight: 900;
}

.live-badge {
    color: #b6ffd7;
    font-weight: 950;
}

.group-table-box {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(246, 243, 232, 0.12);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.12);
}

.group-table-box h3 {
    margin: 0;
    color: var(--gold);
}

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

.group-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.group-table th,
.group-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.tips-strip {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 122, 26, 0.28);
    border-radius: 8px;
    background: rgba(255, 122, 26, 0.08);
    color: var(--muted);
}

.tips-strip strong {
    color: var(--gold);
}

.tip-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--ink);
    background: rgba(246, 243, 232, 0.1);
    font-weight: 850;
}

.tip-pill.is-own-tip {
    color: var(--ink);
    background: rgba(246, 243, 232, 0.1);
}

.matchup-tip {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 76px 18px 76px minmax(150px, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.matchup-tip .save-game {
    grid-column: 6;
    grid-row: 1;
}

.team-name {
    font-size: 1.08rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.team-name-left {
    text-align: right;
}

.team-name-right {
    text-align: left;
}

.score-separator {
    color: var(--accent);
    font-size: 1.35rem;
    font-weight: 900;
    text-align: center;
}

.score-input {
    display: block;
    width: 76px;
    min-width: 76px;
    height: 48px;
    padding: 8px;
    border: 2px solid var(--accent);
    background: #071711;
    color: var(--ink);
    text-align: center;
    font-weight: 850;
    font-size: 1.15rem;
    opacity: 1;
    appearance: textfield;
}

.score-input:disabled {
    border-color: var(--line);
    background: rgba(246, 243, 232, 0.06);
    color: var(--muted);
}

.ko-winner-picker {
    grid-column: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 12px;
    border: 1px solid rgba(246, 211, 107, 0.24);
    border-radius: 8px;
    background: rgba(246, 211, 107, 0.07);
}

.ko-winner-picker legend {
    grid-column: 1 / -1;
    margin-bottom: 8px;
    color: var(--gold);
    font-weight: 950;
}

.ko-winner-picker legend span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.ko-winner-picker label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.16);
    color: var(--ink);
    font-weight: 850;
    cursor: pointer;
}

.ko-winner-picker input {
    width: auto;
    accent-color: var(--accent);
}

.matchup-readonly {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(170px, auto) minmax(150px, 1fr);
    align-items: center;
    gap: 14px;
}

.matchup-readonly strong:first-child {
    text-align: right;
}

.archive-result-stack {
    display: grid;
    gap: 7px;
    justify-items: center;
}

.archive-chip {
    display: grid;
    gap: 3px;
    min-width: 120px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 122, 26, 0.34);
    border-radius: 6px;
    color: var(--gold);
    background: rgba(0, 0, 0, 0.18);
    text-align: center;
    font-weight: 900;
}

.archive-chip small {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.archive-chip b {
    color: var(--gold);
}

.own-status {
    color: var(--ink);
    font-weight: 900;
    text-align: center;
    border-color: rgba(246, 211, 107, 0.32);
}

.probability-box {
    grid-column: 2;
    display: grid;
    gap: 10px;
    padding: 13px;
    border: 1px solid rgba(255, 122, 26, 0.32);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 122, 26, 0.1), rgba(0, 0, 0, 0.16));
}

.probability-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    color: var(--ink);
}

.probability-head strong {
    color: var(--gold);
}

.probability-head span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.probability-labels {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.probability-labels span:nth-child(2) {
    text-align: center;
}

.probability-labels span:nth-child(3) {
    text-align: right;
}

.probability-bar {
    display: flex;
    height: 18px;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid rgba(246, 243, 232, 0.12);
    background: rgba(246, 243, 232, 0.08);
}

.probability-bar span {
    display: block;
    min-width: 0;
    transition: width 180ms ease;
}

.prob-home {
    background: linear-gradient(90deg, #d95400, var(--accent));
}

.prob-draw {
    background: linear-gradient(90deg, #d6aa2b, var(--gold));
}

.prob-away {
    background: linear-gradient(90deg, #169a54, var(--accent-2));
}

.probability-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.probability-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.probability-legend i {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.legend-home {
    background: var(--accent);
}

.legend-draw {
    background: var(--gold);
}

.legend-away {
    background: var(--accent-2);
}

.team-context-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 2px;
}

.team-context-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(246, 243, 232, 0.12);
    border-radius: 8px;
    background: rgba(0, 43, 29, 0.42);
}

.team-context-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.team-context-head strong {
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.2;
}

.team-context-head span {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid rgba(255, 183, 77, 0.36);
    border-radius: 999px;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.team-form-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.team-form-item {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 100%;
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(246, 243, 232, 0.08);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
}

.team-form-item b {
    color: var(--ink);
}

.team-form-item em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 122, 26, 0.18);
    color: var(--gold);
    font-style: normal;
    font-size: 0.68rem;
}

.team-form-legend {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.probability-box p,
.prediction-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

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

.prediction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.prediction-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.12);
}

.prediction-card h3 {
    margin: 0;
    font-size: 1rem;
}

.top-rank {
    background: rgba(255, 122, 26, 0.1);
}

.rank-medal {
    font-size: 1.25rem;
}

.points-large {
    color: var(--accent);
    font-size: 1.25rem;
}

.own-tip {
    color: var(--gold);
    font-weight: 800;
    text-align: center;
}

.own-points {
    color: var(--accent);
    border-color: rgba(47, 191, 113, 0.35);
}

.save-game {
    min-width: 128px;
    white-space: nowrap;
}

.save-game:disabled {
    cursor: not-allowed;
    opacity: 0.78;
}

.save-game.is-saving {
    background: var(--gold);
    color: #1d1206;
}

.save-game.is-saved {
    background: #2fbf71;
    color: #03170c;
}

.save-game.is-error {
    background: #e25555;
    color: #fff;
}

.save-feedback,
.closed-tip-notice {
    grid-column: 1 / -1;
    margin: 0;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 0.92rem;
    font-weight: 850;
}

.save-feedback {
    border: 1px solid rgba(246, 243, 232, 0.14);
    color: var(--muted);
    background: rgba(246, 243, 232, 0.06);
}

.save-feedback.error {
    border-color: rgba(226, 85, 85, 0.6);
    color: #ffd8d8;
    background: rgba(226, 85, 85, 0.14);
}

.closed-tip-notice {
    border: 1px solid rgba(246, 243, 232, 0.16);
    color: var(--gold);
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.lock-state {
    grid-column: 2;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.countdown-state {
    grid-column: 2 / 5;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: stretch;
    gap: 7px;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    color: var(--gold);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    text-align: center;
    white-space: nowrap;
}

.countdown-state::before {
    content: "⏱";
}

.primary-action {
    justify-self: end;
    min-width: 180px;
    background: var(--accent);
}

.secondary-action {
    color: var(--ink);
    background: rgba(246, 243, 232, 0.12);
    border: 1px solid var(--line);
}

.participant-overview {
    margin-top: 18px;
}

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

.compact-table th,
.compact-table td {
    white-space: nowrap;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

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

.stats-page {
    max-width: 1120px;
    margin: -38px auto 60px;
    padding: 0 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-top: 18px;
    padding: 0;
}

.participant-chart-panel {
    padding: 22px;
}

.participant-stat-table {
    margin-top: 18px;
}

.stat-card h2 {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.stat-card-meta {
    margin: -8px 0 12px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.stat-values,
.stat-tip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.stat-values span,
.stat-tip-list span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--muted);
    background: rgba(246, 243, 232, 0.06);
    font-size: 0.86rem;
    font-weight: 800;
}

.stat-values b {
    color: var(--gold);
}

.stat-tip-list span {
    color: var(--ink);
    border-color: rgba(255, 122, 26, 0.28);
    background: rgba(255, 122, 26, 0.1);
}

.probabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.probabilities span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--muted);
    font-weight: 750;
}

.admin-form {
    display: grid;
    gap: 16px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.admin-login {
    max-width: 420px;
}

@media (max-width: 900px) {
    .game-card {
        grid-template-columns: 1fr;
    }

    .matchup-readonly {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px 12px;
        align-items: center;
    }

    .matchup-readonly strong {
        min-width: 0;
        overflow-wrap: anywhere;
        line-height: 1.22;
    }

    .matchup-readonly strong:first-child {
        text-align: right;
    }

    .matchup-readonly strong:first-child::after {
        content: " :";
        color: var(--accent);
    }

    .matchup-readonly strong:last-child {
        text-align: left;
    }

    .archive-result-stack {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-items: center;
    }

    .archive-chip {
        width: auto;
        min-width: 132px;
    }

    .matchup-tip {
        grid-template-columns: minmax(0, 1fr) 64px 14px 64px minmax(0, 1fr);
        gap: 8px;
    }

    .matchup-tip .save-game {
        grid-column: 1 / -1;
        grid-row: auto;
        justify-self: stretch;
    }

    .matchup-tip .countdown-state {
        grid-column: 2 / 5;
        grid-row: auto;
    }

    .matchup-tip .score-input {
        width: 100%;
        min-width: 0;
    }

    .lock-state {
        grid-column: 1;
    }

    .probability-box {
        grid-column: 1;
    }

    .team-context-box {
        grid-template-columns: 1fr;
    }

    .team-context-head {
        flex-wrap: wrap;
    }

    .live-score-box,
    .group-table-box,
    .tips-strip,
    .ko-winner-picker {
        grid-column: 1;
    }

    .team-name {
        font-size: 0.96rem;
    }

    .team-name-left {
        text-align: right;
    }

    .team-name-right {
        text-align: left;
    }

}

@media (max-width: 700px) {
    nav {
        flex-wrap: wrap;
    }

    .hero {
        display: grid;
        gap: 6px;
        padding: 22px 20px 48px;
    }

    .hero h1,
    .hero p {
        white-space: normal;
        text-align: left;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .compact-header h1 {
        padding: 22px 20px 48px;
        font-size: 1.6rem;
    }

    nav {
        gap: 12px;
    }

    .brand {
        flex-basis: 100%;
    }

    .brand-mark {
        font-size: 1.65rem;
    }

    .brand-copy strong {
        font-size: 1.55rem;
    }

    .brand small {
        font-size: 0.68rem;
        letter-spacing: 0.09em;
    }

    .nation-strip {
        width: 100%;
        padding-inline: 7px;
    }

    .nation-flag {
        font-size: clamp(0.48rem, 2.25vw, 0.72rem);
    }

    .nation-flag.is-active {
        font-size: clamp(0.68rem, 2.9vw, 0.94rem);
    }

    .title-chance-head {
        display: grid;
        gap: 2px;
    }

    .title-chance-head span {
        text-align: left;
    }

    .title-chance-list {
        grid-auto-columns: minmax(158px, 78vw);
    }

    .player-dashboard,
    .auth-strip,
    .auth-row,
    .name-row,
    .rename-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .player-dashboard {
        display: grid;
    }

    .matchup-tip {
        grid-template-columns: minmax(0, 1fr) 54px 12px 54px minmax(0, 1fr);
        gap: 6px;
    }

    .ko-winner-picker {
        grid-template-columns: 1fr;
    }

    .score-separator {
        text-align: center;
        line-height: 1;
    }

    .probability-labels {
        grid-template-columns: 1fr;
    }

    .probability-labels span,
    .probability-labels span:nth-child(2),
    .probability-labels span:nth-child(3) {
        text-align: left;
    }

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

    .primary-action,
    .save-game {
        width: 100%;
        min-width: 0;
        padding-inline: 10px;
        white-space: normal;
        line-height: 1.15;
    }

    .ranking-table,
    .ranking-table thead,
    .ranking-table tbody,
    .ranking-table tr,
    .ranking-table th,
    .ranking-table td {
        display: block;
    }

    .ranking-table thead {
        display: none;
    }

    .ranking-table tr {
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: rgba(0, 0, 0, 0.12);
    }

    .ranking-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 8px 0;
        border-bottom: 1px solid rgba(246, 243, 232, 0.08);
        text-align: right;
        white-space: normal;
    }

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

    .ranking-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 800;
        text-align: left;
        text-transform: uppercase;
    }

    .ranking-table td.rank-medal {
        font-size: 1.1rem;
    }
}
