/* ==========================================================================
   Fuzzbol Pro v8.0 — "Stadium Gold" theme
   Navy + gold sports-broadcast identity. No emoji: functional icons are
   inline SVG (see #fuzzbol-icons in index.html); decorative art areas are
   dashed image slots reserved for generated artwork.
   ========================================================================== */

:root {
    --navy-1: #071426;
    --navy-2: #0b1f38;
    --navy-3: #0f2a4a;
    --navy-4: #133455;
    --ground: #050d1a;

    --edge: rgba(255, 255, 255, 0.14);
    --edge-strong: rgba(255, 255, 255, 0.3);

    --ink-1: #ffffff;
    --ink-2: rgba(255, 255, 255, 0.68);
    /* Muted copy still needs AA contrast on the navy surfaces (>= 4.5:1). */
    --ink-3: rgba(255, 255, 255, 0.56);

    --gold-1: #f7dc82;
    --gold-2: #c8942e;
    --gold-text: #eec453;
    --gold-glow: rgba(238, 196, 83, 0.35);

    --blue-1: #4a95ec;
    --blue-2: #1f5fc4;
    --blue-glow: rgba(31, 95, 196, 0.35);

    --silver-1: #eef2f6;
    --silver-2: #9aa6b4;

    --red: #e0483f;
    --red-glow: rgba(224, 72, 63, 0.35);
    --emerald: #2fbf75;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 9999px;

    --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    background: var(--navy-1);
    background-image:
        radial-gradient(ellipse 900px 500px at 12% -10%, rgba(238, 196, 83, 0.07), transparent 55%),
        radial-gradient(ellipse 700px 500px at 100% 0%, rgba(74, 149, 236, 0.08), transparent 55%);
    color: var(--ink-1);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.match-view { overflow: hidden; }

/* Icon defs holder (must stay invisible but present in layout flow) */
#fuzzbol-icons { position: absolute; width: 0; height: 0; overflow: hidden; }

svg.icon { display: inline-block; vertical-align: middle; stroke: currentColor; fill: none; }

/* Star rating (challenges) */
.star-ic { color: rgba(255, 255, 255, 0.28); fill: none; stroke: currentColor; stroke-width: 1.6px; }
.star-ic.filled { color: var(--gold-text); fill: var(--gold-text); stroke: var(--gold-text); }

/* App Container */
#app-container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 16px 24px 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.app-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 22px;
    background: #081a30;
    border: 1px solid var(--edge);
    border-top: 0;
    border-left: 3px solid var(--gold-text);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
    backdrop-filter: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-crest {
    width: 40px;
    height: 40px;
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(238, 196, 83, 0.16));
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 0.03em;
    line-height: 1;
    color: var(--gold-text);
}

.logo-placeholder {
    width: 180px;
    min-height: 40px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--edge);
    color: var(--ink-1);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.86rem;
    font-family: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-icon svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--edge-strong);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .app-header { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
    .header-actions { width: 100%; justify-content: space-between; }
    .btn-icon .btn-text { display: none; }
}

/* Career workspace rebuild */
#screen-career-hub.active {
    align-items: stretch;
    justify-content: center;
    padding: 18px;
}

.career-app-shell {
    width: min(1440px, 100%);
    min-height: calc(100vh - 112px);
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(7, 19, 37, 0.98), rgba(4, 11, 23, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

/* On desktop the sidebar/workspace two-column layout is meant to scroll
   independently (nav always visible, only the panel content scrolls) — that
   needs a real height, not just min-height, so overflow: hidden actually
   clips the grid row and .career-workspace's own overflow-y: auto takes
   over. Mobile keeps min-height below (980px breakpoint): there the sidebar
   collapses into a sticky top bar and the whole page is meant to scroll. */
@media (min-width: 981px) {
    .career-app-shell { height: calc(100vh - 112px); }
}

.career-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px 12px;
    background: rgba(1, 8, 18, 0.72);
    border-right: 1px solid rgba(255, 255, 255, 0.09);
    overflow-y: auto;
}

.career-player-card.compact { margin: 0 4px 16px; padding: 12px; gap: 10px; }
.career-player-card.compact .career-avatar { width: 46px; height: 46px; font-size: 1.35rem; }
.career-player-card.compact .career-player-name { font-size: 1rem; }
.career-player-card.compact .career-player-title { font-size: 0.66rem; margin-bottom: 5px; }
.career-player-card.compact .career-xp-text { font-size: 0.61rem; }
.career-player-card.compact .xp-bar-track { height: 5px; }

.career-nav { display: flex; flex-direction: column; gap: 4px; }
.career-nav-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 8px 11px;
    color: var(--ink-3);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    text-align: left;
    font: 750 0.78rem var(--font-body);
    cursor: pointer;
}
.career-nav-item span { color: var(--ink-3); font: 900 0.9rem var(--font-mono); text-align: center; }
.career-nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.045); }
.career-nav-item.active { color: #fff; background: rgba(238, 196, 83, 0.12); border-color: rgba(238, 196, 83, 0.32); }
.career-nav-item.active span { color: var(--gold-text); }
.career-exit { flex: 0 0 auto; margin: auto 4px 0; padding: 11px 10px; font-size: 0.72rem; }

.career-workspace { min-width: 0; min-height: 0; padding: 22px 24px 26px; overflow-y: auto; }
.career-workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--edge); }
.career-workspace-header h2 { margin: 3px 0 2px; color: #fff; font: 900 clamp(1.65rem, 3vw, 2.45rem) var(--font-display); text-transform: uppercase; }
.career-workspace-header p { margin: 0; color: var(--ink-3); font-size: 0.78rem; }
.career-header-actions { display: flex; align-items: center; gap: 10px; }

.career-view { display: none; padding-top: 18px; }
.career-view.active { display: block; animation: careerViewIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes careerViewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.career-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.career-section-heading > div > span { color: var(--gold-text); font: 800 0.62rem var(--font-mono); letter-spacing: 0.12em; }
.career-section-heading h3 { margin: 3px 0 0; color: #fff; font: 850 1.35rem var(--font-display); text-transform: uppercase; }
.career-section-heading > strong { color: var(--gold-text); font: 800 0.75rem var(--font-mono); }
.career-section-heading .career-season-info { padding: 0; background: transparent; border: 0; min-width: min(480px, 58%); }

.career-table-wrap { max-height: 520px; border: 1px solid var(--edge); background: rgba(0, 0, 0, 0.18); }
.career-table-wrap .league-table { margin: 0; }
.career-table-wrap .career-club-row { background: rgba(238, 196, 83, 0.12); box-shadow: inset 3px 0 var(--gold-text); }

.career-team-performance, .career-contract-grid, .career-history-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.career-team-card, .career-contract-card, .career-history-card {
    min-height: 92px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--edge);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}
.career-team-card span, .career-contract-card span, .career-history-card span { color: var(--ink-3); font: 700 0.63rem var(--font-mono); text-transform: uppercase; }
.career-team-card strong, .career-contract-card strong, .career-history-card strong { color: #fff; font: 850 1.12rem var(--font-mono); }
.career-team-card.gold, .career-contract-card.gold { border-top: 2px solid var(--gold-text); }

.career-squad-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.career-squad-player { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 11px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--edge); }
.career-squad-role { width: 34px; height: 34px; display: grid; place-items: center; color: var(--gold-text); background: rgba(238, 196, 83, 0.1); border: 1px solid rgba(238, 196, 83, 0.28); font: 800 0.65rem var(--font-mono); }
.career-squad-player strong { display: block; color: #fff; font-size: 0.78rem; }
.career-squad-player small { color: var(--ink-3); font-size: 0.62rem; }
.career-squad-overall { color: var(--gold-text); font: 900 1rem var(--font-mono); }

.career-agent-message { margin-bottom: 12px; padding: 14px 16px; color: var(--ink-2); background: rgba(74, 149, 236, 0.08); border-left: 3px solid var(--blue-1); font-size: 0.8rem; line-height: 1.5; }
.career-contract-grid { margin-bottom: 14px; }
.career-transfer-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.career-development-note { margin-bottom: 14px; padding: 11px 13px; color: var(--ink-3); background: rgba(238, 196, 83, 0.06); border: 1px solid rgba(238, 196, 83, 0.18); font-size: 0.74rem; }
.career-training-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.career-training-card { min-height: 180px; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.22)); border: 1px solid var(--edge); border-top: 3px solid var(--training-tone, var(--gold-text)); }
.career-training-card.tone-blue { --training-tone: var(--blue-1); }
.career-training-card.tone-emerald { --training-tone: var(--emerald); }
.career-training-card.tone-red { --training-tone: var(--red); }
.career-training-card.tone-cyan { --training-tone: #37d2cf; }
.career-training-card > span { color: var(--training-tone, var(--gold-text)); font: 800 0.62rem var(--font-mono); letter-spacing: 0.12em; }
.career-training-card h4 { margin: 7px 0; color: #fff; font: 850 1.05rem var(--font-display); text-transform: uppercase; }
.career-training-card p { margin: 0 0 18px; color: var(--ink-3); font-size: 0.75rem; line-height: 1.45; }
.career-training-card button { margin-top: auto; width: 100%; padding: 10px; font-size: 0.74rem; }
.career-training-card button:disabled { opacity: 0.42; cursor: not-allowed; }
.career-training-general-card { background-image: linear-gradient(145deg, rgba(55, 210, 207, 0.14), rgba(8, 28, 42, 0.25)); }
.training-toolbar { margin-top: 14px; padding: 13px 0 0; }
.training-toolbar > span { color: var(--ink-3); font-size: 0.72rem; }

/* Training academy menu: a clear choice before a drill starts. */
.training-menu-screen { align-items: center; justify-content: center; padding: 28px; }
.training-menu-shell { width: min(1080px, 100%); padding: clamp(22px, 4vw, 48px); border: 1px solid rgba(255, 255, 255, .12); background: linear-gradient(145deg, rgba(10, 28, 45, .98), rgba(5, 14, 28, .98)); box-shadow: 0 28px 80px rgba(0, 0, 0, .34); }
.training-menu-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 26px; }
.training-menu-kicker, .training-mode-kicker { color: var(--gold-text); font: 800 .66rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.training-menu-header h1 { margin: 7px 0 6px; color: #fff; font: 900 clamp(2rem, 4vw, 3.35rem)/.92 var(--font-display); text-transform: uppercase; }
.training-menu-header p { max-width: 650px; margin: 0; color: var(--ink-3); font-size: .88rem; line-height: 1.55; }
.training-progress-strip { display: grid; grid-template-columns: repeat(3, minmax(100px, .7fr)) minmax(190px, 1.4fr); gap: 10px; margin-bottom: 16px; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(0,0,0,.18); }
.training-progress-strip > div { min-height: 38px; padding: 0 12px; border-left: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; justify-content: center; }
.training-progress-strip > div:first-child { border-left: 0; }
.training-progress-strip span { color: var(--ink-3); font: 700 .56rem var(--font-mono); letter-spacing: .09em; text-transform: uppercase; }
.training-progress-strip strong { margin-top: 3px; color: var(--gold-text); font: 900 1rem var(--font-mono); }
.training-progress-strip > div:last-child { color: var(--ink-3); font-size: .72rem; line-height: 1.35; }
.training-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.training-mode-card { min-height: 170px; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border: 1px solid rgba(255, 255, 255, .14); border-top: 3px solid rgba(255, 255, 255, .26); border-radius: 12px; color: #fff; background: rgba(255, 255, 255, .045); text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.training-mode-card:hover, .training-mode-card:focus-visible { transform: translateY(-3px); border-color: var(--gold-text); background: rgba(238, 196, 83, .1); box-shadow: 0 12px 26px rgba(0, 0, 0, .2); }
.training-mode-card.featured { grid-row: span 2; min-height: 352px; justify-content: flex-end; border-top-color: var(--fuzzbol-orange); background: radial-gradient(circle at 82% 18%, rgba(255, 75, 24, .3), transparent 42%), linear-gradient(145deg, rgba(255, 75, 24, .15), rgba(12, 32, 50, .4)); }
.training-mode-card.career { border-top-color: var(--emerald); }
.training-mode-card.arena { border-top-color: #58a8ff; }
.training-mode-card strong { color: #fff; font: 900 1.35rem/1 var(--font-display); text-transform: uppercase; }
.training-mode-card.featured strong { font-size: 2rem; }
.training-mode-card p { margin: 0; max-width: 420px; color: var(--ink-3); font-size: .77rem; line-height: 1.5; }
.training-mode-card small { margin-top: auto; color: var(--gold-text); font: 700 .64rem var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }

.training-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 4px 6px;
    border: 1px solid rgba(238, 196, 83, .32);
    border-radius: 9px;
    background: rgba(8, 20, 34, .88);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.training-hud[hidden] { display: none; }
.training-hud > div { min-width: 64px; padding: 0 8px; border-left: 1px solid rgba(255,255,255,.12); }
.training-hud > div:first-child { border-left: 0; }
.training-hud span { display: block; color: var(--ink-3); font: 700 .52rem var(--font-mono); letter-spacing: .08em; }
.training-hud strong { display: block; margin-top: 1px; color: var(--gold-text); font: 900 .82rem var(--font-mono); }
.training-coach-tip { max-width: 230px; margin: 0 4px 0 2px; color: #fff; font-size: .66rem; line-height: 1.25; }

@media (max-width: 700px) {
    .training-menu-screen { padding: 12px; align-items: flex-start; overflow-y: auto; }
    .training-menu-shell { margin: auto 0; padding: 20px; }
    .training-menu-header { align-items: flex-start; flex-direction: column; gap: 16px; }
    .training-progress-strip { grid-template-columns: repeat(3, 1fr); }
    .training-progress-strip > div:last-child { grid-column: 1 / -1; border-left: 0; border-top: 1px solid rgba(255,255,255,.1); padding-top: 9px; }
    .training-mode-grid { grid-template-columns: 1fr; }
    .training-mode-card.featured { grid-row: auto; min-height: 220px; }
    .training-mode-card.featured strong { font-size: 1.55rem; }
    .training-hud { width: 100%; justify-content: space-between; }
    .training-hud > div { flex: 1; min-width: 0; padding: 0 5px; }
    .training-coach-tip { width: 100%; max-width: none; margin: 4px 0 0; padding-top: 5px; border-top: 1px solid rgba(255,255,255,.12); }
}

.career-history-list { display: flex; flex-direction: column; gap: 7px; }
.career-history-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; padding: 11px 13px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--edge); color: var(--ink-3); font-size: 0.72rem; }
.career-history-row strong { color: #fff; }

@media (max-width: 980px) {
    #screen-career-hub.active { padding: 10px; }
    .career-app-shell { grid-template-columns: 1fr; min-height: calc(100vh - 88px); }
    .career-sidebar { position: sticky; top: 0; z-index: 5; padding: 10px; border-right: 0; border-bottom: 1px solid var(--edge); }
    .career-player-card.compact, .career-exit { display: none; }
    .career-nav { flex-direction: row; overflow-x: auto; padding-bottom: 3px; }
    .career-nav-item { width: auto; grid-template-columns: 18px auto; white-space: nowrap; }
    .career-workspace { padding: 16px; }
    .career-team-performance, .career-contract-grid, .career-history-summary { grid-template-columns: repeat(2, 1fr); }
    .career-section-heading { align-items: flex-start; flex-direction: column; }
    .career-section-heading .career-season-info { width: 100%; min-width: 0; }
}

@media (max-width: 620px) {
    .career-workspace-header { flex-direction: column; }
    .career-header-actions { width: 100%; justify-content: space-between; }
    .career-training-grid, .career-team-performance, .career-contract-grid, .career-history-summary { grid-template-columns: 1fr; }
    .career-match-actions { grid-template-columns: 1fr; }
    .career-history-row { grid-template-columns: 72px 1fr; }
    .career-history-row span:last-child { grid-column: 2; }
}

/* Career season structure: league first, cups earned by finishing top two. */
#screen-career-hub .career-competition-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 16px;
    margin: 16px 0 24px;
}

#screen-career-hub .career-competition-card {
    min-width: 0;
    min-height: 112px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 56px;
    gap: 14px;
    align-items: center;
    border: 1px solid #dfe6e9;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 45, 67, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#screen-career-hub .career-competition-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(16, 45, 67, 0.09);
}

#screen-career-hub .career-competition-card.active {
    border-color: #8ac0e2;
    background: linear-gradient(135deg, #ffffff 0%, #f1f8fc 100%);
    box-shadow: 0 4px 16px rgba(29, 120, 181, 0.12);
}

#screen-career-hub .career-competition-card.qualified {
    border-color: #f7b49e;
    background: linear-gradient(135deg, #ffffff 0%, #fff4ef 100%);
    box-shadow: 0 4px 16px rgba(239, 84, 31, 0.1);
}

#screen-career-hub .career-competition-card.locked {
    background: #f7fafb;
    border-color: #e5ecef;
    opacity: 0.74;
}

#screen-career-hub .career-competition-card-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: var(--fuzzbol-navy);
    font: 900 1.1rem/1 var(--font-mono);
    box-shadow: 0 3px 8px rgba(16, 45, 67, 0.15);
    align-self: start;
    margin-top: 2px;
}

#screen-career-hub .career-competition-card.qualified .career-competition-card-icon {
    background: linear-gradient(135deg, #ff7e47, #ea4a13);
    box-shadow: 0 3px 8px rgba(234, 74, 19, 0.25);
}

#screen-career-hub .career-competition-card.locked .career-competition-card-icon {
    background: #9aa8b0;
    box-shadow: none;
}

#screen-career-hub .career-competition-card-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#screen-career-hub .career-competition-card-status {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 2px 7px;
    border-radius: 999px;
    font: 800 0.58rem/1.2 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

#screen-career-hub .career-competition-card.active .career-competition-card-status {
    color: #12639a;
    background: rgba(29, 120, 181, 0.11);
}

#screen-career-hub .career-competition-card.qualified .career-competition-card-status {
    color: #d74819;
    background: rgba(239, 84, 31, 0.11);
}

#screen-career-hub .career-competition-card.locked .career-competition-card-status {
    color: #63737b;
    background: rgba(127, 141, 149, 0.14);
}

#screen-career-hub .career-competition-card strong {
    display: block;
    color: var(--fuzzbol-navy);
    font: 900 1.05rem/1.2 var(--font-display);
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

#screen-career-hub .career-competition-card small {
    display: block;
    margin-top: 3px;
    color: #5c6f7f;
    font-size: 0.74rem;
    line-height: 1.42;
    word-break: break-word;
}

#screen-career-hub .career-competition-trophy {
    width: 52px;
    height: 72px;
    align-self: center;
    justify-self: center;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(18, 45, 64, 0.16));
    transition: transform 0.2s ease;
}

#screen-career-hub .career-competition-card:hover .career-competition-trophy {
    transform: scale(1.06);
}

#screen-career-hub .career-competition-card.locked .career-competition-trophy {
    filter: grayscale(1);
    opacity: 0.35;
}

#screen-career-hub .career-cup-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

#screen-career-hub .career-cup-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    padding: 7px 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--fuzzbol-orange-fill), var(--fuzzbol-orange-fill-hover));
    font: 800 0.67rem var(--font-mono);
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(239, 84, 31, 0.25);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

#screen-career-hub .career-cup-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(239, 84, 31, 0.35);
    filter: brightness(1.06);
}

#screen-career-hub .career-cup-action.secondary {
    color: var(--fuzzbol-navy);
    background: #f1f5f8;
    border: 1px solid #d4dde3;
    box-shadow: none;
}

#screen-career-hub .career-cup-action.secondary:hover {
    background: #e5edf2;
    border-color: #c2cfd8;
    transform: translateY(-1px);
}

#screen-career-hub .career-cup-bracket {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin: 0 0 24px;
}

#screen-career-hub .career-cup-bracket[hidden] {
    display: none;
}

#screen-career-hub .career-cup-bracket-card {
    padding: 16px 18px;
    border: 1px solid #dfe6eb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 45, 67, 0.04);
}

#screen-career-hub .career-cup-bracket-card header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid #edf2f5;
}

#screen-career-hub .career-cup-bracket-card header span {
    color: var(--fuzzbol-navy);
    font: 900 0.74rem var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#screen-career-hub .career-cup-bracket-card header strong {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(239, 84, 31, 0.1);
    color: var(--fuzzbol-orange);
    font: 800 0.58rem var(--font-mono);
    letter-spacing: 0.06em;
}

#screen-career-hub .career-cup-rounds {
    display: grid;
    gap: 10px;
}

#screen-career-hub .career-cup-round {
    display: grid;
    gap: 6px;
}

#screen-career-hub .career-cup-round > span {
    color: #627685;
    font: 800 0.6rem var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#screen-career-hub .career-cup-fixture {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e5ebef;
    font-size: 0.72rem;
}

#screen-career-hub .career-cup-fixture strong {
    color: var(--fuzzbol-navy);
    font-weight: 700;
}

#screen-career-hub .career-cup-fixture strong:last-child {
    text-align: right;
}

#screen-career-hub .career-cup-fixture b {
    color: var(--fuzzbol-navy);
    font: 900 0.65rem var(--font-mono);
    white-space: nowrap;
    background: #e8eef3;
    padding: 2px 7px;
    border-radius: 6px;
}

#screen-career-hub .career-relegation-notice {
    margin: 16px 0;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    border: 1px solid #f1b49e;
    border-radius: 12px;
    color: #6b2b1b;
    background: linear-gradient(135deg, #fff8f4, #ffece4);
    box-shadow: 0 4px 14px rgba(239, 84, 31, 0.08);
}

#screen-career-hub .career-relegation-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #ef541f, #d74819);
    font: 900 1.25rem/1 var(--font-mono);
    box-shadow: 0 3px 8px rgba(239, 84, 31, 0.25);
}

#screen-career-hub .career-relegation-notice span:not(.career-relegation-mark) {
    display: block;
    color: var(--fuzzbol-orange);
    font: 900 0.62rem/1 var(--font-mono);
    letter-spacing: 0.08em;
}

#screen-career-hub .career-relegation-notice strong {
    display: block;
    margin-top: 5px;
    color: #6b2b1b;
    font: 900 1.2rem/1.2 var(--font-display);
    text-transform: uppercase;
}

#screen-career-hub .career-relegation-notice p {
    margin: 6px 0 0;
    color: #865346;
    font-size: 0.76rem;
    line-height: 1.5;
}

@media (max-width: 760px) {
    #screen-career-hub .career-competition-cards { grid-template-columns: 1fr; }
    #screen-career-hub .career-cup-bracket { grid-template-columns: 1fr; }
}

#screen-career-hub .career-section-heading .career-season-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    min-width: auto;
    flex-wrap: wrap;
}

#screen-career-hub .career-section-heading .career-season-info .career-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 9px;
    background: #f1f5f8;
    border: 1px solid #dce4eb;
    min-width: 80px;
}

#screen-career-hub .career-section-heading .career-season-info .career-stat-value {
    color: var(--fuzzbol-navy);
    font: 900 0.95rem/1.2 var(--font-mono);
}

#screen-career-hub .career-section-heading .career-season-info .career-stat-label {
    color: #637785;
    font: 800 0.52rem var(--font-mono);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 1px;
}

#screen-career-hub .career-table-wrap {
    max-height: 520px;
    background: #ffffff;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(16, 45, 67, 0.05);
    overflow-x: auto;
    overflow-y: auto;
    margin-bottom: 24px;
}

#screen-career-hub .career-table-wrap .league-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

#screen-career-hub .career-table-wrap .league-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--fuzzbol-navy);
    color: #ffffff;
    padding: 10px 14px;
    font: 800 0.68rem var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#screen-career-hub .career-table-wrap .league-table td {
    padding: 10px 14px;
    font-size: 0.84rem;
    border-bottom: 1px solid #edf2f5;
    color: var(--fuzzbol-navy);
}

#screen-career-hub .career-table-wrap .league-table tr:hover td {
    background: #f7fafc;
}

#screen-career-hub .career-table-wrap .league-table tr.user-row {
    background: var(--fuzzbol-orange-soft) !important;
    border-left: 3px solid var(--fuzzbol-orange);
}

#screen-career-hub .career-table-wrap .league-table tr.user-row td {
    font-weight: 800;
}

/* Screen Controller */
.screen {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
}

.screen.active {
    display: flex;
    animation: screenFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: opacity, transform;
}

#screen-game.active {
    animation-name: screenGameFadeIn;
    animation-duration: 0.35s;
    will-change: opacity;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes screenGameFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .screen.active,
    #screen-game.active {
        animation: none;
    }
}

/* Reusable image slot (with support for generated art & placeholder fallback) */
.art-slot {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.art-slot:not(.has-image) {
    border: 1.5px dashed var(--edge-strong);
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 10px, transparent 10px 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--ink-3);
}

.art-slot:not(.has-image) svg { opacity: 0.55; }

.art-slot:not(.has-image) .art-caption {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.art-slot.has-image {
    border: none;
    background: transparent;
    display: block;
}

.art-slot.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==========================================================================
   START SCREEN — HERO
   ========================================================================== */

#screen-start {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: calc(100vh - 112px);
    padding: 32px max(24px, calc((100vw - 1260px) / 2)) 52px;
}

#screen-start::before {
    content: '';
    position: absolute;
    z-index: -2;
    inset: 0;
    background-image: url('assets/menu_background.webp');
    background-position: center top;
    background-size: cover;
    opacity: 0.9;
}

#screen-start::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(4, 13, 27, 0.98) 0%, rgba(4, 13, 27, 0.82) 34%, rgba(4, 13, 27, 0.24) 68%, rgba(4, 13, 27, 0.66) 100%),
        linear-gradient(180deg, rgba(4, 13, 27, 0.08) 0%, rgba(4, 13, 27, 0.86) 92%);
}

#screen-start > * { position: relative; z-index: 1; }

.hero {
    width: 100%;
    max-width: 1260px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
    gap: 22px;
    margin: 8px 0 30px;
    min-height: 500px;
    padding: 20px 8px 28px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.hero::after {
    display: none;
}

.hero-copy, .hero-art { position: relative; z-index: 1; }
.hero-copy { padding-top: 76px; }

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-text);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    margin-bottom: 14px;
}

.hero-kicker span {
    width: 24px;
    height: 2px;
    background: var(--gold-text);
}

.hero-eyebrow {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold-text);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(4.4rem, 7.2vw, 6.75rem);
    letter-spacing: 0.005em;
    line-height: 0.88;
    text-transform: uppercase;
    color: var(--ink-1);
    margin-bottom: 14px;
}

.hero-title .accent {
    background: linear-gradient(180deg, var(--gold-1) 15%, var(--gold-2) 95%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: var(--ink-2);
    font-size: 1rem;
    max-width: 46ch;
}

.hero-art {
    height: 560px;
    aspect-ratio: auto;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.hero-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    display: block;
    filter: drop-shadow(0 20px 22px rgba(0, 0, 0, 0.44));
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, 0.9) 68%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, 0.9) 68%, transparent 100%);
    -webkit-mask-mode: alpha;
    mask-mode: alpha;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-art:hover img {
    transform: scale(1.03);
}

.hero-art::after {
    content: '';
    position: absolute;
    left: -12px;
    right: -12px;
    bottom: -12px;
    height: 42%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(4, 13, 27, 0.18) 42%, rgba(4, 13, 27, 0.95) 100%);
}

.hero-art svg { width: 40px; height: 40px; }

/* ==========================================================================
   DASHBOARD — TRIO / SECONDARY / UTILITY CARDS
   ========================================================================== */

.trio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    width: 100%;
    max-width: 1200px;
    margin-top: -74px;
    margin-bottom: 16px;
    position: relative;
    z-index: 3;
}

.mode-card {
    position: relative;
    background: var(--navy-2);
    border: 1px solid var(--edge);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s ease;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(105deg, rgba(5, 18, 36, 0.98) 0%, rgba(5, 18, 36, 0.91) 40%, rgba(5, 18, 36, 0.2) 72%, rgba(5, 18, 36, 0.05) 100%);
    clip-path: polygon(0 0, 62% 0, 46% 100%, 0 100%);
}

.mode-card:hover {
    transform: translateY(-4px);
    border-color: var(--edge-strong);
}

.mode-card .art-slot {
    position: absolute;
    inset: 0;
    z-index: 0;
    height: 100%;
    border-radius: 0;
    border: 0;
    overflow: hidden;
}

.mode-card .art-slot img {
    width: 82%;
    height: 100%;
    margin-left: auto;
    object-fit: contain;
    object-position: right bottom;
    filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.4));
}

.mode-card .art-slot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(5, 18, 36, 0.4), transparent 55%, rgba(5, 18, 36, 0.12));
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mode-card:hover .art-slot::after {
    opacity: 0.35;
}

.mode-card:hover .art-slot img {
    transform: scale(1.07);
}

.mode-crest {
    position: absolute;
    top: auto;
    bottom: 18px;
    left: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy-2);
    border: 2px solid var(--rail, var(--gold-text));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.mode-crest svg { width: 18px; height: 18px; color: var(--rail, var(--gold-text)); }

.mode-body {
    position: relative;
    z-index: 2;
    width: 74%;
    min-height: 330px;
    padding: 34px 20px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mode-body h3 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.5rem;
    text-transform: uppercase;
    line-height: 1.02;
    color: var(--ink-1);
    letter-spacing: 0.005em;
}

.mode-underline {
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: var(--rail, var(--gold-text));
    margin: 10px 0;
}

.mode-body p {
    font-size: 0.85rem;
    color: var(--ink-2);
    line-height: 1.5;
    flex: 1;
    max-width: 22ch;
}

.mode-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    pointer-events: none;
}

.mode-cta.blue { background: var(--blue-2); color: #fff; box-shadow: none; }
.mode-cta.gold { background: var(--gold-2); color: #231805; box-shadow: none; }
.mode-cta.silver { background: var(--silver-2); color: #1c2733; box-shadow: none; }

.mode-card.tone-blue { --rail: var(--blue-1); }
.mode-card.tone-gold { --rail: var(--gold-text); }
.mode-card.tone-silver { --rail: var(--silver-1); }

.secondary-grid,
.utility-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 14px;
}

.mini-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.mini-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--edge-strong);
    transform: translateY(-2px);
}

.mini-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rail-dim, rgba(238, 196, 83, 0.12));
    border: 1px solid var(--edge);
}

.mini-icon svg { width: 19px; height: 19px; color: var(--rail, var(--gold-text)); }

.mini-text b { display: block; font-size: 0.95rem; font-weight: 800; color: var(--ink-1); }
.mini-text span { display: block; font-size: 0.78rem; color: var(--ink-3); margin-top: 2px; }

.mini-card.tone-red { --rail: var(--red); --rail-dim: rgba(224, 72, 63, 0.14); }
.mini-card.tone-violet { --rail: #8b7cf6; --rail-dim: rgba(139, 124, 246, 0.14); }
.mini-card.tone-gold { --rail: var(--gold-text); --rail-dim: rgba(238, 196, 83, 0.14); }
.mini-card.tone-slate { --rail: var(--ink-2); --rail-dim: rgba(255, 255, 255, 0.08); }

@media (max-width: 1000px) {
    .hero { grid-template-columns: 1fr 0.8fr; }
    .hero-copy { padding-top: 46px; }
    .hero-art { height: 460px; }
    .trio-grid { grid-template-columns: 1fr; margin-top: -42px; }
}

@media (max-width: 640px) {
    #screen-start { padding-left: 14px; padding-right: 14px; }
    .hero { grid-template-columns: 1fr; padding: 20px 8px 10px; }
    .hero-copy { padding-top: 0; }
    .hero-art { height: 330px; margin: 0; }
    .logo-crest { width: 32px; height: 32px; }
    .logo-text { font-size: 1.3rem; }
    .hero-kicker { font-size: 0.7rem; }
    .hero-title { font-size: clamp(3.7rem, 16vw, 5rem); }
    .mode-card { min-height: 300px; }
    .mode-body { width: 82%; min-height: 300px; padding: 30px 18px 20px; }
    .mode-card .art-slot img { width: 72%; }
    .trio-grid { margin-top: 0; }
    .secondary-grid, .utility-grid { grid-template-columns: 1fr; }
    .career-toolbar { align-items: flex-start; flex-direction: column; }
    .career-toolbar-actions { width: 100%; justify-content: stretch; }
    .career-toolbar-actions button { flex: 1; }
    .career-metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .career-objective { align-items: flex-start; }
    .career-log-row { grid-template-columns: 28px 1fr auto; }
    .career-log-row span:last-child { display: none; }
    .team-mark { width: 18px; height: 18px; flex-basis: 18px; font-size: 0.52rem; }
}

/* ==========================================================================
   GEOMETRIC CARDS & FORMS (settings / setup / tournament / career / league)
   ========================================================================== */

.glass-card {
    background: var(--navy-2);
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.center-card {
    width: 100%;
    max-width: 680px;
    margin-top: 10px;
}

.form-header {
    border-bottom: 1px solid var(--edge);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--ink-1);
}

.form-desc {
    font-size: 0.88rem;
    color: var(--ink-3);
    margin-top: 6px;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 1120px;
}

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

/* Segmented Control Bar (format picker — JS-bound, keep structure) */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
    margin-bottom: 16px;
}

.segmented-control .btn-mode {
    flex: 1;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--ink-3);
    padding: 10px 0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.segmented-control .btn-mode.active {
    background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
    color: #3a2705;
    box-shadow: 0 2px 8px var(--gold-glow);
}

.segmented-control .btn-mode:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* Form Controls */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-field label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Secondary controls that yield space to a larger stadium preview above them */
.form-field-compact {
    gap: 4px;
    margin-bottom: 10px;
}

.form-field-compact label {
    font-size: 0.7rem;
}

.form-field-compact .geometric-select {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.geometric-select {
    width: 100%;
    background: rgba(5, 13, 26, 0.85);
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.geometric-select:focus {
    border-color: var(--gold-text);
    box-shadow: 0 0 0 3px rgba(238, 196, 83, 0.15);
}

.stadium-preview-box {
    background: rgba(0, 0, 0, 0.22);
    border: 1px dashed var(--edge);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.86rem;
    color: var(--ink-2);
    line-height: 1.5;
}

/* Settings Row with Toggle */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 15px 18px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
}

.setting-meta { display: flex; flex-direction: column; gap: 3px; }
.setting-name { font-size: 0.94rem; font-weight: 700; color: #fff; }
.setting-help { font-size: 0.79rem; color: var(--ink-3); }
.setting-row select { width: auto; min-width: 220px; }

/* Groups a cluster of .setting-row / .lobby-field items under a labeled,
   iconed heading so long option lists (Settings, LAN) read as distinct
   topics instead of one continuous list. */
.settings-section { margin-bottom: 22px; }
.settings-section:last-of-type { margin-bottom: 0; }

.settings-section-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.settings-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--fuzzbol-orange-soft);
    color: var(--fuzzbol-orange);
}

.settings-section-head h3 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.98rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--fuzzbol-navy);
}

.settings-section-head p {
    font-size: 0.8rem;
    color: var(--fuzzbol-muted);
    margin-top: 2px;
}

#btn-join-room.btn-online-secondary {
    background: #fff !important;
    color: var(--fuzzbol-navy) !important;
    border: 1.5px solid var(--fuzzbol-line);
}

#btn-join-room.btn-online-secondary:hover { background: var(--fuzzbol-orange-soft) !important; border-color: rgba(255, 75, 24, .38); }

.settings-section-icon-danger { background: rgba(197, 45, 33, .1); color: #c52d21; }

/* Toggle Switch */
.toggle-switch { position: relative; width: 50px; height: 27px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.14);
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
    border: 1px solid var(--edge);
}

.slider:before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

input:checked + .slider { background-color: var(--gold-2); border-color: var(--gold-text); }
input:checked + .slider:before { transform: translateX(23px); background: var(--gold-1); }

/* Action Buttons */
.dual-actions { display: flex; gap: 12px; width: 100%; }
.form-actions { margin-top: 24px; }

.gameover-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.gameover-actions #btn-rematch {
    grid-column: 1 / -1;
    width: 100%;
}

.btn-share-match {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-share-match .share-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.btn-share-match:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--gold-2);
    color: var(--gold-text);
}

.share-toast {
    margin-top: 14px;
    padding: 10px 16px;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    border-radius: var(--radius-sm, 8px);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    animation: fadeInToast 0.25s ease forwards;
}

@keyframes fadeInToast {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Local release diagnostics */
.settings-diagnostics {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, .14);
}

.diagnostics-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.settings-section-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--gold-text);
    font: 800 .66rem/1 var(--font-mono);
    letter-spacing: .12em;
}

.diagnostics-heading h3 { margin-bottom: 3px; font-size: 1.08rem; }
.diagnostics-heading p, .diagnostics-actions span, .diagnostic-feedback {
    color: var(--ink-3);
    font-size: .76rem;
}

.diagnostic-release-badge {
    flex-shrink: 0;
    padding: 6px 8px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-pill);
    color: var(--gold-text);
    font: 800 .64rem/1 var(--font-mono);
    letter-spacing: .05em;
}

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

.diagnostic-card, .diagnostics-summary > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
}

.diagnostic-card span, .diagnostics-summary span {
    color: var(--ink-3);
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.diagnostic-card strong, .diagnostics-summary strong {
    overflow: hidden;
    color: var(--ink-1);
    font: 800 .82rem/1.2 var(--font-mono);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diagnostic-card strong[data-status="ok"] { color: var(--emerald); }
.diagnostic-card strong[data-status="warning"] { color: var(--gold-text); }
.diagnostic-card strong[data-status="error"] { color: var(--red); }

.diagnostics-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.diagnostics-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.diagnostics-actions .btn-secondary { flex: 0 0 auto; }
.diagnostic-feedback { min-height: 18px; margin-top: 8px; color: var(--emerald); }
/* `dataset.tone` is set from JS ('ok' | 'error') wherever this class renders
   feedback — the save backup box in Settings and every account-form message
   below. Without these two rules every message rendered emerald regardless
   of tone, including error text. */
.diagnostic-feedback[data-tone="error"] { color: var(--red, #e0483f); }
.diagnostic-feedback[data-tone="ok"] { color: var(--emerald); }

.btn-primary-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--blue-2);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    font-family: inherit;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s ease;
    flex: 2;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-primary-start:hover { transform: translateY(-1px); background: var(--blue-1); box-shadow: none; }

.btn-primary-start.btn-gold {
    background: var(--gold-2);
    color: #3a2705;
    box-shadow: none;
}
.btn-primary-start.btn-gold:hover { background: var(--gold-1); box-shadow: none; }

.btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--edge);
    color: var(--ink-1);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    flex: 1;
    font-family: inherit;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.14); border-color: var(--edge-strong); }

/* ==========================================================================
   ONLINE LOBBY
   ========================================================================== */

.online-panel-card {
    max-width: 980px;
}

.online-lobby-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.online-lobby-header > div:first-child { min-width: 0; }

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

.online-lobby-card {
    min-width: 0;
    margin-bottom: 0;
    padding: 20px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .035);
}

.online-lobby-card-primary {
    grid-column: 1 / -1;
    border-color: rgba(255, 75, 24, .38);
    background: linear-gradient(135deg, rgba(255, 75, 24, .1), rgba(255, 255, 255, .035) 58%);
}

.online-lobby-card .settings-section-head {
    align-items: flex-start;
    margin-bottom: 16px;
}

.online-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 1px solid rgba(255, 75, 24, .42);
    border-radius: 50%;
    color: var(--fuzzbol-orange, var(--gold-text));
    font: 900 .8rem/1 var(--font-mono);
}

.online-card-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--gold-text);
    font: 800 .64rem/1 var(--font-mono);
    letter-spacing: .11em;
}

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

.online-setup-block {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .1);
}

.online-setup-block-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.online-setup-block-head .settings-section-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
}

.online-setup-block-head h4 {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.online-setup-block-head p {
    margin-top: 3px;
    color: var(--ink-3);
    font-size: .75rem;
}

.online-setup-block .lobby-field { margin-bottom: 0; }
.online-setup-block .settings-grid { gap: 12px; }

.online-room-actions {
    grid-column: 1 / -1;
    margin-top: 2px;
}

.online-room-actions .btn-primary-start:first-child {
    background: var(--fuzzbol-orange-fill);
}

.online-live-room,
.online-join-code {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .035);
}

.online-live-room .room-code-box { margin-top: 0; }
.online-live-room .dual-actions { margin-top: 20px !important; }

.lobby-field { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.lobby-field input.geometric-select { text-align: center; }
.lobby-field.code input { font-family: var(--font-mono); letter-spacing: 0.3em; font-size: 1.4rem; text-transform: uppercase; }

.room-code-box { text-align: center; padding: 22px; margin-top: 22px; }
.room-code-label { font-size: 0.8rem; color: var(--ink-3); margin-bottom: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
.room-code-value { font-family: var(--font-mono); font-size: 2.4rem; font-weight: 900; letter-spacing: 0.4em; color: var(--gold-text); }
.room-code-hint { font-size: 0.8rem; color: var(--ink-3); margin-top: 10px; }

.online-players-block { margin-top: 18px; }
.online-players-block .setting-meta { margin-bottom: 8px; }
#online-player-list { display: flex; flex-direction: column; gap: 8px; }

.online-status-text {
    align-self: flex-start;
    min-height: 30px;
    padding: 7px 10px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-pill);
    color: var(--ink-3);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
}

.online-status-text:empty { display: none; }
.online-status-text.is-error { border-color: rgba(248, 113, 113, .45); color: #f87171; }
.online-status-text.is-active { border-color: rgba(16, 185, 129, .42); color: var(--emerald); }

.online-room-list { display: flex; flex-direction: column; gap: 10px; }

.online-room-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 16px;
    background: #f8fafb;
    border: 1px solid var(--fuzzbol-line);
    border-radius: var(--fuzzbol-radius);
}

.online-room-row-full { opacity: 0.6; }

.online-room-row-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.online-room-row-info strong { font-size: 0.94rem; color: var(--fuzzbol-navy); }
.online-room-row-info small { font-size: 0.78rem; color: var(--fuzzbol-muted); text-transform: uppercase; letter-spacing: 0.03em; }

.online-room-row .btn-secondary { flex: 0 0 auto; padding: 9px 16px; font-size: 0.85rem; }
.online-room-row .btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

.online-room-list-empty {
    text-align: center;
    padding: 18px;
    color: var(--fuzzbol-muted);
    font-size: 0.85rem;
    background: #f8fafb;
    border: 1px dashed var(--fuzzbol-line);
    border-radius: var(--fuzzbol-radius);
}

.online-queue-box { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.online-queue-box .btn-primary-start { width: 100%; }
.online-queue-box .btn-primary-start.is-searching {
    background: linear-gradient(180deg, #b45309, #92400e);
}

.online-queue-status {
    text-align: center;
    margin: 0;
    font-size: 0.85rem;
    color: var(--fuzzbol-muted);
    min-height: 1.2em;
}

.online-queue-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.online-queue-formats-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fuzzbol-muted);
}

.online-queue-chip {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--fuzzbol-line);
    background: #f8fafb;
    color: var(--fuzzbol-navy);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.online-queue-chip:hover { border-color: var(--emerald); }
.online-queue-chip.is-current { border-color: var(--emerald); background: rgba(16, 185, 129, 0.14); }
.online-queue-chip:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* Server address, tucked away: a deployed build fills it in, so only someone
   running their own relay ever needs to open this. */
.online-advanced { margin-top: 14px; }

.online-advanced > summary {
    cursor: pointer;
    list-style: none;
    padding: 8px 2px;
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--fuzzbol-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.online-advanced > summary::-webkit-details-marker { display: none; }
.online-advanced > summary::before { content: '+ '; font-weight: 800; }
.online-advanced[open] > summary::before { content: '– '; }
.online-advanced > summary:hover { color: var(--fuzzbol-navy); }
.online-advanced > summary:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; border-radius: 6px; }
.online-advanced[open] > summary { margin-bottom: 10px; }

.challenges-banner-slot {
    width: 100%;
    height: 170px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    border: 1px solid var(--edge-strong);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.challenges-banner-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
    transition: transform 0.5s ease;
}

.challenges-banner-slot:hover img {
    transform: scale(1.03);
}

.challenges-banner-slot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(13, 20, 36, 0.8) 100%);
    pointer-events: none;
}

.challenges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 700px) { .challenges-grid { grid-template-columns: 1fr; } }

.btn-challenge-card {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: left;
    color: var(--ink-1);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: inherit;
}

.btn-challenge-card.active {
    background: rgba(238, 196, 83, 0.10);
    border-color: var(--gold-text);
    box-shadow: 0 0 0 1px var(--gold-text) inset;
}

.btn-challenge-card:hover:not(.active) {
    background: rgba(255, 255, 255, 0.055);
    border-color: var(--edge-strong);
}

.challenge-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.challenge-badge { font-size: 0.7rem; font-weight: 800; color: var(--gold-text); letter-spacing: 0.06em; text-transform: uppercase; }
.challenge-stars { display: flex; gap: 3px; }
.btn-challenge-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.005em; color: #fff; }
.btn-challenge-card p { font-size: 0.83rem; color: var(--ink-2); line-height: 1.45; }

/* ==========================================================================
   TOURNAMENT & LEAGUE SCREENS
   ========================================================================== */

.bracket-display { display: flex; justify-content: center; margin: 24px 0; }

.matchup-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.35);
    padding: 18px 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--edge);
    width: 100%;
}

.team-slot { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: 0.01em; text-transform: uppercase; }

.vs {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--ink-3);
    background: rgba(255, 255, 255, 0.07);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.league-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--edge);
    padding-bottom: 14px;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.round-badge { display: inline-flex; align-items: center; padding: 7px 12px; border: 1px solid rgba(238, 196, 83, 0.35); border-radius: var(--radius-sm); background: rgba(238, 196, 83, 0.10); color: var(--gold-text); font-size: 0.85rem; font-family: var(--font-mono); }

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--edge);
    background: rgba(0, 0, 0, 0.22);
}

.league-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.league-table th {
    background: rgba(255, 255, 255, 0.045);
    padding: 10px 12px;
    text-align: center;
    color: var(--ink-3);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--edge);
}

.league-table td { padding: 10px 12px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.league-table th:nth-child(2), .league-table td:nth-child(2) { text-align: left; font-weight: 800; }
.league-table tr.leader-row td { color: var(--gold-text); font-weight: 800; }
.league-table tr.user-row { background: rgba(74, 149, 236, 0.13) !important; border-left: 3px solid var(--blue-1); }

/* ==========================================================================
   IN-GAME HUD (BROADCAST STYLE) & CANVAS
   ========================================================================== */

#game-wrapper { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Match view: the playfield owns the viewport and the broadcast HUD is the
   only persistent chrome left above it. */
#screen-game.active {
    position: fixed;
    inset: 0;
    z-index: 90;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    min-height: 100vh;
    padding: 0;
    overflow: hidden;
    background: #050d1a;
    align-items: stretch;
}

#screen-game.active #game-wrapper {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    display: block;
}

#screen-game.active .btn-pause {
    top: 12px;
    left: auto;
    right: 18px;
}

.btn-pause {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px;
    font-size: 0;
    font-family: inherit;
    background: rgba(5, 13, 26, 0.82);
    color: var(--ink-2);
    border: 1px solid var(--edge);
    border-radius: var(--radius-pill);
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.btn-pause svg { width: 16px; height: 16px; }
.btn-pause:hover { background: rgba(255, 75, 24, 0.16); color: #fff; border-color: var(--fuzzbol-orange, #ff4b18); }

/* Compact floating scoreboard pill — no permanent bar, sits over the canvas */
.scoreboard-hud {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--navy-2);
    border: 1px solid var(--edge);
    border-radius: var(--radius-pill);
    padding: 6px 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

#screen-game.active .scoreboard-hud {
    position: absolute;
    top: 12px;
    left: 18px;
    z-index: 50;
    width: auto;
    max-width: calc(100vw - 90px);
    flex-wrap: wrap;
    row-gap: 4px;
}

.team-score { display: flex; align-items: center; gap: 8px; }
.team-score.blue { flex-direction: row-reverse; }

/* Reserved slot for the team's logo/crest — TeamArt.hydrate() upgrades it to an
   image when one is available; otherwise it just shows the mark text below. */
.team-mark {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: color-mix(in srgb, var(--team-color, var(--fuzzbol-orange, var(--fuzzbol-orange-fill))) 24%, transparent);
    border: 1px solid color-mix(in srgb, var(--team-color, var(--fuzzbol-orange, #ff4b18)) 68%, transparent);
    color: #fff;
    font: 900 0.62rem var(--font-mono);
}

.team-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--team-color, var(--red));
}
.team-score.blue .team-name { color: var(--team-color, var(--blue-1)); }

.score-digit {
    font-size: 1.05rem;
    font-weight: 900;
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--edge);
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    min-width: 28px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.timer-clock {
    font-size: 0.95rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--fuzzbol-orange);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    padding: 0 2px;
}

.hud-penalties-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--edge);
}

.penalty-dots { display: flex; gap: 4px; align-items: center; }
.penalty-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid var(--edge-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
    position: relative;
}
.penalty-dot.goal {
    background: var(--emerald);
    border-color: #34d399;
    box-shadow: 0 0 6px var(--emerald);
}
.penalty-dot.goal::after {
    content: "✓";
    color: #ffffff;
    font-size: 8px;
    font-weight: 900;
}
.penalty-dot.miss {
    background: var(--red);
    border-color: #f87171;
    box-shadow: 0 0 6px var(--red);
    border-radius: 3px;
}
.penalty-dot.miss::after {
    content: "✕";
    color: #ffffff;
    font-size: 7px;
    font-weight: 900;
}
.penalty-label { font-size: 0.65rem; font-weight: 800; color: var(--ink-3); letter-spacing: 0.05em; }

.hud-objective-badge {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--gold-text);
    background: rgba(238, 196, 83, 0.12);
    border: 1px solid rgba(238, 196, 83, 0.32);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    letter-spacing: 0.02em;
}

canvas {
    background: #000;
    border: 1px solid var(--edge);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    max-width: 100%;
    height: auto;
    display: block;
}

#screen-game.active #gameCanvas {
    width: 100% !important;
    max-width: none;
    height: 100% !important;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Goal Overlay */
.overlay-goal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: rgba(5, 13, 26, 0.94);
    backdrop-filter: blur(20px);
    border: 2px solid var(--gold-text);
    border-radius: var(--radius-md);
    padding: 28px 56px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 60px var(--gold-glow);
    z-index: 30;
}

.overlay-goal.active { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.overlay-goal h2 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.7rem;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 20px var(--gold-glow);
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

.overlay-goal p { font-size: 1.05rem; color: var(--ink-2); }

.prepared-countdown {
    position: absolute;
    inset: 0;
    z-index: 29;
    display: none;
    place-items: center;
    pointer-events: none;
    font-family: var(--font-display);
    font-size: clamp(5rem, 13vw, 9rem);
    font-weight: 900;
    line-height: 1;
    color: #fff;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.48), 0 0 20px #25d9ff, 0 0 55px rgba(37, 217, 255, 0.8);
}

.prepared-countdown.active {
    display: grid;
    animation: preparedCountPop 0.55s ease-out both;
}

@keyframes preparedCountPop {
    0% { opacity: 0; transform: scale(1.8); }
    25% { opacity: 1; }
    100% { opacity: 0.88; transform: scale(1); }
}

.overlay-goal.active #goal-title { animation: goalTextPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes goalTextPop {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.pause-overlay {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 8, 18, 0.72);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.pause-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.pause-card {
    width: min(440px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    padding: 32px;
    text-align: center;
    border: 1px solid rgba(255, 75, 24, 0.38);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(13, 39, 72, 0.98), rgba(5, 16, 31, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62), 0 0 36px rgba(255, 75, 24, 0.14);
}

.pause-kicker {
    color: var(--fuzzbol-orange);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.pause-card h2 {
    margin: 8px 0 6px;
    font-family: var(--font-display);
    font-size: 2.8rem;
    line-height: 1;
    text-transform: uppercase;
}

.pause-card p { color: var(--ink-2); font-size: 0.94rem; }

.pause-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.pause-actions button { min-height: 48px; }

.pause-actions .btn-primary-start.btn-gold {
    background: var(--fuzzbol-orange-fill);
    box-shadow: 0 7px 15px rgba(244, 81, 32, 0.24);
}
.pause-actions .btn-primary-start.btn-gold:hover { background: var(--fuzzbol-orange-fill-hover); box-shadow: none; }

@media (max-width: 520px) {
    .pause-actions { flex-direction: column; }
}

.pause-settings {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--edge);
    text-align: left;
}

.pause-settings-kicker {
    color: var(--ink-3);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    margin-bottom: 12px;
}

.pause-settings .setting-row { padding: 12px 14px; gap: 12px; }
.pause-settings .setting-row + .setting-row { margin-top: 8px; }
.pause-settings .setting-name { font-size: 0.86rem; }
.pause-settings .setting-help { font-size: 0.73rem; }

.pause-volume-slider {
    width: 120px;
    accent-color: var(--fuzzbol-orange, #ff4b18);
    flex-shrink: 0;
}

.pause-fullscreen-btn {
    width: 100%;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.reconnect-overlay { z-index: 65; }

.reconnect-spinner {
    width: 34px;
    height: 34px;
    margin: 4px auto 0;
    border-radius: 50%;
    border: 3px solid rgba(238, 196, 83, 0.25);
    border-top-color: var(--gold-text);
    animation: reconnectSpin 0.8s linear infinite;
}

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

@media (max-width: 700px) {
    #screen-game.active .scoreboard-hud {
        top: 8px;
        left: 8px;
        max-width: calc(100vw - 66px);
        padding: 5px 8px;
        gap: 6px;
    }

    .team-score { gap: 5px; }
    .team-name { font-size: 0.68rem; }
    .score-digit { min-width: 22px; padding: 1px 6px; font-size: 0.9rem; }
    .timer-clock { font-size: 0.8rem; }

    #screen-game.active .btn-pause {
        top: 8px;
        right: 8px;
        padding: 8px;
    }
}

/* ==========================================================================
   FUZZBOL HOME — Orange / Navy product dashboard
   The home screen follows the supplied Fuzzbol identity reference while the
   underlying match, career, tournament and LAN logic remains unchanged.
   ========================================================================== */

.app-header .brand-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.legacy-ui-hooks { display: none !important; }

body.home-view {
    background: #f5f7f8;
    color: #172536;
    overflow-x: hidden;
    overflow-y: auto;
}

body.home-view .app-header { display: none; }
body.home-view #app-container {
    width: 100%;
    max-width: none;
    padding: 0;
    display: block;
}

#screen-start.fuzzbol-home.active {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #f5f7f8;
}

.home-sidebar {
    width: 272px;
    min-height: 100vh;
    flex: 0 0 272px;
    display: flex;
    flex-direction: column;
    padding: 22px 22px 20px;
    background: #fff;
    border-right: 1px solid #e3e7ea;
}

.home-brand {
    height: 126px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border-bottom: 1px solid #e5e8eb;
}

.home-brand img {
    width: 208px;
    height: 142px;
    margin-top: -17px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.home-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 24px;
}

.home-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 48px;
    padding: 8px 12px 8px 16px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #253548;
    text-align: left;
    cursor: pointer;
    font: 800 0.86rem/1.15 var(--font-body);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.home-nav-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 3px 3px 0;
    background: transparent;
}

.home-nav-item svg {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-nav-item:hover { color: var(--fuzzbol-orange); background: #fff4ef; transform: translateX(2px); }
.home-nav-item.active { color: var(--fuzzbol-orange); background: #fff3ee; }
.home-nav-item.active::before { background: #f45120; }

.sidebar-spacer { flex: 1 1 24px; min-height: 24px; }

.sidebar-promo {
    position: relative;
    overflow: hidden;
    min-height: 154px;
    padding: 19px 16px 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background:
        radial-gradient(circle at 76% 22%, rgba(255, 75, 24, .9) 0 2px, transparent 3px),
        radial-gradient(circle at 80% 25%, rgba(255, 75, 24, .3) 0 26px, transparent 27px),
        linear-gradient(145deg, #17293a, #071827 68%);
    box-shadow: 0 10px 22px rgba(20, 40, 55, .14);
    text-align: left;
    cursor: pointer;
}

.sidebar-promo::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 2px;
    right: -34px;
    top: 49px;
    background: linear-gradient(90deg, transparent, var(--fuzzbol-orange-fill));
    transform: rotate(-25deg);
    box-shadow: 0 13px 0 rgba(255, 75, 24, .42), 0 26px 0 rgba(255, 75, 24, .22);
}

.promo-orbit {
    position: absolute;
    right: 16px;
    top: 13px;
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    transform: rotate(-18deg);
}

.promo-orbit img { width: 31px; height: 31px; object-fit: contain; filter: brightness(1.15); }
.promo-kicker { position: relative; z-index: 1; font: 800 .6rem var(--font-mono); letter-spacing: .08em; }
.sidebar-promo strong { position: relative; z-index: 1; margin-top: 4px; color: #ff5a25; font: 900 1.35rem/1 var(--font-display); letter-spacing: .02em; font-style: italic; }
.promo-button { position: relative; z-index: 1; margin-top: auto; padding: 6px 10px; color: #ff5a25; border: 1px solid #ff5a25; border-radius: 5px; font: 800 .58rem var(--font-body); }
.sidebar-promo:hover { transform: translateY(-2px); }

.sidebar-profile {
    display: grid;
    grid-template-columns: 38px 1fr 8px;
    gap: 10px;
    align-items: center;
    margin-top: 17px;
    padding: 10px 8px;
    border: 1px solid #e4e7e9;
    border-radius: 10px;
    background: #fff;
}

.profile-shield, .profile-action-mark {
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #091523;
    border-radius: 50%;
}
.profile-shield { width: 38px; height: 38px; }
.profile-shield img { width: 34px; height: 34px; }
.sidebar-profile strong { display: block; color: #142638; font-size: .74rem; }
.sidebar-profile span { display: block; margin-top: 2px; color: #82909c; font: 700 .54rem var(--font-mono); letter-spacing: .04em; }
.sidebar-profile span b { color: #1b2b3c; }
.sidebar-profile i { width: 8px; height: 8px; align-self: start; margin-top: 3px; border-radius: 50%; background: #21c36a; }

.home-content {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0 28px;
    background: #f5f7f8;
}

.home-topbar {
    min-height: 94px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid #e1e5e8;
}

.home-welcome span { display: block; color: #5c6b77; font: 700 .66rem var(--font-mono); letter-spacing: .11em; }
.home-welcome h1 { margin-top: 1px; color: #172638; font: 900 1.3rem/1 var(--font-display); letter-spacing: .02em; }
.home-seo-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin-top: 10px;
}
.home-seo-nav > span {
    display: inline-block;
    color: #5c6b77;
    font: 800 .52rem/1 var(--font-mono);
    letter-spacing: .08em;
}
.home-seo-nav a {
    color: #425a6b;
    font: 800 .63rem/1.2 var(--font-body);
    text-decoration: none;
    transition: color .18s ease;
}
.home-seo-nav a:hover,
.home-seo-nav a:focus-visible { color: var(--fuzzbol-orange); }
.division-pill { display: inline-flex; align-items: center; gap: 6px; margin-left: 28px; padding: 7px 10px; border: 1px solid #ccd3d8; border-radius: 5px; color: #364657; font: 800 .63rem var(--font-mono); letter-spacing: .04em; }
.division-pill svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.home-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-action, .profile-action { position: relative; display: grid; place-items: center; padding: 5px; border: 0; background: transparent; color: #223548; cursor: pointer; }
.header-action svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.header-action.has-badge b { position: absolute; right: -3px; top: -4px; min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #f45120; font: 800 .63rem var(--font-body); }
.action-divider { height: 25px; width: 1px; background: #dfe3e6; }
.profile-action { display: flex; gap: 8px; }
.profile-action-mark { width: 38px; height: 38px; }
.profile-action-mark img { width: 34px; height: 34px; }
.profile-action > svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.home-match-grid { display: grid; grid-template-columns: minmax(0, 1fr) 376px; gap: 16px; margin-top: 20px; }
.match-preview-card, .match-setup-card { min-width: 0; overflow: hidden; border: 1px solid #e0e4e7; border-radius: 14px; background: #fff; box-shadow: 0 8px 18px rgba(25, 43, 58, .07); }
.match-setup-card { align-self: start; }
.preview-scorebar { height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); align-items: stretch; overflow: hidden; color: #fff; background: #0d1d31; }
.preview-team { display: flex; align-items: center; gap: 10px; padding: 0 17px; font: 900 .85rem var(--font-body); }
.preview-team.orange { justify-content: flex-start; background: linear-gradient(100deg, #ff4c16 0 74%, #f15a1e 74% 100%); }
.preview-team.navy { justify-content: flex-end; background: linear-gradient(260deg, #0b284d 0 74%, #123962 74% 100%); }
.preview-team strong { flex: 1; letter-spacing: .02em; }
.preview-team b { font: 900 1.6rem/1 var(--font-display); }
.preview-team-mark { width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.8); border-radius: 50%; color: #fff; font-size: .85rem; }
.preview-clock { display: grid; place-items: center; font: 900 1.02rem var(--font-mono); background: #102c50; }
.mini-pitch { position: relative; min-height: 430px; overflow: hidden; background: linear-gradient(90deg, rgba(24, 96, 37, .12) 0 8%, rgba(255,255,255,.03) 8% 16%, rgba(24,96,37,.12) 16% 24%, rgba(255,255,255,.03) 24% 32%, rgba(24,96,37,.12) 32% 40%, rgba(255,255,255,.03) 40% 48%, rgba(24,96,37,.12) 48% 56%, rgba(255,255,255,.03) 56% 64%, rgba(24,96,37,.12) 64% 72%, rgba(255,255,255,.03) 72% 80%, rgba(24,96,37,.12) 80% 88%, rgba(255,255,255,.03) 88% 96%, rgba(24,96,37,.12) 96% 100%), url('assets/grass_turf.webp'); background-size: auto, cover; background-position: center; }
.mini-pitch::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 44%, transparent 0 16%, rgba(11,80,30,.12) 58%, rgba(7,50,19,.3) 100%); pointer-events: none; }
.pitch-half-line { position: absolute; z-index: 1; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.82); }
.pitch-circle { position: absolute; z-index: 1; left: 50%; top: 50%; width: 160px; height: 160px; transform: translate(-50%,-50%); border: 2px solid rgba(255,255,255,.76); border-radius: 50%; }
.pitch-center-dot { position: absolute; z-index: 2; left: 50%; top: 50%; width: 8px; height: 8px; transform: translate(-50%,-50%); border-radius: 50%; background: rgba(255,255,255,.9); }
.pitch-box { position: absolute; z-index: 1; top: 32%; width: 12%; height: 36%; border: 2px solid rgba(255,255,255,.72); }
.pitch-box.left { left: 0; border-left: 0; }.pitch-box.right { right: 0; border-right: 0; }
.pitch-goal { position: absolute; z-index: 1; top: 41%; width: 3.5%; height: 18%; border: 2px solid rgba(255,255,255,.86); background: repeating-linear-gradient(0deg, rgba(255,255,255,.4) 0 1px, transparent 1px 4px); }
.pitch-goal.left { left: 0; transform: translateX(-1px); }.pitch-goal.right { right: 0; transform: translateX(1px); }
.pitch-player { position: absolute; z-index: 4; width: 38px; height: 38px; display: grid; place-items: center; transform: translate(-50%,-50%); border: 3px solid #fff; border-radius: 50%; color: #fff; font: 900 .85rem var(--font-mono); box-shadow: 0 3px 5px rgba(0,0,0,.35); }
.orange-player { background: #f2571f; }.navy-player { background: #0d2a4e; }
.p1{left:28%;top:22%}.p2{left:43%;top:29%}.p3{left:28%;top:50%}.p4{left:39%;top:65%}.p5{left:31%;top:82%}.p6{left:66%;top:23%}.p7{left:79%;top:31%}.p8{left:62%;top:53%}.p9{left:76%;top:63%}.p10{left:66%;top:83%}
.pitch-ball { position: absolute; z-index: 5; left: 53%; top: 49%; width: 34px; height: 34px; display: grid; place-items: center; padding: 2px; transform: translate(-50%,-50%); border: 1px solid rgba(19,40,60,.24); border-radius: 50%; background: rgba(255,255,255,.96); box-shadow: 0 3px 6px rgba(0,0,0,.3); }
.pitch-ball img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.pitch-tag { position: absolute; z-index: 6; bottom: 16px; min-width: 132px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.54); border-radius: 9px; color: #fff; background: rgba(28,73,36,.76); backdrop-filter: blur(4px); }
.pitch-tag small { display: block; color: rgba(255,255,255,.76); font: 700 .52rem var(--font-mono); }.pitch-tag strong { display: block; margin-top: 4px; font: 800 .76rem var(--font-body); }.pitch-tag strong span { margin-left: 5px; font-size: 1.35rem; line-height: 0; vertical-align: -2px; }
.wind-tag { left: 17px; }.surface-tag { right: 17px; text-align: right; }.pitch-objective { position: absolute; z-index: 6; bottom: 15px; left: 50%; transform: translateX(-50%); padding: 8px 18px; border-radius: 9px; color: #fff; background: rgba(12,33,20,.9); font: 800 .7rem var(--font-mono); white-space: nowrap; }

.setup-card-header { padding: 11px 16px; color: #fff; background: #13283c; font: 900 .75rem var(--font-mono); letter-spacing: .06em; }
.setup-card-body { padding: 17px 16px 14px; }
.setup-label { margin-top: 15px; margin-bottom: 8px; color: #1c2c3e; font: 900 .64rem var(--font-mono); letter-spacing: .05em; }.setup-label:first-child { margin-top: 0; }
.setup-options { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.setup-option { min-height: 94px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #d9dee2; border-radius: 9px; background: #fff; color: #253547; cursor: pointer; }
.setup-option svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }.setup-option strong { font: 900 .71rem var(--font-body); }.setup-option span { color: #5c6b77; font: 700 .55rem var(--font-mono); }.setup-option.active { border-color: #ff6333; color: var(--fuzzbol-orange); box-shadow: inset 0 0 0 1px #ff6333; }.setup-option.active span { color: #c5502e; }
.fun-mode-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 11px 12px; border: 1px solid #e0e5e8; border-radius: 9px; background: linear-gradient(135deg, #fff8f4, #fff); }
.fun-mode-entry label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.fun-mode-entry input { width: 18px; height: 18px; accent-color: #ff4b18; }
.fun-mode-entry strong { display: block; color: #24384d; font: 900 .72rem var(--font-body); letter-spacing: .03em; }
.fun-mode-entry small { display: block; margin-top: 2px; color: #7a8790; font: 600 .6rem var(--font-body); }
.fun-mode-editor { margin-top: 12px; padding: 14px; border: 1px solid rgba(255, 75, 24, .28); border-radius: 10px; background: linear-gradient(135deg, #fff8f3, #fff); }
.fun-mode-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #f0d9cf; }
.fun-mode-editor-head h2 { margin-top: 3px; color: #1d344a; font: 900 .95rem var(--font-body); }
.fun-mode-editor-head p { max-width: 32ch; margin-top: 4px; color: #5c6b77; font: 600 .6rem/1.35 var(--font-body); }
.fun-mode-attributes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; padding-top: 13px; }
.fun-attribute { display: grid; gap: 6px; color: #263b4e; font: 800 .62rem var(--font-mono); }
.fun-attribute span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fun-attribute output { min-width: 20px; padding: 2px 5px; border-radius: 5px; color: #fff; background: var(--fuzzbol-orange-fill); text-align: center; font: 900 .62rem var(--font-mono); }
.fun-attribute input[type="range"] { width: 100%; accent-color: #ff4b18; cursor: pointer; }
.team-size-options { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; }.team-size-options button { min-height: 34px; border: 1px solid #d4dbe0; border-radius: 7px; background: #fff; color: #26384a; font: 800 .7rem var(--font-body); cursor: pointer; }.team-size-options button.active { color: #fff; border-color: #ff4b18; background: var(--fuzzbol-orange-fill); }
.setup-carousel { display: grid; grid-template-columns: 22px 82px 1fr 22px; gap: 8px; align-items: center; }.setup-carousel > button, .weather-row > button { border: 0; background: transparent; color: #1a2f45; font-size: 1.8rem; cursor: pointer; }.setup-carousel img { width: 82px; height: 56px; object-fit: cover; border-radius: 7px; }.setup-carousel strong, .weather-row strong { display: block; color: #21354a; font: 900 .69rem var(--font-body); }.setup-carousel span { display: block; margin-top: 4px; color: #5c6b77; font: 700 .55rem var(--font-mono); }.setup-stadium-players { display: block; margin-top: 5px; color: var(--fuzzbol-orange); font: 800 .49rem var(--font-mono); letter-spacing: .03em; }.setup-carousel i, .weather-row i { display: flex; gap: 4px; margin-top: 8px; }.setup-carousel i b, .weather-row i b { width: 7px; height: 7px; border-radius: 50%; background: #ccd2d6; }.setup-carousel i b:first-child, .weather-row i b:first-child { background: var(--fuzzbol-orange-fill); }
.weather-row { display: grid; grid-template-columns: 22px 45px 1fr 22px; gap: 8px; align-items: center; }.weather-sun { color: #ffac12; font-size: 2.5rem; line-height: 1; text-align: center; }.weather-row small { display: block; margin-top: 3px; color: #5c6b77; font: 500 .58rem/1.3 var(--font-body); }.weather-row i b:first-child { background: #d8dde0; }.weather-row i b:nth-child(2) { background: #ffb31a; }
.home-primary-action { width: 100%; min-height: 47px; display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 17px; border: 0; border-radius: 9px; color: #fff; background: var(--fuzzbol-orange-fill); box-shadow: 0 7px 15px rgba(244, 81, 32, .24); cursor: pointer; font: 900 .86rem var(--font-body); }.home-primary-action span { font-size: 1.3rem; line-height: 0; }.home-primary-action:hover { background: var(--fuzzbol-orange-fill-hover); transform: translateY(-1px); }
.setup-live-readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; padding-top: 11px; border-top: 1px solid #e6eaed; }
.setup-live-readout > div { min-width: 0; padding: 7px 8px; border: 1px solid #e3e8eb; border-radius: 7px; background: #f8fafb; }
.setup-live-readout small { display: block; color: #7b8992; font: 800 .48rem var(--font-mono); letter-spacing: .06em; }
.setup-live-readout strong { display: block; overflow: hidden; margin-top: 4px; color: var(--fuzzbol-navy); font: 900 .58rem var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.setup-map-formats { display: block; margin-top: 5px; color: var(--fuzzbol-orange); font: 800 .58rem var(--font-mono); }
.setup-live-insights { display: none; margin-top: 10px; padding: 11px 12px; border: 1px solid #e1e6e9; border-radius: 9px; background: linear-gradient(135deg, #f8fafb, #fff); }
.setup-live-insights-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #e7ebed; }
.setup-live-insights-head small { display: block; color: var(--fuzzbol-orange); font: 900 .48rem var(--font-mono); letter-spacing: .08em; }
.setup-live-insights-head strong { display: block; margin-top: 3px; color: var(--fuzzbol-navy); font: 900 .7rem var(--font-body); }
.setup-live-insights-head > span { display: inline-flex; align-items: center; gap: 5px; color: #268b5c; font: 900 .49rem var(--font-mono); white-space: nowrap; }
.setup-live-insights-head i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #29bd72; box-shadow: 0 0 0 3px rgba(41,189,114,.13); }
.setup-live-insights-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding: 10px 0 8px; }
.setup-live-insights-grid > div { min-width: 0; padding-right: 7px; border-right: 1px solid #e4e9eb; }
.setup-live-insights-grid > div:last-child { border-right: 0; padding-right: 0; }
.setup-live-insights-grid small { display: block; color: #84919a; font: 800 .45rem var(--font-mono); letter-spacing: .06em; }
.setup-live-insights-grid strong { display: block; overflow: hidden; margin-top: 3px; color: var(--fuzzbol-navy); font: 900 .56rem var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.setup-live-insights-grid span { display: block; overflow: hidden; margin-top: 3px; color: #76858f; font: 600 .49rem var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.setup-sim-meter { display: grid; grid-template-columns: auto auto; gap: 5px 8px; align-items: center; }
.setup-sim-meter > span { color: #7d8a93; font: 800 .47rem var(--font-mono); letter-spacing: .06em; }
.setup-sim-meter > strong { justify-self: end; color: var(--fuzzbol-orange); font: 900 .5rem var(--font-mono); }
.setup-sim-meter > div { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 99px; background: #e1e8eb; }
.setup-sim-meter b { display: block; width: 64%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--fuzzbol-orange-fill), #ff9b27); transition: width .25s ease; }
.setup-live-insights > p { margin: 8px 0 0; color: #71808a; font: 600 .54rem/1.35 var(--font-body); }

.home-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 17px; }.feature-card { position: relative; min-height: 174px; overflow: hidden; display: flex; align-items: stretch; border: 1px solid #e2e5e8; border-radius: 12px; background: #fff; cursor: pointer; }.feature-card > div { position: relative; z-index: 2; width: 63%; padding: 18px 14px; }.feature-card img { position: absolute; z-index: 1; right: -3px; bottom: 0; width: 60%; height: 100%; object-fit: cover; object-position: center; opacity: .62; mask-image: linear-gradient(90deg, transparent 0%, #000 36%, #000 100%); }.feature-card:nth-child(1) img, .feature-card:nth-child(2) img { object-fit: contain; object-position: right bottom; opacity: .82; }.feature-card:nth-child(2) img { width: 54%; }.feature-card .feature-kicker { display: block; max-width: 18ch; color: #1e344a; font: 900 .66rem/1.05 var(--font-mono); letter-spacing: .04em; }.feature-card h2 { margin-top: 12px; color: #25374a; font: 900 1rem/1.08 var(--font-body); }.feature-card p { margin-top: 8px; color: #5c6b77; font: 500 .66rem/1.35 var(--font-body); }.feature-card button { position: absolute; z-index: 3; left: 14px; bottom: 12px; padding: 7px 10px; border: 1px solid #d7dde1; border-radius: 6px; background: rgba(255,255,255,.9); color: #2b3c4d; font: 900 .58rem var(--font-body); cursor: pointer; }.feature-card button span { margin-left: 12px; font-size: 1rem; vertical-align: -1px; }.feature-card.dark { color: #fff; background: linear-gradient(135deg, #13283c, #2e3d4c); border-color: #253c50; }.feature-card.dark .feature-kicker, .feature-card.dark h2 { color: #fff; }.feature-card.dark p { color: rgba(255,255,255,.72); }.feature-card.dark img { width: 70%; opacity: .52; mix-blend-mode: screen; }.feature-card:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(25,43,58,.1); }


@media (max-width: 1180px) {
    .home-sidebar { width: 230px; flex-basis: 230px; padding-left: 18px; padding-right: 18px; }.home-nav-item::before { left: -18px; }.home-content { padding: 0 20px; }.home-match-grid { grid-template-columns: minmax(0,1fr) 340px; }.home-feature-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.feature-card { min-height: 162px; }
}

@media (max-width: 900px) {
    #screen-start.fuzzbol-home.active { flex-direction: column; }.home-sidebar { width: 100%; min-height: auto; flex-basis: auto; padding: 10px 15px; border-right: 0; border-bottom: 1px solid #e3e7ea; }.home-brand { height: 54px; justify-content: flex-start; border-bottom: 0; }.home-brand img { width: 102px; height: 72px; margin-top: -10px; }.home-nav { flex-direction: row; overflow-x: auto; gap: 4px; margin-top: 3px; padding-bottom: 3px; }.home-nav-item { flex: 0 0 auto; min-height: 38px; gap: 7px; padding: 7px 11px; font-size: .66rem; }.home-nav-item br { display: none; }.home-nav-item svg { width: 17px; height: 17px; flex-basis: 17px; }.home-nav-item::before { display: none; }.sidebar-spacer, .sidebar-promo, .sidebar-profile { display: none; }.home-content { padding: 0 15px; }.home-topbar { min-height: 80px; }.home-match-grid { grid-template-columns: 1fr; }.match-setup-card { order: -1; }.home-feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 560px) {
    .home-topbar { gap: 10px; }.division-pill { display: none; }.header-action:first-child, .action-divider { display: none; }.home-welcome h1 { font-size: 1.08rem; }.home-actions { gap: 4px; }.preview-scorebar { grid-template-columns: minmax(0,1fr) 63px minmax(0,1fr); }.preview-team { gap: 5px; padding: 0 8px; font-size: .68rem; }.preview-team-mark { width: 21px; height: 21px; }.preview-team b { font-size: 1.35rem; }.mini-pitch { min-height: 350px; }.pitch-circle { width: 118px; height: 118px; }.pitch-player { width: 31px; height: 31px; font-size: .67rem; }.pitch-tag { min-width: 0; padding: 7px 8px; }.wind-tag { left: 8px; }.surface-tag { right: 8px; }.pitch-tag strong { font-size: .61rem; }.pitch-objective { bottom: 12px; padding: 7px 10px; font-size: .6rem; }.setup-live-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }.setup-live-readout > div:last-child { grid-column: 1 / -1; }.home-feature-grid { grid-template-columns: 1fr; }.feature-card { min-height: 155px; }.home-footer { flex-wrap: wrap; gap: 8px 13px; padding: 12px 0; }.home-footer span:not(.news-pill), .home-footer i { display: none; }.social-icons { margin-left: auto; }
}

/* ==========================================================================
   MODALS (GAMEOVER)
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 14, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal-card {
    background: var(--navy-2);
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
    padding: 32px;
    width: 100%;
    max-width: 520px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

.modal-victory-badge {
    width: 100%;
    height: 140px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid rgba(238, 196, 83, 0.35);
    box-shadow: 0 8px 24px rgba(238, 196, 83, 0.2);
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.modal-victory-badge[data-outcome="defeat"] {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
}

.modal-victory-badge[data-outcome="draw"] {
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.2);
}

.modal-victory-badge[data-outcome="victory"] {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.modal-victory-badge[data-outcome="mvp"] {
    border-color: rgba(238, 196, 83, 0.5);
    box-shadow: 0 8px 28px rgba(238, 196, 83, 0.35);
}

.modal-victory-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.modal-victory-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(18, 25, 44, 0.75) 100%);
    pointer-events: none;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-header h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; text-transform: uppercase; }
.career-action-button {
    background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
    color: #3a2705;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.86rem;
    transition: all 0.2s ease;
}

.career-action-button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--gold-glow); }
.career-action-button:disabled { background: rgba(255, 255, 255, 0.08); color: var(--ink-3); cursor: not-allowed; box-shadow: none; transform: none; }

.winner-title { font-family: var(--font-display); font-weight: 900; font-size: 2.1rem; text-transform: uppercase; margin-bottom: 6px; letter-spacing: 0.01em; }

.match-stats-table { width: 100%; margin: 20px 0; border-collapse: collapse; }
.match-stats-table td { padding: 10px 14px; border-bottom: 1px solid var(--edge); font-size: 0.95rem; }

/* The end-of-match modal keeps its own light Fuzzbol card regardless of
   body.match-view's --ink-1 swap: that swap targets the in-match HUD (which
   sits on a light background), but this modal's card is always the dark
   .modal-card base, so inheriting --ink-1 there turned title/labels navy-on-navy
   and made them unreadable right when a player finishes a match. */
body:has(#modal-gameover.active) {
    overflow-y: auto !important;
    touch-action: pan-y !important;
}

#modal-gameover.modal-overlay {
    overflow-y: auto;
    overflow-x: hidden;
    align-items: center;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    padding: clamp(8px, 1.8vh, 18px) 12px max(14px, env(safe-area-inset-bottom));
}

#modal-gameover .modal-card {
    margin: auto;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    width: 100%;
    max-width: 490px;
    padding: clamp(10px, 2vh, 18px) clamp(12px, 3vw, 20px);
    background: var(--fuzzbol-panel);
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
    box-shadow: 0 24px 60px rgba(19, 40, 60, .28);
    display: flex;
    flex-direction: column;
}

#modal-gameover .modal-victory-badge {
    height: clamp(48px, 7.5vh, 76px);
    margin-bottom: 6px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

#modal-gameover .modal-victory-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

#modal-gameover .winner-title {
    color: var(--fuzzbol-navy);
    font-size: clamp(1.25rem, 2.3vh, 1.7rem);
    line-height: 1.15;
    margin-bottom: 2px;
    flex-shrink: 0;
}

#modal-gameover #modal-subtitle {
    color: var(--fuzzbol-muted);
    font-size: clamp(0.74rem, 1.1vh, 0.82rem);
    margin-bottom: 5px;
    flex-shrink: 0;
}

#modal-gameover .career-postmatch-card {
    margin: 5px 0 6px;
    padding: 7px 11px;
    border-radius: 8px;
    flex-shrink: 0;
}

#modal-gameover .career-pm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

#modal-gameover .career-pm-rating-badge {
    min-width: 54px;
    padding: 3px 6px;
    border-radius: 6px;
}

#modal-gameover .career-pm-rating-num {
    font-size: 1.2rem;
    line-height: 1;
}

#modal-gameover .career-pm-rating-label {
    font-size: 0.48rem;
    margin-top: 2px;
}

#modal-gameover .career-pm-player {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
}

#modal-gameover .career-pm-headline {
    font-size: 0.76rem;
    line-height: 1.25;
    margin: 2px 0 0;
}

#modal-gameover .career-pm-progress-wrap {
    margin-top: 4px;
    padding-top: 4px;
}

#modal-gameover .career-pm-progress-header {
    font-size: 0.62rem;
    margin-bottom: 2px;
}

#modal-gameover .career-pm-levelup {
    margin-top: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
}

#modal-gameover .match-possession-bar-wrap {
    margin: 4px 0 5px;
    padding: 5px 10px;
    border-radius: 8px;
    flex-shrink: 0;
}

#modal-gameover .possession-bar-labels {
    font-size: 0.74rem;
    margin-bottom: 3px;
}

#modal-gameover .possession-bar-mid-label {
    font-size: 0.64rem;
}

#modal-gameover .possession-pct {
    font-size: 0.82rem;
}

#modal-gameover .possession-bar-track {
    height: 6px;
}

#modal-gameover .match-stats-table {
    margin: 4px 0 5px;
    border-collapse: collapse;
}

#modal-gameover .match-stats-table td {
    border-bottom-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
    padding: clamp(2.5px, 0.45vh, 4px) 8px;
    font-size: clamp(0.72rem, 1.15vh, 0.82rem);
    line-height: 1.25;
}

#modal-gameover .match-stats-table td:first-child { color: var(--fuzzbol-muted); }

#modal-gameover .btn-primary-start {
    background: var(--fuzzbol-orange-fill);
    color: #fff;
}

#modal-gameover .btn-primary-start:hover { background: var(--fuzzbol-orange-fill-hover); }

#modal-gameover .btn-secondary {
    background: #fff;
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
}

#modal-gameover .btn-secondary:hover {
    background: var(--fuzzbol-orange-soft);
    border-color: rgba(255, 75, 24, .42);
}
.match-stats-table td:last-child { text-align: right; font-family: var(--font-mono); }

#modal-gameover .gameover-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 6px;
    width: 100%;
    flex-shrink: 0;
}

#modal-gameover .gameover-actions #btn-rematch {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 40px;
    padding: 9px 14px;
    font-size: 0.94rem;
    font-weight: 800;
    margin-top: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(255, 75, 24, 0.3);
}

#modal-gameover .btn-share-match,
#modal-gameover #btn-return-menu {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-height: 720px) {
    #modal-gameover.modal-overlay {
        padding: 4px 8px max(8px, env(safe-area-inset-bottom));
    }
    #modal-gameover .modal-card {
        padding: 8px 12px;
        max-height: calc(100vh - 10px);
        max-height: calc(100dvh - 10px);
    }
    #modal-gameover .modal-victory-badge {
        height: 42px;
        margin-bottom: 3px;
    }
    #modal-gameover .winner-title {
        font-size: 1.12rem;
        margin-bottom: 1px;
    }
    #modal-gameover #modal-subtitle {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
    #modal-gameover .career-postmatch-card {
        margin: 3px 0;
        padding: 5px 8px;
    }
    #modal-gameover .career-pm-header {
        gap: 6px;
        margin-bottom: 3px;
    }
    #modal-gameover .career-pm-rating-badge {
        min-width: 44px;
        padding: 2px 4px;
    }
    #modal-gameover .career-pm-rating-num {
        font-size: 1.05rem;
    }
    #modal-gameover .career-pm-headline {
        font-size: 0.7rem;
        line-height: 1.2;
    }
    #modal-gameover .match-possession-bar-wrap {
        margin: 2px 0;
        padding: 3px 6px;
    }
    #modal-gameover .possession-bar-labels {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    #modal-gameover .match-stats-table {
        margin: 2px 0;
    }
    #modal-gameover .match-stats-table td {
        padding: 1.5px 5px;
        font-size: 0.72rem;
        line-height: 1.2;
    }
    #modal-gameover .gameover-actions {
        gap: 5px;
        margin-top: 5px;
    }
    #modal-gameover .gameover-actions #btn-rematch {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 0.86rem;
    }
    #modal-gameover .btn-share-match,
    #modal-gameover #btn-return-menu {
        min-height: 32px;
        padding: 5px 8px;
        font-size: 0.74rem;
    }
}

@media (max-height: 540px) {
    #modal-gameover .modal-victory-badge {
        display: none;
    }
    #modal-gameover .winner-title {
        font-size: 1.02rem;
    }
    #modal-gameover #modal-subtitle {
        display: none;
    }
}

/* Post-match reveal: card pops in, then its contents stagger in behind it
   instead of the whole modal just snapping into view. */
#modal-gameover.active .modal-card { animation: gameoverCardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
#modal-gameover.active .modal-victory-badge { animation: careerViewIn 0.4s ease both; animation-delay: 0.05s; }
#modal-gameover.active .winner-title { animation: gameoverTitlePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: 0.1s; }
#modal-gameover.active #modal-subtitle { animation: careerViewIn 0.4s ease both; animation-delay: 0.16s; }
#modal-gameover.active .career-postmatch-card { animation: careerViewIn 0.45s ease both; animation-delay: 0.2s; }
#modal-gameover.active .career-pm-rating-badge { animation: gameoverTitlePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: 0.32s; }
#modal-gameover.active .match-stats-table { animation: careerViewIn 0.4s ease both; animation-delay: 0.3s; }
#modal-gameover.active .dual-actions { animation: careerViewIn 0.4s ease both; animation-delay: 0.38s; }

@keyframes gameoverCardIn {
    0% { opacity: 0; transform: scale(0.92) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes gameoverTitlePop {
    0% { opacity: 0; transform: scale(0.7); }
    60% { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   ACCOUNTS (Fase 2 — docs/PLAN-CUENTAS-Y-NUBE.md)
   Topbar entry point + the sign-in/sign-up/reset modal. Hidden entirely by
   js/auth-ui.js when this deployment has no accounts configured, so these
   rules are inert (never painted) on a build without Supabase credentials.
   ========================================================================== */

.home-account-button {
    display: none;
    align-items: center;
    gap: 9px;
    margin-left: 8px;
    padding: 6px 13px 6px 6px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink-1);
    cursor: pointer;
    font-family: inherit;
    max-width: 200px;
    transition: border-color .18s ease, transform .18s ease;
}
.home-account-button:not([hidden]) { display: flex; }
.home-account-button:hover,
.home-account-button:focus-visible { border-color: var(--gold-text); transform: translateY(-1px); }

.account-avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
    background: rgba(127, 143, 158, .16);
    color: inherit;
}
.account-avatar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-account-button[data-account-state="signed-in"] .account-avatar { background: rgba(47, 191, 117, .16); color: var(--emerald); }

.account-button-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left; }
.account-button-copy strong {
    display: block;
    font: 800 .78rem/1.1 var(--font-display);
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 148px;
}
.account-button-copy small { font: 700 .58rem/1 var(--font-mono); letter-spacing: .04em; color: var(--ink-3); text-transform: uppercase; }

.account-modal-card { max-width: 440px; position: relative; text-align: left; }
.account-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    color: var(--ink-3);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
}
.account-modal-close:hover, .account-modal-close:focus-visible { color: var(--ink-1); background: rgba(127, 143, 158, .14); }

.account-tabs { display: flex; gap: 6px; padding: 4px; margin-bottom: 18px; border: 1px solid var(--edge); border-radius: var(--radius-pill); }
.account-tabs[hidden] { display: none; }
.account-tab {
    flex: 1 1 0;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink-3);
    font: 800 .76rem var(--font-body);
    text-transform: uppercase;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.account-tab.active { background: var(--gold-text); color: #1c1206; }

.account-form[hidden] { display: none; }
.account-form .lobby-field { margin-bottom: 14px; }
.account-form .form-actions { margin-top: 8px; }
.account-form-subheader { border-bottom: none; padding-bottom: 0; margin-bottom: 16px; }
.account-form-subheader h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; text-transform: uppercase; color: var(--ink-1); }
.account-form-actions-split { display: flex; gap: 10px; }
.account-form-actions-split button { flex: 1 1 0; }

.account-link {
    display: inline-block;
    margin: -6px 0 12px;
    padding: 0;
    border: none;
    background: none;
    color: var(--ink-3);
    font-size: .78rem;
    text-decoration: underline;
    cursor: pointer;
}
.account-link:hover { color: var(--gold-text); }

.account-feedback[data-tone="error"],
.account-feedback[data-tone="ok"] { margin-bottom: 4px; }

.account-fineprint { margin-top: 14px; font-size: .74rem; color: var(--ink-3); text-align: center; }

.account-btn-loading[hidden] { display: none; }

.account-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
}
.account-identity .account-avatar { width: 40px; height: 40px; flex-basis: 40px; }
.account-identity .account-avatar svg { width: 21px; height: 21px; }
.account-identity strong { display: block; color: var(--ink-1); font-family: var(--font-display); font-size: 1rem; word-break: break-word; }
.account-sync-status { display: block; margin-top: 3px; font-size: .78rem; color: var(--ink-3); }

/* The profile makes this modal the one card that can outgrow the viewport.
   A centered flex child overflows in both directions, putting its own top
   out of reach, so let the overlay scroll and let auto margins keep the card
   centered only while it still fits. */
.modal-overlay.account-modal { overflow-y: auto; align-items: flex-start; }
.modal-overlay.account-modal .account-modal-card { margin: auto; }

/* Profile (Fase 5 — docs/PLAN-CUENTAS-Y-NUBE.md). The bar carries identity,
   everything under it is the player's record. */
.profile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
    background: var(--surface-2, transparent);
}
.profile-bar-copy { flex: 1 1 auto; min-width: 0; }
.profile-bar-copy strong {
    display: block;
    color: var(--ink-1);
    font-family: var(--font-display);
    font-size: 1.05rem;
    word-break: break-word;
}
.profile-bar-copy strong[data-empty="true"] { color: var(--ink-3); font-style: italic; }
.profile-bar-email { display: block; margin-top: 2px; font-size: .78rem; color: var(--ink-3); word-break: break-all; }
.profile-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gold, #d9a441);
    color: #1a1400;
    font-family: var(--font-display);
    font-size: 1.25rem;
    line-height: 1;
}
.btn-compact { padding: 7px 12px; font-size: .78rem; white-space: nowrap; }
.profile-username-form { margin-bottom: 18px; }

.profile-highlights {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}
.profile-tile {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm, 8px);
}
.profile-tile strong { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--ink-1); }
.profile-tile span { display: block; margin-top: 3px; font-size: .68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.profile-tile.ok strong { color: var(--emerald); }
.profile-tile.gold strong { color: var(--gold-text); }

.profile-section { margin-bottom: 18px; }
.profile-section-title {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.profile-trophies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.profile-trophy {
    padding: 10px 6px;
    text-align: center;
    border: 1px dashed var(--edge);
    border-radius: var(--radius-sm, 8px);
    opacity: .55;
}
.profile-trophy.won { border-style: solid; border-color: var(--gold, #d9a441); opacity: 1; }
.profile-trophy strong { display: block; font-family: var(--font-display); font-size: 1.15rem; color: var(--ink-1); }
.profile-trophy.won strong { color: var(--gold-text); }
.profile-trophy span { display: block; margin-top: 2px; font-size: .64rem; color: var(--ink-3); }

/* The table is the one thing here that can outgrow a narrow modal. */
.profile-modes-scroll { overflow-x: auto; }
.profile-modes { width: 100%; border-collapse: collapse; font-size: .8rem; }
.profile-modes th, .profile-modes td { padding: 7px 6px; text-align: right; white-space: nowrap; }
.profile-modes th:first-child, .profile-modes td:first-child { text-align: left; }
.profile-modes thead th {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-3);
    border-bottom: 1px solid var(--edge);
}
.profile-modes tbody tr + tr td { border-top: 1px solid var(--edge-soft, var(--edge)); }
.profile-modes tbody td { color: var(--ink-2); }
.profile-modes tbody td:first-child { color: var(--ink-1); }
.profile-empty { margin: 10px 0 0; font-size: .8rem; color: var(--ink-3); }

.profile-records { list-style: none; margin: 0; padding: 0; }
.profile-records li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    font-size: .82rem;
}
.profile-records li + li { border-top: 1px solid var(--edge); }
.profile-records span { color: var(--ink-3); }
.profile-records strong { color: var(--ink-1); font-weight: 600; text-align: right; }

@media (max-width: 520px) {
    .profile-highlights, .profile-trophies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sync status tones (Fase 3 — docs/PLAN-CUENTAS-Y-NUBE.md), shared between
   the topbar's short label and the account modal's full one. */
.account-sync-status[data-tone="ok"], .home-account-sub[data-tone="ok"] { color: var(--emerald); }
.account-sync-status[data-tone="warn"], .home-account-sub[data-tone="warn"] { color: var(--gold-text); }
.account-sync-status[data-tone="error"], .home-account-sub[data-tone="error"] { color: var(--red, #e0483f); }

.sync-conflict-options { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 14px; }
.sync-conflict-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--ink-1);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.sync-conflict-option:hover, .sync-conflict-option:focus-visible { border-color: var(--gold-text); background: rgba(238, 196, 83, .08); }
.sync-conflict-option-kicker { font: 800 .68rem var(--font-mono); letter-spacing: .06em; color: var(--ink-3); }
.sync-conflict-option strong { font-family: var(--font-display); font-size: .95rem; }

/* Fase 4 — docs/PLAN-CUENTAS-Y-NUBE.md: data export + account deletion. */
.account-privacy-note { margin: 2px 0 14px; }
.account-danger-row { margin-top: 18px; }

@media (max-width: 560px) {
    .home-account-button { max-width: 44px; padding: 6px; }
    .account-button-copy { display: none; }
    .account-modal-card { padding: 24px 20px; }
}

/* ==========================================================================
   TOUCH CONTROLS (VIRTUAL JOYSTICK & CHUTE)
   ========================================================================== */

.touch-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 40; display: flex; justify-content: space-between; }
.touch-overlay.hidden { display: none; }
.touch-joystick-zone { width: 50%; height: 100%; position: relative; pointer-events: auto; }

.joystick-base {
    position: absolute;
    width: 96px; height: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
    display: none;
    pointer-events: none;
}

.joystick-knob {
    position: absolute; top: 50%; left: 50%;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
    border: 2px solid #fff;
    box-shadow: 0 0 12px var(--blue-glow);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.touch-kick-zone { width: 50%; height: 100%; position: relative; display: flex; justify-content: flex-end; align-items: flex-end; padding: 24px 32px; pointer-events: none; }

.touch-kick-btn {
    pointer-events: auto;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--red), #b9312a);
    border: 3px solid rgba(255, 255, 255, 0.8);
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    font-family: var(--font-body);
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    box-shadow: 0 0 25px var(--red-glow);
    transition: transform 0.1s, box-shadow 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.touch-kick-btn:active, .touch-kick-btn.pressed {
    transform: scale(0.92);
    box-shadow: 0 0 35px var(--red-glow);
    background: linear-gradient(180deg, #f0685f, var(--red));
}

/* ==========================================================================
   MOBILE SESSION — safe areas, gesture hygiene and the rotate prompt
   (js/mobile.js tags <html> with is-touch / is-ios / is-standalone)
   ========================================================================== */

/* Kill the double-tap zoom delay on every control; the pitch itself takes
   no browser gestures at all so a joystick drag never scrolls or pinches. */
html.is-touch body { touch-action: manipulation; }
#screen-game.active {
    touch-action: none;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Notch / home-indicator clearance for the persistent match chrome. */
html.is-touch #screen-game.active .scoreboard-hud {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    max-width: calc(100vw - 90px - env(safe-area-inset-left) - env(safe-area-inset-right));
}
html.is-touch #screen-game.active .btn-pause {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    min-width: 44px;
    min-height: 44px;
}
html.is-touch .touch-kick-zone {
    padding: 0 max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) 0;
}
html.is-touch .touch-joystick-zone {
    padding-left: env(safe-area-inset-left);
}

/* Menus that sit on top of the pitch still need to scroll by finger even
   though the pitch itself refuses every browser gesture. */
#screen-game.active .pause-card {
    touch-action: pan-y;
}
@media (max-height: 540px) {
    /* Outranks the match-view card rule further down, which hides overflow. */
    html body.match-view #screen-game.active .pause-card {
        max-height: calc(100dvh - 16px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Landscape phones are short: keep the thumb targets clear of the HUD. */
@media (max-height: 460px) {
    html.is-touch .touch-kick-btn { width: 76px; height: 76px; font-size: 0.9rem; }
    html.is-touch .joystick-base { width: 84px; height: 84px; }
    html.is-touch .joystick-knob { width: 40px; height: 40px; }
}

.rotate-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    background: rgba(3, 8, 18, 0.96);
    color: #fff;
    text-align: center;
}
.rotate-overlay[hidden] { display: none; }
.rotate-card { max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.rotate-card h2 { margin: 0; font-family: var(--font-display, inherit); font-size: 1.5rem; letter-spacing: 0.02em; }
.rotate-card p { margin: 0; font-size: 0.95rem; line-height: 1.45; color: rgba(255, 255, 255, 0.82); }
.rotate-ios-tip { display: none; font-size: 0.8rem !important; color: rgba(255, 255, 255, 0.6) !important; }
html.is-ios:not(.is-standalone) .rotate-ios-tip { display: block; }

.rotate-phone {
    width: 54px; height: 96px;
    border: 3px solid rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    animation: rotatePhoneHint 2.2s ease-in-out infinite;
    margin-bottom: 8px;
}
.rotate-phone-screen {
    width: 38px; height: 74px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--blue-1, #3a7bd5), var(--blue-2, #1f4fa3));
}
@keyframes rotatePhoneHint {
    0%, 25% { transform: rotate(0deg); }
    55%, 80% { transform: rotate(90deg); }
    100% { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
    .rotate-phone { animation: none; transform: rotate(90deg); }
}

/* ==========================================================================
   MATCH INTRO CINEMATIC OVERLAY
   ========================================================================== */

.match-intro-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 8% 0%, rgba(255, 75, 24, .16), transparent 32%),
        radial-gradient(ellipse at 92% 100%, rgba(19, 40, 60, .16), transparent 36%),
        linear-gradient(135deg, #f5f7f8 0%, #ffffff 60%, #edf3f5 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.match-intro-overlay.active { opacity: 1; pointer-events: auto; }

.match-intro-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .7;
    background: repeating-linear-gradient(124deg, transparent 0 68px, rgba(19, 40, 60, .035) 69px 70px, transparent 71px 136px);
    pointer-events: none;
}

.intro-topline,
.intro-stadium-card,
.intro-vs-container,
.intro-bottomline { position: relative; z-index: 1; }

.intro-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(880px, calc(100% - 44px));
    margin-bottom: 18px;
    color: var(--fuzzbol-navy);
    font: 900 .62rem var(--font-mono);
    letter-spacing: .1em;
}

.intro-topline b {
    padding: 7px 10px;
    border-radius: 999px;
    color: #fff;
    background: var(--fuzzbol-orange-fill);
    font-size: .56rem;
}

.intro-stadium-card {
    display: grid;
    justify-items: center;
    gap: 4px;
    margin-bottom: 30px;
    padding: 12px 22px;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .74);
    box-shadow: 0 8px 18px rgba(19, 40, 60, .06);
}

.intro-stadium-kicker,
.intro-team-side {
    color: var(--fuzzbol-orange);
    font: 900 .56rem var(--font-mono);
    letter-spacing: .1em;
}

.intro-stadium-card strong {
    color: var(--fuzzbol-navy);
    font: 900 1.2rem/1 var(--font-display);
    letter-spacing: .03em;
    text-transform: uppercase;
}

.intro-stadium-card small {
    color: var(--fuzzbol-muted);
    font: 600 .68rem var(--font-body);
}

.intro-vs-container { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); }

.intro-team {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    min-width: min(290px, 34vw);
    padding: 18px 22px;
    border: 1px solid var(--fuzzbol-line);
    border-left: 4px solid var(--team-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 12px 22px rgba(19, 40, 60, .1);
}

.intro-team-left { animation: introSlideFromLeft 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; transform: translateX(-100px); opacity: 0; }
.intro-team-right { animation: introSlideFromRight 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards; transform: translateX(100px); opacity: 0; }
@keyframes slideFromLeft { to { transform: translateX(0); opacity: 1; } }
@keyframes slideFromRight { to { transform: translateX(0); opacity: 1; } }

@keyframes introSlideFromLeft { to { transform: translateX(0); opacity: 1; } }
@keyframes introSlideFromRight { to { transform: translateX(0); opacity: 1; } }

.intro-team-side { grid-column: 1 / -1; }

.intro-team-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #fff;
    background: var(--team-color);
    font: 900 1.15rem/1 var(--font-display);
}

.intro-team-name {
    color: var(--fuzzbol-navy);
    font: 900 clamp(1.05rem, 2.2vw, 1.55rem)/1 var(--font-display);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.intro-vs-badge {
    display: grid;
    justify-items: center;
    gap: 6px;
    color: var(--fuzzbol-orange);
    font: 900 1.8rem/1 var(--font-mono);
    animation: introVsBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
    transform: scale(0);
}

.intro-vs-badge i { width: 32px; height: 3px; border-radius: 999px; background: var(--fuzzbol-orange-fill); }
@keyframes introVsBounce { to { transform: scale(1); } }

.intro-bottomline {
    margin-top: 28px;
    color: var(--fuzzbol-muted);
    font: 700 .62rem var(--font-mono);
    letter-spacing: .05em;
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .intro-topline { width: calc(100% - 28px); font-size: .52rem; }
    .intro-topline b { font-size: .48rem; }
    .intro-stadium-card { margin-bottom: 18px; }
    .intro-vs-container { gap: 7px; width: calc(100% - 20px); }
    .intro-team { min-width: 0; flex: 1; padding: 13px 10px; }
    .intro-team-name { font-size: .82rem; }
    .intro-team-mark { width: 25px; height: 25px; font-size: .9rem; }
    .intro-vs-badge { font-size: 1.1rem; }
    .intro-vs-badge i { width: 20px; }
    .intro-bottomline { width: calc(100% - 28px); text-align: center; font-size: .5rem; }
}

/* ==========================================================================
   CAREER MODE
   ========================================================================== */

.color-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.color-swatch {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--gold-text); }

.career-player-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 20px;
}

.career-avatar {
    flex-shrink: 0;
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    border: 2px solid var(--edge);
}

.career-player-info { flex: 1; min-width: 0; }
.career-player-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; text-transform: uppercase; color: #fff; }
.career-player-title { font-size: 0.84rem; color: var(--gold-text); font-weight: 700; margin-bottom: 8px; }
.career-player-age { color: var(--ink-3); font: 700 .62rem var(--font-mono); margin-bottom: 5px; }

.career-club-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding: 15px 16px;
    background: linear-gradient(100deg, rgba(238, 196, 83, 0.1), rgba(0, 0, 0, 0.24));
    border: 1px solid rgba(238, 196, 83, 0.35);
    border-left: 3px solid var(--gold-text);
}
.career-club-panel-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.career-panel-kicker { color: var(--gold-text); font: 800 0.6rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.career-club-panel-copy strong { color: #fff; font: 900 1.05rem var(--font-display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.career-club-panel-copy > span:last-child { color: var(--ink-2); font-size: 0.76rem; }
.career-club-rating, .career-market-value { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.career-club-rating strong { color: var(--gold-text); font: 900 1.6rem var(--font-mono); }
.career-market-value strong { color: var(--emerald); font: 900 1rem var(--font-mono); }
.career-club-rating span, .career-market-value span { color: var(--ink-3); font: 700 0.58rem var(--font-mono); letter-spacing: 0.06em; white-space: nowrap; }

.career-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--edge);
    padding: 0 0 14px;
}

.career-toolbar-status { display: flex; flex-direction: column; gap: 4px; }
.career-prep-status { color: var(--gold-text); font: 800 0.7rem var(--font-mono); }
.career-prep-status.used { color: var(--ink-3); }
.career-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.career-save-status { color: var(--ink-3); font: 700 0.7rem var(--font-mono); }
.career-save-status[data-status="success"] { color: var(--emerald); }
.career-save-status[data-status="error"] { color: var(--red); }

.career-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.career-metric {
    min-height: 66px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid var(--edge-strong);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.career-metric span { color: var(--ink-3); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.career-metric strong { color: #fff; font: 800 1.22rem var(--font-mono); }
.career-metric.gold { border-left-color: var(--gold-text); }
.career-metric.gold strong { color: var(--gold-text); }
.career-metric.blue { border-left-color: var(--blue-1); }
.career-metric.blue strong { color: var(--blue-1); }
.career-metric.warning { border-left-color: var(--red); }
.career-metric.warning strong { color: #ff887f; }

.career-objective {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(238, 196, 83, 0.07);
    border: 1px solid rgba(238, 196, 83, 0.28);
}

.career-objective > div { display: flex; flex-direction: column; gap: 4px; }
.career-objective-kicker { color: var(--gold-text); font: 800 0.62rem var(--font-mono); letter-spacing: 0.1em; }
.career-objective strong { color: var(--ink-1); font-size: 0.88rem; }
.career-objective-progress { color: var(--gold-text); font: 800 1rem var(--font-mono); white-space: nowrap; }

.career-transfer-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 15px;
    background: rgba(74, 149, 236, 0.08);
    border: 1px solid rgba(74, 149, 236, 0.3);
}
.career-transfer-panel > div { min-width: 0; }
.career-transfer-panel p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.78rem; }
.career-transfer-panel button { white-space: nowrap; }
.career-transfer-offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.career-transfer-offer { padding: 12px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--edge); }
.career-transfer-offer strong { display: block; color: #fff; font: 800 0.82rem var(--font-display); }
.career-transfer-offer span { display: block; color: var(--ink-3); font-size: 0.68rem; margin-top: 4px; }
.career-transfer-offer .offer-meta { color: var(--gold-text); font: 700 0.64rem var(--font-mono); }
.career-transfer-offer button { width: 100%; margin-top: 10px; }

.career-next-match {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--edge);
}
.career-next-match-copy { display: flex; flex-direction: column; gap: 4px; }
.career-next-match-copy strong { color: #fff; font: 900 1.08rem var(--font-display); text-transform: uppercase; }
.career-next-match-copy > span:last-child { color: var(--ink-2); font-size: 0.76rem; }
.career-match-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.career-match-action {
    min-height: 104px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    padding: 12px;
    text-align: left;
    color: var(--ink-1);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.career-match-action:hover { transform: translateY(-2px); border-color: var(--gold-text); background: rgba(238, 196, 83, 0.09); }
.career-match-action.featured { background: rgba(238, 196, 83, 0.12); border-color: rgba(238, 196, 83, 0.56); }
.career-match-action:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.career-match-action-icon { color: var(--gold-text); font: 900 1rem var(--font-mono); }
.career-match-action strong { color: #fff; font: 800 0.82rem var(--font-body); }
.career-match-action small { color: var(--ink-3); font-size: 0.68rem; line-height: 1.3; }
[hidden] { display: none !important; }

.xp-bar-track { width: 100%; height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: var(--gold-text); border-radius: 4px; transition: width 0.3s ease; }
.career-xp-text { font-size: 0.74rem; color: var(--ink-3); margin-top: 4px; font-family: var(--font-mono); }

.career-section-label {
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 18px 0 10px;
}

.career-attr-level { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 900; color: var(--gold-text); }

.career-attributes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.career-attribute-card { min-height: 172px; min-width: 0; display: grid; grid-template-rows: 1fr auto; gap: 12px; padding: 18px; overflow: hidden; border: 1px solid var(--fuzzbol-line, var(--edge)); border-radius: 10px; background: var(--fuzzbol-surface, #fff); }
.career-attribute-title { color: var(--fuzzbol-navy, var(--ink-1)); font: 900 .92rem var(--font-body); }
.career-attribute-desc { margin-top: 5px; color: var(--fuzzbol-muted, var(--ink-3)); font-size: .68rem; line-height: 1.4; }
.career-attr-content { display: flex; flex-direction: column; gap: 4px; }
.career-attr-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.career-attr-heading strong { color: var(--gold-text); font: 800 0.86rem var(--font-mono); }
.career-meter { height: 5px; margin: 9px 0 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.career-meter span { display: block; height: 100%; background: var(--gold-text); transition: width 0.25s ease; }
.career-attr-effect { color: var(--ink-3); font: 600 0.67rem var(--font-mono); }
.career-attr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

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

@media (max-width: 500px) {
    .career-attributes-grid { grid-template-columns: 1fr; }
}

.career-view[data-career-panel="development"] .career-attr-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#screen-career-hub .career-attr-actions .career-action-button {
    min-width: 0;
    padding: 9px 6px;
    font-size: .72rem;
    white-space: nowrap;
}

#screen-career-hub .career-attr-actions .career-action-button.secondary {
    color: var(--fuzzbol-navy, var(--ink-1));
    background: transparent;
    border: 1px solid var(--fuzzbol-line, var(--edge));
    box-shadow: none;
}

#screen-career-hub .career-attr-actions .career-action-button.secondary:hover:not(:disabled) {
    color: var(--fuzzbol-orange, var(--gold-text));
    background: rgba(255, 75, 24, .08);
    border-color: var(--fuzzbol-orange, var(--gold-text));
}

#screen-career-hub .career-attr-allocation {
    color: var(--fuzzbol-muted, var(--ink-3));
    font: 600 .62rem/1.25 var(--font-mono);
}

.btn-training {
    background: rgba(74, 149, 236, 0.12);
    color: var(--blue-1);
    border: 1px solid rgba(74, 149, 236, 0.42);
    border-radius: var(--radius-sm);
    padding: 10px;
    font: 800 0.78rem var(--font-body);
    cursor: pointer;
}

.btn-training:hover { background: rgba(74, 149, 236, 0.2); border-color: var(--blue-1); }
.btn-training:disabled { opacity: 0.45; cursor: not-allowed; }

.career-match-log {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 210px;
    overflow-y: auto;
}

.career-log-row {
    display: grid;
    grid-template-columns: 28px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--ink-3);
    font: 600 0.72rem var(--font-mono);
}

.career-log-result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 900;
}

.career-log-result.win { background: rgba(47, 191, 117, 0.16); color: var(--emerald); }
.career-log-result.draw { background: rgba(238, 196, 83, 0.16); color: var(--gold-text); }
.career-log-result.loss { background: rgba(224, 72, 63, 0.16); color: #ff887f; }
.career-log-opponent { color: var(--ink-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.career-log-row strong { color: var(--ink-1); }
.career-log-empty { padding: 16px; background: rgba(0, 0, 0, 0.2); color: var(--ink-3); font-size: 0.8rem; }

.career-season-info, .career-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--edge);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.career-stat-item { text-align: center; }
.career-stat-value { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 800; color: #fff; }
.career-stat-label { font-size: 0.68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }

@media (max-width: 640px) {
    .career-club-panel { grid-template-columns: 1fr 1fr; gap: 12px; }
    .career-club-panel-copy { grid-column: 1 / -1; }
    .career-club-rating, .career-market-value { align-items: flex-start; text-align: left; }
    .career-transfer-panel { align-items: flex-start; flex-direction: column; }
    .career-transfer-panel button { width: 100%; }
    .career-transfer-offers { grid-template-columns: 1fr; }
    .career-match-actions { grid-template-columns: 1fr; }
    .career-match-action { min-height: 78px; }
}

/* Shared secondary buttons grow inside toolbars; the sidebar exit must remain compact. */
.career-sidebar .career-exit {
    flex: 0 0 auto;
    min-height: 42px;
    height: auto;
    align-self: stretch;
}

/* ==========================================================================
   FUZZBOL UI FOUNDATION — reusable tokens and primitives for every mode
   ========================================================================== */

:root {
    /* Orange as text and accents. Darker than the logo orange so it reads
       at 4.5:1 on white; night mode restores the bright tone (see below). */
    --fuzzbol-orange: #cf360b;
    /* Orange behind white text (buttons, active chips, badges): 4.6:1. */
    --fuzzbol-orange-fill: #d9390c;
    --fuzzbol-orange-fill-hover: #c2330a;
    --fuzzbol-orange-soft: #fff3ee;
    --fuzzbol-navy: #13283c;
    --fuzzbol-navy-deep: #0b1f38;
    --fuzzbol-page: #f5f7f8;
    --fuzzbol-panel: #ffffff;
    --fuzzbol-line: #dfe4e7;
    --fuzzbol-muted: #71808c;
    --fuzzbol-radius: 12px;
    --fuzzbol-shadow: 0 8px 18px rgba(25, 43, 58, .07);
}

.fuzzbol-screen {
    --screen-page: var(--fuzzbol-page);
    --screen-panel: var(--fuzzbol-panel);
    --screen-line: var(--fuzzbol-line);
    --screen-accent: var(--fuzzbol-orange);
}

.fuzzbol-panel {
    overflow: hidden;
    border: 1px solid var(--screen-line, var(--fuzzbol-line));
    border-radius: var(--fuzzbol-radius);
    background: var(--screen-panel, var(--fuzzbol-panel));
    box-shadow: var(--fuzzbol-shadow);
}

.fuzzbol-panel-header {
    padding: 11px 16px;
    color: #fff;
    background: var(--fuzzbol-navy);
    font: 900 .75rem var(--font-mono);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.fuzzbol-primary,
.fuzzbol-screen .fuzzbol-primary {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--fuzzbol-orange-fill);
    box-shadow: 0 7px 15px rgba(244, 81, 32, .2);
    cursor: pointer;
    font: 900 .78rem var(--font-body);
    letter-spacing: .02em;
    text-transform: uppercase;
}

.fuzzbol-primary:hover,
.fuzzbol-screen .fuzzbol-primary:hover { background: var(--fuzzbol-orange-fill-hover); }

.fuzzbol-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 999px;
    color: var(--fuzzbol-navy);
    background: #fff;
    font: 800 .6rem var(--font-mono);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.fuzzbol-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.fuzzbol-section-heading > span {
    color: var(--fuzzbol-orange);
    font: 800 .62rem var(--font-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.fuzzbol-section-heading h2 {
    margin-top: 4px;
    color: var(--fuzzbol-navy);
    font: 900 1.7rem/1 var(--font-display);
    text-transform: uppercase;
}

.home-feedback {
    position: fixed;
    z-index: 200;
    left: 50%;
    bottom: 22px;
    max-width: min(440px, calc(100vw - 30px));
    padding: 11px 16px;
    border: 1px solid rgba(255, 75, 24, .36);
    border-radius: 9px;
    color: #fff;
    background: rgba(19, 40, 60, .96);
    box-shadow: 0 12px 28px rgba(12, 28, 42, .22);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity .2s ease, transform .2s ease;
    font: 700 .7rem/1.35 var(--font-body);
}

.home-feedback.active { opacity: 1; transform: translate(-50%, 0); }

#screen-start.fuzzbol-home.active { padding: 0; }

@media (min-width: 901px) and (min-height: 650px) {
    body.home-view {
        height: 100dvh;
        overflow: hidden;
    }

    #screen-start.fuzzbol-home.active {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .home-sidebar {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .home-content {
        height: 100dvh;
        min-height: 0;
        display: grid;
        grid-template-rows: 82px minmax(0, 1fr) 138px;
        gap: 14px;
        overflow: hidden;
    }

    .home-topbar { min-height: 0; height: 100%; }
    .home-match-grid { min-height: 0; height: 100%; margin-top: 0; }
    .match-preview-card, .match-setup-card { height: 100%; min-height: 0; }
    .match-preview-card { display: flex; flex-direction: column; }
    .mini-pitch { min-height: 0; height: 100%; }
    .setup-card-body { min-height: 0; overflow-y: auto; padding: 9px 14px 10px; }
    .setup-label { margin-top: 6px; margin-bottom: 4px; }
    .setup-label:first-child { margin-top: 0; }
    .setup-option { min-height: 58px; }
    .setup-option svg { width: 21px; height: 21px; }
    .team-size-options button { min-height: 30px; }
    .setup-carousel { grid-template-columns: 20px 74px 1fr 20px; gap: 6px; }
    .setup-carousel img { width: 74px; height: 48px; }
    .setup-carousel i, .weather-row i { margin-top: 4px; }
    .weather-row { grid-template-columns: 20px 40px 1fr 20px; gap: 6px; }
    .home-primary-action { min-height: 38px; margin-top: 7px; }
    .setup-live-readout { margin-top: 3px; padding-top: 5px; }
    .setup-live-readout > div { padding: 5px 7px; }
    .home-feature-grid { height: 100%; min-height: 0; margin-top: 0; }
    .feature-card { height: 100%; min-height: 0; }
    .feature-card > div { padding: 14px; }
    .feature-card h2 { margin-top: 8px; font-size: .9rem; }
    .feature-card button { bottom: 10px; }
}

/* ==========================================================================
   UX POLISH PASS — hierarchy, overflow guards and responsive clarity
   ========================================================================== */

/* Home feature cards keep copy and actions in separate visual lanes. */
.feature-card:not(.stadium-feature-card) > div {
    padding-bottom: 62px;
}

.feature-card:not(.stadium-feature-card) p {
    display: -webkit-box;
    overflow: hidden;
    max-width: 24ch;
    max-height: 2.8em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.feature-card:not(.stadium-feature-card) button {
    bottom: 12px;
    max-width: calc(100% - 28px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tournament selectors never allow an icon or a long option label to collide. */
.competition-field,
.competition-select-wrap,
.competition-team-preview,
.competition-team-copy {
    min-width: 0;
}

.competition-select-wrap { width: 100%; }
.competition-select-wrap .geometric-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-right: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.competition-icon { left: 13px; }
.competition-team-preview { overflow: hidden; }
.competition-team-copy > strong,
.competition-team-copy > span,
.competition-team-copy > small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Career home: the next match is the primary task, so it comes before the
   club, trophy and metric summaries. */
#screen-career-hub .career-next-match-label { margin-top: 0; }
#screen-career-hub .career-next-match {
    position: relative;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 75, 24, .34);
    border-radius: 12px;
    background: linear-gradient(135deg, #fffaf7, #f4f8fb);
    box-shadow: 0 9px 20px rgba(25, 43, 58, .07);
}

#screen-career-hub .career-next-match-copy strong { color: var(--fuzzbol-navy); }
#screen-career-hub .career-next-match-copy > span:last-child { color: #5c6f7f; }
#screen-career-hub .career-match-actions { grid-column: 1 / -1; }
#screen-career-hub .career-match-action {
    min-height: 94px;
    color: var(--fuzzbol-navy);
    background: #fff;
    border-color: #d7e1e7;
}
#screen-career-hub .career-match-action strong { color: var(--fuzzbol-navy); }
#screen-career-hub .career-match-action small { color: #5c6f7f; }
#screen-career-hub .career-match-action-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#screen-career-hub .career-match-action.featured { order: 3; color: #fff; background: var(--fuzzbol-orange-fill); border-color: var(--fuzzbol-orange); }
#screen-career-hub .career-match-action.featured strong,
#screen-career-hub .career-match-action.featured small { color: #fff; }
#screen-career-hub .career-avatar { overflow: hidden; }
#screen-career-hub .career-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 4px; filter: drop-shadow(0 5px 7px rgba(5, 13, 26, .25)); }
#screen-career-hub .career-nav-item span svg {
    width: 19px;
    height: 19px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#screen-career-hub .career-nav-item:nth-child(2) span svg,
#screen-career-hub .career-nav-item:nth-child(8) span svg { fill: currentColor; stroke: none; }
#screen-career-hub .career-workspace { overflow-x: hidden; }
#screen-career-hub .career-view { min-width: 0; }

@media (max-width: 760px) {
    #screen-career-hub .career-next-match { grid-template-columns: 56px minmax(0, 1fr); padding: 15px; }
    #screen-career-hub .career-match-actions { grid-template-columns: 1fr 1fr; }
    #screen-career-hub .career-match-action.featured { grid-column: 1 / -1; grid-row: 1; order: -1; min-height: 88px; }
    #screen-career-hub .career-match-action { min-height: 76px; }
}

@media (min-width: 901px) and (max-height: 649px) {
    body.home-view { overflow: hidden; }
    .home-sidebar { min-height: 100dvh; overflow-y: auto; }
    .home-content { height: 100dvh; overflow-y: auto; }
}

@media (min-width: 901px) and (min-height: 850px) {
    .setup-option { min-height: 84px; gap: 7px; padding: 9px 6px; }
    .setup-option svg { width: 28px; height: 28px; }
    .setup-option strong { font-size: .78rem; }
    .setup-option span { font-size: .58rem; }
    .setup-live-insights { display: block; }
}

.setup-carousel i b.active,
.weather-row i b.active { background: var(--fuzzbol-orange-fill); }

@media (max-width: 900px) {
    .home-content { overflow: visible; }
    #screen-start.fuzzbol-home.active { overflow: visible; }
}

/* ==========================================================================
   FUZZBOL BRAND SURFACES — shared visual language for the rest of the game
   ========================================================================== */

.setup-stadium-thumb {
    display: block;
    width: 100%;
    height: 116px;
    margin-bottom: 12px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--fuzzbol-line);
    background: var(--fuzzbol-navy-deep);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) {
    background: var(--fuzzbol-page);
    background-image:
        radial-gradient(ellipse 760px 420px at 0% 0%, rgba(255, 75, 24, .08), transparent 58%),
        radial-gradient(ellipse 820px 520px at 100% 0%, rgba(19, 40, 60, .08), transparent 60%);
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #app-container {
    max-width: 1440px;
    padding: 16px 24px 32px;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .app-header {
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--fuzzbol-line);
    border-left: 3px solid var(--fuzzbol-orange);
    color: var(--fuzzbol-navy);
    box-shadow: var(--fuzzbol-shadow);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-icon {
    background: #fff;
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-icon:hover {
    background: var(--fuzzbol-orange-soft);
    border-color: rgba(255, 75, 24, .45);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .fuzzbol-screen.active:not(#screen-game) {
    color: var(--fuzzbol-navy);
    padding-bottom: 28px;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .glass-card,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .fuzzbol-panel {
    background: rgba(255, 255, 255, .96);
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
    box-shadow: var(--fuzzbol-shadow);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .card-title,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .fuzzbol-section-heading h2 {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .form-header,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .league-header-bar,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .career-workspace-header {
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .form-desc,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .setting-help,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .form-field label,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .online-status-text {
    color: var(--fuzzbol-muted);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .setting-name,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .team-slot,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .vs,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .bracket-display,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .fuzzbol-screen h3,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .fuzzbol-screen h4 {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .geometric-select {
    background: #fff;
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .geometric-select:focus {
    border-color: var(--fuzzbol-orange);
    box-shadow: 0 0 0 3px rgba(255, 75, 24, .13);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .stadium-preview-box,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .setting-row,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .matchup-box,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .table-responsive {
    background: #f8fafb;
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .settings-diagnostics {
    background: #f8fafb;
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostic-card,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostics-summary > div,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostic-release-badge {
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostic-card span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostics-summary span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostics-heading p,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostics-actions span {
    color: var(--fuzzbol-muted);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostic-card strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostics-summary strong {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostic-release-badge,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .settings-section-kicker {
    color: var(--fuzzbol-orange);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostic-card strong[data-status="ok"] { color: #14834b; }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostic-card strong[data-status="warning"] { color: #9a6a00; }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .diagnostic-card strong[data-status="error"] { color: #b52c21; }

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-primary-start,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-primary-start.btn-gold {
    background: var(--fuzzbol-orange-fill) !important;
    color: #fff !important;
    box-shadow: 0 7px 15px rgba(244, 81, 32, .16);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-primary-start:hover,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-primary-start.btn-gold:hover {
    background: var(--fuzzbol-orange-fill-hover) !important;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-secondary {
    background: #fff;
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-secondary:hover {
    background: var(--fuzzbol-orange-soft);
    border-color: rgba(255, 75, 24, .42);
}

/* Training academy in day mode: the same panel/card system as the other
   menus, with the gold accents swapped for the orange the light palette uses. */
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-menu-shell {
    border-color: var(--fuzzbol-line);
    background: var(--fuzzbol-panel);
    box-shadow: var(--fuzzbol-shadow);
}
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-menu-kicker,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-kicker,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-progress-strip strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card small { color: var(--fuzzbol-orange); }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-menu-header h1,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card strong { color: var(--fuzzbol-navy); }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-menu-header p,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-progress-strip span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-progress-strip > div:last-child,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card p { color: var(--fuzzbol-muted); }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-progress-strip {
    background: #f1f4f5;
    border-color: var(--fuzzbol-line);
}
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-progress-strip > div { border-left-color: var(--fuzzbol-line); }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card {
    background: #fff;
    border-color: var(--fuzzbol-line);
    border-top-color: rgba(19, 40, 60, .22);
}
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card:hover,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card:focus-visible {
    border-color: rgba(255, 75, 24, .42);
    background: var(--fuzzbol-orange-soft);
    box-shadow: var(--fuzzbol-shadow);
}
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card.featured {
    border-top-color: var(--fuzzbol-orange);
    background: radial-gradient(circle at 82% 18%, rgba(255, 75, 24, .16), transparent 42%), linear-gradient(145deg, #fff3ee, #fff);
}
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card.career { border-top-color: var(--emerald); }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .training-mode-card.arena { border-top-color: #2f7fd6; }

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .segmented-control {
    background: #f1f4f5;
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .segmented-control .btn-mode { color: var(--fuzzbol-muted); }

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .segmented-control .btn-mode.active {
    background: var(--fuzzbol-orange-fill);
    color: #fff;
    box-shadow: none;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .segmented-control .btn-mode:hover:not(.active) {
    color: var(--fuzzbol-navy);
    background: var(--fuzzbol-orange-soft);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .league-table th {
    background: var(--fuzzbol-navy);
    color: #fff;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .league-table td {
    color: var(--fuzzbol-navy);
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .league-table tr.leader-row td { color: var(--fuzzbol-orange); }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .league-table tr.user-row { background: var(--fuzzbol-orange-soft) !important; border-left-color: var(--fuzzbol-orange); }

/* Career keeps its information architecture, now on the same white / orange / navy canvas. */
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-app-shell {
    background: #fff;
    border-color: var(--fuzzbol-line);
    box-shadow: var(--fuzzbol-shadow);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-sidebar {
    background: #f8fafb;
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-workspace { background: #fff; }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-workspace-header h2,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-player-name,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-club-panel-copy strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-next-match-copy strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-match-action strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-transfer-offer strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-metric strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-stat-value {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-workspace-header p,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-section-label,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-metric span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-stat-label,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-next-match-copy > span:last-child {
    color: var(--fuzzbol-muted);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-nav-item {
    color: var(--fuzzbol-muted);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-nav-item:hover,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-nav-item.active {
    color: var(--fuzzbol-orange);
    background: var(--fuzzbol-orange-soft);
    border-color: rgba(255, 75, 24, .28);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-nav-item span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-nav-item.active span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-panel-kicker,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-player-title,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-objective-kicker {
    color: var(--fuzzbol-orange);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-player-card.compact,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-next-match,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-metric,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-season-info,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-stats-row,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-log-row,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-transfer-offer,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-match-action {
    background: #f8fafb;
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-club-panel,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-objective {
    background: var(--fuzzbol-orange-soft);
    border-color: rgba(255, 75, 24, .28);
    border-left-color: var(--fuzzbol-orange);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-objective strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-club-panel-copy > span:last-child,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-transfer-panel p {
    color: var(--fuzzbol-navy);
}

/* Dashboard modals follow the same light visual system as the rest of the app. */
body:not([data-theme="night"]):not(.theme-night):not(.match-view) .modal-overlay { background: rgba(19, 40, 60, .22); }
body:not([data-theme="night"]):not(.theme-night):not(.match-view) .modal-card {
    background: #fff;
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
    box-shadow: 0 24px 60px rgba(19, 40, 60, .18);
}
body:not([data-theme="night"]):not(.theme-night):not(.match-view) .modal-header h2 { color: var(--fuzzbol-navy); }
body:not([data-theme="night"]):not(.theme-night):not(.match-view) .career-action-button { background: var(--fuzzbol-orange-fill); color: #fff; }

/* The account modal's own content (title, tab labels, links, feedback) reads
   --ink-1/--ink-2/--ink-3 directly rather than inheriting a resolved color,
   and those tokens only flip to dark on screens outside home-view (see the
   `body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view)` block above). Left alone, the
   modal above renders white-on-white on the home dashboard — the only place
   its trigger button lives. Scope the same light values here so it always
   matches the light card it sits in. The Fase 3 sync-conflict modal is the
   same story: its trigger (an auto-shown dialog) only ever fires from that
   same home-view context. */
body:not([data-theme="night"]):not(.theme-night):not(.match-view) #modal-account,
body:not([data-theme="night"]):not(.theme-night):not(.match-view) #modal-sync-conflict {
    --ink-1: var(--fuzzbol-navy);
    --ink-2: #4f6575;
    --ink-3: var(--fuzzbol-muted);
    --edge: var(--fuzzbol-line);
    --gold-text: var(--fuzzbol-orange);
}
/* Fase 4 reuses Settings' .setting-row-danger for the "Eliminar cuenta" row.
   That row already renders light (its own background/border are hardcoded
   light values, not tokens), but .setting-name hardcodes white for its
   normal dark home — override it here too, same reasoning as the block
   above. */
#modal-account .setting-name { color: var(--ink-1); }

.setting-row-danger {
    border-color: rgba(210, 61, 48, .28) !important;
    background: #fff8f7 !important;
}

.btn-danger-outline {
    flex-shrink: 0;
    padding: 10px 14px;
    border: 1px solid rgba(210, 61, 48, .45);
    border-radius: 8px;
    color: #b3372d;
    background: #fff;
    cursor: pointer;
    font: 800 .74rem var(--font-body);
    text-transform: uppercase;
}

.btn-danger-outline:hover { background: #fff0ee; border-color: #d23d30; }

@media (max-width: 620px) {
    .setting-row-danger { align-items: flex-start; flex-direction: column; }
    .btn-danger-outline { width: 100%; }
    .diagnostics-heading, .diagnostics-actions { align-items: stretch; flex-direction: column; }
    .diagnostics-grid, .diagnostics-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .diagnostics-actions .btn-secondary { width: 100%; }
}

/* Stadium photography + tactical map pairing */
.setup-stadium-photo {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 10px;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 9px;
    object-fit: contain;
    object-position: center;
    background: var(--fuzzbol-navy-deep);
}

.setup-stadium-mapline {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.setup-stadium-mapline .setup-stadium-thumb {
    width: 84px;
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 0;
    object-fit: contain;
}

.stadium-preview-box[data-weather="night"] .setup-stadium-photo {
    filter: brightness(.55) saturate(1.18) hue-rotate(4deg);
    box-shadow: inset 0 0 28px rgba(255, 180, 72, .22), 0 0 0 1px rgba(255, 75, 24, .12);
}

.stadium-preview-box[data-weather="rain"] .setup-stadium-photo {
    filter: saturate(.82) brightness(.82);
}

.mini-pitch[data-home-weather="night"]::before {
    content: '';
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 8% 2%, rgba(255, 229, 160, .28), transparent 29%),
        radial-gradient(ellipse at 92% 2%, rgba(255, 229, 160, .28), transparent 29%),
        linear-gradient(180deg, rgba(2, 9, 32, .6), rgba(2, 9, 32, .2) 58%, rgba(1, 5, 20, .58));
    mix-blend-mode: screen;
}

.mini-pitch[data-home-weather="night"]::after {
    background: radial-gradient(circle at 50% 45%, transparent 0 13%, rgba(7, 31, 69, .1) 45%, rgba(1, 7, 25, .56) 100%);
}

/* Career notifications use the same orange / navy language as the landing. */
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-section-heading h3 {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-section-heading > div > span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-notifications-caption {
    color: var(--fuzzbol-orange);
}

.career-header-actions .career-notifications-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.career-notifications-button b {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--fuzzbol-orange-fill);
    font: 800 .62rem var(--font-mono);
}

.career-notifications-button b[hidden] { display: none; }

.career-notifications-panel {
    margin: 18px 0 19px;
    padding: 16px;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(19, 40, 60, .06);
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.career-notifications-panel .career-section-heading { margin-bottom: 11px; }
.career-notifications-caption { font: 700 .62rem var(--font-mono); }
.career-notifications-list { display: grid; gap: 8px; }

.career-notification-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--fuzzbol-line);
    border-left: 3px solid var(--fuzzbol-orange);
    border-radius: 8px;
    background: #f8fafb;
}

.career-notification-item.tone-blue { border-left-color: #2272a9; }
.career-notification-item.tone-gold { border-left-color: #d89516; }
.career-notification-item.tone-green { border-left-color: #198754; }
.career-notification-item.tone-muted { border-left-color: #98a5ad; }

.career-notification-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: var(--fuzzbol-orange);
    background: var(--fuzzbol-orange-soft);
    font: 900 .64rem var(--font-mono);
}

.tone-blue .career-notification-icon { color: #2272a9; background: #edf6fb; }
.tone-gold .career-notification-icon { color: #b87600; background: #fff6df; }
.tone-green .career-notification-icon { color: #198754; background: #edf9f2; }
.tone-muted .career-notification-icon { color: #66757f; background: #eef1f3; }

.career-notification-copy { min-width: 0; }
.career-notification-copy strong { display: block; color: var(--fuzzbol-navy); font: 800 .76rem var(--font-body); }
.career-notification-copy p { margin: 3px 0 0; color: var(--fuzzbol-muted); font-size: .68rem; line-height: 1.4; }
.career-notification-action { border: 0; background: transparent; color: var(--fuzzbol-orange); cursor: pointer; font: 800 .62rem var(--font-body); white-space: nowrap; }
.career-notification-action:hover { text-decoration: underline; }
.career-notifications-panel.is-highlighted { border-color: rgba(255, 75, 24, .7); box-shadow: 0 0 0 4px rgba(255, 75, 24, .1), 0 12px 28px rgba(19, 40, 60, .1); transform: translateY(-2px); }

/* The preview communicates motion and the underlying physics at a glance. */
.mini-pitch .pitch-player {
    animation: homePlayerPulse 2.8s ease-in-out infinite;
}

.mini-pitch .pitch-player:nth-of-type(3n + 1) { animation-delay: -.35s; }
.mini-pitch .pitch-player:nth-of-type(3n + 2) { animation-delay: -.95s; }
.mini-pitch .pitch-player:nth-of-type(3n) { animation-delay: -1.55s; }

.mini-pitch .pitch-ball {
    animation: homeBallDrive 3.2s cubic-bezier(.42, 0, .25, 1) infinite;
}

.mini-pitch .pitch-objective {
    animation: homeObjectivePulse 2.7s ease-in-out infinite;
}

@keyframes homePlayerPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 3px 5px rgba(0,0,0,.35); }
    50% { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 5px rgba(255,255,255,.13), 0 5px 10px rgba(0,0,0,.36); }
}

@keyframes homeBallDrive {
    0%, 100% { left: 53%; top: 49%; }
    34% { left: 58%; top: 44%; }
    66% { left: 47%; top: 55%; }
}

@keyframes homeObjectivePulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 75, 24, 0); }
    50% { box-shadow: 0 0 0 5px rgba(255, 75, 24, .12); }
}

@media (max-width: 620px) {
    .career-notification-item { grid-template-columns: 30px minmax(0, 1fr); }
    .career-notification-action { grid-column: 2; justify-self: start; margin-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .mini-pitch .pitch-player,
    .mini-pitch .pitch-ball,
    .mini-pitch .pitch-objective { animation: none; }
    .career-notifications-panel { transition: none; }
}

/* Live match preview: the landing uses the same generated surface materials
   as the playable arenas while keeping the pitch visually uncluttered. */
.mini-pitch {
    background-image:
        linear-gradient(90deg, rgba(24, 96, 37, .12) 0 8%, rgba(255,255,255,.03) 8% 16%, rgba(24,96,37,.12) 16% 24%, rgba(255,255,255,.03) 24% 32%, rgba(24,96,37,.12) 32% 40%, rgba(255,255,255,.03) 40% 48%, rgba(24,96,37,.12) 48% 56%, rgba(255,255,255,.03) 56% 64%, rgba(24,96,37,.12) 64% 72%, rgba(255,255,255,.03) 72% 80%, rgba(24,96,37,.12) 80% 88%, rgba(255,255,255,.03) 88% 96%, rgba(24,96,37,.12) 96% 100%),
        var(--preview-texture, url('assets/texture-classic-checkered.webp'));
    background-size: 100% 100%, 420px 420px;
    background-repeat: no-repeat, repeat;
}

.mini-pitch[data-home-stadium="cyber"] {
    background-image: linear-gradient(180deg, rgba(5, 8, 25, .12), rgba(3, 10, 24, .2)), var(--preview-texture, url('assets/texture-cyber-neon.webp'));
}

.mini-pitch[data-home-stadium="ice"] {
    background-image: linear-gradient(180deg, rgba(255,255,255,.06), rgba(13,55,110,.12)), var(--preview-texture, url('assets/texture-ice-glacial.webp'));
}

.mini-pitch[data-home-stadium="cage"] {
    background-image: linear-gradient(180deg, rgba(8, 12, 19, .1), rgba(8, 12, 19, .28)), var(--preview-texture, url('assets/texture-cage-asphalt.webp'));
}

.mini-pitch.is-live-simulated .pitch-player,
.mini-pitch.is-live-simulated .pitch-ball {
    animation: none;
    transition: left .14s linear, top .14s linear, opacity .14s ease, box-shadow .14s ease;
}

.pitch-live-badge {
    position: absolute;
    z-index: 8;
    top: 14px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 7px;
    color: #fff;
    background: rgba(7, 23, 34, .76);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    backdrop-filter: blur(5px);
    font: 900 .58rem var(--font-mono);
    letter-spacing: .04em;
}

.pitch-live-badge i {
    width: 7px;
    height: 7px;
    display: block;
    border-radius: 50%;
    background: var(--fuzzbol-orange-fill);
    box-shadow: 0 0 0 4px rgba(255,75,24,.18);
    animation: liveDotPulse 1.4s ease-in-out infinite;
}

.pitch-live-badge span {
    padding-left: 5px;
    border-left: 1px solid rgba(255,255,255,.24);
    color: #ffb29a;
    font-size: .52rem;
}

.pitch-ball.is-live-kick {
    box-shadow: 0 0 0 7px rgba(255,255,255,.14), 0 0 20px rgba(255,255,255,.58), 0 3px 7px rgba(0,0,0,.36);
}

.mini-pitch.is-live-simulated .pitch-ball.is-live-kick img {
    animation: liveBallSpin .42s linear infinite;
}

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

@keyframes liveDotPulse {
    0%, 100% { opacity: .55; transform: scale(.86); }
    50% { opacity: 1; transform: scale(1.12); }
}

@media (max-width: 560px) {
    .pitch-live-badge { top: 9px; left: 9px; padding: 6px 7px; }
    .pitch-live-badge span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pitch-live-badge i { animation: none; }
}

/* Reserved art system: every future crest, portrait or item illustration has
   a stable slot before the final asset is generated. */
.team-logo-slot {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    gap: 3px;
}

.team-logo-slot:not(.has-image),
.club-logo-slot:not(.has-image),
.agent-logo-slot:not(.has-image),
.career-squad-avatar-slot:not(.has-image),
.table-logo-slot:not(.has-image) {
    background: #fff;
    border: 1px dashed #c8d2d8;
    color: #9aa8b1;
}

.team-logo-slot:not(.has-image) svg,
.club-logo-slot:not(.has-image) svg,
.agent-logo-slot:not(.has-image) svg,
.career-squad-avatar-slot:not(.has-image) svg,
.table-logo-slot:not(.has-image) svg {
    color: #9aa8b1;
    opacity: 1;
}

.team-logo-slot .art-caption,
.club-logo-slot .art-caption,
.agent-logo-slot .art-caption,
.career-squad-avatar-slot .art-caption {
    color: #87959e;
    font: 900 .5rem var(--font-mono);
    letter-spacing: .08em;
}

.team-logo-slot small,
.club-logo-slot small,
.agent-logo-slot small {
    color: #a2adb3;
    font-size: .5rem;
}

.matchup-team {
    min-width: 126px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.matchup-team .team-slot {
    text-align: center;
    line-height: 1.05;
}

.club-logo-slot {
    width: 58px;
    height: 58px;
    display: flex;
    flex: 0 0 58px;
    gap: 2px;
}

.club-logo-slot svg { width: 20px; height: 20px; }
.club-logo-slot .art-caption { font-size: .48rem; }
.club-logo-slot small { font-size: .47rem; }

.table-team-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 148px;
}

.table-team-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fuzzbol-navy);
}

.table-team-accent {
    width: 7px;
    height: 7px;
    display: inline-block;
    flex: 0 0 7px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(19, 40, 60, .12);
}

.table-logo-slot {
    width: 24px;
    height: 24px;
    display: inline-flex;
    flex: 0 0 24px;
    border-radius: 6px;
}

.table-logo-slot svg { width: 15px; height: 15px; }

/* Career light screens use navy text consistently, including cards whose
   legacy dark theme originally supplied white copy. */
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-agent-message {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--fuzzbol-navy);
    background: #f4f8fb;
    border: 1px solid var(--fuzzbol-line);
    border-left: 3px solid var(--fuzzbol-orange);
}

.agent-logo-slot {
    width: 68px;
    height: 68px;
    display: flex;
    gap: 2px;
}

.agent-logo-slot svg { width: 24px; height: 24px; }
.agent-logo-slot .art-caption { font-size: .48rem; }
.agent-logo-slot small { font-size: .48rem; }
.agent-logo-slot.has-image img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.agent-message-copy { color: var(--fuzzbol-navy); font-size: .8rem; line-height: 1.5; }

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-contract-card,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-team-card,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-history-card {
    background: #f8fafb;
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-contract-card span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-team-card span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-history-card span,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-squad-player small,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-development-note,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-training-card p {
    color: var(--fuzzbol-muted);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-contract-card strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-team-card strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-history-card strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-squad-player strong,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-training-card h4,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-training-card > span {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-training-card {
    background: #fff;
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-squad-player {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    background: #f8fafb;
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
}

.career-squad-avatar-slot {
    width: 42px;
    height: 42px;
    display: flex;
    gap: 1px;
    border-radius: 8px;
}

.career-squad-avatar-slot svg { width: 15px; height: 15px; }
.career-squad-avatar-slot .art-caption { font-size: .43rem; }
.career-squad-player > div { min-width: 0; }
.career-squad-role { display: inline-flex; margin-bottom: 3px; }

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-club-panel {
    grid-template-columns: 58px minmax(0, 1fr) auto auto;
}

@media (max-width: 640px) {
    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-club-panel {
        grid-template-columns: 58px minmax(0, 1fr);
    }
    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-club-panel-copy {
        grid-column: auto;
    }
    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-club-rating,
    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-market-value {
        grid-row: 2;
    }
    .matchup-box { gap: 10px; padding-inline: 12px; }
    .matchup-team { min-width: 0; flex: 1; }
    .team-logo-slot { width: 62px; height: 62px; flex-basis: 62px; }
}

/* League identity: give each fictional competition a stronger home inside
   the shared landing/game visual system. */
.league-identity-card {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 112px;
    margin: 0 0 18px;
    padding: 18px 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--fuzzbol-radius);
    color: #fff;
    background:
        radial-gradient(circle at 86% 20%, rgba(255, 75, 24, .32), transparent 25%),
        linear-gradient(112deg, #102b43 0%, #13283c 56%, #1d4054 100%);
    box-shadow: 0 12px 24px rgba(19, 40, 60, .16);
}

.league-identity-card::after {
    content: '';
    position: absolute;
    width: 190px;
    height: 190px;
    right: 12%;
    bottom: -142px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
    box-shadow: 0 0 0 20px rgba(255, 255, 255, .025), 0 0 0 40px rgba(255, 255, 255, .018);
    transform: rotate(-18deg);
    pointer-events: none;
}

.league-identity-mark {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 14px;
    color: #fff0b0;
    background: linear-gradient(145deg, var(--fuzzbol-orange-fill), #db3211);
    box-shadow: 0 8px 16px rgba(255, 75, 24, .24);
    font: 900 1.7rem/1 var(--font-display);
}

.league-identity-mark img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }

.league-identity-copy,
.league-identity-stats { position: relative; z-index: 1; }

.league-identity-kicker {
    display: block;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, .64);
    font: 800 .58rem var(--font-mono);
    letter-spacing: .12em;
}

.league-identity-copy h3 {
    margin: 0;
    color: #fff !important;
    font: 900 clamp(1.35rem, 2.2vw, 2rem)/1 var(--font-display);
    letter-spacing: .015em;
    text-transform: uppercase;
}

.league-identity-copy p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, .72);
    font: 600 .76rem/1.35 var(--font-body);
}

.league-identity-stats {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.league-identity-stats span {
    display: grid;
    justify-items: center;
    min-width: 70px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
}

.league-identity-stats strong {
    color: #fff;
    font: 900 1.05rem/1 var(--font-mono);
}

.league-identity-stats small {
    margin-top: 4px;
    color: rgba(255, 255, 255, .6);
    font: 700 .55rem var(--font-body);
    letter-spacing: .04em;
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .league-identity-card { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 14px; }
    .league-identity-mark { width: 44px; height: 44px; font-size: 1.4rem; }
    .league-identity-stats { grid-column: 1 / -1; width: 100%; }
    .league-identity-stats span { flex: 1; min-width: 0; }
}

/* ==========================================================================
   PHASE 5 — PERFORMANCE, ACCESSIBILITY & BROWSER COMPATIBILITY
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text;
}

#screen-game.active,
#screen-game.active #gameCanvas {
    touch-action: none;
}

#gameCanvas:focus-visible {
    /* Keep the active match discoverable for keyboard users. */
    outline: 3px solid #ff6e34;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}

@supports not (backdrop-filter: blur(1px)) {
    .btn-pause,
    .pause-overlay,
    .overlay-goal {
        backdrop-filter: none;
    }
}

/* ========================================================================== 
   PHASE 4 — MATCH FEEDBACK, AUDIO STATE & ACCESSIBLE MOTION
   ========================================================================== */

button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid #ff6e34;
    outline-offset: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .7);
}

input[type="checkbox"]:focus-visible + .slider {
    outline: 3px solid #ff6e34;
    outline-offset: 3px;
}

.screen[tabindex="-1"]:focus {
    outline: none;
}

.scoreboard-hud[data-time-urgency="high"] .timer-clock {
    color: #ff766a;
    animation: timerUrgency 0.9s ease-in-out infinite;
}

@keyframes timerUrgency {
    0%, 100% { opacity: 0.72; }
    50% { opacity: 1; }
}

.score-digit.score-flash {
    animation: scoreFlash 0.58s cubic-bezier(0.2, 0.9, 0.25, 1.3) both;
}

.team-score.goal-scored {
    animation: teamScoreImpact 0.78s ease-out both;
}

@keyframes scoreFlash {
    0% { transform: scale(1); color: #fff; }
    35% { transform: scale(1.32); color: #fff7c2; text-shadow: 0 0 18px var(--competition-accent, #f7dc82); }
    100% { transform: scale(1); color: #fff; }
}

@keyframes teamScoreImpact {
    0% { filter: brightness(1); }
    35% { filter: brightness(1.65); }
    100% { filter: brightness(1); }
}

.overlay-goal .goal-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--gold-text);
    font: 800 0.58rem/1 var(--font-mono);
    letter-spacing: 0.18em;
}

.overlay-goal .goal-scoreline {
    display: block;
    margin-top: 12px;
    color: #fff;
    font: 900 1.15rem/1 var(--font-mono);
    letter-spacing: 0.08em;
}

@media (max-width: 700px) {
    .overlay-goal { padding: 22px 28px; }
    .overlay-goal h2 { font-size: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ========================================================================== 
   BRAND ALIGNMENT — landing palette, logo and larger stadium/weather setup
   ========================================================================== */

/* Team identity art ------------------------------------------------------- */
.team-logo-slot.has-image,
.club-logo-slot.has-image,
.table-logo-slot.has-image,
.career-squad-avatar-slot.has-image {
    border: 0;
    background: transparent;
}

.team-art-image,
.team-avatar-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.team-logo-slot.has-image .team-art-image,
.club-logo-slot.has-image .team-art-image {
    padding: 3px;
}

.table-logo-slot.has-image {
    border-radius: 6px;
    overflow: hidden;
}

.table-logo-slot.has-image .team-art-image {
    padding: 1px;
}

.career-squad-avatar-slot.has-image {
    overflow: hidden;
}

.career-squad-avatar-slot.has-image .team-avatar-image {
    object-fit: cover;
}

.team-mark.has-image {
    padding: 0;
    overflow: hidden;
    border: none;
    background: transparent;
}

.team-mark-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-team-mark.has-image {
    padding: 0;
    overflow: hidden;
    background: transparent;
}

.intro-team-mark.has-image .team-mark-image {
    object-fit: contain;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) {
    --ink-1: var(--fuzzbol-navy);
    --ink-2: #4f6575;
    --ink-3: var(--fuzzbol-muted);
    --edge: var(--fuzzbol-line);
    --edge-strong: #b9c5cb;
    --gold-1: #ff9e78;
    --gold-2: var(--fuzzbol-orange);
    --gold-text: var(--fuzzbol-orange);
    --gold-glow: rgba(255, 75, 24, .24);
    --blue-1: #ff7449;
    --blue-2: var(--fuzzbol-orange);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .app-header {
    min-height: 72px;
    background: rgba(255, 255, 255, .96);
    border-color: var(--fuzzbol-line);
    border-left: 4px solid var(--fuzzbol-orange);
    color: var(--fuzzbol-navy);
    box-shadow: 0 8px 20px rgba(25, 43, 58, .08);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .app-header .brand-logo-img {
    width: 164px;
    height: 58px;
    object-fit: contain;
    object-position: left center;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .logo-placeholder {
    width: 200px;
    min-height: 58px;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .profile-shield,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .profile-action-mark {
    background: var(--fuzzbol-orange-soft);
    border: 1px solid rgba(255, 75, 24, .24);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .profile-shield img,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .profile-action-mark img,
body.home-view .home-brand img {
    mix-blend-mode: normal;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .room-code-value,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .settings-section-kicker,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .settings-section-kicker,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .challenge-badge,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .challenge-stars {
    color: var(--fuzzbol-orange);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .slider {
    background-color: #e9edef;
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) input:checked + .slider {
    background-color: var(--fuzzbol-orange-fill);
    border-color: var(--fuzzbol-orange);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) input:checked + .slider:before {
    background: #fff;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--fuzzbol-orange);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-challenge-card {
    background: #fff;
    border-color: var(--fuzzbol-line);
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-challenge-card:hover,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-challenge-card.active {
    border-color: var(--fuzzbol-orange);
    background: var(--fuzzbol-orange-soft);
}

body.home-view .home-brand img {
    width: 208px;
    height: 142px;
    object-fit: contain;
}

/* The setup card has unused vertical room on desktop. Give the stadium and
   weather controls more visual weight so they become a real preview instead
   of compact form rows. */
@media (min-width: 901px) and (min-height: 650px) {
    .home-match-grid { grid-template-columns: minmax(0, 1fr) 420px; }
    .setup-card-body { padding: 11px 18px 14px; }
    .setup-option { min-height: 66px; }
    .setup-option svg { width: 24px; height: 24px; }
    .setup-carousel {
        grid-template-columns: 26px minmax(122px, .92fr) minmax(0, 1.08fr) 26px;
        gap: 10px;
        min-height: 98px;
    }
    .setup-carousel img { width: 100%; height: 82px; border-radius: 9px; }
    .setup-carousel strong,
    .weather-row strong { font-size: .78rem; }
    .setup-carousel span { font-size: .59rem; }
    .setup-stadium-players { font-size: .52rem; }
    .weather-row {
        grid-template-columns: 26px 58px minmax(0, 1fr) 26px;
        gap: 10px;
        min-height: 82px;
    }
    .weather-sun { font-size: 3.2rem; }
    .weather-row small { font-size: .63rem; }
    .setup-carousel i,
    .weather-row i { margin-top: 7px; }
}

@media (max-width: 900px) {
    .setup-carousel { grid-template-columns: 24px 104px minmax(0, 1fr) 24px; }
    .setup-carousel img { width: 104px; height: 70px; }
    .weather-row { grid-template-columns: 24px 54px minmax(0, 1fr) 24px; }
    .weather-sun { font-size: 3rem; }
}

.feature-card[data-nav-target="stadiums"] > div { width: 52%; }
.feature-card[data-nav-target="stadiums"] img {
    width: 80%;
    opacity: .92;
    object-fit: cover;
    object-position: center;
}

/* ========================================================================== 
   MATCH + STADIUM POLISH — shared white/orange presentation
   ========================================================================== */

body:not([data-theme="night"]):not(.theme-night).match-view {
    --ink-1: var(--fuzzbol-navy);
    --ink-2: #506574;
    --ink-3: var(--fuzzbol-muted);
    --edge: var(--fuzzbol-line);
    --edge-strong: #b9c5cb;
    --gold-1: #ff9e78;
    --gold-2: var(--fuzzbol-orange);
    --gold-text: var(--fuzzbol-orange);
    --gold-glow: rgba(255, 75, 24, .24);
    --blue-1: var(--fuzzbol-navy);
    --blue-2: var(--fuzzbol-navy);
    background: #edf1f3;
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night).match-view .app-header {
    background: #fff;
    border-color: var(--fuzzbol-line);
    border-left-color: var(--fuzzbol-orange);
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active {
    background: #edf1f3;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .scoreboard-hud {
    --competition-accent: var(--fuzzbol-orange) !important;
    color: var(--fuzzbol-navy);
    background: #fff;
    border-color: var(--fuzzbol-orange);
    box-shadow: 0 8px 24px rgba(25, 43, 58, .12);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .team-name,
body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .team-score.red .team-name,
body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .team-score.blue .team-name {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .score-digit {
    color: #fff;
    background: var(--fuzzbol-orange-fill);
    border-color: var(--fuzzbol-orange);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .timer-clock {
    color: var(--fuzzbol-orange);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .scoreboard-hud[data-time-urgency="high"] .timer-clock {
    color: #e94313;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .hud-penalties-container {
    background: #f8fafb;
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .penalty-label {
    color: var(--fuzzbol-muted);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .hud-objective-badge {
    background: var(--fuzzbol-orange-soft);
    border-color: rgba(255, 75, 24, .32);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .btn-pause {
    color: var(--fuzzbol-navy);
    background: rgba(255, 255, 255, .96);
    border-color: var(--fuzzbol-orange);
    box-shadow: 0 8px 20px rgba(25, 43, 58, .16);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .btn-pause:hover {
    color: #fff;
    background: var(--fuzzbol-orange-fill);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .overlay-goal {
    background: rgba(255, 255, 255, .96);
    border-color: var(--fuzzbol-orange);
    box-shadow: 0 0 60px rgba(255, 75, 24, .24);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .overlay-goal h2 {
    color: var(--fuzzbol-navy);
    text-shadow: none;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .overlay-goal p {
    color: var(--fuzzbol-muted);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .overlay-goal .goal-scoreline {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-overlay {
    background: rgba(19, 40, 60, .38);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-card {
    color: var(--fuzzbol-navy);
    background: #fff;
    border-color: rgba(255, 75, 24, .34);
    box-shadow: 0 24px 70px rgba(25, 43, 58, .24);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-card h2 {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-actions .btn-primary-start.btn-gold {
    color: #fff;
    background: var(--fuzzbol-orange-fill);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-actions .btn-secondary,
body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-fullscreen-btn {
    color: var(--fuzzbol-navy);
    background: #f8fafb;
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-actions .btn-secondary:hover,
body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-fullscreen-btn:hover {
    color: var(--fuzzbol-orange);
    background: var(--fuzzbol-orange-soft);
    border-color: rgba(255, 75, 24, .38);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-card p,
body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-settings-kicker,
body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-settings .setting-help {
    color: var(--fuzzbol-muted);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-settings {
    border-top-color: var(--fuzzbol-line);
}

/* The stadium card is now an edge-to-edge photo. The title is a real caption
   at the bottom of the image, so no empty white strip remains below it. */
.home-feature-grid {
    grid-template-columns: minmax(0, .95fr) minmax(0, .95fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
}

.stadium-feature-card {
    background: #13283c;
}

.stadium-feature-card > img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 1 !important;
    mask-image: none;
}

.stadium-feature-card::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 35% 0 0;
    background: linear-gradient(180deg, transparent, rgba(10, 24, 38, .94));
    pointer-events: none;
}

.stadium-feature-card .stadium-feature-copy {
    position: absolute;
    z-index: 2;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 42px 112px 13px 14px;
}

.stadium-feature-card .feature-kicker {
    color: #ffb39a;
    font-size: .58rem;
}

.stadium-feature-card h2 {
    margin-top: 4px;
    color: #fff;
    font-size: 1.12rem;
}

.stadium-feature-card p {
    margin-top: 3px;
    color: rgba(255, 255, 255, .78);
    font-size: .61rem;
}

.stadium-feature-card > button {
    right: 12px;
    bottom: 13px;
    left: auto;
    color: #fff;
    background: var(--fuzzbol-orange-fill);
    border-color: var(--fuzzbol-orange);
}

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

@media (max-width: 560px) {
    .stadium-feature-card .stadium-feature-copy { padding-right: 14px; }
    .stadium-feature-card > button { display: none; }
}

/* ==========================================================================
   FRIENDLY MATCH SETUP — match center presentation
   ========================================================================== */

body:has(#screen-setup.active) {
    background-color: #edf2f4;
    background-image:
        linear-gradient(90deg, rgba(237, 242, 244, .84), rgba(237, 242, 244, .6) 50%, rgba(237, 242, 244, .82)),
        url('assets/menu_background.webp');
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

body:has(#screen-setup.active) #app-container {
    max-width: 1810px;
    padding: 18px 28px 26px;
}

body:has(#screen-setup.active) .app-header {
    position: relative;
    min-height: 64px;
    margin-bottom: 24px;
    padding: 8px 20px;
    border-left: 4px solid var(--fuzzbol-orange);
    border-radius: 9px;
    background: rgba(255, 255, 255, .96);
}

body:has(#screen-setup.active) .logo {
    width: 228px;
    min-height: 48px;
    gap: 9px;
}

.setup-wordmark { display: none; }
body:has(#screen-setup.active) .setup-wordmark { display: block; }

body:has(#screen-setup.active) .brand-logo-mark {
    width: 53px;
    height: 28px;
    display: block;
    flex: 0 0 53px;
    overflow: hidden;
}

body:has(#screen-setup.active) .brand-logo-mark .brand-logo-img {
    width: 53px;
    height: auto;
    min-height: 0;
    display: block;
    object-fit: contain;
    object-position: center top;
}

body:has(#screen-setup.active) .setup-wordmark {
    color: var(--fuzzbol-navy);
    font: 900 1.42rem/1 var(--font-display);
    letter-spacing: .015em;
}

body:has(#screen-setup.active) .match-nav {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    gap: 4px;
    margin-left: 8px;
}

.match-nav-item {
    position: relative;
    padding: 0 13px;
    border: 0;
    background: transparent;
    color: #627487;
    cursor: pointer;
    font: 800 .7rem var(--font-body);
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: color .2s ease;
}

.match-nav-item:hover,
.match-nav-item.active { color: var(--fuzzbol-orange); }

.match-nav-item.active::after {
    content: '';
    position: absolute;
    right: 13px;
    bottom: -1px;
    left: 13px;
    height: 2px;
    border-radius: 2px;
    background: var(--fuzzbol-orange-fill);
}

body:has(#screen-setup.active) .header-actions { gap: 9px; }
body:has(#screen-setup.active) .btn-icon {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: .73rem;
}

#screen-setup.match-setup-screen {
    position: relative;
    width: 100%;
    max-width: 1660px;
    padding: 0;
    align-items: stretch;
}

#screen-setup.match-setup-screen::before,
#screen-setup.match-setup-screen::after { pointer-events: none; }

.match-setup-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
    gap: 16px;
    width: 100%;
    min-height: 0;
    align-items: start;
}

.match-setup-shell > .glass-card {
    min-width: 0;
    min-height: 0;
    padding: 24px 26px 22px;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .97);
    color: var(--fuzzbol-navy);
    box-shadow: 0 12px 28px rgba(25, 43, 58, .09);
}

.match-config-card,
.stadium-config-card { display: flex; flex-direction: column; }

.setup-title-block { margin-bottom: 12px; }
.setup-title-block .card-title {
    color: var(--fuzzbol-navy);
    font: 900 clamp(2rem, 2.8vw, 2.5rem)/.92 var(--font-display);
    letter-spacing: .01em;
}

.setup-eyebrow {
    display: block;
    margin-top: 4px;
    color: var(--fuzzbol-muted);
    font: 800 .75rem/1.2 var(--font-body);
    letter-spacing: .07em;
    text-transform: uppercase;
}

.setup-format-control {
    margin: 0 0 18px;
    padding: 4px;
    gap: 3px;
    border: 1px solid #d9e0e4;
    border-radius: 7px;
    background: #eef2f4;
}

.setup-format-control .btn-mode {
    min-height: 39px;
    padding: 7px 0;
    border-radius: 6px;
    color: #687989;
    font-size: .82rem;
}

.setup-format-control .btn-mode.active {
    background: var(--fuzzbol-orange-fill);
    color: #fff;
    box-shadow: 0 4px 10px rgba(255, 75, 24, .2);
}

.teams-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.teams-heading span,
.setup-field-block > label,
.competition-field > label,
.stadium-select-field > label {
    display: block;
    color: var(--fuzzbol-navy);
    font: 900 .72rem/1.2 var(--font-body);
    letter-spacing: .07em;
    text-transform: uppercase;
}

.teams-heading small {
    color: var(--fuzzbol-muted);
    font-size: .66rem;
}

.team-duel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    margin-bottom: 18px;
}

.setup-team-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--team-color) 28%, #dfe5e8);
    border-radius: 8px;
    background: #fbfcfc;
    text-align: center;
}

.setup-team-band {
    padding: 7px 10px;
    color: #fff;
    background: var(--team-color);
    font: 900 .69rem/1 var(--font-body);
    letter-spacing: .05em;
    text-transform: uppercase;
}

.setup-team-away { --team-color: #2179b6; }
.setup-team-home { --team-color: var(--fuzzbol-orange); }
.setup-team-picker {
    display: grid;
    grid-template-columns: 25px minmax(76px, 1fr) 25px;
    align-items: center;
    gap: 2px;
    min-height: 112px;
    padding: 6px 8px 0;
}

.team-step {
    border: 0;
    background: transparent;
    color: var(--fuzzbol-navy);
    cursor: pointer;
    font: 400 2rem/1 Arial, sans-serif;
    transition: color .18s ease, transform .18s ease;
}

.team-step:hover { color: var(--fuzzbol-orange); transform: scale(1.12); }

.setup-team-card .team-logo-slot {
    width: 92px;
    height: 102px;
    justify-self: center;
    border: 0;
    background: transparent;
}

.setup-team-card .team-logo-slot.has-image .team-art-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.setup-team-name {
    display: block;
    padding: 0 8px;
    overflow: hidden;
    color: var(--fuzzbol-navy);
    font: 900 1.12rem/1 var(--font-display);
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.setup-team-country {
    display: block;
    margin-top: 4px;
    color: #5c6b77;
    font-size: .67rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.setup-team-stars {
    display: inline-flex;
    gap: 2px;
    margin-top: 7px;
    color: #c5ced3;
    font-size: 1rem;
    letter-spacing: .03em;
}

.setup-team-stars .filled { color: var(--fuzzbol-orange); }

.setup-team-stats {
    display: flex;
    justify-content: space-around;
    gap: 5px;
    margin: 9px 9px 10px;
    padding: 8px 5px;
    border: 1px solid #e1e6e8;
    border-radius: 6px;
    background: #fff;
    color: var(--fuzzbol-navy);
    font: 800 .61rem var(--font-body);
}

.setup-team-stats span { white-space: nowrap; }
.setup-team-stats b { margin-left: 2px; font-size: .73rem; }

.setup-team-change {
    width: calc(100% - 18px);
    margin: 0 9px 10px;
    min-height: 35px;
    border: 1px solid #d9e0e4;
    border-radius: 6px;
    color: var(--fuzzbol-navy);
    background: #fff;
    cursor: pointer;
    font: 800 .7rem var(--font-body);
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.setup-team-change:hover {
    border-color: rgba(255, 75, 24, .4);
    color: var(--fuzzbol-orange);
    background: var(--fuzzbol-orange-soft);
}

.setup-vs {
    color: #97a5af;
    font: 900 2.2rem/.9 var(--font-display);
    text-align: center;
}

.setup-field-block { min-width: 0; }
.setup-field-block > label,
.competition-field > label { margin-bottom: 6px; color: var(--fuzzbol-muted); }

.competition-field {
    padding-top: 2px;
    margin-bottom: 16px;
}

.setup-team-select-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.setup-team-select-field { min-width: 0; }
.setup-team-select-field > span {
    display: block;
    margin: 0 0 5px 2px;
    color: var(--fuzzbol-navy);
    font: 800 .62rem/1.1 var(--font-body);
    letter-spacing: .05em;
    text-transform: uppercase;
}

.setup-team-select-field .geometric-select {
    min-height: 40px;
    font-size: .73rem;
}

.competition-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.competition-icon {
    position: absolute;
    left: 10px;
    z-index: 1;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--fuzzbol-navy);
}

.competition-icon svg { width: 25px; height: 25px; fill: currentColor; }
.competition-select-wrap .geometric-select { padding-left: 49px; }
.competition-field > small {
    display: block;
    margin-top: 5px;
    color: var(--fuzzbol-muted);
    font-size: .65rem;
}

.setup-select-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.setup-select-icon {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 5px;
    color: var(--fuzzbol-navy);
}

.setup-select-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.setup-select-icon span { display: none; }

.match-setup-screen .geometric-select {
    min-height: 38px;
    padding: 8px 12px;
    border-color: #d6dfe3;
    border-radius: 6px;
    color: var(--fuzzbol-navy);
    background: #fff;
    font-size: .8rem;
}

.match-setup-screen .geometric-select:focus { border-color: var(--fuzzbol-orange); }
.setup-legacy-select { display: none; }

.stadium-config-card .setup-title-block { margin-bottom: 10px; }
.stadium-select-field { margin-bottom: 14px; }
.stadium-select-field > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.stadium-select-field .geometric-select { font-size: .84rem; }

.stadium-preview-box {
    padding: 0;
    border: 1px dashed #d5dfe3;
    border-radius: 7px;
    overflow: hidden;
    background: #f8fafb;
    color: var(--fuzzbol-navy);
}

.setup-stadium-photo-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #0b1f38;
}

.setup-stadium-photo-frame .setup-stadium-photo {
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    object-fit: cover;
}

.setup-stadium-photo-frame::after {
    content: '';
    position: absolute;
    inset: 48% 0 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(7, 24, 39, .36));
}

.setup-stadium-arrow {
    position: absolute;
    z-index: 1;
    top: 50%;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 50%;
    color: #fff;
    background: rgba(8, 28, 45, .58);
    cursor: pointer;
    font: 400 2.25rem/1 Arial, sans-serif;
    transform: translateY(-50%);
    transition: background .18s ease, transform .18s ease;
}

.setup-stadium-arrow.left { left: 14px; }
.setup-stadium-arrow.right { right: 14px; }
.setup-stadium-arrow:hover { background: var(--fuzzbol-orange-fill); transform: translateY(-50%) scale(1.05); }

.setup-stadium-page {
    position: absolute;
    z-index: 1;
    right: 14px;
    bottom: 12px;
    padding: 5px 8px;
    border-radius: 4px;
    color: #fff;
    background: rgba(8, 28, 45, .76);
    font: 800 .68rem var(--font-mono);
}

.setup-stadium-mapline {
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px 14px 13px;
}

.setup-stadium-mapline .setup-stadium-thumb {
    width: 142px;
    height: 82px;
    margin: 0;
    border: 1px solid #cbd6da;
    border-radius: 7px;
    object-fit: cover;
}

.setup-stadium-mapline strong {
    display: block;
    color: var(--fuzzbol-navy);
    font: 900 .96rem/1.1 var(--font-body);
}

.setup-stadium-mapline p {
    margin: 5px 0 0;
    color: #4f6575;
    font-size: .72rem;
    line-height: 1.45;
}

.setup-stadium-mapline p b { color: var(--fuzzbol-navy); }

.setup-stadium-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.setup-stadium-tags span {
    padding: 4px 8px;
    border-radius: 999px;
    color: #506575;
    background: #e9eef1;
    font: 700 .57rem var(--font-body);
}

.setup-stadium-tags span:first-child { color: #28734c; background: #e2f1e6; }
.stadium-options-grid { grid-template-columns: 1fr; margin-top: 13px; }
.stadium-options-grid .setup-field-block > label { font-size: .63rem; }

.setup-actions {
    gap: 14px;
    margin-top: auto;
    padding-top: 18px;
}

.setup-actions .btn-secondary,
.setup-actions .btn-primary-start {
    min-height: 48px;
    border-radius: 7px;
    font-size: .85rem;
}

.setup-actions .btn-secondary { flex: .8; }
.setup-actions .btn-primary-start { flex: 1.25; background: var(--fuzzbol-orange-fill); box-shadow: 0 9px 18px rgba(255, 75, 24, .17); }
.setup-actions .btn-primary-start:hover { background: var(--fuzzbol-orange-fill-hover); }

@media (max-width: 1120px) {
    body:has(#screen-setup.active) .app-header { flex-wrap: wrap; gap: 8px; }
    body:has(#screen-setup.active) .match-nav { order: 3; width: 100%; min-height: 33px; justify-content: center; margin: 0; border-top: 1px solid #e7ecee; }
    .match-nav-item { min-height: 32px; }
    .match-setup-shell { grid-template-columns: 1fr 1fr; }
    .setup-team-picker { grid-template-columns: 21px minmax(62px, 1fr) 21px; }
    .setup-team-card .team-logo-slot { width: 76px; height: 88px; }
    .setup-team-name { font-size: .96rem; }
    .setup-stadium-mapline { grid-template-columns: 104px minmax(0, 1fr); }
    .setup-stadium-mapline .setup-stadium-thumb { width: 104px; height: 66px; }
}

@media (max-width: 760px) {
    body:has(#screen-setup.active) #app-container { padding: 10px 14px 22px; }
    body:has(#screen-setup.active) .app-header { margin-bottom: 14px; padding: 8px 12px; }
    body:has(#screen-setup.active) .logo { width: auto; margin-right: auto; }
    body:has(#screen-setup.active) .header-actions { gap: 4px; }
    body:has(#screen-setup.active) .btn-icon { min-width: 38px; padding: 7px 9px; }
    body:has(#screen-setup.active) .btn-text { display: none; }
    .match-setup-shell { grid-template-columns: 1fr; min-height: 0; }
    .match-setup-shell > .glass-card { padding: 20px 16px; }
    .stadium-config-card { min-height: 0; }
    .setup-stadium-mapline { grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 11px; }
    .setup-stadium-mapline .setup-stadium-thumb { width: 92px; height: 58px; }
    .setup-team-select-row { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 460px) {
    .team-duel-grid { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 4px; }
    .setup-vs { font-size: 1.45rem; }
    .setup-team-picker { grid-template-columns: 16px minmax(52px, 1fr) 16px; padding-inline: 3px; }
    .setup-team-card .team-logo-slot { width: 64px; height: 78px; }
    .team-step { font-size: 1.45rem; }
    .setup-team-name { font-size: .8rem; }
    .setup-team-country { font-size: .57rem; }
    .setup-team-stats { margin-inline: 4px; gap: 2px; font-size: .53rem; }
    .setup-team-change { width: calc(100% - 8px); margin-inline: 4px; font-size: .6rem; }
    .setup-select-grid { grid-template-columns: 1fr; gap: 10px; }
    .setup-actions { flex-direction: column; }
    .setup-actions .btn-secondary,
    .setup-actions .btn-primary-start { width: 100%; flex: 1; }
}

/* ============================================================================
   COMPETITION SETUP — official tournament presentation
   ============================================================================ */

body:has(#screen-tournament-setup.active) {
    background-color: #edf2f4;
    background-image:
        linear-gradient(90deg, rgba(237, 242, 244, .84), rgba(237, 242, 244, .6) 50%, rgba(237, 242, 244, .82)),
        url('assets/menu_background.webp');
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

body:has(#screen-tournament-setup.active) #app-container {
    max-width: 1810px;
    padding: 18px 28px 26px;
}

body:has(#screen-tournament-setup.active) .app-header {
    position: relative;
    min-height: 64px;
    margin-bottom: 24px;
    padding: 8px 20px;
    border-left: 4px solid var(--fuzzbol-orange);
    border-radius: 9px;
    background: rgba(255, 255, 255, .96);
}

body:has(#screen-tournament-setup.active) .logo {
    width: 228px;
    min-height: 48px;
    gap: 9px;
}

body:has(#screen-tournament-setup.active) .brand-logo-mark {
    width: 53px;
    height: 28px;
    display: block;
    flex: 0 0 53px;
    overflow: hidden;
}

body:has(#screen-tournament-setup.active) .brand-logo-mark .brand-logo-img {
    width: 53px;
    height: auto;
    min-height: 0;
    display: block;
    object-fit: contain;
    object-position: center top;
}

body:has(#screen-tournament-setup.active) .setup-wordmark {
    display: block;
    color: var(--fuzzbol-navy);
    font: 900 1.42rem/1 var(--font-display);
    letter-spacing: .015em;
}

body:has(#screen-tournament-setup.active) .match-nav {
    display: flex !important;
    align-items: stretch;
    align-self: stretch;
    gap: 4px;
    margin-left: 8px;
}

body:has(#screen-tournament-setup.active) .header-actions { gap: 9px; }
body:has(#screen-tournament-setup.active) .btn-icon {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: .73rem;
}

#screen-tournament-setup.tournament-setup-screen {
    width: 100%;
    max-width: 1660px;
    padding: 0;
    align-items: stretch;
}

.competition-setup-shell {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
    gap: 15px;
    width: 100%;
    min-height: calc(100vh - 173px);
    align-items: stretch;
}

.competition-setup-shell > .glass-card {
    min-width: 0;
    min-height: 0;
    padding: 23px 23px 20px;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .97);
    color: var(--fuzzbol-navy);
    box-shadow: 0 12px 28px rgba(25, 43, 58, .09);
}

.competition-config-card,
.competition-summary-card { display: flex; flex-direction: column; }
.competition-setup-shell > .competition-config-card { padding-inline: 24px; }

.competition-title-block {
    padding-bottom: 15px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--fuzzbol-line);
}

.competition-title-block .card-title,
.competition-summary-heading .card-title {
    color: var(--fuzzbol-navy);
    font: 900 clamp(2rem, 2.8vw, 2.48rem)/.94 var(--font-display);
    letter-spacing: .01em;
}

.competition-title-block .form-desc {
    max-width: none;
    color: #5c6b77;
    font-size: .82rem;
}

.competition-section-block { margin-bottom: 18px; }

.competition-section-label,
.competition-field > label {
    display: block;
    margin-bottom: 8px;
    color: var(--fuzzbol-muted);
    font: 900 .68rem/1.2 var(--font-body);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.competition-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.competition-mode-card {
    min-width: 0;
    min-height: 92px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border: 1px solid #dce3e6;
    border-radius: 7px;
    color: var(--fuzzbol-navy);
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.competition-mode-card:hover:not(.competition-mode-card-disabled) {
    border-color: rgba(255, 75, 24, .48);
    background: var(--fuzzbol-orange-soft);
    transform: translateY(-1px);
}

.competition-mode-card.active {
    border-color: var(--fuzzbol-orange);
    background: #fffaf7;
    box-shadow: 0 0 0 1px var(--fuzzbol-orange) inset;
}

.competition-mode-card-disabled {
    cursor: not-allowed;
    opacity: 1;
}

.competition-mode-card > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.competition-mode-card strong {
    color: var(--fuzzbol-navy);
    font: 900 .72rem/1.1 var(--font-body);
}

.competition-mode-card small {
    color: #5c6b77;
    font-size: .61rem;
    line-height: 1.15;
}

.competition-mode-icon {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
}

.competition-mode-icon svg { width: 28px; height: 28px; fill: currentColor; }
.competition-mode-icon.tone-orange { color: var(--fuzzbol-orange); }
.competition-mode-icon.tone-navy { color: #5c6b77; }
.competition-mode-icon.tone-slate { color: #708292; }

.competition-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.tournament-league-field { margin-bottom: 14px; }
.competition-team-field { margin-bottom: 8px; }
.competition-team-field .setting-help { display: none; }
.competition-field .geometric-select {
    min-height: 39px;
    padding: 9px 12px;
    border-color: #d6dfe3;
    border-radius: 6px;
    color: var(--fuzzbol-navy);
    background: #fff;
    font-size: .8rem;
}

.competition-field .geometric-select:focus {
    border-color: var(--fuzzbol-orange);
    box-shadow: 0 0 0 3px rgba(255, 75, 24, .13);
}

.competition-select-wrap { position: relative; display: flex; align-items: center; }
.competition-select-wrap .geometric-select { padding-left: 47px; }
.competition-icon {
    position: absolute;
    left: 11px;
    z-index: 1;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    color: var(--fuzzbol-navy);
    pointer-events: none;
}

.competition-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.competition-bars-icon svg { fill: none; stroke-width: 1.8; }
.competition-field .setting-help { margin-top: 5px; font-size: .65rem; }

.competition-team-preview {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) minmax(250px, 1.1fr);
    align-items: center;
    gap: 14px;
    min-height: 144px;
    margin-bottom: 13px;
    padding: 10px 13px;
    border: 1px solid #dce3e6;
    border-radius: 7px;
    background: #fbfcfc;
}

.competition-team-preview .team-logo-slot {
    width: 118px;
    height: 118px;
    justify-self: center;
    border: 0;
    background: transparent;
}

.competition-team-preview .team-logo-slot.has-image .team-art-image {
    width: 100%;
    height: 100%;
    padding: 3px;
    object-fit: contain;
}

.competition-team-copy { min-width: 0; }
.competition-team-copy > strong {
    display: block;
    overflow: hidden;
    color: var(--fuzzbol-navy);
    font: 900 1.42rem/1 var(--font-display);
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.competition-team-copy > span:not(.competition-team-stars) {
    display: block;
    margin-top: 7px;
    color: #5c6b77;
    font-size: .7rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.competition-team-stars {
    display: inline-flex;
    gap: 2px;
    margin-top: 7px;
    color: #c5ced3;
    font-size: 1rem;
    letter-spacing: .03em;
}

.competition-team-stars .filled { color: var(--fuzzbol-orange); }
.competition-team-copy > small {
    display: block;
    margin-top: 5px;
    color: #5c6b77;
    font-size: .56rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.competition-team-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-self: center;
    border-left: 1px solid #dbe3e6;
}

.competition-team-stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.competition-team-stats span + span { border-left: 1px solid #dbe3e6; }
.competition-team-stats small { color: #5c6b77; font: 800 .58rem var(--font-body); }
.competition-team-stats b { color: var(--fuzzbol-navy); font: 900 1.28rem/1 var(--font-body); }
.competition-ai-field { margin-bottom: 0; }

.competition-actions {
    gap: 12px;
    margin-top: auto;
    padding-top: 15px;
}

.competition-actions .btn-secondary,
.competition-actions .btn-primary-start {
    min-height: 48px;
    border-radius: 7px;
    font-size: .84rem;
}

.competition-actions .btn-secondary { flex: .78; }
.competition-actions .btn-primary-start {
    flex: 1.22;
    background: var(--fuzzbol-orange-fill);
    box-shadow: 0 9px 18px rgba(255, 75, 24, .17);
}

.competition-summary-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-height: 84px;
    padding-bottom: 10px;
}

.competition-summary-heading .setup-eyebrow { margin-top: 5px; }
.competition-summary-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.competition-summary-brand img { width: 72px; height: 72px; object-fit: contain; }
.competition-summary-brand span {
    padding-left: 12px;
    border-left: 1px solid #ccd7dc;
    color: #80909d;
    font: 700 .58rem/1.55 var(--font-body);
    letter-spacing: .05em;
    text-transform: uppercase;
}

.competition-summary-brand span::after {
    content: '';
    display: block;
    width: 28px;
    height: 2px;
    margin-top: 8px;
    background: var(--fuzzbol-orange-fill);
}

.competition-bracket-preview {
    min-height: 342px;
    padding: 10px 15px 13px;
    border: 1px solid #dce3e6;
    border-radius: 7px;
    background: #f8fafb;
}

.bracket-heading-row {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    align-items: center;
    min-height: 27px;
    margin: -10px -15px 9px;
    padding: 0 10px;
    border-bottom: 1px solid #e4eaed;
    color: #5c6b77;
    font: 800 .61rem var(--font-body);
    text-align: center;
    text-transform: uppercase;
}

.bracket-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 44px;
    min-height: 285px;
    align-items: stretch;
}

.bracket-column { min-width: 0; position: relative; }
.bracket-quarters { display: flex; flex-direction: column; justify-content: space-between; gap: 7px; }
.bracket-pair { position: relative; display: grid; gap: 4px; }
.bracket-pair::after {
    content: '';
    position: absolute;
    top: 25%;
    right: -18px;
    width: 18px;
    height: 50%;
    border-top: 1px solid #91a4b0;
    border-right: 1px solid #91a4b0;
    border-bottom: 1px solid #91a4b0;
}

.bracket-team {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    min-width: 0;
    min-height: 44px;
    padding: 5px 7px;
    border: 1px solid #e0e6e9;
    border-radius: 5px;
    color: var(--fuzzbol-navy);
    background: #f4f7f8;
}

.bracket-team strong {
    overflow: hidden;
    color: var(--fuzzbol-navy);
    font: 900 .65rem/1 var(--font-display);
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.bracket-team small { color: #5c6b77; font: 800 .62rem var(--font-mono); }
.bracket-team-player { background: #fff7f3; border-color: rgba(255, 75, 24, .25); }
.bracket-logo-slot { width: 23px; height: 25px; border: 0; background: transparent; }
.bracket-logo-slot.has-image .team-art-image { width: 100%; height: 100%; object-fit: contain; }

.bracket-semis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
    padding: 62px 0 89px;
}

.bracket-semis .bracket-team::before,
.bracket-semis .bracket-team::after {
    content: '';
    position: absolute;
    width: 18px;
    border-top: 1px solid #91a4b0;
}

.bracket-semis .bracket-team::before { left: -19px; }
.bracket-semis .bracket-team::after { right: -35px; }
.bracket-final { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; }
.bracket-final::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 50%;
    width: 35px;
    border-top: 1px solid #91a4b0;
}

.bracket-final-trophy { color: #697b88; }
.bracket-final-trophy svg { width: 57px; height: 57px; fill: currentColor; }
.bracket-champion-card {
    width: min(210px, 100%);
    padding: 10px 8px;
    border: 1px solid #dce3e6;
    border-radius: 6px;
    background: #f4f7f8;
    text-align: center;
}

.bracket-champion-card span { display: block; color: #5c6b77; font: 800 .65rem var(--font-body); text-transform: uppercase; }
.bracket-champion-card strong { display: block; margin-top: 4px; color: var(--fuzzbol-navy); font: 900 .82rem var(--font-display); }

.competition-summary-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 13px;
    border: 1px solid #dce3e6;
    border-radius: 7px;
    background: #fff;
}

.competition-summary-meta > div {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    min-width: 0;
    padding: 10px 9px;
}

.competition-summary-meta > div + div { border-left: 1px solid #dce3e6; }
.summary-meta-icon { color: var(--fuzzbol-navy); font: 900 1.3rem/1 Arial, sans-serif; text-align: center; }
.competition-summary-meta > div > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.competition-summary-meta small { color: #5c6b77; font: 800 .51rem var(--font-body); text-transform: uppercase; }
.competition-summary-meta strong { overflow: hidden; color: var(--fuzzbol-navy); font: 900 .65rem/1.1 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.competition-summary-meta em { overflow: hidden; color: #5c6b77; font: normal .54rem/1.1 var(--font-body); text-overflow: ellipsis; white-space: nowrap; }

.competition-banner {
    position: relative;
    overflow: hidden;
    min-height: 89px;
    margin-top: 13px;
    border-radius: 6px;
    background: var(--fuzzbol-navy-deep);
}

.competition-banner img { width: 100%; height: 100%; min-height: 89px; display: block; object-fit: cover; object-position: center 43%; }
.competition-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 24, 39, .9), rgba(7, 24, 39, .12) 75%); }
.competition-banner > div { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 12px 16px; color: #fff; }
.competition-banner strong { font: 900 1.26rem/.92 var(--font-display); letter-spacing: .02em; }
.competition-banner span { margin-top: 7px; color: rgba(255, 255, 255, .82); font: 700 .56rem var(--font-body); letter-spacing: .08em; }

.competition-summary-card .competition-bracket-preview { flex: 1 1 auto; }
.competition-banner-image-only { min-height: 148px; flex: 0 0 148px; }
.competition-banner-image-only img { min-height: 148px; object-position: center 50%; }
.competition-banner-image-only::after { background: linear-gradient(90deg, rgba(7, 24, 39, .18), rgba(7, 24, 39, 0)); }
.competition-banner-image-only > div { display: none; }

@media (max-width: 1120px) {
    body:has(#screen-tournament-setup.active) .app-header { flex-wrap: wrap; gap: 8px; }
    body:has(#screen-tournament-setup.active) .match-nav { order: 3; width: 100%; min-height: 33px; justify-content: center; margin: 0; border-top: 1px solid #e7ecee; }
    .competition-setup-shell { grid-template-columns: minmax(0, .82fr) minmax(0, 1fr); }
    .competition-setup-shell > .glass-card { padding-inline: 18px; }
    .competition-team-preview { grid-template-columns: 92px minmax(0, 1fr) minmax(135px, .82fr); gap: 9px; padding-inline: 9px; }
    .competition-team-preview .team-logo-slot { width: 84px; height: 100px; }
    .competition-team-copy > strong { font-size: 1.08rem; }
    .competition-mode-grid { gap: 6px; }
    .competition-mode-card { grid-template-columns: 26px minmax(0, 1fr); gap: 6px; padding-inline: 7px; }
    .competition-mode-icon { width: 25px; height: 25px; }
    .competition-mode-icon svg { width: 23px; height: 23px; }
    .competition-mode-card strong { font-size: .62rem; }
    .competition-mode-card small { font-size: .55rem; }
    .competition-bracket-preview { padding-inline: 7px; }
    .bracket-grid { gap: 22px; }
}

@media (max-width: 760px) {
    body:has(#screen-tournament-setup.active) #app-container { padding: 10px 14px 22px; }
    body:has(#screen-tournament-setup.active) .app-header { margin-bottom: 14px; padding: 8px 12px; }
    body:has(#screen-tournament-setup.active) .logo { width: auto; margin-right: auto; }
    body:has(#screen-tournament-setup.active) .header-actions { gap: 4px; }
    body:has(#screen-tournament-setup.active) .btn-icon { min-width: 38px; padding: 7px 9px; }
    body:has(#screen-tournament-setup.active) .btn-text { display: none; }
    .competition-setup-shell { grid-template-columns: 1fr; min-height: 0; }
    .competition-setup-shell > .glass-card { padding: 20px 16px; }
    .competition-mode-grid { grid-template-columns: 1fr; }
    .competition-mode-card { min-height: 62px; }
    .competition-team-preview { grid-template-columns: 84px minmax(0, 1fr); }
    .competition-team-stats { grid-column: 1 / -1; border-top: 1px solid #dbe3e6; border-left: 0; padding-top: 9px; }
    .competition-summary-heading { min-height: 70px; }
    .competition-summary-brand img { width: 54px; height: 54px; }
    .competition-summary-brand span { display: none; }
    .bracket-grid { gap: 12px; }
    .bracket-team { grid-template-columns: 21px minmax(0, 1fr) auto; padding-inline: 4px; }
    .bracket-team strong { font-size: .56rem; }
    .competition-summary-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .competition-summary-meta > div:nth-child(3) { border-left: 0; border-top: 1px solid #dce3e6; }
    .competition-summary-meta > div:nth-child(4) { border-top: 1px solid #dce3e6; }
}

@media (max-width: 460px) {
    .competition-title-block .card-title,
    .competition-summary-heading .card-title { font-size: 1.85rem; }
    .competition-summary-heading { gap: 6px; }
    .competition-summary-brand { display: none; }
    .competition-bracket-preview { overflow-x: auto; }
    .bracket-grid, .bracket-heading-row { min-width: 470px; }
    .competition-actions { flex-direction: column; }
    .competition-actions .btn-secondary,
    .competition-actions .btn-primary-start { width: 100%; flex: 1; }
}

/* Career: editorial matchday dashboard, scoped to protect other game modes. */
#screen-career-hub .career-story-hero,
#screen-career-setup .career-setup-intro {
    position: relative; isolation: isolate; overflow: hidden; border-radius: 12px;
    background: #102d43; color: #fff; padding: 26px 30px; margin-bottom: 20px;
}
#screen-career-hub .career-story-hero { min-height: 216px; display: flex; align-items: center; }
#screen-career-hub .career-story-hero > div { position: relative; z-index: 2; width: 72%; }
#screen-career-hub .career-story-hero h3,
#screen-career-setup .career-setup-intro h3 { color: #fff; font: 900 clamp(2rem, 3.4vw, 3.5rem)/1.05 var(--font-display); text-transform: uppercase; margin: 10px 0; letter-spacing: -.01em; }
#screen-career-hub .career-story-hero p,
#screen-career-setup .career-setup-intro p { color: #d1e0e9; font-size: .8rem; line-height: 1.65; max-width: 420px; margin: 0; }
.career-eyebrow { font: 800 .6rem var(--font-mono); letter-spacing: .14em; color: #ff865f; }
#screen-career-hub .career-hero-art { position: absolute; right: 0; top: 0; height: 100%; width: 54%; object-fit: cover; opacity: .55; mask-image: linear-gradient(to right, transparent, #000 55%); }
.career-hero-wordmark { position: absolute; right: 18px; bottom: 16px; color: #fff; opacity: .75; font: 800 .6rem var(--font-mono); letter-spacing: .13em; }
.career-journey { display: flex; gap: 18px; margin-top: 21px; flex-wrap: wrap; }
.career-journey > span { color: #a4b6c3; font: 700 .63rem var(--font-body); display: flex; align-items: center; gap: 6px; }
.career-journey b { border-top: 2px solid #5a6e7f; padding-top: 5px; font: 700 .65rem var(--font-mono); }
.career-journey .reached { color: #fff; }
.career-journey .reached b { color: #ff865f; border-color: #ff7547; }
#screen-career-setup .career-setup-intro { background: linear-gradient(100deg, #102d43 25%, #102d4380), url('assets/career-matchday-discs.webp') center 55% / cover; }
#screen-career-setup .career-setup-intro h3 { font-size: 2.5rem; }
.career-setup-stamp { position: absolute; right: 20px; bottom: 18px; font: 800 .55rem var(--font-mono); color: #d1e0e9; letter-spacing: .1em; }
#screen-career-setup .career-setup-note { color: #5d7181; font-size: .77rem; line-height: 1.6; margin-top: 24px; }
#screen-career-hub .career-workspace-header { flex-wrap: wrap; gap: 12px; }
#screen-career-hub .career-header-actions { flex-wrap: wrap; margin-left: auto; }
#screen-career-hub .career-save-status { max-width: 230px; color: #397149; line-height: 1.5; font-size: .65rem; }
#screen-career-hub .career-save-status[data-status="error"] { color: #b53725; }
#screen-career-hub .career-nav-item { min-height: 44px; }
#screen-career-hub .career-view { animation-duration: .15s; }
#screen-career-hub .career-club-panel { border-radius: 10px; padding: 14px 18px; }
#screen-career-hub .career-objective { position: relative; overflow: hidden; border-radius: 8px; padding-bottom: 17px; }
#screen-career-hub .career-objective::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--objective-progress, 0%); background: var(--fuzzbol-orange-fill); transition: width .25s; }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-next-match {
    display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 16px; padding: 22px; border-radius: 12px; background: #f4f7f9; border: 1px solid #d7e1e7;
}
#screen-career-hub .career-rival-crest { width: 68px; height: 76px; background: transparent; border: 0; }
#screen-career-hub .career-rival-crest img { width: 100%; height: 100%; object-fit: contain; }
#screen-career-hub .career-next-match-copy { min-width: 0; }
#screen-career-hub .career-next-match-copy strong { font-size: clamp(1.4rem, 2.4vw, 2rem); }
#screen-career-hub .career-match-actions { grid-column: 1 / -1; width: 100%; display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 10px; }
#screen-career-hub .career-match-action[data-career-season-start] { grid-column: 1 / -1; }
#screen-career-hub .career-match-action { border-radius: 8px; min-height: 102px; padding: 15px 12px; transition: transform .16s, box-shadow .16s; }
#screen-career-hub .career-match-action:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 18px #13283c12; }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-match-action.featured { color: #fff; background: var(--fuzzbol-orange-fill-hover); border-color: #ef4515; }
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-match-action.featured strong,
#screen-career-hub .career-match-action.featured small,
#screen-career-hub .career-match-action.featured .career-match-action-icon { color: #fff; }
#screen-career-hub .career-match-action small { color: #5c6f7f; }
#screen-career-hub .career-match-action:disabled { opacity: .45; cursor: not-allowed; transform: none; }
#screen-career-hub .career-howto { margin: 12px 0 22px; color: #526b7d; font-size: .75rem; line-height: 1.65; }
#screen-career-hub .career-howto summary { cursor: pointer; padding: 8px 0; color: #15354c; font-weight: 750; }
#screen-career-hub .career-howto > div { padding: 12px 18px; border: 1px solid #dce5eb; border-radius: 8px; }
#screen-career-hub kbd { font-family: inherit; background: #e9eff3; padding: 3px 5px; border-radius: 3px; }
.career-decision { margin: 20px 0; padding: 22px; background: #f8f5ef; border: 1px solid #e9dfcf; border-radius: 10px; }
.career-decision:empty { display: none; }
.career-decision-heading { display: flex; gap: 10px; justify-content: space-between; }
.career-decision-heading > span:last-child { color: #7a6c59; font: 700 .65rem var(--font-body); }
.career-decision .career-eyebrow { color: #95631c; }
#screen-career-hub .career-decision h3 { color: #163449; font: 900 1.7rem var(--font-display); text-transform: uppercase; margin: 12px 0 6px; }
.career-decision p { font-size: .78rem; line-height: 1.6; margin: 0 0 16px; color: #66727a; }
.career-decision-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.career-decision-choices button { text-align: left; background: #fff; border: 1px solid #dcd4c6; border-radius: 7px; padding: 14px; color: #19394f; cursor: pointer; }
.career-decision-choices button:hover { border-color: #ec591f; background: #fffaf6; }
.career-decision-choices button:disabled { opacity: .5; cursor: not-allowed; }
.career-decision-choices strong { display: flex; justify-content: space-between; font: 800 .78rem var(--font-body); }
.career-decision-choices small { display: block; color: #78705f; margin-top: 7px; font-size: .69rem; }
.career-decision-resolved { padding: 12px; border-radius: 6px; color: #366447; background: #e9f0e6; font-size: .8rem; font-weight: 750; }
.career-decision-resolved span { display: block; margin-top: 5px; font-weight: 500; }
#screen-career-hub .career-reward-recap { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: 18px; padding: 18px; border: 1px solid #d9e6df; background: #f8fbf9; border-radius: 10px; }
#screen-career-hub .career-reward-recap[hidden], #screen-career-hub .career-season-finale[hidden] { display: none; }
.career-result-score { min-width: 88px; padding-right: 18px; border-right: 1px solid #d9e6df; text-align: center; color: #237247; }
.career-result-score.loss { color: #b33b32; }
.career-result-score.draw { color: #6f612e; }
.career-result-score span { display: block; font: 800 .55rem var(--font-mono); letter-spacing: .08em; }
.career-result-score strong { font: 900 2.3rem var(--font-display); }
.career-result-copy > span { font: 750 .56rem var(--font-mono); color: #617b6c; letter-spacing: .06em; }
.career-result-copy > strong { display: block; color: #15374c; font: 850 1.1rem var(--font-display); margin: 4px 0; }
.career-result-copy p { color: #667d70; font-size: .69rem; line-height: 1.5; margin: 0; }
.career-reward-values { display: flex; flex-direction: column; gap: 4px; color: #207046; text-align: right; }
.career-reward-values b { font: 900 1.2rem var(--font-mono); }
.career-reward-values > span { font-size: .7rem; }
.career-inline-action { cursor: pointer; border: 0; padding: 6px 0; background: transparent; color: #c33e13; font: 750 .69rem var(--font-body); }
#screen-career-hub .career-season-finale { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; padding: 22px; background: #fff4dd; border: 1px solid #e6c78a; border-radius: 10px; margin-bottom: 20px; color: #19344a; }
.career-season-finale > svg { height: 48px; width: 48px; color: #b77717; }
.career-season-finale > div { flex: 1; }
.career-season-finale span { color: #926525; font: 800 .6rem var(--font-mono); }
#screen-career-hub .career-season-finale h3 { color: #19344a; font: 900 1.8rem var(--font-display); margin: 5px 0; }
.career-season-finale p { color: #806a4c; font-size: .73rem; line-height: 1.5; margin: 0; }
.career-season-finale button { font-size: .75rem; min-height: 44px; }
.career-calendar { margin-bottom: 26px; }
.career-calendar-caption { color: #63798a; font-size: .68rem; }
.career-calendar-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.career-calendar-match { flex: 0 0 120px; background: #f6f8fa; border: 1px solid #dfe7ec; border-radius: 8px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #17344a; text-align: center; }
.career-calendar-match.current { background: #fff4ee; border-color: #ff865f; }
.career-calendar-match > span:first-child { font: 700 .55rem var(--font-mono); color: #667989; }
.career-calendar-match > strong { font: 800 .8rem var(--font-display); min-height: 28px; }
.career-calendar-match > b { font: 900 1.1rem var(--font-mono); }
#screen-career-hub .career-calendar-logo { width: 40px; height: 44px; border: 0; background: transparent; }
.career-achievements { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.career-achievement { display: flex; gap: 14px; align-items: center; background: #f8fafb; border: 1px solid #e1e7ec; border-radius: 8px; padding: 16px; }
.career-achievement.unlocked { background: #fff9ed; border-color: #e7cd96; }
.career-achievement-mark { color: #8798a3; }
.career-achievement-mark svg { width: 30px; height: 30px; }
.career-achievement.unlocked .career-achievement-mark { color: #bc811f; }
.career-achievement strong { color: #1b3a50; font-size: .82rem; }
.career-achievement p { color: #617788; font-size: .71rem; line-height: 1.45; margin: 5px 0; }
.career-achievement small { color: #83662d; font: 750 .58rem var(--font-mono); }
#screen-career-hub .career-offer-crest { width: 56px; height: 62px; border: 0; background: transparent; }
#screen-career-hub .career-attribute-card { grid-template-rows: 1fr auto; padding: 18px; gap: 12px; }
#screen-career-hub .career-attr-content { padding: 0; }
#screen-career-hub .career-attr-actions button { min-height: 42px; }
#screen-career-hub .career-notifications-panel { margin-top: 22px; box-shadow: none; }
#screen-career-hub :is(button, summary):focus-visible,
#screen-career-setup :is(button, input, select):focus-visible { outline: 3px solid #ff6e34; outline-offset: 3px; }
@media (max-width: 980px) {
    #screen-career-hub .career-story-hero > div { width: 85%; }
    #screen-career-hub .career-sidebar { position: static; }
    #screen-career-hub .career-exit { display: block; margin: 6px 0 0 auto; width: auto; min-height: 38px; }
    #screen-career-hub .career-player-card.compact { display: flex; margin: 0 0 10px; }
    #screen-career-hub .career-header-actions { margin-left: 0; }
}
@media (max-width: 620px) {
    #screen-career-hub .career-story-hero { padding: 22px 18px; }
    #screen-career-hub .career-story-hero > div { width: 100%; }
    #screen-career-hub .career-story-hero h3 { font-size: 2.2rem; }
    #screen-career-hub .career-hero-art { width: 90%; opacity: .22; }
    #screen-career-hub .career-hero-wordmark { display: none; }
    .career-journey { gap: 10px; }
    .career-journey > span { font-size: .57rem; }
    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-career-hub.active .career-next-match { padding: 16px; gap: 10px; grid-template-columns: 52px minmax(0, 1fr); }
    #screen-career-hub .career-rival-crest { width: 52px; height: 62px; }
    #screen-career-hub .career-match-actions { grid-template-columns: 1fr 1fr; }
    #screen-career-hub .career-match-action.featured { grid-column: 1 / -1; grid-row: 1; min-height: 92px; }
    .career-decision { padding: 18px; }
    .career-decision-choices, .career-achievements { grid-template-columns: 1fr; }
    #screen-career-hub .career-reward-recap { grid-template-columns: auto 1fr; gap: 12px; }
    .career-reward-values { grid-column: 1 / -1; text-align: left; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; border-top: 1px solid #e0e9e3; padding-top: 10px; }
    #screen-career-hub .career-save-status { max-width: none; flex-basis: 100%; }
    #screen-career-hub .career-season-finale { padding: 18px; gap: 12px; }
    #screen-career-hub .career-season-finale button { width: 100%; }
    #screen-career-hub .career-club-rating, #screen-career-hub .career-market-value { text-align: left; }
    .career-setup-stamp { display: none; }
    #screen-career-setup .career-setup-intro { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    #screen-career-hub .career-view { animation: none; }
    #screen-career-hub .career-match-action, #screen-career-hub .career-objective::after { transition: none; }
}
#screen-career-hub .career-notifications-panel > summary { cursor: pointer; margin-bottom: 0; }
#screen-career-hub .career-notifications-panel[open] > summary { margin-bottom: 16px; }
#screen-career-hub .career-calendar-logo, #screen-career-hub .career-rival-crest, #screen-career-hub .career-offer-crest { flex: none; }
#screen-career-hub .career-metrics-grid { margin-top: 18px; }
#screen-career-hub .career-notifications-panel > summary::after { content: '+'; color: #cf421b; font-size: 1.2rem; }
#screen-career-hub .career-notifications-panel[open] > summary::after { content: '−'; }

/* ==========================================================================
   CAREER VISUAL SYSTEM — club identity, trophies and richer hub views
   ========================================================================== */

#screen-career-hub .career-view > .career-section-heading { margin-top: 4px; }
#screen-career-hub .career-view > .career-section-heading h3 { letter-spacing: -.015em; }
#screen-career-hub .career-panel-kicker { letter-spacing: .12em; }

#screen-career-hub .career-honor-shelf {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .82fr); gap: 18px;
    min-height: 176px; margin: 18px 0 22px; overflow: hidden; border-radius: 12px;
    color: #fff; background: #112f45; border: 1px solid #274b62; position: relative;
}
#screen-career-hub .career-honor-shelf::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle at 15% 15%, #ff784b35, transparent 37%), linear-gradient(100deg, #102d43 25%, transparent 70%);
}
#screen-career-hub .career-honor-copy { position: relative; z-index: 1; padding: 24px 24px 20px; }
#screen-career-hub .career-honor-copy h3 { margin: 8px 0 6px; color: #fff; font: 900 1.65rem/1 var(--font-display); text-transform: uppercase; }
#screen-career-hub .career-honor-copy p { max-width: 520px; margin: 0; color: #bfd1db; font-size: .75rem; line-height: 1.55; }
#screen-career-hub .career-honor-counts { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 18px; }
#screen-career-hub .career-honor-counts span { display: flex; align-items: baseline; gap: 7px; }
#screen-career-hub .career-honor-counts strong { color: #ff8152; font: 900 1.3rem var(--font-mono); }
#screen-career-hub .career-honor-counts small { color: #d8e3e8; font: 800 .52rem var(--font-mono); letter-spacing: .08em; }
#screen-career-hub .career-trophy-wall { min-height: 176px; position: relative; overflow: hidden; background: #081b2a; }
#screen-career-hub .career-trophy-wall::after,
#screen-career-hub .career-history-trophy-wall::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #112f45 0%, transparent 37%, #07152333); pointer-events: none; }
#screen-career-hub .career-trophy-wall img { display: block; width: 100%; height: 100%; min-height: 176px; object-fit: cover; object-position: center 45%; opacity: .77; mix-blend-mode: screen; }
#screen-career-hub .career-trophy-wall span { position: absolute; z-index: 2; right: 17px; bottom: 14px; color: #fff; font: 800 .54rem var(--font-mono); letter-spacing: .12em; }

#screen-career-hub .career-competition-banner {
    display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 18px; align-items: center;
    margin-bottom: 22px; padding: 20px 24px; overflow: hidden; position: relative; border-radius: 14px;
    color: #fff; background: linear-gradient(110deg, #142d4b, #1c1a44 66%, #3c1d4c); border: 1px solid #445174;
    box-shadow: 0 8px 24px rgba(16, 28, 56, 0.15);
}
#screen-career-hub .career-competition-banner img { width: 66px; height: 66px; object-fit: contain; filter: drop-shadow(0 5px 8px #0008); position: relative; z-index: 2; }
#screen-career-hub .career-competition-banner h3 { position: relative; z-index: 2; margin: 4px 0 5px; color: #fff; font: 900 clamp(1.35rem, 2.5vw, 1.8rem)/1.15 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
#screen-career-hub .career-competition-banner p { position: relative; z-index: 2; max-width: 570px; margin: 0; color: #d1dde8; font-size: 0.8rem; line-height: 1.5; }
#screen-career-hub .career-competition-season {
    position: relative; z-index: 2; min-width: 82px; padding: 10px 14px; text-align: center;
    background: rgba(14, 30, 52, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 12px;
}
#screen-career-hub .career-competition-season strong { display: block; color: #ff8557; font: 900 1.9rem/1 var(--font-mono); }
#screen-career-hub .career-competition-season span { color: #cdd9e5; font: 800 .54rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
#screen-career-hub .career-calendar-match { min-height: 152px; transition: transform .16s, box-shadow .16s; }
#screen-career-hub .career-calendar-match:hover { transform: translateY(-3px); box-shadow: 0 7px 16px #1d415321; }
#screen-career-hub .career-calendar-match.current { box-shadow: inset 0 3px 0 #ef541f, 0 7px 16px #ef541f18; }
#screen-career-hub .career-calendar-match.current::after { content: 'AHORA'; color: #d74819; font: 900 .49rem var(--font-mono); letter-spacing: .1em; }

#screen-career-hub .career-player-spotlight {
    display: grid; grid-template-columns: 86px minmax(0, 1fr) auto 118px; gap: 18px; align-items: center;
    min-height: 192px; margin: 2px 0 20px; padding: 22px 24px; overflow: hidden; position: relative;
    color: #fff; border-radius: 13px; background: linear-gradient(112deg, #321f4b, #152743 69%, #10334d); border: 1px solid #4f4a6b;
}
#screen-career-hub .career-player-spotlight::before { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 46%, #ff6c3925 46.3%, transparent 47%); pointer-events: none; }
#screen-career-hub .career-player-portrait,
#screen-career-hub .career-development-avatar {
    display: grid; place-items: center; position: relative; z-index: 1; width: 78px; height: 92px;
    border: 2px solid var(--player-color, #ff7545); border-radius: 10px 10px 28px 28px;
    color: #fff; background: linear-gradient(160deg, var(--player-color, #ff7545)66, #14233a 67%); font-size: 2.8rem;
    box-shadow: 0 10px 20px #050d1a55;
}
#screen-career-hub .career-player-spotlight-copy { position: relative; z-index: 1; min-width: 0; }
#screen-career-hub .career-player-spotlight-copy h3 { margin: 6px 0 4px; color: #fff; font: 900 clamp(1.8rem, 3.2vw, 2.75rem)/.95 var(--font-display); text-transform: uppercase; }
#screen-career-hub .career-player-spotlight-copy p { margin: 0; color: #cfdae5; font-size: .75rem; }
#screen-career-hub .career-player-xp { max-width: 360px; display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 9px; border-top: 1px solid #ffffff2b; color: #aebfd1; font: 800 .52rem var(--font-mono); letter-spacing: .08em; }
#screen-career-hub .career-player-xp b { color: #ff895f; white-space: nowrap; }
#screen-career-hub .career-overall-badge { position: relative; z-index: 1; min-width: 62px; padding: 10px 8px; border: 1px solid #ff855d85; border-radius: 8px; background: #ff6d3024; text-align: center; }
#screen-career-hub .career-overall-badge strong { display: block; color: #ff9a73; font: 900 2rem var(--font-mono); line-height: 1; }
#screen-career-hub .career-overall-badge span { color: #d7e0e7; font: 800 .53rem var(--font-mono); letter-spacing: .1em; }
.career-radar,
#screen-career-hub .career-radar {
    display: none !important;
}

#screen-career-hub .career-team-showcase {
    display: grid; grid-template-columns: 74px minmax(0, 1fr) 184px auto; gap: 18px; align-items: center;
    min-height: 154px; margin: 2px 0 20px; padding: 20px 22px; overflow: hidden; position: relative;
    border-radius: 12px; color: #fff; background: linear-gradient(110deg, #112d43, #1b4154 60%, #2b5d62); border: 1px solid #3d6973;
}
#screen-career-hub .career-team-showcase::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 78% 0, #ffffff16, transparent 35%); pointer-events: none; }
#screen-career-hub .career-team-showcase-crest { position: relative; z-index: 1; width: 70px; height: 76px; border: 0; background: transparent; }
#screen-career-hub .career-team-showcase-crest img { width: 100%; height: 100%; object-fit: contain; }
#screen-career-hub .career-team-showcase h3 { position: relative; z-index: 1; margin: 6px 0 5px; color: #fff; font: 900 1.8rem/1 var(--font-display); text-transform: uppercase; }
#screen-career-hub .career-team-showcase p { position: relative; z-index: 1; margin: 0; color: #c7d9dd; font-size: .75rem; }
#screen-career-hub .career-tactics-board { position: relative; width: 184px; height: 112px; border: 1px solid #a5d2ca66; border-radius: 7px; background: linear-gradient(90deg, transparent 49.5%, #c3e1d866 50% 50.5%, transparent 51%), linear-gradient(0deg, #65a88833 49.5%, #c3e1d866 50% 50.5%, transparent 51%), #33785a; box-shadow: inset 0 0 0 8px #ffffff0c; }
#screen-career-hub .career-tactics-board > span { position: absolute; inset: 23px 0; border-top: 1px solid #c3e1d866; border-bottom: 1px solid #c3e1d866; }
#screen-career-hub .career-tactics-board i { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #ff7047; border: 2px solid #fff; box-shadow: 0 2px 4px #07382788; }
#screen-career-hub .career-tactics-board i:nth-of-type(1) { left: 24px; top: 48px; } #screen-career-hub .career-tactics-board i:nth-of-type(2) { left: 72px; top: 25px; }
#screen-career-hub .career-tactics-board i:nth-of-type(3) { left: 92px; top: 72px; } #screen-career-hub .career-tactics-board i:nth-of-type(4) { right: 24px; top: 48px; }
#screen-career-hub .career-tactics-board b { position: absolute; right: 8px; bottom: 5px; color: #dff2e7; font: 800 .48rem var(--font-mono); }
#screen-career-hub .career-team-honors { position: relative; z-index: 1; align-self: end; text-align: right; }
#screen-career-hub .career-team-honors span { display: block; color: #b4d1d2; font: 800 .49rem var(--font-mono); letter-spacing: .1em; }
#screen-career-hub .career-team-honors strong { color: #ffc76c; font: 900 1.1rem var(--font-mono); letter-spacing: .12em; }

#screen-career-hub .career-agent-hero {
    display: grid; grid-template-columns: 76px minmax(0, 1fr) 150px; gap: 18px; align-items: center;
    margin: 2px 0 20px; padding: 18px 22px; border-radius: 12px; overflow: hidden; position: relative;
    color: #fff; background: linear-gradient(110deg, #132c47, #222452 68%, #362b5c); border: 1px solid #4e5681;
}
#screen-career-hub .career-agent-hero::after { content: 'REP'; position: absolute; right: 15px; top: -20px; color: #ffffff0a; font: 900 7rem var(--font-display); }
#screen-career-hub .career-agent-hero img { width: 70px; height: 76px; object-fit: contain; border-radius: 10px; position: relative; z-index: 1; }
#screen-career-hub .career-agent-hero h3 { position: relative; z-index: 1; margin: 5px 0; color: #fff; font: 900 1.8rem/1 var(--font-display); text-transform: uppercase; }
#screen-career-hub .career-agent-hero p { position: relative; z-index: 1; margin: 0; max-width: 500px; color: #c9d5e2; font-size: .75rem; line-height: 1.45; }
#screen-career-hub .career-agent-trust { position: relative; z-index: 1; }
#screen-career-hub .career-agent-trust span { color: #c0cedd; font: 800 .52rem var(--font-mono); letter-spacing: .1em; }
#screen-career-hub .career-agent-trust strong { display: block; color: #ff9a73; font: 900 1.2rem var(--font-mono); margin: 4px 0 7px; }
#screen-career-hub .career-agent-trust i, #screen-career-hub .career-training-energy i { display: block; height: 6px; border-radius: 99px; background: #ffffff2b; overflow: hidden; }
#screen-career-hub .career-agent-trust i b { display: block; width: 82%; height: 100%; background: #ff744b; }
#screen-career-hub .career-contract-card { border-radius: 10px; transition: transform .16s, box-shadow .16s; }
#screen-career-hub .career-contract-card:hover { transform: translateY(-2px); box-shadow: 0 7px 15px #1d41531b; }

#screen-career-hub .career-development-hero {
    display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; gap: 18px; align-items: center;
    margin: 2px 0 18px; padding: 20px 22px; border-radius: 12px; overflow: hidden; position: relative;
    color: #fff; background: linear-gradient(110deg, #162e4a, #173c4c 68%, #194f4a); border: 1px solid #416f74;
}
#screen-career-hub .career-development-hero::before { content: ''; position: absolute; width: 270px; height: 270px; right: 82px; top: -115px; border: 1px solid #ffffff1b; border-radius: 50%; box-shadow: 0 0 0 32px #ffffff08, 0 0 0 64px #ffffff05; }
#screen-career-hub .career-development-avatar { width: 70px; height: 80px; font-size: 2.2rem; }
#screen-career-hub .career-development-hero > div:nth-child(2) { position: relative; z-index: 1; }
#screen-career-hub .career-development-hero h3 { margin: 5px 0; color: #fff; font: 900 1.8rem/1 var(--font-display); text-transform: uppercase; }
#screen-career-hub .career-development-hero p { margin: 0; color: #c8dadf; font-size: .74rem; }
#screen-career-hub .career-development-overall, #screen-career-hub .career-skillpoints-badge { position: relative; z-index: 1; text-align: center; }
#screen-career-hub .career-development-overall strong, #screen-career-hub .career-skillpoints-badge b { display: block; color: #ff9b73; font: 900 1.65rem var(--font-mono); line-height: 1; }
#screen-career-hub .career-development-overall span, #screen-career-hub .career-skillpoints-badge span { display: block; margin-top: 5px; color: #c7d9dd; font: 800 .49rem var(--font-mono); letter-spacing: .09em; }
#screen-career-hub .career-skillpoints-badge { min-width: 62px; padding: 10px 8px; border: 1px solid #ff9a7366; border-radius: 8px; background: #ff81521c; }
#screen-career-hub .career-development-note { position: relative; margin-bottom: 18px; padding-left: 14px; border-left: 3px solid #ef5b25; color: #5d7181; font-size: .74rem; line-height: 1.55; }
#screen-career-hub .career-attribute-card { position: relative; overflow: hidden; border-radius: 10px; transition: transform .16s, box-shadow .16s; }
#screen-career-hub .career-attribute-card::before { content: ''; position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: linear-gradient(#ff6d3e, #ffa45d); }
#screen-career-hub .career-attribute-card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px #163b5016; }

#screen-career-hub .career-training-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) 160px minmax(170px, .68fr); gap: 20px; align-items: center;
    min-height: 130px; margin: 2px 0 22px; padding: 22px 24px; border-radius: 12px; overflow: hidden; position: relative;
    color: #fff; background: linear-gradient(90deg, #13344aD9, #173b48C9), url('assets/grass_turf.webp') center / cover; border: 1px solid #4a7d79;
}
#screen-career-hub .career-training-hero::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(120deg, #fff0 0 40px, #ffffff08 41px 42px); pointer-events: none; }
#screen-career-hub .career-training-hero > div { position: relative; z-index: 1; }
#screen-career-hub .career-training-hero h3 { margin: 5px 0; color: #fff; font: 900 1.85rem/1 var(--font-display); text-transform: uppercase; }
#screen-career-hub .career-training-hero p { margin: 0; color: #cfdee0; font-size: .74rem; }
#screen-career-hub .career-training-energy span, #screen-career-hub .career-training-coach span { color: #c6d9dd; font: 800 .5rem var(--font-mono); letter-spacing: .09em; }
#screen-career-hub .career-training-energy strong { display: block; margin: 5px 0 7px; color: #ffb071; font: 900 1.25rem var(--font-mono); }
#screen-career-hub .career-training-energy i b { display: block; width: 72%; height: 100%; background: #ff9d55; }
#screen-career-hub .career-training-coach { padding-left: 16px; border-left: 1px solid #ffffff42; color: #ffb071; font-size: 1.35rem; }
#screen-career-hub .career-training-coach span, #screen-career-hub .career-training-coach strong { display: block; }
#screen-career-hub .career-training-coach strong { margin-top: 5px; color: #fff; font-size: .75rem; line-height: 1.3; }
#screen-career-hub .career-training-card { min-height: 194px; display: flex; flex-direction: column; border-radius: 11px; overflow: hidden; position: relative; transition: transform .16s, box-shadow .16s; }
#screen-career-hub .career-training-card::before { content: ''; position: absolute; right: -24px; top: 14px; width: 112px; height: 112px; border: 1px solid currentColor; border-radius: 50%; opacity: .17; box-shadow: 0 0 0 17px currentColor, 0 0 0 34px transparent; }
#screen-career-hub .career-training-card:hover { transform: translateY(-4px); box-shadow: 0 9px 18px #183b5018; }
#screen-career-hub .career-training-card h4, #screen-career-hub .career-training-card p, #screen-career-hub .career-training-card button { position: relative; z-index: 1; }
#screen-career-hub .career-training-card h4 { margin-top: 8px; }
#screen-career-hub .career-training-card p { flex: 1; }
#screen-career-hub .career-training-card button { align-self: flex-start; }
#screen-career-hub .training-toolbar { margin-top: 18px; padding: 14px 16px; border-radius: 9px; background: #f2f7f5; border: 1px solid #d8e7e0; }

#screen-career-hub .career-history-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr); align-items: stretch; min-height: 174px;
    margin: 2px 0 20px; overflow: hidden; border-radius: 12px; color: #fff; background: #121e2c; border: 1px solid #2d4555;
}
#screen-career-hub .career-history-hero > div:first-child { padding: 24px; position: relative; z-index: 1; background: linear-gradient(90deg, #12263a, #12263add 70%, transparent); }
#screen-career-hub .career-history-hero h3 { margin: 7px 0; color: #fff; font: 900 1.85rem/1 var(--font-display); text-transform: uppercase; }
#screen-career-hub .career-history-hero p { max-width: 420px; margin: 0; color: #bdcbd5; font-size: .75rem; line-height: 1.5; }
#screen-career-hub .career-history-trophy-wall { min-height: 246px; position: relative; overflow: hidden; margin-left: -24px; }
#screen-career-hub .career-history-hero > .career-history-art { display: block; width: 100%; height: 100%; min-height: 174px; object-fit: cover; object-position: center 43%; opacity: .86; }
#screen-career-hub .career-history-hall-label { position: absolute; z-index: 4; right: 15px; bottom: 7px; color: #fff; font: 800 .52rem var(--font-mono); letter-spacing: .1em; }

/* The career cabinet mirrors the landing stadium coverflow: one readable
   trophy in focus, neighboring trophies as context, and arrows/dots for a
   deliberate browse instead of a compressed five-column wall. */
#screen-career-hub .career-trophy-carousel {
    position: absolute; inset: 0 0 34px; z-index: 2; display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 212px; overflow: hidden; background: #081624; border: 1px solid rgba(255, 255, 255, .08);
}
#screen-career-hub .career-trophy-coverflow-ambience {
    position: absolute; inset: 0; background-position: center; background-size: cover;
    filter: brightness(.2) blur(24px); transform: scale(1.15); opacity: .9; pointer-events: none; z-index: 0;
    transition: background-image .5s ease;
}
#screen-career-hub .career-trophy-carousel > button {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 40; width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%; color: #fff; background: rgba(8, 22, 36, .76); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
#screen-career-hub .career-trophy-carousel > button::before { content: ''; position: absolute; inset: -6px; }
#screen-career-hub .career-trophy-carousel > button svg { width: 18px; height: 18px; stroke: currentColor; }
#screen-career-hub .career-trophy-arrow.left { left: 8px; }
#screen-career-hub .career-trophy-arrow.right { right: 8px; }
#screen-career-hub .career-trophy-carousel > button:hover,
#screen-career-hub .career-trophy-carousel > button:focus-visible {
    color: #fff; border-color: var(--fuzzbol-orange); background: var(--fuzzbol-orange-fill); transform: translateY(-50%) scale(1.1);
}
#screen-career-hub .career-trophy-viewport {
    position: relative; z-index: 10; width: 100%; height: 210px; display: flex; align-items: center; justify-content: center;
    overflow: hidden; perspective: 900px; -webkit-perspective: 900px; touch-action: pan-y;
}
#screen-career-hub .career-trophy-track { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
#screen-career-hub .career-trophy-card {
    position: absolute; width: 118px; height: 190px; overflow: hidden; padding: 0; border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 12px; color: #fff; background: #111e2c; text-align: left; cursor: pointer; transform-origin: center center;
    transition: transform 420ms cubic-bezier(.25, 1, .5, 1), opacity 420ms cubic-bezier(.25, 1, .5, 1),
        filter 420ms cubic-bezier(.25, 1, .5, 1), border-color 250ms ease, box-shadow 250ms ease;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .6); will-change: transform, opacity, filter;
}
#screen-career-hub .career-trophy-card:hover:not(.active) { border-color: #ff9a78; }
#screen-career-hub .career-trophy-card.active {
    border: 2px solid var(--fuzzbol-orange); box-shadow: 0 16px 36px rgba(0, 0, 0, .8), 0 0 24px rgba(255, 75, 24, .35); cursor: default;
}
#screen-career-hub .career-trophy-card.locked.active { border-color: #899aaa; box-shadow: 0 16px 30px rgba(0, 0, 0, .7), 0 0 15px rgba(160, 180, 195, .16); }
#screen-career-hub .career-trophy-card-media,
#screen-career-hub .career-trophy-card-media img { display: block; width: 100%; height: 100%; }
#screen-career-hub .career-trophy-card-media { background: radial-gradient(circle at 50% 30%, #274964, #0b1c2c 68%); }
#screen-career-hub .career-trophy-card-media img { box-sizing: border-box; padding: 10px 12px 29px; object-fit: contain; opacity: 1; }
#screen-career-hub .career-trophy-card.locked .career-trophy-card-media img { filter: grayscale(1); opacity: .32; }
#screen-career-hub .career-trophy-card-copy {
    position: absolute; right: 0; bottom: 0; left: 0; z-index: 2; display: flex; flex-direction: column; gap: 3px;
    align-items: center; padding: 26px 7px 8px; background: linear-gradient(180deg, transparent, rgba(5, 14, 23, .74) 38%, rgba(5, 14, 23, .97));
    text-align: center; pointer-events: none;
}
#screen-career-hub .career-trophy-card-copy strong,
#screen-career-hub .career-trophy-card-copy small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#screen-career-hub .career-trophy-card-copy strong { color: #fff; font: 900 .62rem/1.1 var(--font-display); letter-spacing: .03em; text-transform: uppercase; text-shadow: 0 2px 8px rgba(0, 0, 0, .9); }
#screen-career-hub .career-trophy-card-copy small { color: #ff8b68; font: 800 .5rem/1 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }
#screen-career-hub .career-trophy-card.locked .career-trophy-card-copy small { color: #aebfcb; }
#screen-career-hub .career-trophy-card-check {
    position: absolute; top: 7px; right: 7px; z-index: 3; width: 20px; height: 20px; display: grid; place-items: center;
    border-radius: 50%; color: #fff; background: var(--fuzzbol-orange-fill); font: 900 .72rem/1 var(--font-body); opacity: 0;
    transform: scale(.6); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); transition: opacity .22s ease, transform .22s ease;
}
#screen-career-hub .career-trophy-card.unlocked.active .career-trophy-card-check { opacity: 1; transform: scale(1); }
#screen-career-hub .career-trophy-page {
    position: absolute; top: 10px; right: 12px; z-index: 4; color: #d7e4ea; font: 800 .52rem var(--font-mono); letter-spacing: .08em;
}
#screen-career-hub .career-trophy-dots {
    position: absolute; right: 0; bottom: 18px; left: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 10px;
}
#screen-career-hub .career-trophy-dot {
    width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #d3d9dd; cursor: pointer;
    transition: all 300ms cubic-bezier(.2, .8, .2, 1);
}
#screen-career-hub .career-trophy-dot.active { width: 22px; border-radius: 9999px; background: var(--fuzzbol-orange-fill); box-shadow: 0 0 10px rgba(255, 75, 24, .5); }
#screen-career-hub .career-trophy-dot:hover:not(.active) { background: #9db1c0; }
#screen-career-hub .career-history-summary { margin-bottom: 22px; }
#screen-career-hub .career-history-card { position: relative; overflow: hidden; border-radius: 9px; }
#screen-career-hub .career-history-card::after { content: '✦'; position: absolute; right: 10px; bottom: -8px; color: #ef5b2526; font-size: 3rem; }
#screen-career-hub .career-achievement { min-height: 102px; transition: transform .16s, box-shadow .16s; }
#screen-career-hub .career-achievement:hover { transform: translateY(-2px); box-shadow: 0 6px 15px #21415512; }
#screen-career-hub .career-achievement-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #e8eef1; }
#screen-career-hub .career-achievement.unlocked .career-achievement-mark { background: #ffedc8; }

@media (max-width: 820px) {
    #screen-career-hub .career-player-spotlight { grid-template-columns: 76px minmax(0, 1fr) auto; }
    #screen-career-hub .career-radar { display: none; }
    #screen-career-hub .career-team-showcase { grid-template-columns: 70px minmax(0, 1fr) auto; }
    #screen-career-hub .career-tactics-board { display: none; }
    #screen-career-hub .career-team-honors { grid-column: 2 / -1; text-align: left; }
    #screen-career-hub .career-training-hero { grid-template-columns: 1fr 145px; }
    #screen-career-hub .career-training-coach { display: none; }
}
@media (max-width: 620px) {
    #screen-career-hub .career-honor-shelf,
    #screen-career-hub .career-history-hero { grid-template-columns: 1fr; }
    #screen-career-hub .career-trophy-wall { min-height: 132px; }
    #screen-career-hub .career-trophy-wall img { min-height: 132px; }
    #screen-career-hub .career-history-trophy-wall { min-height: 270px; }
    #screen-career-hub .career-history-hero > .career-history-art { min-height: 132px; }
    #screen-career-hub .career-competition-banner { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 15px; }
    #screen-career-hub .career-competition-banner img { width: 52px; height: 52px; }
    #screen-career-hub .career-competition-season { grid-column: 1 / -1; justify-self: start; margin-top: 4px; padding: 6px 12px; min-width: auto; }
    #screen-career-hub .career-player-spotlight { grid-template-columns: 62px minmax(0, 1fr); padding: 17px; gap: 12px; }
    #screen-career-hub .career-player-portrait { width: 60px; height: 74px; font-size: 2rem; }
    #screen-career-hub .career-overall-badge { grid-column: 2; justify-self: start; }
    #screen-career-hub .career-team-showcase { grid-template-columns: 62px minmax(0, 1fr); padding: 17px; }
    #screen-career-hub .career-team-showcase-crest { width: 58px; height: 64px; }
    #screen-career-hub .career-team-honors { grid-column: 1 / -1; }
    #screen-career-hub .career-agent-hero { grid-template-columns: 60px minmax(0, 1fr); padding: 15px; }
    #screen-career-hub .career-agent-hero img { width: 56px; height: 62px; }
    #screen-career-hub .career-agent-trust { grid-column: 2; }
    #screen-career-hub .career-development-hero { grid-template-columns: 60px minmax(0, 1fr) auto; padding: 16px; }
    #screen-career-hub .career-development-avatar { width: 56px; height: 66px; font-size: 1.8rem; }
    #screen-career-hub .career-skillpoints-badge { grid-column: 2; justify-self: start; }
    #screen-career-hub .career-training-hero { grid-template-columns: 1fr; min-height: 0; padding: 18px; }
    #screen-career-hub .career-training-energy { max-width: 180px; }
    #screen-career-hub .career-history-hero > div:first-child { padding: 20px 18px 16px; }
    #screen-career-hub .career-history-trophy-wall { margin-left: 0; }
    #screen-career-hub .career-trophy-carousel { min-height: 236px; }
    #screen-career-hub .career-trophy-viewport { height: 234px; }
    #screen-career-hub .career-trophy-card { width: 128px; height: 208px; }
}

/* ==========================================================================
   CAREER ART PASS — generated disc-world scenes and interaction affordances
   ========================================================================== */

#screen-career-hub .career-story-hero { min-height: 292px; padding: 32px 34px; }
#screen-career-hub .career-story-hero > div { width: 59%; }
#screen-career-hub .career-hero-art { width: 78%; opacity: .88; object-position: 66% center; mask-image: linear-gradient(to right, transparent 0%, #000 28%, #000 100%); }
#screen-career-hub .career-story-hero::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, #102d43 0%, #102d43e8 30%, transparent 70%); }
#screen-career-hub .career-story-hero > div, #screen-career-hub .career-hero-wordmark { z-index: 3; }
#screen-career-hub .career-hero-action,
#screen-career-hub .career-spotlight-action {
    appearance: none; border: 1px solid #ff865f88; border-radius: 7px; cursor: pointer; color: #fff;
    background: #ff6a35; font: 800 .63rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase;
    padding: 10px 13px; margin-top: 19px; box-shadow: 0 7px 15px #091b2c35; transition: transform .16s, background .16s, box-shadow .16s;
}
#screen-career-hub .career-hero-action:hover,
#screen-career-hub .career-spotlight-action:hover { transform: translateY(-2px); background: #ff8457; box-shadow: 0 10px 20px #091b2c4d; }
#screen-career-hub .career-hero-action span,
#screen-career-hub .career-spotlight-action span { margin-left: 8px; font-size: .9rem; }
#screen-career-hub .career-honor-shelf { min-height: 244px; }
#screen-career-hub .career-trophy-wall, #screen-career-hub .career-trophy-wall img { min-height: 244px; }
#screen-career-hub .career-honor-copy { padding: 30px; }

#screen-career-hub .career-competition-banner { min-height: 210px; grid-template-columns: 74px minmax(0, 1fr) auto; }
#screen-career-hub .career-competition-banner > *:not(.career-competition-art) { position: relative; z-index: 2; }
#screen-career-hub .career-competition-banner .career-competition-art {
    display: block; position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 58%; opacity: .78; filter: saturate(.95);
}
#screen-career-hub .career-competition-banner::before { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, #122a4ce8 0%, #17254ccc 38%, #171b3c50 72%, #171b3c99); pointer-events: none; }
#screen-career-hub .career-competition-banner > img:not(.career-competition-art) { width: 66px; height: 66px; object-fit: contain; }

#screen-career-hub .career-player-spotlight { min-height: 246px; grid-template-columns: 86px minmax(0, 1fr) auto; }
#screen-career-hub .career-player-spotlight::before { z-index: 1; background: linear-gradient(110deg, #24153fdd, #162746bf 62%, #102e4b99); }
#screen-career-hub .career-player-art,
#screen-career-hub .career-development-art,
#screen-career-hub .career-player-spotlight .career-radar { display: none !important; }
#screen-career-hub .career-player-spotlight > :not(.career-player-art) { position: relative; z-index: 2; }
#screen-career-hub .career-player-spotlight .career-spotlight-action { position: absolute; z-index: 4; right: 27px; bottom: 23px; margin: 0; background: #152944df; }
#screen-career-hub .career-player-spotlight .career-spotlight-action:hover { background: #ff6a35; }

#screen-career-hub .career-team-showcase { min-height: 238px; grid-template-columns: 74px minmax(0, 1fr) 184px auto; }
#screen-career-hub .career-team-showcase > :not(.career-team-showcase-art) { position: relative; z-index: 2; }
#screen-career-hub .career-team-showcase-art,
#screen-career-hub .career-agent-art,
#screen-career-hub .career-development-art,
#screen-career-hub .career-training-art,
#screen-career-hub .career-history-art { display: block; position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#screen-career-hub .career-team-showcase-art { object-position: center 52%; opacity: .76; }
#screen-career-hub .career-team-showcase::after { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, #102d43ef 0%, #133549dd 48%, #173a47a8 75%, #173a4740); pointer-events: none; }

#screen-career-hub .career-agent-hero { min-height: 216px; }
#screen-career-hub .career-agent-hero > :not(.career-agent-art) { position: relative; z-index: 2; }
#screen-career-hub .career-agent-art { object-position: center 60%; opacity: .67; }
#screen-career-hub .career-agent-hero > img.career-agent-art { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover !important; object-position: center 60%; border-radius: 0; z-index: 0; }
#screen-career-hub .career-agent-hero::before { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, #122b48ef 0%, #1d2452dc 48%, #29245982 100%); }

#screen-career-hub .career-development-hero { min-height: 208px; }
#screen-career-hub .career-development-hero > :not(.career-development-art) { position: relative; z-index: 2; }
#screen-career-hub .career-development-art { object-position: 73% center; opacity: .62; }
#screen-career-hub .career-development-hero::after { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, #142e4beb 0%, #173f4bcc 48%, #194d4a67 100%); pointer-events: none; }

#screen-career-hub .career-training-hero { min-height: 228px; }
#screen-career-hub .career-training-hero > :not(.career-training-art) { position: relative; z-index: 2; }
#screen-career-hub .career-training-art { object-position: center 62%; opacity: .62; }
#screen-career-hub .career-training-hero::before { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, #13344af2 0%, #173b48dc 47%, #173b4875 100%); pointer-events: none; }
#screen-career-hub .career-training-card { min-height: 224px; background-image: linear-gradient(110deg, #ffffffef, #ffffffcf); }
#screen-career-hub .career-training-card:hover { background-image: linear-gradient(110deg, #fffaf4, #ffffffda); }

#screen-career-hub .career-history-hero { min-height: 246px; position: relative; }
#screen-career-hub .career-history-hero > :not(.career-history-art) { position: relative; z-index: 2; }
#screen-career-hub .career-history-hero > div:first-child { width: 54%; min-height: 246px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(90deg, #12263af5 0%, #12263add 65%, transparent); }
#screen-career-hub .career-history-art { object-position: center 48%; opacity: .88; }
#screen-career-hub .career-history-hero::after { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, transparent 20%, #12263a36 58%, #12263a08 100%); pointer-events: none; }

@media (max-width: 820px) {
    #screen-career-hub .career-story-hero { min-height: 300px; }
    #screen-career-hub .career-story-hero > div { width: 78%; }
    #screen-career-hub .career-player-art { width: 72%; }
    #screen-career-hub .career-team-showcase { min-height: 230px; }
}
@media (max-width: 620px) {
    #screen-career-hub .career-story-hero { min-height: 330px; padding: 24px 18px; }
    #screen-career-hub .career-story-hero > div { width: 100%; }
    #screen-career-hub .career-hero-art { width: 100%; opacity: .5; mask-image: linear-gradient(to right, transparent, #000 38%); }
    #screen-career-hub .career-honor-shelf { min-height: 0; }
    #screen-career-hub .career-trophy-wall, #screen-career-hub .career-trophy-wall img { min-height: 160px; }
    #screen-career-hub .career-competition-banner { min-height: 260px; }
    #screen-career-hub .career-player-spotlight { min-height: 310px; }
    #screen-career-hub .career-player-spotlight .career-spotlight-action { right: 18px; bottom: 18px; }
    #screen-career-hub .career-team-showcase { min-height: 280px; }
    #screen-career-hub .career-history-hero > div:first-child { width: 100%; min-height: 220px; background: linear-gradient(90deg, #12263af7, #12263abf); }
}

/* ============================================================================
   MENU POLISH — shared header logo + refreshed career setup
   ========================================================================== */

.app-header .js-home-logo,
.home-brand {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.app-header .js-home-logo {
    color: inherit;
    text-align: left;
    background: transparent;
}

.app-header .js-home-logo:focus-visible,
.home-brand:focus-visible {
    outline: 3px solid #ff6e34;
    outline-offset: 3px;
}

/* The top logo uses one locked box on setup, tournaments, settings and
   career screens so the navigation never shifts between tabs. */
body:not(.home-view) .app-header .js-home-logo {
    width: 214px;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0;
}

body:not(.home-view) .app-header .brand-logo-mark {
    width: 54px;
    height: 34px;
    display: block;
    flex: 0 0 54px;
    overflow: hidden;
}

body:not(.home-view) .app-header .brand-logo-mark .brand-logo-img {
    display: block;
    width: 58px;
    height: auto;
    min-height: 0;
    object-fit: contain;
    object-position: center top;
    transform: translate(-2px, -1px);
    clip-path: inset(0 0 20% 0);
}

body:not(.home-view) .app-header .setup-wordmark {
    display: block;
    color: var(--fuzzbol-navy);
    font: 900 1.42rem/1 var(--font-display);
    letter-spacing: .015em;
}

body:has(#screen-career-setup.active) {
    background-color: #edf2f4;
    background-image:
        linear-gradient(90deg, rgba(237, 242, 244, .84), rgba(237, 242, 244, .6) 50%, rgba(237, 242, 244, .82)),
        url('assets/menu_background.webp');
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

body:has(#screen-career-setup.active) #app-container {
    max-width: 1810px;
    padding: 18px 28px 26px;
}

body:has(#screen-career-setup.active) .app-header {
    position: relative;
    min-height: 64px;
    margin-bottom: 24px;
    padding: 8px 20px;
    border-left: 4px solid var(--fuzzbol-orange);
    border-radius: 9px;
    background: rgba(255, 255, 255, .96);
}

#screen-career-setup.active {
    width: 100%;
    max-width: 1660px;
    padding: 0;
    align-items: stretch;
}

#screen-career-setup .career-setup-card {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 142px);
    margin: 0;
    padding: 28px 30px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(410px, .92fr);
    gap: 26px;
    align-items: stretch;
    border-radius: 10px;
    background: rgba(255, 255, 255, .97);
    color: var(--fuzzbol-navy);
    box-shadow: 0 12px 28px rgba(25, 43, 58, .09);
}

#screen-career-setup .career-setup-story,
#screen-career-setup .career-setup-form { min-width: 0; }

#screen-career-setup .career-setup-story {
    display: flex;
    flex-direction: column;
}

#screen-career-setup .career-setup-header {
    padding: 0;
    margin: 0 0 18px;
    border: 0;
}

.career-setup-kicker {
    display: block;
    color: var(--fuzzbol-orange);
    font: 900 .68rem/1.1 var(--font-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}

#screen-career-setup .career-setup-header .card-title {
    margin-top: 6px;
    color: var(--fuzzbol-navy);
    font-size: clamp(2.2rem, 3.4vw, 3.35rem);
    line-height: .92;
}

#screen-career-setup .career-setup-header .form-desc {
    max-width: 660px;
    margin-top: 10px;
    color: var(--fuzzbol-muted);
    font-size: .9rem;
    line-height: 1.55;
}

#screen-career-setup .career-setup-intro {
    flex: 1 1 auto;
    min-height: 340px;
    margin: 0;
    padding: 34px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(100deg, rgba(16, 45, 67, .97) 20%, rgba(16, 45, 67, .58)), url('assets/stadium-photo-monumental.webp') center / cover;
}

#screen-career-setup .career-setup-intro h3 {
    max-width: 620px;
    margin: 12px 0;
    color: #fff;
    font-size: clamp(2.55rem, 4.4vw, 4.4rem);
    line-height: .92;
}

#screen-career-setup .career-setup-intro p {
    max-width: 520px;
    color: #d1e0e9;
    font-size: .9rem;
    line-height: 1.55;
}

#screen-career-setup .career-setup-journey {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid #dfe6e9;
    border-radius: 9px;
    background: #fff;
}

#screen-career-setup .career-setup-journey > div {
    min-width: 0;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 9px;
    align-items: center;
}

#screen-career-setup .career-setup-journey > div + div { border-left: 1px solid #dfe6e9; }
.journey-icon { grid-row: 1 / span 2; color: var(--fuzzbol-orange); font-size: 1.4rem; line-height: 1; }
#screen-career-setup .career-setup-journey strong {
    color: var(--fuzzbol-navy);
    font: 900 .66rem/1.2 var(--font-mono);
    letter-spacing: .03em;
}
#screen-career-setup .career-setup-journey small { color: var(--fuzzbol-muted); font-size: .64rem; line-height: 1.35; }

#screen-career-setup .career-setup-form {
    padding-left: 26px;
    border-left: 1px solid #e0e6e9;
    display: flex;
    flex-direction: column;
}

.career-setup-form-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.career-form-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--fuzzbol-navy);
    font-size: .75rem;
}

.career-setup-form-heading h3 {
    margin-top: 3px;
    color: var(--fuzzbol-navy);
    font: 900 1.55rem/1 var(--font-display);
    text-transform: uppercase;
}

#screen-career-setup .career-setup-fields { gap: 15px; }
#screen-career-setup .career-setup-fields .form-field { gap: 7px; margin: 0; }
#screen-career-setup .career-setup-fields .form-field label { color: var(--fuzzbol-navy); font-size: .7rem; }
#screen-career-setup .career-map-field { grid-column: 1 / -1; gap: 6px; }
#screen-career-setup .career-map-help { margin: 0; color: var(--fuzzbol-muted); font-size: .72rem; line-height: 1.4; }
#screen-career-setup .career-map-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#screen-career-setup .career-map-option {
    min-width: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: left;
    border: 2px solid #d5dfe4;
    border-radius: 9px;
    color: var(--fuzzbol-navy);
    background: #fff;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
#screen-career-setup .career-map-option:hover { border-color: var(--fuzzbol-orange); transform: translateY(-1px); }
#screen-career-setup .career-map-option.active { border-color: var(--fuzzbol-orange); box-shadow: 0 0 0 2px rgba(255, 75, 24, .14), 0 8px 16px rgba(25, 43, 58, .1); }
#screen-career-setup .career-map-option img { width: 100%; height: 66px; display: block; object-fit: cover; object-position: center; }
#screen-career-setup .career-map-option-copy { min-width: 0; padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 3px; }
#screen-career-setup .career-map-option-copy strong { font: 900 .76rem/1.1 var(--font-display); text-transform: uppercase; }
#screen-career-setup .career-map-option-copy small { color: var(--fuzzbol-muted); font: 700 .58rem/1.2 var(--font-mono); letter-spacing: .02em; }
#screen-career-setup .career-map-rules { color: var(--fuzzbol-orange); font: 700 .64rem/1.4 var(--font-mono); }
#screen-career-setup .career-setup-fields .geometric-select {
    min-height: 46px;
    padding: 10px 14px;
    border-color: #cfd9de;
    border-radius: 7px;
    color: var(--fuzzbol-navy);
    background: #fff;
    font-size: .88rem;
}

#screen-career-setup .career-setup-fields input.geometric-select::placeholder { color: #99a7b0; opacity: 1; }
#screen-career-setup #career-emoji-picker { margin: 0; padding: 3px; background: #eef2f4; border-color: #d9e0e4; }
#screen-career-setup #career-emoji-picker .btn-mode { min-height: 37px; color: var(--fuzzbol-muted); }
#screen-career-setup #career-emoji-picker .btn-mode.active { background: var(--fuzzbol-orange-fill); color: #fff; box-shadow: 0 4px 10px rgba(255, 75, 24, .2); }

#screen-career-setup .career-setup-note {
    margin: auto 0 0;
    padding-top: 20px;
    color: var(--fuzzbol-muted);
    font-size: .72rem;
    line-height: 1.55;
}

#screen-career-setup .career-setup-actions {
    gap: 12px;
    margin-top: 16px;
    padding-top: 18px;
    border-top: 1px solid #e0e6e9;
}

#screen-career-setup .career-setup-actions .btn-secondary,
#screen-career-setup .career-setup-actions .btn-primary-start { min-height: 50px; border-radius: 7px; font-size: .82rem; }
#screen-career-setup .career-setup-actions .btn-primary-start { background: var(--fuzzbol-orange-fill); color: #fff; box-shadow: 0 9px 18px rgba(255, 75, 24, .17); }
#screen-career-setup .career-setup-actions .btn-primary-start:hover { background: var(--fuzzbol-orange-fill-hover); }

@media (max-width: 980px) {
    #screen-career-setup .career-setup-card { grid-template-columns: 1fr; min-height: 0; }
    #screen-career-setup .career-setup-form { padding: 24px 0 0; border-top: 1px solid #e0e6e9; border-left: 0; }
}

@media (max-width: 620px) {
    body:has(#screen-career-setup.active) #app-container { padding: 10px 14px 22px; }
    body:has(#screen-career-setup.active) .app-header { margin-bottom: 14px; padding: 8px 12px; }
    body:not(.home-view) .app-header .js-home-logo { width: auto; margin-right: auto; }
    body:not(.home-view) .app-header .setup-wordmark { font-size: 1.22rem; }
    #screen-career-setup .career-setup-card { padding: 20px 16px; gap: 20px; }
    #screen-career-setup .career-setup-intro { min-height: 310px; padding: 24px 20px; }
    #screen-career-setup .career-setup-intro h3 { font-size: 2.55rem; }
    #screen-career-setup .career-setup-journey { grid-template-columns: 1fr; }
    #screen-career-setup .career-setup-journey > div + div { border-top: 1px solid #dfe6e9; border-left: 0; }
    #screen-career-setup .career-setup-actions { flex-direction: column; }
    #screen-career-setup .career-setup-actions .btn-secondary,
    #screen-career-setup .career-setup-actions .btn-primary-start { width: 100%; flex: 1; }
}

@media (max-width: 440px) {
    #screen-career-setup .career-map-picker { grid-template-columns: 1fr; }
}

/* FINAL POLISH: editorial type, quicker career access and disc-first player art */
:root {
    --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

#screen-career-hub .career-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

#screen-career-hub .career-hero-action { margin-top: 0; }

#screen-career-hub .career-player-portrait,
#screen-career-hub .career-development-avatar {
    width: 94px;
    height: 94px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    font-size: 0;
}

#screen-career-hub .career-player-portrait img,
#screen-career-hub .career-development-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 12px rgba(5, 13, 26, .34));
}

#screen-career-hub .career-squad-avatar-slot.has-image .team-avatar-image {
    object-fit: contain;
    padding: 2px;
    filter: drop-shadow(0 6px 8px rgba(5, 13, 26, .22));
}

#screen-career-hub .career-squad-avatar-slot { border-radius: 50%; }
#screen-career-hub .career-squad-avatar-slot.has-image { background: #edf4f7; }

.brand-logo-img,
.profile-shield,
.profile-action-mark { background: transparent !important; }

#screen-career-hub .career-workspace,
#screen-career-hub button,
#screen-career-hub input,
#screen-career-hub select { font-family: var(--font-body); }

#screen-career-hub .career-workspace-header h2,
#screen-career-hub .career-section-heading h3,
#screen-career-hub .career-competition-banner h3,
#screen-career-hub .career-team-showcase h3,
#screen-career-hub .career-agent-hero h3,
#screen-career-hub .career-development-hero h3,
#screen-career-hub .career-training-hero h3,
#screen-career-hub .career-history-hero h3 {
    letter-spacing: .015em;
}

@media (max-width: 620px) {
    #screen-career-hub .career-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    #screen-career-hub .career-hero-action {
        width: 100%;
        justify-content: center;
    }

    #screen-career-hub .career-player-portrait,
    #screen-career-hub .career-development-avatar {
        width: 74px;
        height: 74px;
    }
}

/* SETTINGS REFRESH — modern, hierarchical two-column layout.
   Grouped logically: Gameplay & Controls on the left, System & Diagnostics on the right. */
#screen-settings.active {
    width: 100%;
    max-width: 1200px;
    min-height: 0;
    align-items: stretch;
    padding-bottom: 24px;
}

#screen-settings.active .settings-page-card {
    width: 100%;
    max-width: 1200px;
    min-height: 0;
    margin-top: 0;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-radius: 18px;
    background: #ffffff;
    border: 1.5px solid var(--fuzzbol-line);
    box-shadow: 0 10px 30px rgba(8, 22, 36, 0.05);
}

#screen-settings.active .settings-page-header {
    margin-bottom: 0;
    padding: 0 0 16px;
    border-bottom: 1.5px solid var(--fuzzbol-line);
}

#screen-settings.active .settings-kicker {
    display: inline-block;
    font: 800 0.68rem/1 var(--font-mono);
    letter-spacing: 0.12em;
    color: var(--fuzzbol-orange);
    text-transform: uppercase;
    margin-bottom: 6px;
}

#screen-settings.active .settings-page-header .card-title {
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--fuzzbol-navy);
    line-height: 1.2;
    margin: 0 0 4px;
}

#screen-settings.active .settings-page-header .form-desc {
    font-size: 0.84rem;
    color: var(--fuzzbol-muted);
    margin: 0;
}

/* Two-column responsive layout */
#screen-settings.active .settings-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 20px;
    align-items: start;
    width: 100%;
}

#screen-settings.active .settings-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* Section Cards */
#screen-settings.active .settings-section {
    margin-bottom: 0;
    padding: 18px 20px;
    border: 1.5px solid var(--fuzzbol-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(8, 22, 36, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#screen-settings.active .settings-section:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(8, 22, 36, 0.06);
}

/* Section Head */
#screen-settings.active .settings-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(8, 22, 36, 0.06);
}

#screen-settings.active .settings-section-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--fuzzbol-orange-soft);
    color: var(--fuzzbol-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 75, 24, 0.12);
}

#screen-settings.active .settings-section-head h3 {
    font-family: var(--font-display);
    font-size: 0.96rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--fuzzbol-navy);
    margin: 0;
    line-height: 1.2;
}

#screen-settings.active .settings-section-head p {
    font-size: 0.74rem;
    color: var(--fuzzbol-muted);
    margin: 2px 0 0;
    line-height: 1.35;
}

/* Settings Grid & Rows */
#screen-settings.active .settings-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#screen-settings.active .setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 56px;
    padding: 11px 14px;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 10px;
    background: #f8fafb;
    transition: background 0.15s ease, border-color 0.15s ease;
}

#screen-settings.active .setting-row:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

#screen-settings.active .setting-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

#screen-settings.active .setting-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--fuzzbol-navy);
}

#screen-settings.active .setting-help {
    font-size: 0.72rem;
    color: var(--fuzzbol-muted);
    line-height: 1.35;
}

#screen-settings.active .setting-row select,
#screen-settings.active .geometric-select {
    min-width: 175px;
    max-width: 230px;
    height: 38px;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fuzzbol-navy);
    background-color: #ffffff;
    border: 1.5px solid var(--fuzzbol-line);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#screen-settings.active .setting-row select:hover {
    border-color: var(--fuzzbol-orange);
}

#screen-settings.active .setting-row select:focus-visible {
    outline: 3px solid #ff6e34;
    outline-offset: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .7);
    border-color: var(--fuzzbol-orange);
}

#screen-settings.active .settings-action-btn {
    min-width: 140px;
    height: 36px;
    padding: 0 14px;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 8px;
}

/* Danger Zone */
#screen-settings.active .settings-section-danger {
    background: #fff;
    border-color: rgba(220, 38, 38, 0.25);
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.04);
}

#screen-settings.active .settings-section-danger:hover {
    border-color: rgba(220, 38, 38, 0.4);
}

#screen-settings.active .settings-section-icon-danger {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

#screen-settings.active .setting-row-danger {
    background: rgba(254, 242, 242, 0.5);
    border-color: rgba(220, 38, 38, 0.2);
}

#screen-settings.active .setting-row-danger:hover {
    background: rgba(254, 242, 242, 0.85);
    border-color: rgba(220, 38, 38, 0.35);
}

#screen-settings.active .setting-row-danger .setting-name {
    color: #991b1b;
}

#screen-settings.active .btn-danger-outline {
    min-width: 140px;
    height: 36px;
    padding: 0 14px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #dc2626;
    border: 1.5px solid rgba(220, 38, 38, 0.35);
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#screen-settings.active .btn-danger-outline:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

/* Diagnostics Panel */
#screen-settings.active .settings-diagnostics {
    margin-top: 0;
    padding: 18px 20px;
    border: 1.5px solid var(--fuzzbol-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(8, 22, 36, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#screen-settings.active .settings-diagnostics:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(8, 22, 36, 0.06);
}

#screen-settings.active .diagnostics-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(8, 22, 36, 0.06);
}

#screen-settings.active .settings-section-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--fuzzbol-orange);
    font: 800 0.65rem/1 var(--font-mono);
    letter-spacing: 0.1em;
}

#screen-settings.active .diagnostics-heading h3 {
    font-family: var(--font-display);
    font-size: 0.96rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--fuzzbol-navy);
    margin: 0;
    line-height: 1.2;
}

#screen-settings.active .diagnostics-heading p {
    font-size: 0.72rem;
    color: var(--fuzzbol-muted);
    margin: 2px 0 0;
    line-height: 1.35;
}

#screen-settings.active .diagnostic-release-badge {
    flex-shrink: 0;
    padding: 5px 10px;
    border: 1.5px solid var(--fuzzbol-line);
    border-radius: 20px;
    color: var(--fuzzbol-orange);
    background: var(--fuzzbol-orange-soft);
    font: 800 0.66rem/1 var(--font-mono);
    letter-spacing: 0.06em;
}

#screen-settings.active .diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

#screen-settings.active .diagnostic-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafb;
    border: 1px solid var(--fuzzbol-line);
}

#screen-settings.active .diagnostic-card span {
    font-size: 0.68rem;
    color: var(--fuzzbol-muted);
    font-weight: 600;
}

#screen-settings.active .diagnostic-card strong {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--fuzzbol-navy);
}

#screen-settings.active .diagnostics-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

#screen-settings.active .diagnostics-summary > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid var(--fuzzbol-line);
}

#screen-settings.active .diagnostics-summary span {
    font-size: 0.68rem;
    color: var(--fuzzbol-muted);
    font-weight: 600;
}

#screen-settings.active .diagnostics-summary strong {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--fuzzbol-navy);
}

#screen-settings.active .diagnostics-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#screen-settings.active .diagnostics-actions .btn-secondary {
    width: 100%;
    height: 36px;
    font-size: 0.76rem;
    font-weight: 700;
}

#screen-settings.active .diagnostics-actions span {
    font-size: 0.69rem;
    color: var(--fuzzbol-muted);
    line-height: 1.35;
}

/* Footer / Actions */
#screen-settings.active .settings-footer {
    display: flex;
    justify-content: center;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1.5px solid var(--fuzzbol-line);
}

#screen-settings.active .settings-footer .btn-back-home {
    min-height: 44px;
    min-width: 220px;
    padding: 0 24px;
    font-size: 0.88rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 10px;
    background: #ffffff;
    color: var(--fuzzbol-navy);
    border: 1.5px solid var(--fuzzbol-line);
    box-shadow: 0 2px 6px rgba(8, 22, 36, 0.05);
    transition: all 0.2s ease;
}

#screen-settings.active .settings-footer .btn-back-home:hover {
    background: var(--fuzzbol-orange-fill);
    color: #ffffff;
    border-color: var(--fuzzbol-orange);
    box-shadow: 0 4px 14px rgba(255, 75, 24, 0.3);
    transform: translateY(-1px);
}

/* The logo is a transparent asset; no wrapper should paint a gray disc or
   blend it against the page. Keep the same dimensions across every tab. */
.app-header .js-home-logo,
.app-header .brand-logo-mark,
.app-header .brand-logo-img,
.home-brand,
.home-brand img,
.profile-shield,
.profile-action-mark,
.profile-shield img,
.profile-action-mark img {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    mix-blend-mode: normal !important;
}

.app-header .brand-logo-mark,
.app-header .brand-logo-img {
    border: 0 !important;
}

/* One locked logo box for setup, tournaments, career, LAN and settings. */
body:not(.home-view) .app-header .js-home-logo {
    width: 214px !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 0 !important;
}

body:not(.home-view) .app-header .brand-logo-mark {
    width: 54px !important;
    height: 34px !important;
    flex: 0 0 54px !important;
    overflow: hidden !important;
}

body:not(.home-view) .app-header .brand-logo-mark .brand-logo-img {
    width: 58px !important;
    height: auto !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center top !important;
    transform: translate(-2px, -1px) !important;
    clip-path: inset(0 0 20% 0) !important;
}

@media (max-width: 960px) {
    #screen-settings.active .settings-layout-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #screen-settings.active .diagnostics-grid,
    #screen-settings.active .diagnostics-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    #screen-settings.active .settings-page-card {
        padding: 16px 14px;
        gap: 14px;
    }

    #screen-settings.active .settings-section,
    #screen-settings.active .settings-diagnostics {
        padding: 14px;
    }

    #screen-settings.active .setting-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    #screen-settings.active .setting-row select,
    #screen-settings.active .geometric-select,
    #screen-settings.active .toggle-switch,
    #screen-settings.active .settings-action-btn,
    #screen-settings.active .btn-danger-outline {
        width: 100%;
        max-width: 100%;
    }

    #screen-settings.active .settings-footer .btn-back-home {
        width: 100%;
    }

    #screen-settings.active .diagnostics-grid,
    #screen-settings.active .diagnostics-summary {
        grid-template-columns: 1fr;
    }
}

/* GLOBAL PRE-MATCH NAV — the same route bar stays available on career,
   settings, LAN and tournament screens, not only on the setup screen. */
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .match-nav {
    display: flex !important;
    align-items: stretch;
    align-self: stretch;
    gap: 4px;
    margin-left: 8px;
}

#screen-tournament-setup .competition-mode-grid {
    grid-template-columns: minmax(0, 1fr);
}

/* Let the setup cards end after their real content instead of stretching to
   the viewport height and producing a white dead zone below the CTA. */
#screen-setup.match-setup-screen .match-setup-shell {
    min-height: 0;
    align-items: start;
}

#screen-setup.match-setup-screen .match-setup-shell > .glass-card {
    height: auto;
}

#screen-setup.match-setup-screen .setup-actions {
    margin-top: 18px;
}

@media (max-width: 1120px) {
    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .app-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .match-nav {
        order: 3;
        width: 100%;
        min-height: 33px;
        justify-content: center;
        margin: 0;
        border-top: 1px solid #e7ecee;
    }
}

@media (max-width: 760px) {
    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #app-container {
        padding: 10px 14px 22px;
    }

    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .app-header {
        margin-bottom: 14px;
        padding: 8px 12px;
    }

    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .header-actions {
        gap: 4px;
    }

    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-icon {
        min-width: 38px;
        padding: 7px 9px;
    }

    body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-text {
        display: none;
    }

    .match-nav-item {
        padding-inline: 9px;
        font-size: .62rem;
    }
}

/* ==========================================================================
   CAREER BROADCAST BAR & POST-MATCH SUMMARY
   ========================================================================== */

.career-broadcast-bar {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translate(-50%, calc(100% + 40px));
    max-width: 680px;
    width: min(680px, calc(100% - 28px));
    background: rgba(10, 16, 28, 0.96) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(238, 196, 83, 0.45) !important;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 24px rgba(238, 196, 83, 0.16);
    padding: 11px 18px;
    pointer-events: none;
    z-index: 60;
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    box-sizing: border-box;
    color: #ffffff !important;
}

.career-broadcast-bar.active {
    transform: translate(-50%, 0);
    opacity: 1;
}

.career-broadcast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    font-family: var(--font-mono, monospace);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
}

.career-broadcast-badge {
    color: #facc15 !important;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.career-broadcast-badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
}

.career-broadcast-comp,
#career-broadcast-comp {
    color: #cbd5e1 !important;
    font-weight: 700;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.career-broadcast-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 9px;
}

.career-broadcast-teams {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.career-broadcast-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.career-broadcast-team strong,
#career-broadcast-home-name,
#career-broadcast-away-name {
    color: #ffffff !important;
    font-size: 0.92rem;
    font-weight: 850;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.career-broadcast-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.career-broadcast-logo svg,
.career-broadcast-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.career-broadcast-vs {
    color: #facc15 !important;
    font-family: var(--font-mono, monospace);
    font-weight: 900;
    font-size: 0.72rem;
    padding: 2px 6px;
    background: rgba(250, 204, 21, 0.12);
    border-radius: 4px;
    border: 1px solid rgba(250, 204, 21, 0.25);
    flex-shrink: 0;
}

.career-broadcast-player {
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex-shrink: 0;
    gap: 2px;
}

.career-broadcast-star {
    color: #facc15 !important;
    font-size: 0.62rem;
    font-family: var(--font-mono, monospace);
    font-weight: 900;
    letter-spacing: 0.1em;
}

.career-broadcast-player strong,
#career-broadcast-player-name {
    color: #ffffff !important;
    font-size: 0.86rem;
    font-weight: 850;
    white-space: nowrap;
}

.career-broadcast-player-meta,
#career-broadcast-player-meta {
    color: #cbd5e1 !important;
    font-size: 0.70rem;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    white-space: nowrap;
}

/* Career Post-Match Card */
.career-postmatch-card {
    margin: 14px 0 16px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.045);
    border: 1px solid var(--fuzzbol-line, rgba(19, 40, 60, 0.15));
    border-radius: 8px;
    text-align: left;
}

.career-pm-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.career-pm-rating-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.05);
    border: 2px solid var(--rating-accent, var(--accent-gold));
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.career-pm-rating-num {
    color: var(--fuzzbol-navy, #0f172a);
    font-family: var(--font-mono, monospace);
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1;
}

.career-pm-rating-label {
    color: var(--fuzzbol-muted, #64748b);
    font-family: var(--font-mono, monospace);
    font-size: 0.52rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    margin-top: 3px;
    text-align: center;
    white-space: nowrap;
}

.career-pm-meta {
    min-width: 0;
    flex: 1;
}

.career-pm-player {
    display: block;
    color: var(--fuzzbol-muted, #64748b);
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.career-pm-headline {
    margin: 3px 0 0;
    color: var(--fuzzbol-navy, #0f172a);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.38;
    font-style: italic;
}

.career-pm-progress-wrap {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--fuzzbol-line, rgba(19, 40, 60, 0.12));
}

.career-pm-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    color: var(--fuzzbol-muted, #64748b);
    font-weight: 700;
    margin-bottom: 5px;
}

.career-pm-xp-gained {
    color: #b48312;
    font-weight: 900;
    font-size: 0.74rem;
}

.career-pm-levelup {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-radius: 6px;
    color: #854d0e;
    font-size: 0.74rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.career-pm-levelup span {
    font-weight: 900;
    letter-spacing: 0.06em;
}

.career-pm-levelup strong {
    font-weight: 700;
}

/* Slower, easier fill than the hub's live XP bar — this one is a reveal
   moment, not a constantly-updating readout. */
.career-postmatch-card .xp-bar-fill { transition: width 0.9s cubic-bezier(0.16, 0.84, 0.44, 1); }

#modal-gameover.active .career-pm-levelup {
    animation: careerLevelUpPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 0.6s;
}

@keyframes careerLevelUpPop {
    0% { opacity: 0; transform: scale(0.85) translateY(6px); }
    60% { opacity: 1; transform: scale(1.03) translateY(0); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 600px) {
    .career-broadcast-bar {
        bottom: 12px;
        padding: 8px 12px;
    }
    .career-broadcast-player {
        display: none;
    }
    .career-pm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* --------------------------------------------------------------------------
   MATCH PREVIEW POLISH — full stadium art, stronger CTA, and readable rain
   -------------------------------------------------------------------------- */

@media (min-width: 901px) {
    .match-setup-card .setup-card-body {
        display: flex;
        flex-direction: column;
    }

    .match-setup-card .setup-carousel {
        position: relative;
        display: block;
        min-height: 214px;
        padding: 0;
        overflow: hidden;
        border-radius: 11px;
        background: #102d43;
    }

    .match-setup-card .setup-carousel img {
        display: block;
        width: 100%;
        height: 214px;
        border-radius: 0;
        object-fit: cover;
        object-position: center;
    }

    .match-setup-card .setup-carousel > div {
        position: absolute;
        z-index: 2;
        right: 0;
        bottom: 0;
        left: 0;
        padding: 34px 18px 14px;
        color: #fff;
        background: linear-gradient(180deg, transparent, rgba(6, 20, 34, .9));
    }

    .match-setup-card .setup-carousel strong { color: #fff; font-size: .9rem; }
    .match-setup-card .setup-carousel span { color: rgba(255, 255, 255, .72); font-size: .58rem; }
    .match-setup-card .setup-carousel .setup-stadium-players { color: #ff8b68; }
    .match-setup-card .setup-carousel i { margin-top: 7px; }
    .match-setup-card .setup-carousel i b { background: rgba(255, 255, 255, .38); }
    .match-setup-card .setup-carousel i b:first-child { background: var(--fuzzbol-orange-fill); }
    .match-setup-card .setup-carousel > button {
        position: absolute;
        z-index: 3;
        top: 50%;
        width: 38px;
        height: 38px;
        border: 1px solid rgba(255, 255, 255, .62);
        border-radius: 50%;
        color: #fff;
        background: rgba(6, 22, 36, .55);
        transform: translateY(-50%);
    }
    .match-setup-card .setup-carousel > button:first-child { left: 10px; }
    .match-setup-card .setup-carousel > button:last-child { right: 10px; }
    .match-setup-card .setup-carousel > button:hover { background: var(--fuzzbol-orange-fill); }

    .match-setup-card #home-play-match {
        min-height: 104px;
        margin-top: auto;
        border-radius: 13px;
        font-size: 1.08rem;
        letter-spacing: .04em;
        box-shadow: 0 14px 28px rgba(244, 81, 32, .26);
    }
    .match-setup-card #home-play-match span { font-size: 1.65rem; }
}

/* The tactical map is a real visual panel, not a thumbnail squeezed beside
   copy. The stadium photo above it remains the hero image. */
.match-setup-screen .setup-stadium-mapline {
    grid-template-columns: 1fr;
    gap: 11px;
}
.match-setup-screen .setup-stadium-mapline .setup-stadium-thumb {
    width: 100%;
    height: 118px;
    object-fit: cover;
}

/* Rain in the setup card: dark wet material plus animated diagonal drops. */
.setup-stadium-photo-frame.is-rainy .setup-stadium-photo {
    filter: saturate(.72) brightness(.76) contrast(1.08);
}
.setup-stadium-photo-frame.is-rainy::before {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(18, 49, 69, .08), rgba(3, 22, 35, .3)),
        repeating-linear-gradient(108deg, transparent 0 82px, rgba(219, 241, 255, .19) 83px 84px, transparent 85px 152px);
    background-size: 100% 100%, 152px 118px;
    animation: fuzzbol-setup-rain 1.35s linear infinite;
}
.setup-stadium-photo-frame.is-rainy .stadium-wet-gloss {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(210, 242, 255, .12), transparent 26%, transparent 66%, rgba(105, 187, 218, .1));
    mix-blend-mode: screen;
}

/* Rain in the landing simulation preview. */
.mini-pitch[data-home-weather="rain"] {
    background-image:
        linear-gradient(180deg, rgba(22, 61, 80, .12), rgba(3, 27, 39, .28)),
        linear-gradient(90deg, rgba(24, 96, 37, .07) 0 8%, rgba(255,255,255,.018) 8% 16%, rgba(24,96,37,.07) 16% 24%, rgba(255,255,255,.018) 24% 32%, rgba(24,96,37,.07) 32% 40%, rgba(255,255,255,.018) 40% 48%, rgba(24,96,37,.07) 48% 56%, rgba(255,255,255,.018) 56% 64%, rgba(24,96,37,.07) 64% 72%, rgba(255,255,255,.018) 72% 80%, rgba(24,96,37,.07) 80% 88%, rgba(255,255,255,.018) 88% 96%, rgba(24,96,37,.07) 96% 100%),
        var(--preview-texture, url('assets/texture-classic-checkered.webp'));
    background-size: 100% 100%, 100% 100%, 420px 420px;
}
.mini-pitch[data-home-weather="rain"]::before {
    content: '';
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(22, 62, 83, .04), rgba(4, 25, 38, .12)),
        repeating-linear-gradient(108deg, transparent 0 88px, rgba(218, 242, 255, .17) 89px 90px, transparent 91px 164px);
    background-size: 100% 100%, 164px 126px;
    animation: fuzzbol-preview-rain 1.5s linear infinite;
}
.mini-pitch[data-home-weather="rain"]::after {
    background:
        linear-gradient(116deg, transparent 0 42%, rgba(205, 237, 248, .08) 42.5% 43%, transparent 43.5% 100%),
        radial-gradient(circle at 50% 44%, transparent 0 22%, rgba(20, 64, 79, .08) 55%, rgba(3, 25, 38, .38) 100%);
}
.mini-pitch[data-home-weather="rain"] .pitch-live-badge,
.mini-pitch[data-home-weather="rain"] .pitch-tag,
.mini-pitch[data-home-weather="rain"] .pitch-objective {
    background-color: rgba(7, 33, 45, .88);
}

@keyframes fuzzbol-setup-rain {
    to { background-position: 0 0, 152px 118px; }
}
@keyframes fuzzbol-preview-rain {
    to { background-position: 0 0, 164px 126px; }
}

/* Competition identity stays visible all the way into the match bracket. */
.tourney-bracket-heading > span {
    display: block;
    margin-bottom: 6px;
    color: var(--fuzzbol-orange);
    font: 900 .58rem var(--font-mono);
    letter-spacing: .12em;
}
.tourney-bracket-heading h2 { margin-bottom: 5px; }
.tourney-bracket-heading p {
    margin: 0;
    color: #5c6b77;
    font-size: .72rem;
}
.tourney-round-title {
    margin: 24px 0 0;
    color: var(--fuzzbol-navy);
    font: 900 .86rem var(--font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}
#select-tourney-league:disabled { opacity: .76; cursor: not-allowed; }

@media (max-width: 900px) {
    .competition-mode-grid { grid-template-columns: 1fr; }
    .competition-mode-card { min-height: 72px; }
}

/* Primary actions carry their consequence in the button itself. This makes
   the interface feel more intentional than a row of flat text controls. */
.action-with-info {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    gap: 14px;
    text-align: left;
    box-shadow: 0 9px 18px rgba(19, 40, 60, .13);
}
.action-with-info::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(115deg, rgba(255,255,255,.18), transparent 38% 72%, rgba(255,255,255,.08));
    pointer-events: none;
}
.action-copy {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
}
.action-copy strong {
    display: block;
    color: inherit;
    font: 900 .84rem/1.05 var(--font-body);
    letter-spacing: .02em;
    text-transform: uppercase;
}
.action-copy small {
    display: block;
    overflow: hidden;
    color: rgba(255,255,255,.76);
    font: 700 .59rem/1.2 var(--font-mono);
    letter-spacing: .02em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.action-arrow {
    flex: 0 0 auto;
    color: inherit;
    font: 900 1.35rem/1 var(--font-body);
}
.home-primary-action.action-with-info {
    justify-content: flex-start;
    min-height: 58px;
    padding: 10px 16px;
}
.home-primary-action.action-with-info .action-copy {
    align-items: flex-start;
    font-size: initial;
    line-height: normal;
}
.home-primary-action.action-with-info .action-copy strong { font-size: .86rem; }
.home-primary-action.action-with-info .action-copy small {
    color: rgba(255,255,255,.78);
    font-size: .59rem;
    line-height: 1.2;
    margin: 0;
}
.home-primary-action.action-with-info .action-arrow { font-size: 1.3rem; line-height: 1; }
.home-primary-action.action-with-info:hover { box-shadow: 0 12px 23px rgba(244, 81, 32, .3); }
.btn-primary-start.action-with-info { min-height: 58px; }
.btn-primary-start.action-with-info .action-copy small { color: rgba(255,255,255,.75); }
.btn-primary-start.btn-gold.action-with-info .action-copy small { color: rgba(58,39,5,.68); }
.btn-secondary.action-with-info .action-copy small { color: var(--ink-3); }

@media (max-width: 460px) {
    .competition-title-block .card-title,
    .competition-summary-heading .card-title {
        max-width: 100%;
        overflow-wrap: anywhere;
        font-size: 1.55rem;
    }
    #screen-tournament-setup .competition-field > label,
    #screen-tournament-setup .competition-section-label {
        max-width: 100%;
        overflow-wrap: anywhere;
        letter-spacing: .07em;
    }
    #screen-tournament-setup .competition-select-wrap {
        display: block;
        position: relative;
    }
    #screen-tournament-setup .competition-select-wrap .competition-icon {
        z-index: 2;
        left: 12px;
        pointer-events: none;
    }
    #screen-tournament-setup .competition-select-wrap .geometric-select {
        min-height: 46px;
        padding-left: 46px;
        padding-right: 32px;
        font-size: .7rem;
    }
    #screen-tournament-setup .competition-team-preview {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 8px;
        padding: 9px;
    }
    #screen-tournament-setup .competition-team-preview .team-logo-slot {
        width: 70px;
        height: 82px;
    }
    #screen-tournament-setup .competition-team-copy > strong { font-size: 1rem; }
    .home-primary-action.action-with-info,
    .btn-primary-start.action-with-info { min-height: 54px; }
}

@media (max-width: 900px) {
    .match-setup-card .setup-carousel {
        position: relative;
        display: block;
        min-height: 174px;
        padding: 0;
        overflow: hidden;
        border-radius: 10px;
    }
    .match-setup-card .setup-carousel img { width: 100%; height: 174px; border-radius: 0; }
    .match-setup-card .setup-carousel > div {
        position: absolute;
        z-index: 2;
        right: 0;
        bottom: 0;
        left: 0;
        padding: 28px 14px 12px;
        color: #fff;
        background: linear-gradient(180deg, transparent, rgba(6, 20, 34, .92));
    }
    .match-setup-card .setup-carousel strong { color: #fff; }
    .match-setup-card .setup-carousel span { color: rgba(255, 255, 255, .72); }
    .match-setup-card .setup-carousel .setup-stadium-players { color: #ff8b68; }
    .match-setup-card .setup-carousel > button {
        position: absolute;
        z-index: 3;
        top: 50%;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        color: #fff;
        background: rgba(6, 22, 36, .55);
        transform: translateY(-50%);
    }
    .match-setup-card .setup-carousel > button:first-child { left: 8px; }
    .match-setup-card .setup-carousel > button:last-child { right: 8px; }
    .match-setup-card #home-play-match { min-height: 82px; margin-top: auto; font-size: .98rem; }
}

/* Keep the enlarged CTA in the first viewport on desktop while the stadium
   photo remains full-width. The values scale with the available viewport. */
@media (min-width: 901px) and (min-height: 650px) {
    .home-content {
        grid-template-rows: 82px auto auto;
        align-content: start;
        overflow-y: auto;
    }
    .home-match-grid {
        height: max-content;
        min-height: auto;
        grid-auto-rows: max-content;
        align-items: start;
    }
    .match-preview-card, .match-setup-card { height: auto; }
    .match-preview-card { display: flex; flex-direction: column; }
    .match-preview-card .mini-pitch { height: 360px; min-height: 360px; }
    .match-setup-card .setup-card-body {
        height: auto;
        max-height: none;
        overflow: visible;
        padding: 8px 14px;
    }
    .match-setup-card .setup-label { margin-top: 4px; margin-bottom: 3px; }
    .match-setup-card .setup-option { min-height: 50px; }
    .match-setup-card .setup-option svg { width: 18px; height: 18px; }
    .match-setup-card .setup-carousel,
    .match-setup-card .setup-carousel img {
        min-height: 104px;
        height: 104px;
    }
    .match-setup-card .weather-row { min-height: 48px; }
    .match-setup-card #home-play-match { min-height: 62px; }
    .home-feature-grid { height: auto; min-height: 146px; }
    .match-setup-card .setup-carousel,
    .match-setup-card .setup-carousel img {
        min-height: clamp(100px, 13vh, 112px);
        height: clamp(100px, 13vh, 112px);
    }
    .match-setup-card .weather-row { min-height: clamp(46px, 6vh, 52px); }
    .match-setup-card #home-play-match {
        min-height: clamp(60px, 8vh, 66px);
    }
}

/* ==========================================================================
   HOME PROPORTION PASS — keep the match surface wide and the supporting
   content readable across laptop and desktop widths.
   ========================================================================== */

@media (min-width: 1201px) and (min-height: 650px) {
    .home-sidebar {
        width: 248px;
        flex-basis: 248px;
        padding: 20px 18px 18px;
    }

    .home-brand { height: 108px; }
    .home-brand img {
        width: 178px;
        height: 122px;
        margin-top: -13px;
    }

    .home-nav { margin-top: 20px; gap: 5px; }
    .home-nav-item {
        min-height: 44px;
        gap: 13px;
        padding: 7px 10px 7px 14px;
        font-size: .82rem;
    }
    .home-nav-item svg { width: 20px; height: 20px; flex-basis: 20px; }

    .home-content {
        padding: 0 clamp(24px, 2.3vw, 38px);
        grid-template-rows: 78px auto auto;
        gap: 16px;
    }

    .home-match-grid {
        grid-template-columns: minmax(0, 1fr) 392px;
        gap: 18px;
    }

    .match-preview-card,
    .match-setup-card { border-radius: 16px; }

    .preview-scorebar { height: 56px; }
    .match-preview-card .mini-pitch {
        height: clamp(340px, 39vh, 420px);
        min-height: 0;
    }

    .match-setup-card .setup-card-body { padding: 11px 16px 13px; }
    .match-setup-card .setup-option { min-height: 58px; }
    .match-setup-card .setup-option svg { width: 21px; height: 21px; }

    .home-feature-grid {
        grid-template-columns: minmax(0, .95fr) minmax(0, .95fr) minmax(0, 1.1fr) minmax(0, 1.1fr);
        gap: 16px;
    }
    .feature-card { min-height: 156px; }
    .feature-card h2 { font-size: 1.08rem; }
    .feature-card p { font-size: .7rem; }
    .feature-card button { font-size: .63rem; }
}

/* A fixed side panel becomes the source of the distortion on medium desktop
   widths. Stack the two primary surfaces before the pitch gets squeezed. */
@media (max-width: 1200px) and (min-width: 901px) {
    body.home-view {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    #screen-start.fuzzbol-home.active {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .home-sidebar {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .home-content {
        height: auto;
        min-height: 100vh;
        display: block;
        overflow: visible;
        padding: 0 20px 24px;
    }

    .home-topbar {
        height: auto;
        min-height: 82px;
    }

    .home-match-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 16px;
    }

    .match-setup-card { order: -1; }
    .match-preview-card,
    .match-setup-card { height: auto; }
    .match-preview-card .mini-pitch {
        height: auto;
        min-height: 0;
        aspect-ratio: 2.05 / 1;
    }

    .home-feature-grid {
        height: auto;
        min-height: 0;
        margin-top: 16px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-card { min-height: 164px; }
}

@media (max-width: 900px) {
    .home-feature-grid { margin-top: 16px; }
}

/* === PERIMETER SPONSORS ===
   The canvas boards cannot be clicked, so the brands playing on the perimeter
   are repeated as real links on the pause and full-time cards. Both cards sit
   on dark surfaces, so one restrained treatment serves the two of them. */
.sponsor-strip {
    /* Both hosts — the dark pause card and the light full-time modal — share
       this block, so the neutral tones must read on either background. */
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(128, 140, 155, 0.32);
    text-align: left;
}

.sponsor-strip-title {
    display: block;
    color: var(--fuzzbol-muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    margin-bottom: 10px;
}

.sponsor-strip-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sponsor-link {
    --sponsor-accent: var(--fuzzbol-orange, #ff4b18);
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(128, 140, 155, 0.28);
    border-left: 3px solid var(--sponsor-accent);
    border-radius: var(--radius-sm);
    background: rgba(128, 140, 155, 0.08);
    color: var(--fuzzbol-navy);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.sponsor-link:hover,
.sponsor-link:focus-visible {
    background: var(--fuzzbol-orange-soft, rgba(255, 75, 24, 0.14));
    border-color: var(--sponsor-accent);
    color: var(--fuzzbol-orange);
}

/* Respect the operating system's motion preference across the whole app,
   including the newer broadcast and post-match surfaces. The game simulation
   itself remains playable; only decorative CSS motion is reduced. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* HOME REFERENCE MATCH — direct composition pass for the supplied visual. */

/* Stadium picker (heading, "view all", 3D coverflow, dots). Shared by every
   width: js/app.js renders this markup on phones too. */
.setup-stadium-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.setup-stadium-heading .setup-label { margin-bottom: 0; }
.setup-view-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    color: var(--fuzzbol-navy);
    background: transparent;
    font: 900 .61rem var(--font-mono);
    letter-spacing: .03em;
    cursor: pointer;
    white-space: nowrap;
}
.setup-view-all:hover,
.setup-view-all:focus-visible { color: var(--fuzzbol-orange); }

/* 3D CoverFlow Stadium Carousel */
.match-setup-card .setup-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 172px;
    border-radius: 14px;
    overflow: hidden;
    background: #081624;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
    margin: 4px 0 6px;
    box-sizing: border-box;
}

.stadium-coverflow-ambience {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.22) blur(24px);
    transform: scale(1.15);
    transition: background-image 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.setup-carousel > button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #fff;
    background: rgba(8, 22, 36, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
    padding: 0;
}
.setup-carousel > button::before {
    content: '';
    position: absolute;
    inset: -6px;
}
.setup-carousel > button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.setup-carousel > button[data-home-stadium-step="-1"] {
    left: 8px;
}
.setup-carousel > button[data-home-stadium-step="1"] {
    right: 8px;
}
.setup-carousel > button:hover,
.setup-carousel > button:focus-visible {
    color: #fff;
    border-color: var(--fuzzbol-orange);
    background: var(--fuzzbol-orange-fill);
    transform: translateY(-50%) scale(1.1);
}

.setup-stadium-viewport {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 156px;
    perspective: 900px;
    -webkit-perspective: 900px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.setup-stadium-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.setup-stadium-card {
    position: absolute;
    width: 165px;
    height: 138px;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    background: #111e2c;
    text-align: left;
    cursor: pointer;
    transform-origin: center center;
    transition: transform 420ms cubic-bezier(0.25, 1, 0.5, 1),
                opacity 420ms cubic-bezier(0.25, 1, 0.5, 1),
                filter 420ms cubic-bezier(0.25, 1, 0.5, 1),
                border-color 250ms ease,
                box-shadow 250ms ease;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
    will-change: transform, opacity, filter;
}

.setup-stadium-card:hover:not(.active) {
    border-color: #ff9a78;
}

.setup-stadium-card.active {
    border: 2px solid var(--fuzzbol-orange);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 24px rgba(255, 75, 24, 0.35);
    cursor: default;
}

.setup-stadium-card-media,
.setup-stadium-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.setup-stadium-card-copy {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 24px 8px 8px;
    background: linear-gradient(180deg, transparent 0%, rgba(5, 14, 23, 0.65) 40%, rgba(5, 14, 23, 0.96) 100%);
    text-align: center;
    align-items: center;
    pointer-events: none;
}

.setup-stadium-card-copy strong {
    color: #fff;
    font: 900 0.68rem/1.1 var(--font-display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.setup-stadium-card-copy small {
    color: #ff8b68;
    font: 800 0.52rem/1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.setup-stadium-card-check {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--fuzzbol-orange-fill);
    font: 900 0.72rem/1 var(--font-body);
    opacity: 0;
    transform: scale(0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: opacity .22s ease, transform .22s ease;
    z-index: 15;
}
.setup-stadium-card.active .setup-stadium-card-check {
    opacity: 1;
    transform: scale(1);
}

.setup-stadium-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 14px;
    margin-top: 6px;
}
.setup-stadium-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d3d9dd;
    cursor: pointer;
    transition: all 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.setup-stadium-dot.active {
    width: 22px;
    border-radius: 9999px;
    background: var(--fuzzbol-orange-fill);
    box-shadow: 0 0 10px rgba(255, 75, 24, 0.5);
}
.setup-stadium-dot:hover:not(.active) {
    background: #9db1c0;
    transform: scale(1.2);
}

@media (min-width: 901px) {
    body.home-view {
        min-height: 100vh;
        height: auto;
        overflow-y: auto;
    }

    #screen-start.fuzzbol-home.active {
        min-height: 100vh;
        height: auto;
        overflow: visible;
    }

    .home-sidebar {
        width: 226px;
        flex-basis: 226px;
        min-height: 100vh;
        padding: 20px 16px 24px;
    }

    .home-brand { height: 122px; }
    .home-brand img {
        width: 184px;
        height: 132px;
        margin-top: -12px;
    }

    .home-nav { margin-top: 20px; gap: 5px; }
    .home-nav-item {
        min-height: 49px;
        gap: 15px;
        padding: 8px 12px 8px 14px;
        font-size: .86rem;
    }
    .home-nav-item svg { width: 22px; height: 22px; flex-basis: 22px; }

    .home-content {
        height: auto;
        min-height: 100vh;
        display: block;
        overflow: visible;
        padding: 0 26px 30px;
    }

    .home-topbar {
        min-height: 116px;
        height: auto;
        padding: 23px 0 15px;
        align-items: flex-start;
        gap: 16px;
    }

    .home-welcome h1 {
        margin-top: 4px;
        font-size: clamp(1.55rem, 2.5vw, 2.05rem);
        line-height: .98;
    }
    .home-welcome-subtitle {
        display: block;
        margin-top: 7px;
        color: #5c6b77;
        font: 500 .92rem/1.25 var(--font-body);
    }

    .home-match-grid {
        grid-template-columns: minmax(0, 1.45fr) minmax(420px, 1fr);
        gap: 20px;
        margin-top: 10px;
        align-items: stretch;
    }

    .match-preview-card,
    .match-setup-card { border-radius: 13px; }
    .match-preview-card { display: flex; flex-direction: column; }
    .match-preview-card .mini-pitch {
        height: clamp(390px, 46vh, 480px);
        min-height: 0;
        flex: 1 1 auto;
    }

    .preview-scorebar { height: 61px; }
    .preview-team { padding: 0 18px; font-size: .9rem; }
    .preview-team b { font-size: 1.75rem; }
    .preview-clock { font-size: 1.16rem; }

    .match-setup-card { display: flex; flex-direction: column; }
    .setup-card-header { padding: 13px 16px; font-size: .8rem; }
    .match-setup-card .setup-card-body {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        padding: 13px 16px 13px;
    }

    .match-setup-card .setup-label { margin-top: 12px; margin-bottom: 6px; }
    .match-setup-card .setup-label:first-child { margin-top: 0; }
    .setup-options { gap: 10px; }
    .setup-option {
        min-height: 86px;
        gap: 5px;
        border-radius: 9px;
    }
    .setup-option svg { width: 23px; height: 23px; }
    .setup-option strong { font-size: .76rem; }
    .setup-option span { font-size: .58rem; }
    .team-size-options { gap: 8px; }
    .team-size-options button { min-height: 42px; }

    .match-setup-card .weather-row.weather-compact {
        grid-template-columns: 26px 38px minmax(0, 1fr) 26px;
        gap: 8px;
        min-height: 44px;
        margin-top: 0;
        padding: 0 4px;
    }
    .weather-compact .weather-sun { font-size: 2rem; }
    .weather-compact small,
    .weather-compact i { display: none; }
    .weather-compact strong { font-size: .74rem; }
    .weather-compact > button { font-size: 1.55rem; }

    .match-setup-card #home-play-match {
        min-height: 69px;
        margin-top: auto;
        justify-content: flex-start;
        gap: 17px;
        padding: 0 22px;
        border-radius: 10px;
    }
    .home-primary-action .action-copy { display: grid; gap: 3px; text-align: left; }
    .home-primary-action .action-copy strong { font-size: 1rem; }
    .home-primary-action .action-copy small { color: rgba(255,255,255,.9); font: 700 .58rem var(--font-mono); letter-spacing: .04em; }
    .home-primary-action .action-arrow { order: -1; font-size: 2rem; }

    .home-feature-grid {
        grid-template-columns: minmax(0, .9fr) minmax(0, .9fr) minmax(0, 1.6fr);
        gap: 16px;
        height: auto;
        min-height: 224px;
        margin-top: 18px;
    }
    .feature-card { min-height: 224px; border-radius: 12px; }
    .feature-card > div { width: 72%; padding: 20px 20px 74px; }
    .feature-card .feature-kicker { font-size: .67rem; }
    .feature-card h2 { margin-top: 11px; font-size: 1.22rem; line-height: 1.02; }
    .feature-card p { margin-top: 9px; max-width: 19ch; font-size: .82rem; line-height: 1.35; }
    .feature-card button { left: 20px; bottom: 17px; min-height: 44px; padding: 8px 16px; font-size: .72rem; }
    .feature-card button span { margin-left: 10px; }
    .feature-card:nth-child(1) img { width: 57%; }
    .feature-card:nth-child(2) img { width: 58%; }
    .stadium-feature-card > img { object-position: center; }
    .stadium-feature-card .stadium-feature-copy {
        top: 0;
        bottom: auto;
        width: 58%;
        padding: 21px 18px 76px 20px;
    }
    .stadium-feature-card .feature-kicker { font-size: .65rem; }
    .stadium-feature-card h2 { margin-top: 11px; font-size: 1.43rem; line-height: .98; }
    .stadium-feature-card p { display: none; }
    .stadium-feature-card > button { right: auto; left: 20px; bottom: 17px; }
}

@media (max-width: 1200px) and (min-width: 901px) {
    .home-match-grid { grid-template-columns: 1fr; }
    .match-setup-card { order: -1; }
    .match-preview-card .mini-pitch { height: auto; aspect-ratio: 2.05 / 1; }
    .home-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stadium-feature-card { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .home-welcome-subtitle { display: none; }
    .home-seo-nav { margin-top: 8px; gap: 6px 11px; }
    .home-seo-nav > span { font-size: .47rem; }
    .home-seo-nav a { font-size: .58rem; }
    .match-setup-card .setup-carousel { min-height: 156px; }
    .setup-stadium-viewport { height: 144px; }
    .setup-stadium-card { width: 145px; height: 126px; }
    .home-feature-grid { grid-template-columns: 1fr; }
    .stadium-feature-card { grid-column: auto; }
}

/* ==========================================================================
   HOME ON PHONES — the sidebar folds into a compact header: small logo on
   its own row, then the navigation as a horizontally scrolling chip row.
   ========================================================================== */
@media (max-width: 900px) {
    .home-sidebar {
        position: sticky;
        top: 0;
        z-index: 30;
        padding: max(8px, env(safe-area-inset-top)) 0 0;
        box-shadow: 0 6px 18px rgba(10, 20, 35, .12);
    }
    .home-brand {
        height: 52px;
        padding: 0 14px;
        align-items: center;
        justify-content: flex-start;
    }
    /* The lockup box is what sizes the logo (see .brand-lockup rules below);
       the negative top margin used on desktop would push it off-screen here. */
    html body.home-view .home-brand .brand-lockup {
        width: 78px;
        height: 56px;
        margin-top: 0;
    }
    body.theme-night .home-nav-item,
    body[data-theme="night"] .home-nav-item { border-color: rgba(148, 163, 184, .22); }
    body.theme-night .home-nav-item.active,
    body[data-theme="night"] .home-nav-item.active { border-color: #ff5a25; }
    .home-nav {
        margin: 2px 0 0;
        padding: 6px 14px 10px;
        gap: 6px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 14px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .home-nav::-webkit-scrollbar { display: none; }
    .home-nav-item {
        flex: 0 0 auto;
        width: auto;
        min-height: 40px;
        gap: 8px;
        padding: 8px 14px;
        border: 1px solid rgba(37, 53, 72, .14);
        border-radius: 999px;
        font-size: .68rem;
        letter-spacing: .03em;
        white-space: nowrap;
        scroll-snap-align: start;
    }
    .home-nav-item:hover { transform: none; }
    .home-nav-item.active {
        border-color: #ff4b18;
        background: var(--fuzzbol-orange-fill);
        color: #fff;
    }
    .home-nav-item svg { width: 16px; height: 16px; flex-basis: 16px; }

    .home-topbar {
        min-height: 0;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 12px;
        padding: 14px 0 12px;
    }
    .home-welcome { flex: 1 1 100%; min-width: 0; }
    .home-welcome h1 { font-size: 1.28rem; }
    .home-theme-button,
    .home-account-button { flex: 0 0 auto; margin-left: auto; }

    .setup-card-body { padding: 12px 14px 16px; }
    .setup-stadium-heading { flex-wrap: wrap; gap: 6px 12px; }

    .feature-card button {
        max-width: calc(100% - 28px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 460px) {
    .home-welcome span { font-size: .6rem; }
    .home-welcome h1 { font-size: 1.16rem; }
    .setup-options.mode-options { gap: 6px; }
    .setup-option { padding-left: 4px; padding-right: 4px; }
    .setup-option strong { font-size: .7rem; }
    .setup-option span { font-size: .52rem; }
    .team-size-options button { min-height: 40px; }
    .feature-card > div { width: 66%; }
    .feature-card h2 { font-size: 1rem; }
    .feature-card button { font-size: .66rem; padding: 8px 12px; }
}

/* FUN MODE — make the sandbox feel like a distinct, high-energy playground. */
.fun-mode-entry {
    position: relative;
    min-height: 74px;
    overflow: hidden;
    padding: 11px 13px 11px 10px;
    border-color: rgba(255, 75, 24, .28);
    background:
        radial-gradient(circle at 92% 18%, rgba(255, 173, 24, .34), transparent 28%),
        linear-gradient(112deg, #102b45 0%, #173b59 58%, #ff5a1f 58.2%, #ff7b27 100%);
    box-shadow: 0 8px 18px rgba(21, 48, 71, .14);
    isolation: isolate;
}
.fun-mode-entry::before,
.fun-mode-entry::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 150px;
    height: 1px;
    right: -18px;
    background: rgba(255,255,255,.42);
    transform: rotate(-24deg);
    box-shadow: 0 11px 0 rgba(255,255,255,.22), 0 22px 0 rgba(255,255,255,.12);
}
.fun-mode-entry::before { top: 18px; }
.fun-mode-entry::after { top: 44px; opacity: .55; }
.fun-mode-entry label { position: relative; z-index: 1; min-width: 0; color: #fff; }
.fun-mode-entry input { flex: 0 0 18px; position: relative; z-index: 2; }
.fun-mode-entry-art {
    position: relative;
    z-index: 1;
    width: 47px;
    height: 47px;
    flex: 0 0 47px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 50%;
    background: rgba(7, 22, 36, .48);
    box-shadow: 0 0 0 4px rgba(255,255,255,.08), 0 5px 12px rgba(0,0,0,.2);
}
.fun-mode-entry-art::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed rgba(255, 184, 61, .78);
    border-radius: 50%;
}
.fun-mode-entry-art img { width: 58px; height: 58px; object-fit: contain; transform: rotate(-8deg); }
.fun-mode-entry-copy { display: grid; gap: 2px; min-width: 0; }
.fun-mode-entry-kicker {
    margin: 0;
    color: #ffd38a !important;
    font: 900 .47rem var(--font-mono) !important;
    letter-spacing: .1em;
}
.fun-mode-entry strong { color: #fff; font-size: .84rem; letter-spacing: .08em; }
.fun-mode-entry small:not(.fun-mode-entry-kicker) { overflow: hidden; color: rgba(255,255,255,.76); text-overflow: ellipsis; white-space: nowrap; }
.fun-mode-entry-arrow {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    border: 1px solid rgba(255,255,255,.68);
    border-radius: 50%;
    color: #fff;
    font: 900 1rem/1 var(--font-body);
    transition: transform .18s ease, background .18s ease;
}
.fun-mode-entry:hover .fun-mode-entry-arrow,
.fun-mode-entry.is-active .fun-mode-entry-arrow { transform: rotate(45deg); background: rgba(255,255,255,.15); }
.fun-mode-entry.is-active { box-shadow: 0 0 0 2px rgba(255, 102, 45, .14), 0 10px 22px rgba(21, 48, 71, .2); }
.fun-mode-entry.is-active .fun-mode-entry-art { border-color: #ffd08a; box-shadow: 0 0 0 4px rgba(255, 184, 61, .15), 0 5px 12px rgba(0,0,0,.2); }
.fun-mode-editor {
    position: relative;
    overflow: hidden;
    color: #fff;
    border-color: rgba(255, 112, 49, .55);
    background:
        radial-gradient(circle at 100% 0, rgba(255, 116, 39, .28), transparent 32%),
        linear-gradient(135deg, #0e263d, #183b59);
    box-shadow: 0 10px 24px rgba(20, 48, 72, .16);
}
.fun-mode-editor::after {
    content: '✦  ✧  ✦';
    position: absolute;
    right: 13px;
    bottom: 8px;
    color: rgba(255, 190, 87, .45);
    font: 900 .7rem var(--font-mono);
    letter-spacing: .25em;
}
.fun-mode-editor-head { position: relative; border-bottom-color: rgba(255,255,255,.14); }
.fun-mode-editor-head h2 { color: #fff; }
.fun-mode-editor-head p { color: rgba(255,255,255,.68); }
.fun-mode-editor-head .setup-eyebrow { color: #ffb657; }
.fun-mode-editor-badge {
    position: absolute;
    top: -2px;
    right: 0;
    color: #ffd078;
    font-size: 1.35rem;
    filter: drop-shadow(0 0 8px rgba(255, 166, 49, .55));
}
.fun-mode-editor-head #btn-reset-fun-attributes { position: relative; z-index: 1; margin-top: 27px; color: #fff; border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.08); }
.fun-mode-editor-head #btn-reset-fun-attributes:hover { border-color: #ff9c52; background: rgba(255, 117, 49, .2); }
.fun-attribute { position: relative; z-index: 1; color: rgba(255,255,255,.86); }
.fun-attribute output { color: #112c44; background: #ffb84f; }
.fun-attribute input[type="range"] { accent-color: #ff9b37; }
.fun-mode-presets { position: relative; z-index: 1; margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.14); }
.fun-mode-presets-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.fun-mode-presets-heading > span { color: #ffd078; font: 900 .56rem var(--font-mono); letter-spacing: .1em; }
.fun-mode-presets-heading small { color: rgba(255,255,255,.58); font-size: .58rem; }
.fun-mode-preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.fun-mode-preset { min-width: 0; padding: 8px 7px; text-align: left; color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.06); cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.fun-mode-preset:hover { transform: translateY(-1px); border-color: rgba(255,184,79,.72); background: rgba(255,255,255,.12); }
.fun-mode-preset.active { border-color: #ffb84f; background: linear-gradient(135deg, rgba(255,117,49,.38), rgba(255,184,79,.18)); box-shadow: 0 0 0 1px rgba(255,184,79,.22), 0 5px 12px rgba(0,0,0,.16); }
.fun-mode-preset strong { display: block; overflow: hidden; color: #fff; font: 900 .64rem var(--font-body); text-overflow: ellipsis; white-space: nowrap; }
.fun-mode-preset small { display: block; overflow: hidden; margin-top: 3px; color: rgba(255,255,255,.62); font: 600 .5rem var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.fun-mode-preview { position: relative; z-index: 1; margin-top: 13px; padding: 10px; border: 1px solid rgba(255,184,79,.28); border-radius: 9px; background: rgba(5,18,31,.3); }
.fun-mode-preview > strong { color: #ffd078; font: 900 .56rem var(--font-mono); letter-spacing: .1em; }
.fun-mode-preview-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.fun-mode-preview-grid span { display: grid; gap: 3px; min-width: 0; }
.fun-mode-preview-grid small { overflow: hidden; color: rgba(255,255,255,.55); font: 700 .43rem var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.fun-mode-preview-grid b { color: #fff; font: 900 .7rem var(--font-mono); white-space: nowrap; }

@media (max-width: 620px) {
    .fun-mode-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fun-mode-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fun-mode-preview-grid span:last-child { grid-column: span 2; }
}

/* Explicit sudden-death state after the regular clock expires. */
.hud-extra-time {
    flex: 0 0 100%;
    display: grid;
    gap: 2px;
    min-width: 214px;
    margin-top: 2px;
    padding: 7px 10px 5px;
    border-top: 1px solid rgba(255, 181, 72, .34);
    color: #fff;
    background: linear-gradient(90deg, rgba(255, 89, 30, .22), rgba(255, 181, 72, .08));
}
.hud-extra-time[hidden] { display: none !important; }
.hud-extra-time strong { color: #ffb84f; font: 900 .66rem var(--font-mono); letter-spacing: .1em; }
.hud-extra-time span { color: rgba(255,255,255,.76); font: 600 .56rem/1.25 var(--font-body); }
body.match-view #screen-game.active .hud-extra-time { color: var(--fuzzbol-navy); border-top-color: rgba(255, 75, 24, .2); background: linear-gradient(90deg, rgba(255, 75, 24, .1), rgba(255, 181, 72, .05)); }
.scoreboard-hud[data-extra-time="active"] { border-color: #ff9f48; box-shadow: 0 0 0 2px rgba(255, 159, 72, .16), 0 8px 24px rgba(0,0,0,.3); }
.scoreboard-hud[data-extra-time="active"] .timer-clock { color: #ffb84f; letter-spacing: .08em; }

/* Mobile-safe tournament selects: labels already identify the field, so the
   decorative icons do not need to sit inside the native control. Keeping them
   out of the text box prevents the icon/option collision shown in narrow
   Safari layouts. */
.competition-select-wrap .competition-icon { display: none; }
.competition-select-wrap .geometric-select { padding-left: 12px !important; }

/* Shared action treatment for the game's repeated button patterns. */
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-primary-start,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-secondary,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .setup-team-change,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .career-action-button,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .career-match-action {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 7px 16px rgba(20, 46, 68, .09);
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-primary-start::after,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-secondary::after,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .setup-team-change::after,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .career-action-button::after,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .career-match-action::after {
    content: '';
    position: absolute;
    top: -45%;
    right: -24%;
    width: 48%;
    height: 180%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
    transform: rotate(18deg) translateX(150%);
    transition: transform .42s ease;
}
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-primary-start:hover:not(:disabled),
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-secondary:hover:not(:disabled),
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .setup-team-change:hover:not(:disabled),
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .career-action-button:hover:not(:disabled),
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .career-match-action:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 11px 22px rgba(20, 46, 68, .15);
}
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-primary-start:hover:not(:disabled)::after,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .btn-secondary:hover:not(:disabled)::after,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .setup-team-change:hover:not(:disabled)::after,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .career-action-button:hover:not(:disabled)::after,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) .career-match-action:hover:not(:disabled)::after {
    transform: rotate(18deg) translateX(-260%);
}
.match-setup-screen .team-step {
    width: 32px;
    height: 32px;
    position: relative;
    display: grid;
    place-items: center;
    border: 1px solid #d8e1e5;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(20, 46, 68, .08);
}
.match-setup-screen .team-step::before {
    content: '';
    position: absolute;
    inset: -6px;
}
.match-setup-screen .team-step:hover { border-color: var(--fuzzbol-orange); background: var(--fuzzbol-orange-soft); }

/* ============================================================================
   ACTIVE MATCH OVERLAYS + COMPACT SETUP — final visual pass
   ============================================================================ */

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-overlay {
    background: rgba(7, 20, 34, .62);
    backdrop-filter: blur(18px) saturate(1.12);
}

body.match-view #screen-game.active .pause-card {
    position: relative;
    width: min(520px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 28px));
    overflow: hidden;
    padding: 30px 28px 24px;
    border-radius: 22px;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-card {
    border: 1px solid rgba(255, 75, 24, .28);
    background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
    box-shadow: 0 30px 90px rgba(5, 18, 30, .36), 0 0 0 1px rgba(255, 255, 255, .52) inset;
}

body.match-view #screen-game.active .pause-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 7px;
    background: linear-gradient(90deg, var(--fuzzbol-orange-fill), #ffad42 52%, var(--fuzzbol-navy));
}

body.match-view #screen-game.active .pause-card::after {
    content: 'Ⅱ';
    position: absolute;
    top: 18px;
    right: 25px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 75, 24, .18);
    border-radius: 14px;
    color: var(--fuzzbol-orange);
    background: var(--fuzzbol-orange-soft);
    font: 900 1rem/1 var(--font-display);
}

body.match-view #screen-game.active .pause-card .pause-kicker {
    margin-bottom: 8px;
    color: var(--fuzzbol-orange);
    font: 900 .67rem/1 var(--font-mono);
    letter-spacing: .18em;
}

body.match-view #screen-game.active .pause-card h2 {
    max-width: calc(100% - 56px);
    margin: 0;
    font: 900 clamp(2rem, 4vw, 2.75rem)/.94 var(--font-display);
    letter-spacing: .01em;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-card h2 {
    color: var(--fuzzbol-navy);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-card > p {
    margin: 11px 0 20px;
    color: #647988;
    font-size: .82rem;
    line-height: 1.45;
}

body.match-view #screen-game.active .pause-actions {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

body.match-view #screen-game.active .pause-actions button {
    min-height: 54px;
    border-radius: 12px;
    font: 900 .78rem/1.1 var(--font-body);
    letter-spacing: .04em;
}

body.match-view #screen-game.active .pause-actions .btn-primary-start.btn-gold {
    background: linear-gradient(135deg, var(--fuzzbol-orange-fill), var(--fuzzbol-orange-fill-hover));
    box-shadow: 0 10px 20px rgba(255, 75, 24, .24);
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-actions .btn-secondary {
    border-color: #d9e3e7;
    color: #536978;
    background: #fff;
}

body.match-view #screen-game.active .pause-settings {
    margin: 0;
    padding: 14px;
    border-radius: 16px;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-settings {
    border: 1px solid #e1e9ec;
    background: #f1f5f6;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-settings-kicker {
    margin: 0 0 9px 2px;
    color: #5c6b77;
    font: 900 .62rem/1 var(--font-mono);
    letter-spacing: .16em;
}

body.match-view #screen-game.active .pause-settings .setting-row {
    min-height: 56px;
    margin-top: 7px;
    padding: 10px 12px;
    border-radius: 11px;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-settings .setting-row {
    border: 1px solid #e1e8eb;
    background: #fff;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-settings .setting-name {
    color: var(--fuzzbol-navy);
    font-size: .75rem;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-settings .setting-help {
    margin-top: 3px;
    color: #5c6b77;
    font-size: .59rem;
}

body.match-view #screen-game.active .pause-fullscreen-btn {
    width: 100%;
    min-height: 43px;
    margin-top: 9px;
    border-radius: 10px;
}

body:not([data-theme="night"]):not(.theme-night).match-view #screen-game.active .pause-fullscreen-btn {
    color: var(--fuzzbol-navy);
    background: #fff;
}

@media (max-width: 520px) {
    body.match-view #screen-game.active .pause-card { padding: 27px 16px 16px; }
    body.match-view #screen-game.active .pause-actions { grid-template-columns: 1fr; }
    body.match-view #screen-game.active .pause-actions button { min-height: 48px; }
}

/* Keep the primary setup action in the first viewport on laptop-sized screens.
   Phones retain normal document scrolling below this breakpoint. */
@media (min-width: 761px) and (max-height: 900px) {
    body:has(#screen-setup.active),
    body:has(#screen-tournament-setup.active) {
        overflow: hidden;
    }

    body:has(#screen-setup.active) #app-container,
    body:has(#screen-tournament-setup.active) #app-container {
        box-sizing: border-box;
        height: 100vh;
        min-height: 0;
        overflow: hidden;
        padding: 8px 18px 10px;
    }

    body:has(#screen-setup.active) .app-header,
    body:has(#screen-tournament-setup.active) .app-header {
        flex-wrap: nowrap !important;
        min-height: 52px;
        margin-bottom: 8px;
        padding: 4px 12px;
        gap: 8px;
    }

    body:has(#screen-setup.active) .logo,
    body:has(#screen-tournament-setup.active) .logo {
        width: 190px;
        min-height: 42px;
        gap: 6px;
    }

    body:has(#screen-setup.active) .match-nav,
    body:has(#screen-tournament-setup.active) .match-nav {
        order: initial !important;
        width: auto !important;
        min-height: 0 !important;
        margin-left: auto !important;
        border-top: 0 !important;
        gap: 0;
    }

    body:has(#screen-setup.active) .match-nav-item,
    body:has(#screen-tournament-setup.active) .match-nav-item {
        min-height: 0;
        padding: 0 8px;
        font-size: .6rem;
    }

    body:has(#screen-setup.active) .header-actions,
    body:has(#screen-tournament-setup.active) .header-actions { gap: 5px; }

    body:has(#screen-setup.active) .btn-icon,
    body:has(#screen-tournament-setup.active) .btn-icon {
        min-height: 32px;
        padding: 5px 8px;
        font-size: .62rem;
    }

    body:has(#screen-setup.active) .match-setup-shell,
    body:has(#screen-tournament-setup.active) .competition-setup-shell {
        height: calc(100vh - 78px);
        min-height: 0;
    }

    body:has(#screen-setup.active) .match-setup-shell > .glass-card,
    body:has(#screen-tournament-setup.active) .competition-setup-shell > .glass-card {
        height: 100%;
        overflow: hidden;
        padding: 14px 16px 12px;
    }

    body:has(#screen-setup.active) .setup-title-block { margin-bottom: 8px; }
    body:has(#screen-setup.active) .setup-title-block .card-title,
    body:has(#screen-tournament-setup.active) .competition-title-block .card-title,
    body:has(#screen-tournament-setup.active) .competition-summary-heading .card-title {
        font-size: clamp(1.72rem, 2.5vw, 2.05rem);
    }

    body:has(#screen-setup.active) .setup-eyebrow { margin-top: 2px; font-size: .68rem; }
    body:has(#screen-setup.active) .setup-format-control { margin-bottom: 10px; }
    body:has(#screen-setup.active) .setup-format-control .btn-mode { min-height: 32px; padding: 5px 0; }
    body:has(#screen-setup.active) .team-duel-grid { margin-bottom: 9px; }
    body:has(#screen-setup.active) .setup-team-picker { min-height: 78px; }
    body:has(#screen-setup.active) .setup-team-card .team-logo-slot { width: 58px; height: 66px; }
    body:has(#screen-setup.active) .setup-team-name { font-size: .82rem; }
    body:has(#screen-setup.active) .setup-team-country { margin-top: 2px; font-size: .55rem; }
    body:has(#screen-setup.active) .setup-team-stars { margin-top: 3px; font-size: .8rem; }
    body:has(#screen-setup.active) .setup-team-stats { margin: 4px 7px 5px; padding: 4px; font-size: .5rem; }
    body:has(#screen-setup.active) .setup-team-change { min-height: 28px; margin: 4px auto; }
    body:has(#screen-setup.active) .setup-select-grid { gap: 8px; }
    body:has(#screen-setup.active) .setup-field-block > label { margin-bottom: 4px; }
    body:has(#screen-setup.active) .setup-stadium-photo-frame { aspect-ratio: 2.15 / 1; }
    body:has(#screen-setup.active) .setup-stadium-mapline { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; padding: 8px; }
    body:has(#screen-setup.active) .setup-stadium-mapline .setup-stadium-thumb { width: 76px; height: 46px; }
    body:has(#screen-setup.active) .setup-stadium-mapline p { display: none; }
    body:has(#screen-setup.active) .setup-stadium-tags { margin-top: 4px; gap: 4px; }
    body:has(#screen-setup.active) .setup-stadium-tags span { padding: 3px 5px; font-size: .48rem; }
    body:has(#screen-setup.active) .setup-actions { padding-top: 8px; }
    body:has(#screen-setup.active) .setup-actions .btn-secondary,
    body:has(#screen-setup.active) .setup-actions .btn-primary-start { min-height: 42px; }

    body:has(#screen-tournament-setup.active) .competition-title-block { padding-bottom: 8px; margin-bottom: 10px; }
    body:has(#screen-tournament-setup.active) .competition-title-block .form-desc { display: none; }
    body:has(#screen-tournament-setup.active) .competition-section-block { margin-bottom: 7px; }
    body:has(#screen-tournament-setup.active) .competition-section-label,
    body:has(#screen-tournament-setup.active) .competition-field > label { margin-bottom: 5px; }
    body:has(#screen-tournament-setup.active) .competition-mode-grid { gap: 6px; }
    body:has(#screen-tournament-setup.active) .competition-mode-card {
        min-height: 49px;
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 6px;
        padding: 5px 7px;
    }
    body:has(#screen-tournament-setup.active) .competition-mode-icon,
    body:has(#screen-tournament-setup.active) .competition-mode-icon svg { width: 23px; height: 23px; }
    body:has(#screen-tournament-setup.active) .competition-mode-card > span:last-child { gap: 2px; }
    body:has(#screen-tournament-setup.active) .competition-mode-card strong { font-size: .62rem; }
    body:has(#screen-tournament-setup.active) .competition-mode-card small { font-size: .52rem; }
    body:has(#screen-tournament-setup.active) .tournament-league-field { margin-bottom: 8px; }
    body:has(#screen-tournament-setup.active) .competition-team-field { margin-bottom: 6px; }
    body:has(#screen-tournament-setup.active) .competition-field .geometric-select { min-height: 34px; padding-block: 6px; }
    body:has(#screen-tournament-setup.active) .competition-team-preview {
        min-height: 78px;
        margin-bottom: 6px;
        padding: 5px 7px;
        grid-template-columns: 58px minmax(0, 1fr) minmax(100px, .8fr);
        gap: 7px;
    }
    body:has(#screen-tournament-setup.active) .competition-team-preview .team-logo-slot { width: 54px; height: 60px; }
    body:has(#screen-tournament-setup.active) .competition-team-copy > strong { font-size: .9rem; }
    body:has(#screen-tournament-setup.active) .competition-team-copy > span:not(.competition-team-stars) { margin-top: 2px; font-size: .58rem; }
    body:has(#screen-tournament-setup.active) .competition-team-stars { margin-top: 2px; font-size: .72rem; }
    body:has(#screen-tournament-setup.active) .competition-team-copy > small { display: none; }
    body:has(#screen-tournament-setup.active) .competition-team-stats { gap: 2px; }
    body:has(#screen-tournament-setup.active) .competition-team-stats small { font-size: .48rem; }
    body:has(#screen-tournament-setup.active) .competition-team-stats b { font-size: 1rem; }
    body:has(#screen-tournament-setup.active) .competition-ai-field { margin-bottom: 0; }
    body:has(#screen-tournament-setup.active) .competition-actions { padding-top: 5px; }
    body:has(#screen-tournament-setup.active) .competition-actions button { min-height: 40px; }
    body:has(#screen-tournament-setup.active) .competition-bracket-preview { min-height: 0; padding: 6px 9px 8px; }
    body:has(#screen-tournament-setup.active) .bracket-grid { min-height: 0; height: 100%; gap: 14px; }
    body:has(#screen-tournament-setup.active) .bracket-team { min-height: 34px; padding: 3px 5px; }
    body:has(#screen-tournament-setup.active) .bracket-semis { padding: 42px 0 55px; }
    body:has(#screen-tournament-setup.active) .competition-summary-meta { margin-top: 8px; }
    body:has(#screen-tournament-setup.active) .competition-summary-meta > div { padding: 6px 5px; }
    body:has(#screen-tournament-setup.active) .competition-banner-image-only,
    body:has(#screen-tournament-setup.active) .competition-banner-image-only img { min-height: 72px; height: 72px; }
}

/* ==========================================================================
   NIGHT MODE (Dark Theme) Universal Support
   Applies dark stadium broadcast theme across the entire application:
   Home, Settings, Career Hub (all panels, tables, cards, dialogs),
   Tournament, LAN, Modals, Inputs, HUD, and Canvas.
   ========================================================================== */

:root[data-theme="night"],
body[data-theme="night"],
body.theme-night {
    --fuzzbol-navy: #f0f6fc;
    --fuzzbol-navy-deep: #050c16;
    --fuzzbol-page: #08101c;
    --fuzzbol-panel: #0d1a2d;
    --fuzzbol-line: rgba(255, 255, 255, 0.1);
    --fuzzbol-muted: #8b9bb4;
    /* On navy the bright orange already clears 4.8:1 as text. */
    --fuzzbol-orange: #ff4b18;
    --fuzzbol-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
    --fuzzbol-orange-soft: rgba(255, 75, 24, 0.18);

    --screen-page: #08101c;
    --screen-panel: #0d1a2d;
    --screen-line: rgba(255, 255, 255, 0.1);
    --screen-accent: var(--fuzzbol-orange);

    --navy-1: #050c16;
    --navy-2: #091524;
    --navy-3: #0e1e33;
    --navy-4: #142842;
    --ground: #060d17;
    --edge: rgba(255, 255, 255, 0.12);
    --edge-strong: rgba(255, 255, 255, 0.28);

    --ink-1: #f0f6fc;
    --ink-2: #c9d1d9;
    --ink-3: #8b949e;

    --silver-1: #f0f6fc;
    --silver-2: #8b9bb4;
}

/* ==========================================================================
   BASE BODY & SCREEN CONTAINERS IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"],
body.theme-night {
    background-color: #08101c !important;
    background-image:
        radial-gradient(ellipse 900px 500px at 15% -10%, rgba(255, 75, 24, 0.07), transparent 55%),
        radial-gradient(ellipse 800px 500px at 85% 0%, rgba(14, 165, 233, 0.08), transparent 55%) !important;
    color: var(--ink-1) !important;
}

body[data-theme="night"]:not(.home-view):not(.match-view),
body.theme-night:not(.home-view):not(.match-view) {
    background-color: #08101c !important;
    color: var(--ink-1) !important;
}

body:has(#screen-setup.active)[data-theme="night"],
body:has(#screen-setup.active).theme-night,
body:has(#screen-tournament-setup.active)[data-theme="night"],
body:has(#screen-tournament-setup.active).theme-night,
body:has(#screen-career-setup.active)[data-theme="night"],
body:has(#screen-career-setup.active).theme-night,
body:has(#screen-tournament-bracket.active)[data-theme="night"],
body:has(#screen-tournament-bracket.active).theme-night,
body:has(#screen-league.active)[data-theme="night"],
body:has(#screen-league.active).theme-night,
body:has(#screen-online.active)[data-theme="night"],
body:has(#screen-online.active).theme-night {
    background-color: #08101c !important;
    background-image:
        linear-gradient(90deg, rgba(8, 16, 28, 0.94), rgba(8, 16, 28, 0.82) 50%, rgba(8, 16, 28, 0.94)),
        url('assets/menu_background.webp') !important;
    background-attachment: fixed !important;
}

/* ==========================================================================
   GLOBAL APP HEADER IN NIGHT MODE (All Non-Home Screens)
   ========================================================================== */

body[data-theme="night"] .app-header,
body.theme-night .app-header,
body:not(.home-view):not(.match-view)[data-theme="night"] .app-header,
body:has(#screen-setup.active)[data-theme="night"] .app-header,
body:has(#screen-tournament-setup.active)[data-theme="night"] .app-header,
body:has(#screen-career-setup.active)[data-theme="night"] .app-header {
    background: rgba(11, 22, 38, 0.96) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: 4px solid var(--fuzzbol-orange) !important;
    color: var(--ink-1) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45) !important;
}

body[data-theme="night"] .setup-wordmark,
body.theme-night .setup-wordmark {
    color: #f0f6fc !important;
}

body[data-theme="night"] .match-nav-item,
body.theme-night .match-nav-item {
    color: #94a3b8 !important;
}

body[data-theme="night"] .match-nav-item:hover,
body.theme-night .match-nav-item:hover {
    color: #ff5a25 !important;
}

body[data-theme="night"] .match-nav-item.active,
body.theme-night .match-nav-item.active {
    color: #ff5a25 !important;
}

body[data-theme="night"] .btn-icon,
body.theme-night .btn-icon,
body:not(.home-view):not(.match-view)[data-theme="night"] .btn-icon,
body:has(#screen-setup.active)[data-theme="night"] .btn-icon,
body[data-theme="night"] #btn-theme-toggle,
body[data-theme="night"] #btn-sound-toggle,
body[data-theme="night"] #btn-fullscreen {
    background: #112238 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .btn-icon:hover,
body.theme-night .btn-icon:hover,
body:not(.home-view):not(.match-view)[data-theme="night"] .btn-icon:hover,
body:has(#screen-setup.active)[data-theme="night"] .btn-icon:hover,
body[data-theme="night"] #btn-theme-toggle:hover,
body[data-theme="night"] #btn-sound-toggle:hover,
body[data-theme="night"] #btn-fullscreen:hover {
    background: rgba(255, 75, 24, 0.22) !important;
    border-color: rgba(255, 75, 24, 0.5) !important;
    color: #fff !important;
}

/* ==========================================================================
   1. LANDING PAGE (HOME VIEW) IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] #screen-start.fuzzbol-home.active,
body.theme-night #screen-start.fuzzbol-home.active {
    background: #08101c !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .home-sidebar,
body.theme-night .home-sidebar {
    background: #0b1626 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .home-brand,
body.theme-night .home-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .home-brand img,
body.theme-night .home-brand img {
    mix-blend-mode: normal !important;
    filter: drop-shadow(0 0 12px rgba(255, 75, 24, 0.38)) !important;
}

/* ==========================================================================
   SHARED FUZZBOL WORDMARK
   ========================================================================== */

/* Both menu locations use the same complete logo asset. In night mode the
   second copy is clipped to the asset's wordmark and recolored white, while
   the orange symbol remains untouched. */
.brand-lockup {
    position: relative;
    display: block;
    width: 208px;
    height: 142px;
    flex: 0 0 auto;
    overflow: hidden;
}

.brand-lockup .brand-logo-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
    clip-path: none !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    pointer-events: none;
}

.brand-logo-night-wordmark {
    display: none !important;
}

body.home-view .home-brand .brand-lockup {
    width: clamp(102px, 15vw, 208px);
    height: auto;
    aspect-ratio: 512 / 367;
    margin-top: -17px;
}

body:not(.home-view) .app-header .js-home-logo {
    width: 124px !important;
    min-height: 70px !important;
    justify-content: flex-start;
}

body:not(.home-view) .app-header .brand-lockup {
    width: 108px;
    height: 77px;
}

body[data-theme="night"] .brand-logo-night-wordmark,
body.theme-night .brand-logo-night-wordmark {
    display: block !important;
    filter: brightness(0) invert(1) !important;
    clip-path: inset(76% 0 0 0) !important;
}

/* The legacy home-image rule has higher specificity and also carries an
   important orange glow, so override it explicitly for the white wordmark. */
body[data-theme="night"] .home-brand .brand-logo-night-wordmark,
body.theme-night .home-brand .brand-logo-night-wordmark {
    filter: brightness(0) invert(1) !important;
}

@media (min-width: 1201px) {
    body.home-view .home-brand .brand-lockup {
        width: 178px;
        height: 128px;
        margin-top: -13px;
    }
}

@media (max-width: 640px) {
    body.home-view .home-brand .brand-lockup {
        width: 102px;
        height: 73px;
        margin-top: -10px;
    }

    body:not(.home-view) .app-header .js-home-logo {
        width: 108px !important;
        min-height: 64px !important;
    }

    body:not(.home-view) .app-header .brand-lockup {
        width: 94px;
        height: 67px;
    }
}

body[data-theme="night"] .home-nav-item,
body.theme-night .home-nav-item {
    color: #94a3b8 !important;
    background: transparent !important;
}

body[data-theme="night"] .home-nav-item svg,
body.theme-night .home-nav-item svg {
    stroke: currentColor !important;
}

body[data-theme="night"] .home-nav-item:hover,
body.theme-night .home-nav-item:hover {
    color: #ff5a25 !important;
    background: rgba(255, 75, 24, 0.12) !important;
}

body[data-theme="night"] .home-nav-item.active,
body.theme-night .home-nav-item.active {
    color: #ff5a25 !important;
    background: rgba(255, 75, 24, 0.18) !important;
}

body[data-theme="night"] .home-nav-item.active::before,
body.theme-night .home-nav-item.active::before {
    background: var(--fuzzbol-orange-fill) !important;
}

body[data-theme="night"] .sidebar-profile,
body.theme-night .sidebar-profile {
    background: #0f2035 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] .sidebar-profile strong,
body.theme-night .sidebar-profile strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .sidebar-profile span,
body.theme-night .sidebar-profile span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .sidebar-profile span b,
body.theme-night .sidebar-profile span b {
    color: #f0f6fc !important;
}

body[data-theme="night"] .home-content,
body.theme-night .home-content {
    background: #08101c !important;
}

body[data-theme="night"] .home-topbar,
body.theme-night .home-topbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .home-welcome span,
body.theme-night .home-welcome span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .home-welcome h1,
body.theme-night .home-welcome h1 {
    color: #f0f6fc !important;
}

body[data-theme="night"] .home-seo-nav > span,
body.theme-night .home-seo-nav > span { color: #71849c !important; }

body[data-theme="night"] .home-seo-nav a,
body.theme-night .home-seo-nav a { color: #b8c7d8 !important; }

body[data-theme="night"] .home-seo-nav a:hover,
body[data-theme="night"] .home-seo-nav a:focus-visible,
body.theme-night .home-seo-nav a:hover,
body.theme-night .home-seo-nav a:focus-visible { color: #ff7545 !important; }

body[data-theme="night"] .header-action,
body[data-theme="night"] .profile-action,
body.theme-night .header-action,
body.theme-night .profile-action {
    color: #94a3b8 !important;
}

body[data-theme="night"] .header-action:hover,
body[data-theme="night"] .profile-action:hover,
body.theme-night .header-action:hover,
body.theme-night .profile-action:hover {
    color: #f0f6fc !important;
}

body[data-theme="night"] .action-divider,
body.theme-night .action-divider {
    background: rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] .match-preview-card,
body[data-theme="night"] .match-setup-card,
body.theme-night .match-preview-card,
body.theme-night .match-setup-card {
    background: #0c1828 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
}

body[data-theme="night"] .setup-card-header,
body.theme-night .setup-card-header {
    background: #112338 !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .setup-label,
body.theme-night .setup-label {
    color: #94a3b8 !important;
}

body[data-theme="night"] .setup-option,
body.theme-night .setup-option {
    background: #0f2035 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .setup-option strong,
body.theme-night .setup-option strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .setup-option span,
body.theme-night .setup-option span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .setup-option:hover,
body.theme-night .setup-option:hover {
    border-color: #ff5a25 !important;
    background: #152b45 !important;
}

body[data-theme="night"] .setup-option.active,
body.theme-night .setup-option.active {
    border-color: #ff4b18 !important;
    color: #ff5a25 !important;
    background: rgba(255, 75, 24, 0.16) !important;
    box-shadow: inset 0 0 0 1px #ff4b18, 0 0 16px rgba(255, 75, 24, 0.25) !important;
}

body[data-theme="night"] .team-size-options button,
body.theme-night .team-size-options button {
    background: #0f2035 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .team-size-options button:hover,
body.theme-night .team-size-options button:hover {
    background: #152b45 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

body[data-theme="night"] .team-size-options button.active,
body.theme-night .team-size-options button.active {
    background: var(--fuzzbol-orange-fill) !important;
    color: #fff !important;
    border-color: #ff4b18 !important;
}

body[data-theme="night"] .setup-carousel strong,
body[data-theme="night"] .weather-row strong,
body.theme-night .setup-carousel strong,
body.theme-night .weather-row strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .setup-carousel span,
body[data-theme="night"] .weather-row small,
body.theme-night .setup-carousel span,
body.theme-night .weather-row small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .setup-carousel > button,
body[data-theme="night"] .weather-row > button,
body.theme-night .setup-carousel > button,
body.theme-night .weather-row > button {
    color: #f0f6fc !important;
}

body[data-theme="night"] .setup-live-readout,
body.theme-night .setup-live-readout {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .setup-live-readout > div,
body.theme-night .setup-live-readout > div {
    background: #091422 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .setup-live-readout small,
body.theme-night .setup-live-readout small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .setup-live-readout strong,
body.theme-night .setup-live-readout strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .fun-mode-entry,
body.theme-night .fun-mode-entry {
    background: linear-gradient(135deg, rgba(255, 75, 24, 0.12), #0f2035) !important;
    border: 1px solid rgba(255, 75, 24, 0.3) !important;
}

body[data-theme="night"] .fun-mode-entry strong,
body.theme-night .fun-mode-entry strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .fun-mode-entry small,
body.theme-night .fun-mode-entry small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .home-feature-grid .feature-card,
body.theme-night .home-feature-grid .feature-card {
    background: #0c1828 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35) !important;
}

body[data-theme="night"] .feature-card .feature-kicker,
body.theme-night .feature-card .feature-kicker {
    color: #ff4b18 !important;
}

body[data-theme="night"] .feature-card h2,
body.theme-night .feature-card h2 {
    color: #f0f6fc !important;
}

body[data-theme="night"] .feature-card p,
body.theme-night .feature-card p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .feature-card button,
body.theme-night .feature-card button {
    background: rgba(15, 32, 53, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .feature-card button:hover,
body.theme-night .feature-card button:hover {
    background: var(--fuzzbol-orange-fill) !important;
    color: #fff !important;
    border-color: #ff4b18 !important;
}

/* Night Pitch Floodlights in Home Mini-Pitch */
body[data-theme="night"] .mini-pitch::before,
body.theme-night .mini-pitch::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.22) 0%, transparent 45%),
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.22) 0%, transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 90% 90%, rgba(255, 255, 255, 0.18) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(14, 165, 233, 0.08) 0%, rgba(5, 12, 22, 0.45) 80%);
}

/* ==========================================================================
   2. SETTINGS SCREEN (#screen-settings) IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] #screen-settings.active .settings-page-card,
body.theme-night #screen-settings.active .settings-page-card {
    background: #0d1a2d !important;
    border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

body[data-theme="night"] #screen-settings.active .settings-page-header,
body.theme-night #screen-settings.active .settings-page-header {
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-settings.active .settings-page-header .card-title,
body.theme-night #screen-settings.active .settings-page-header .card-title {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-settings.active .settings-page-header .form-desc,
body.theme-night #screen-settings.active .settings-page-header .form-desc {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-settings.active .settings-section,
body.theme-night #screen-settings.active .settings-section {
    background: #102137 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

body[data-theme="night"] #screen-settings.active .settings-section:hover,
body.theme-night #screen-settings.active .settings-section:hover {
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

body[data-theme="night"] #screen-settings.active .settings-section-head h3,
body.theme-night #screen-settings.active .settings-section-head h3 {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-settings.active .settings-section-head p,
body.theme-night #screen-settings.active .settings-section-head p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-settings.active .setting-row,
body.theme-night #screen-settings.active .setting-row {
    background: #0c1727 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] #screen-settings.active .setting-name,
body.theme-night #screen-settings.active .setting-name {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-settings.active .setting-help,
body.theme-night #screen-settings.active .setting-help {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-settings.active .setting-row select,
body[data-theme="night"] #screen-settings.active .geometric-select,
body.theme-night #screen-settings.active .setting-row select,
body.theme-night #screen-settings.active .geometric-select {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

body[data-theme="night"] #screen-settings.active .settings-action-btn,
body[data-theme="night"] #screen-settings.active .btn-secondary,
body.theme-night #screen-settings.active .settings-action-btn,
body.theme-night #screen-settings.active .btn-secondary {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

body[data-theme="night"] #screen-settings.active .settings-action-btn:hover,
body[data-theme="night"] #screen-settings.active .btn-secondary:hover,
body.theme-night #screen-settings.active .settings-action-btn:hover,
body.theme-night #screen-settings.active .btn-secondary:hover {
    background: #1c3558 !important;
    color: #fff !important;
    border-color: rgba(255, 75, 24, 0.4) !important;
}

body[data-theme="night"] #screen-settings.active .diagnostic-card,
body.theme-night #screen-settings.active .diagnostic-card {
    background: #0c1727 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-settings.active .diagnostic-card strong,
body.theme-night #screen-settings.active .diagnostic-card strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-settings.active .diagnostic-card span,
body.theme-night #screen-settings.active .diagnostic-card span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-settings.active .diagnostics-heading h3,
body.theme-night #screen-settings.active .diagnostics-heading h3 {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-settings.active .diagnostics-heading p,
body.theme-night #screen-settings.active .diagnostics-heading p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-settings.active .diagnostics-summary > div,
body.theme-night #screen-settings.active .diagnostics-summary > div {
    background: #0c1727 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] #screen-settings.active .diagnostics-summary strong,
body.theme-night #screen-settings.active .diagnostics-summary strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-settings.active .diagnostics-summary span,
body.theme-night #screen-settings.active .diagnostics-summary span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-settings.active .settings-section-danger,
body.theme-night #screen-settings.active .settings-section-danger {
    background: rgba(185, 28, 28, 0.14) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
}

body[data-theme="night"] #screen-settings.active .setting-row-danger,
body.theme-night #screen-settings.active .setting-row-danger {
    background: rgba(185, 28, 28, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
}

body[data-theme="night"] #screen-settings.active .btn-danger-outline,
body.theme-night #screen-settings.active .btn-danger-outline {
    border-color: rgba(239, 68, 68, 0.6) !important;
    color: #f87171 !important;
    background: transparent !important;
}

body[data-theme="night"] #screen-settings.active .btn-danger-outline:hover,
body.theme-night #screen-settings.active .btn-danger-outline:hover {
    background: #ef4444 !important;
    color: #fff !important;
}

/* ==========================================================================
   3. MATCH SETUP SCREEN (#screen-setup) IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] .match-setup-shell > .glass-card,
body.theme-night .match-setup-shell > .glass-card {
    background: #0d1a2d !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

body[data-theme="night"] .setup-title-block .card-title,
body[data-theme="night"] .stadium-title-block .card-title,
body.theme-night .setup-title-block .card-title,
body.theme-night .stadium-title-block .card-title {
    color: #f0f6fc !important;
}

body[data-theme="night"] .setup-title-block .form-desc,
body[data-theme="night"] .stadium-title-block .form-desc,
body.theme-night .setup-title-block .form-desc,
body.theme-night .stadium-title-block .form-desc {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .setup-format-control .btn-mode,
body.theme-night .setup-format-control .btn-mode {
    background: #112238 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .setup-format-control .btn-mode.active,
body.theme-night .setup-format-control .btn-mode.active {
    background: var(--fuzzbol-orange-fill) !important;
    color: #fff !important;
    border-color: #ff4b18 !important;
}

body[data-theme="night"] .setup-team-card,
body.theme-night .setup-team-card {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .team-card-copy strong,
body.theme-night .team-card-copy strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .team-card-copy span,
body.theme-night .team-card-copy span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .team-stats-preview b,
body.theme-night .team-stats-preview b {
    color: #f0f6fc !important;
}

body[data-theme="night"] .team-stats-preview small,
body.theme-night .team-stats-preview small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .btn-change-team,
body.theme-night .btn-change-team {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

body[data-theme="night"] .btn-change-team:hover,
body.theme-night .btn-change-team:hover {
    background: #1c3558 !important;
    border-color: rgba(255, 75, 24, 0.4) !important;
    color: #fff !important;
}

body[data-theme="night"] #screen-setup .geometric-select,
body.theme-night #screen-setup .geometric-select {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

body[data-theme="night"] .setup-actions .btn-secondary,
body.theme-night .setup-actions .btn-secondary {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

body[data-theme="night"] .setup-actions .btn-secondary:hover,
body.theme-night .setup-actions .btn-secondary:hover {
    background: #1c3558 !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

body[data-theme="night"] .stadium-chip-card,
body.theme-night .stadium-chip-card {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] .stadium-chip-copy strong,
body.theme-night .stadium-chip-copy strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .stadium-chip-copy span,
body.theme-night .stadium-chip-copy span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .team-carousel-btn,
body.theme-night .team-carousel-btn {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
}

/* ==========================================================================
   4. TOURNAMENT SETUP SCREEN (#screen-tournament-setup) IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] .competition-setup-shell > .glass-card,
body.theme-night .competition-setup-shell > .glass-card {
    background: #0d1a2d !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

body[data-theme="night"] .competition-title-block .card-title,
body[data-theme="night"] .competition-summary-heading .card-title,
body.theme-night .competition-title-block .card-title,
body.theme-night .competition-summary-heading .card-title {
    color: #f0f6fc !important;
}

body[data-theme="night"] .competition-title-block .form-desc,
body.theme-night .competition-title-block .form-desc {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .competition-mode-card,
body.theme-night .competition-mode-card {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .competition-mode-card strong,
body.theme-night .competition-mode-card strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .competition-mode-card small,
body.theme-night .competition-mode-card small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .competition-mode-card.active,
body.theme-night .competition-mode-card.active {
    border-color: #ff4b18 !important;
    background: rgba(255, 75, 24, 0.16) !important;
    box-shadow: inset 0 0 0 1px #ff4b18 !important;
}

body[data-theme="night"] .competition-team-preview,
body.theme-night .competition-team-preview {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] .competition-team-copy strong,
body.theme-night .competition-team-copy strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .competition-team-copy span,
body.theme-night .competition-team-copy span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .competition-team-stats b,
body.theme-night .competition-team-stats b {
    color: #f0f6fc !important;
}

body[data-theme="night"] .bracket-team,
body.theme-night .bracket-team {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .competition-bracket-preview,
body.theme-night .competition-bracket-preview {
    background: #091422 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .competition-summary-meta > div,
body.theme-night .competition-summary-meta > div {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .competition-summary-meta small,
body.theme-night .competition-summary-meta small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .competition-summary-meta strong,
body.theme-night .competition-summary-meta strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .competition-actions .btn-secondary,
body.theme-night .competition-actions .btn-secondary {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

body[data-theme="night"] .competition-actions .btn-secondary:hover,
body.theme-night .competition-actions .btn-secondary:hover {
    background: #1c3558 !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* ==========================================================================
   5. CAREER SETUP SCREEN (#screen-career-setup) IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] #screen-career-setup .career-setup-card,
body.theme-night #screen-career-setup .career-setup-card {
    background: #0d1a2d !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-header .card-title,
body.theme-night #screen-career-setup .career-setup-header .card-title {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-header .form-desc,
body.theme-night #screen-career-setup .career-setup-header .form-desc {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-section-heading h4,
body.theme-night #screen-career-setup .career-setup-section-heading h4 {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-field label,
body.theme-night #screen-career-setup .career-setup-field label {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-setup input[type="text"],
body[data-theme="night"] #screen-career-setup select,
body[data-theme="night"] #screen-career-setup .geometric-select,
body.theme-night #screen-career-setup input[type="text"],
body.theme-night #screen-career-setup select,
body.theme-night #screen-career-setup .geometric-select {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

body[data-theme="night"] #screen-career-setup input[type="text"]::placeholder,
body.theme-night #screen-career-setup input[type="text"]::placeholder {
    color: #64748b !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-journey > div,
body.theme-night #screen-career-setup .career-setup-journey > div {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-journey strong,
body.theme-night #screen-career-setup .career-setup-journey strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-journey small,
body.theme-night #screen-career-setup .career-setup-journey small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-setup .career-map-help,
body.theme-night #screen-career-setup .career-map-help,
body[data-theme="night"] #screen-career-setup .career-map-option-copy small,
body.theme-night #screen-career-setup .career-map-option-copy small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-setup .career-map-option,
body.theme-night #screen-career-setup .career-map-option {
    background: #142842 !important;
    color: #f0f6fc !important;
    border-color: rgba(255, 255, 255, .16) !important;
}

body[data-theme="night"] #screen-career-setup .career-map-option.active,
body.theme-night #screen-career-setup .career-map-option.active {
    border-color: #ff4b18 !important;
    box-shadow: 0 0 0 2px rgba(255, 75, 24, .22), 0 8px 18px rgba(0, 0, 0, .3) !important;
}

body[data-theme="night"] #screen-career-setup .career-emoji-btn,
body.theme-night #screen-career-setup .career-emoji-btn {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-setup .career-emoji-btn.active,
body.theme-night #screen-career-setup .career-emoji-btn.active {
    border-color: #ff4b18 !important;
    background: rgba(255, 75, 24, 0.22) !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-fineprint,
body.theme-night #screen-career-setup .career-setup-fineprint {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-setup .btn-secondary,
body.theme-night #screen-career-setup .btn-secondary {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

/* ==========================================================================
   6. ONLINE / LAN HUB SCREEN (#screen-online) IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] #screen-online .glass-card,
body[data-theme="night"] #screen-online .online-shell,
body[data-theme="night"] #screen-online .lan-shell,
body.theme-night #screen-online .glass-card,
body.theme-night #screen-online .online-shell,
body.theme-night #screen-online .lan-shell {
    background: #0d1a2d !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

body[data-theme="night"] #screen-online .room-list-empty,
body[data-theme="night"] #screen-online .online-room-list-empty,
body[data-theme="night"] #screen-online .open-rooms-list,
body.theme-night #screen-online .room-list-empty,
body.theme-night #screen-online .online-room-list-empty,
body.theme-night #screen-online .open-rooms-list {
    background: #0c1727 !important;
    border: 1px dashed rgba(255, 255, 255, 0.12) !important;
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-online .online-queue-chip,
body.theme-night #screen-online .online-queue-chip {
    background: #0c1727 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #dbe6f5 !important;
}

body[data-theme="night"] #screen-online .online-queue-chip.is-current,
body.theme-night #screen-online .online-queue-chip.is-current {
    border-color: var(--emerald) !important;
    background: rgba(16, 185, 129, 0.18) !important;
}

body[data-theme="night"] #screen-online .online-advanced > summary:hover,
body.theme-night #screen-online .online-advanced > summary:hover {
    color: #dbe6f5 !important;
}

body[data-theme="night"] #screen-online input[type="text"],
body[data-theme="night"] #screen-online select,
body[data-theme="night"] #screen-online .geometric-select,
body.theme-night #screen-online input[type="text"],
body.theme-night #screen-online select,
body.theme-night #screen-online .geometric-select {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

body[data-theme="night"] #screen-online .card-title,
body.theme-night #screen-online .card-title {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-online .form-desc,
body.theme-night #screen-online .form-desc {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-online .btn-secondary,
body.theme-night #screen-online .btn-secondary {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

body[data-theme="night"] #screen-online .online-lobby-card,
body.theme-night #screen-online .online-lobby-card,
body[data-theme="night"] #screen-online .online-live-room,
body.theme-night #screen-online .online-live-room,
body[data-theme="night"] #screen-online .online-join-code,
body.theme-night #screen-online .online-join-code {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, .12) !important;
}

body[data-theme="night"] #screen-online .online-lobby-card-primary,
body.theme-night #screen-online .online-lobby-card-primary {
    background: linear-gradient(135deg, rgba(255, 75, 24, .16), #102137 62%) !important;
    border-color: rgba(255, 75, 24, .5) !important;
}

body[data-theme="night"] #screen-online .online-setup-block,
body.theme-night #screen-online .online-setup-block {
    background: #0c1727 !important;
    border-color: rgba(255, 255, 255, .1) !important;
}

body[data-theme="night"] #screen-online .online-card-kicker,
body.theme-night #screen-online .online-card-kicker,
body[data-theme="night"] #screen-online .online-step,
body.theme-night #screen-online .online-step {
    color: #ff8a68 !important;
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-online .online-lobby-card,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-online .online-live-room,
body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-online .online-join-code {
    background: #fff;
    border-color: var(--fuzzbol-line);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-online .online-lobby-card-primary {
    background: linear-gradient(135deg, rgba(255, 75, 24, .08), #fff 64%);
    border-color: rgba(255, 75, 24, .32);
}

body:not([data-theme="night"]):not(.theme-night):not(.home-view):not(.match-view) #screen-online .online-setup-block {
    background: #f8fafb;
    border-color: var(--fuzzbol-line);
}

@media (max-width: 760px) {
    .online-lobby-header { flex-direction: column; gap: 12px; }
    .online-status-text { align-self: stretch; text-align: left; }
    .online-lobby-layout,
    .online-setup-grid { grid-template-columns: 1fr; }
    .online-lobby-card-primary,
    .online-room-actions { grid-column: auto; }
    .online-room-actions { flex-direction: column; }
    .online-room-actions .btn-primary-start { width: 100%; }
}

/* ==========================================================================
   7. TOURNAMENT BRACKET & LEAGUE SCREENS IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] .tournament-bracket-card,
body[data-theme="night"] .league-table-card,
body[data-theme="night"] .career-table-wrap,
body[data-theme="night"] #screen-career-hub .career-table-wrap,
body.theme-night .tournament-bracket-card,
body.theme-night .league-table-card,
body.theme-night .career-table-wrap,
body.theme-night #screen-career-hub .career-table-wrap {
    background: #0d1a2d !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .league-table th,
body.theme-night .league-table th {
    background: #091524 !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] .league-table td,
body.theme-night .league-table td {
    background: transparent !important;
    color: #f0f6fc !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

body[data-theme="night"] .league-table tr:hover td,
body.theme-night .league-table tr:hover td {
    background: rgba(255, 255, 255, 0.04) !important;
}

body[data-theme="night"] .career-club-row td,
body.theme-night .career-club-row td {
    background: rgba(255, 75, 24, 0.14) !important;
}

/* ==========================================================================
   8. MODALS IN NIGHT MODE (#modal-gameover, #modal-account, #modal-sync-conflict)
   ========================================================================== */

body[data-theme="night"] .modal-overlay,
body.theme-night .modal-overlay {
    background: rgba(3, 7, 14, 0.82) !important;
    backdrop-filter: blur(8px) !important;
}

body[data-theme="night"] .modal-card,
body[data-theme="night"] #modal-gameover .modal-card,
body[data-theme="night"] #modal-account .modal-card,
body[data-theme="night"] #modal-sync-conflict .modal-card,
body.theme-night .modal-card,
body.theme-night #modal-gameover .modal-card,
body.theme-night #modal-account .modal-card,
body.theme-night #modal-sync-conflict .modal-card {
    background: #0d1a2d !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f0f6fc !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7) !important;
}

body[data-theme="night"] #modal-gameover .btn-secondary,
body[data-theme="night"] #btn-gameover-home,
body.theme-night #modal-gameover .btn-secondary,
body.theme-night #btn-gameover-home {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

body[data-theme="night"] #modal-gameover .btn-secondary:hover,
body[data-theme="night"] #btn-gameover-home:hover,
body.theme-night #modal-gameover .btn-secondary:hover,
body.theme-night #btn-gameover-home:hover {
    background: #1c3558 !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

body[data-theme="night"] #modal-gameover .match-stats-table td,
body.theme-night #modal-gameover .match-stats-table td {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #modal-gameover .match-stats-table td:first-child,
body.theme-night #modal-gameover .match-stats-table td:first-child {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .career-pm-levelup,
body.theme-night .career-pm-levelup {
    background: rgba(234, 179, 8, 0.16) !important;
    border-color: rgba(234, 179, 8, 0.45) !important;
    color: #facc15 !important;
}

body[data-theme="night"] #modal-account .account-tab,
body.theme-night #modal-account .account-tab {
    color: #8b9bb4 !important;
    background: transparent !important;
}

body[data-theme="night"] #modal-account .account-tab.active,
body.theme-night #modal-account .account-tab.active {
    color: #f0f6fc !important;
    background: #142842 !important;
}

body[data-theme="night"] #modal-account input,
body.theme-night #modal-account input {
    background: #102137 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

body[data-theme="night"] #modal-account .account-link,
body.theme-night #modal-account .account-link {
    color: #38bdf8 !important;
}

body[data-theme="night"] #modal-account .account-fineprint,
body.theme-night #modal-account .account-fineprint {
    color: #8b9bb4 !important;
}

/* ==========================================================================
   9. DUAL POSSESSION BAR IN GAME OVER MODAL
   ========================================================================== */

.match-possession-bar-wrap {
    margin: 14px 0;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--fuzzbol-line);
    border-radius: var(--radius-md);
}

.possession-bar-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--ink-2);
}

.possession-side {
    display: flex;
    align-items: center;
    gap: 8px;
}

.possession-side.red {
    color: #ff5252;
}

.possession-side.blue {
    color: #4a95ec;
}

.possession-bar-mid-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--fuzzbol-muted);
    text-transform: uppercase;
}

.possession-pct {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.95rem;
}

.possession-bar-track {
    width: 100%;
    height: 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.possession-bar-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.possession-bar-fill.red {
    background: linear-gradient(90deg, #d32f2f, #ff5252);
}

.possession-bar-fill.blue {
    background: linear-gradient(90deg, #1976d2, #42a5f5);
}

/* ==========================================================================
   10. CAREER STATS ANALYTICS (CENTRO DE RENDIMIENTO)
   ========================================================================== */

.career-stats-analytics-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fuzzbol-line);
}

.career-stats-analytics-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink-1);
    margin-top: 2px;
}

.career-stats-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--fuzzbol-orange);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.career-stats-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.career-tab-btn {
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--fuzzbol-line);
    background: transparent;
    color: var(--fuzzbol-muted);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.career-tab-btn:hover {
    color: var(--ink-1);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.career-tab-btn.active {
    background: var(--fuzzbol-orange-fill);
    color: #fff;
    border-color: var(--fuzzbol-orange);
    box-shadow: 0 2px 8px rgba(255, 75, 24, 0.35);
}

.career-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.career-stat-item {
    background: var(--fuzzbol-panel);
    border: 1px solid var(--fuzzbol-line);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--fuzzbol-shadow);
}

.career-stat-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 75, 24, 0.35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.career-stat-value {
    font-size: 1.45rem;
    font-weight: 900;
    font-family: var(--font-display);
    color: var(--ink-1);
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.career-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fuzzbol-muted);
    margin-top: 4px;
}

.career-stat-subtext {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--gold-text);
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Rich Match Log Card */
.career-log-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--fuzzbol-line);
    margin-bottom: 8px;
    background: var(--fuzzbol-panel);
}

.career-log-result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    font-weight: 900;
    font-size: 0.82rem;
    color: #fff;
    flex-shrink: 0;
}

.career-log-result.win {
    background: #14834b;
}

.career-log-result.draw {
    background: #9a6a00;
}

.career-log-result.loss {
    background: #b52c21;
}

.career-log-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.career-log-opponent {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--ink-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.career-log-meta {
    font-size: 0.72rem;
    color: var(--fuzzbol-muted);
    font-family: var(--font-mono);
}

.career-log-score {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: var(--ink-1);
}

.career-log-rating {
    font-size: 0.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--fuzzbol-orange);
    min-width: 54px;
    text-align: right;
}



/* ==========================================================================
   MATCH SETUP SCREEN EXTRA NIGHT OVERRIDES
   ========================================================================== */

body[data-theme="night"] .setup-team-stats,
body.theme-night .setup-team-stats {
    background: #0a1727 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .setup-team-stats b,
body.theme-night .setup-team-stats b {
    color: #ff4b18 !important;
}

body[data-theme="night"] .setup-team-change,
body.theme-night .setup-team-change {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .setup-team-change:hover,
body.theme-night .setup-team-change:hover {
    background: #1c3558 !important;
    border-color: rgba(255, 75, 24, 0.4) !important;
    color: #fff !important;
}

body[data-theme="night"] .match-setup-screen .team-step,
body[data-theme="night"] .team-step,
body.theme-night .match-setup-screen .team-step,
body.theme-night .team-step {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #f0f6fc !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

body[data-theme="night"] .match-setup-screen .team-step:hover,
body[data-theme="night"] .team-step:hover,
body.theme-night .match-setup-screen .team-step:hover,
body.theme-night .team-step:hover {
    background: #1c3558 !important;
    color: #fff !important;
    border-color: rgba(255, 75, 24, 0.4) !important;
}

body[data-theme="night"] .stadium-preview-box,
body.theme-night .stadium-preview-box {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .stadium-preview-box strong,
body[data-theme="night"] .stadium-preview-box span,
body.theme-night .stadium-preview-box strong,
body.theme-night .stadium-preview-box span {
    color: #f0f6fc !important;
}

/* ==========================================================================
   TOURNAMENT SETUP SCREEN EXTRA NIGHT OVERRIDES
   ========================================================================== */

body[data-theme="night"] #screen-tournament-setup select,
body[data-theme="night"] #screen-tournament-setup .geometric-select,
body.theme-night #screen-tournament-setup select,
body.theme-night #screen-tournament-setup .geometric-select {
    background: #142842 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

body[data-theme="night"] .bracket-champion-card,
body.theme-night .bracket-champion-card {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .bracket-champion-card span,
body.theme-night .bracket-champion-card span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .bracket-champion-card strong,
body.theme-night .bracket-champion-card strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .competition-summary-meta,
body.theme-night .competition-summary-meta {
    background: #0a1727 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   TOURNAMENT BRACKET & LEAGUE SCREEN EXTRA NIGHT OVERRIDES
   ========================================================================== */

body[data-theme="night"] #screen-tournament-bracket .glass-card,
body.theme-night #screen-tournament-bracket .glass-card {
    background: #0d1a2d !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f0f6fc !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

body[data-theme="night"] #screen-tournament-bracket .card-title,
body[data-theme="night"] #screen-tournament-bracket h2,
body[data-theme="night"] #screen-tournament-bracket h3,
body[data-theme="night"] #screen-tournament-bracket .team-slot,
body.theme-night #screen-tournament-bracket .card-title,
body.theme-night #screen-tournament-bracket h2,
body.theme-night #screen-tournament-bracket h3,
body.theme-night #screen-tournament-bracket .team-slot {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-tournament-bracket p,
body[data-theme="night"] #tourney-competition-meta,
body.theme-night #screen-tournament-bracket p,
body.theme-night #tourney-competition-meta {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-tournament-bracket .matchup-box,
body.theme-night #screen-tournament-bracket .matchup-box {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-tournament-bracket .vs,
body.theme-night #screen-tournament-bracket .vs {
    color: #ff7849 !important;
}

body[data-theme="night"] #screen-tournament-bracket .btn-secondary,
body.theme-night #screen-tournament-bracket .btn-secondary {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-league .glass-card,
body.theme-night #screen-league .glass-card {
    background: #0d1a2d !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-league .table-responsive,
body.theme-night #screen-league .table-responsive {
    background: #0a1727 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] #screen-league .btn-secondary,
body.theme-night #screen-league .btn-secondary {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #f0f6fc !important;
}

/* ==========================================================================
   CAREER HUB SCREEN (#screen-career-hub) IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] #screen-career-hub.active .career-app-shell,
body.theme-night #screen-career-hub.active .career-app-shell {
    background: #0b1626 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-sidebar,
body.theme-night #screen-career-hub.active .career-sidebar {
    background: #08111e !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-workspace,
body.theme-night #screen-career-hub.active .career-workspace {
    background: #0d1a2d !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-player-card.compact,
body.theme-night #screen-career-hub.active .career-player-card.compact {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-player-name,
body.theme-night #screen-career-hub.active .career-player-name {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-player-title,
body.theme-night #screen-career-hub.active .career-player-title {
    color: #ff7849 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-player-age,
body[data-theme="night"] #screen-career-hub.active .career-xp-text,
body.theme-night #screen-career-hub.active .career-player-age,
body.theme-night #screen-career-hub.active .career-xp-text {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .xp-bar-track,
body.theme-night #screen-career-hub.active .xp-bar-track {
    background: rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-nav-item,
body.theme-night #screen-career-hub.active .career-nav-item {
    color: #8b9bb4 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
}

body[data-theme="night"] #screen-career-hub.active .career-nav-item:hover,
body.theme-night #screen-career-hub.active .career-nav-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-nav-item.active,
body.theme-night #screen-career-hub.active .career-nav-item.active {
    background: rgba(255, 75, 24, 0.18) !important;
    color: #ff7849 !important;
    border-color: rgba(255, 75, 24, 0.35) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-exit,
body.theme-night #screen-career-hub.active .career-exit {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-exit:hover,
body.theme-night #screen-career-hub.active .career-exit:hover {
    background: #1c3558 !important;
    color: #fff !important;
}

body[data-theme="night"] #screen-career-hub.active .career-workspace-header,
body.theme-night #screen-career-hub.active .career-workspace-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-workspace-header h2,
body.theme-night #screen-career-hub.active .career-workspace-header h2 {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-workspace-header p,
body.theme-night #screen-career-hub.active .career-workspace-header p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active #career-view-kicker,
body[data-theme="night"] #screen-career-hub.active .career-panel-kicker,
body.theme-night #screen-career-hub.active #career-view-kicker,
body.theme-night #screen-career-hub.active .career-panel-kicker {
    color: #ff7849 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-save-status,
body.theme-night #screen-career-hub.active .career-save-status {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-header-actions .btn-secondary,
body[data-theme="night"] #screen-career-hub.active #btn-career-notifications,
body[data-theme="night"] #screen-career-hub.active #btn-career-save,
body.theme-night #screen-career-hub.active .career-header-actions .btn-secondary,
body.theme-night #screen-career-hub.active #btn-career-notifications,
body.theme-night #screen-career-hub.active #btn-career-save {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-header-actions .btn-secondary:hover,
body[data-theme="night"] #screen-career-hub.active #btn-career-notifications:hover,
body[data-theme="night"] #screen-career-hub.active #btn-career-save:hover,
body.theme-night #screen-career-hub.active .career-header-actions .btn-secondary:hover,
body.theme-night #screen-career-hub.active #btn-career-notifications:hover,
body.theme-night #screen-career-hub.active #btn-career-save:hover {
    background: #1c3558 !important;
    color: #fff !important;
}

body[data-theme="night"] #screen-career-hub.active .career-story-hero,
body.theme-night #screen-career-hub.active .career-story-hero {
    background: linear-gradient(135deg, #0f2238 0%, #091524 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-story-hero h3,
body.theme-night #screen-career-hub.active .career-story-hero h3 {
    color: #ffffff !important;
}

body[data-theme="night"] #screen-career-hub.active .career-story-hero p,
body.theme-night #screen-career-hub.active .career-story-hero p {
    color: #c9d1d9 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-eyebrow,
body.theme-night #screen-career-hub.active .career-eyebrow {
    color: #ff7849 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-next-match,
body.theme-night #screen-career-hub.active .career-next-match {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-next-match-copy strong,
body.theme-night #screen-career-hub.active .career-next-match-copy strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-next-match-copy span,
body.theme-night #screen-career-hub.active .career-next-match-copy span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-match-action,
body.theme-night #screen-career-hub.active .career-match-action {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-match-action:hover,
body.theme-night #screen-career-hub.active .career-match-action:hover {
    background: #152943 !important;
    border-color: rgba(255, 75, 24, 0.4) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-match-action strong,
body.theme-night #screen-career-hub.active .career-match-action strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-match-action span,
body.theme-night #screen-career-hub.active .career-match-action span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-match-action.featured,
body.theme-night #screen-career-hub.active .career-match-action.featured {
    background: var(--fuzzbol-orange-fill) !important;
    color: #fff !important;
    border-color: #ff4b18 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-match-action.featured strong,
body[data-theme="night"] #screen-career-hub.active .career-match-action.featured span,
body.theme-night #screen-career-hub.active .career-match-action.featured strong,
body.theme-night #screen-career-hub.active .career-match-action.featured span {
    color: #fff !important;
}

body[data-theme="night"] #screen-career-hub.active .career-competition-card,
body.theme-night #screen-career-hub.active .career-competition-card {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-competition-card strong,
body.theme-night #screen-career-hub.active .career-competition-card strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-competition-card small,
body.theme-night #screen-career-hub.active .career-competition-card small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-competition-card-status,
body.theme-night #screen-career-hub.active .career-competition-card-status {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-competition-card.active,
body.theme-night #screen-career-hub.active .career-competition-card.active {
    background: rgba(255, 75, 24, 0.14) !important;
    border-color: #ff4b18 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-competition-card.active .career-competition-card-status,
body.theme-night #screen-career-hub.active .career-competition-card.active .career-competition-card-status {
    background: var(--fuzzbol-orange-fill) !important;
    color: #fff !important;
}

body[data-theme="night"] #screen-career-hub.active .career-cup-bracket-card,
body.theme-night #screen-career-hub.active .career-cup-bracket-card {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-cup-fixture,
body.theme-night #screen-career-hub.active .career-cup-fixture {
    background: #091524 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-cup-fixture strong,
body.theme-night #screen-career-hub.active .career-cup-fixture strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-cup-action,
body.theme-night #screen-career-hub.active .career-cup-action {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-cup-action:hover,
body.theme-night #screen-career-hub.active .career-cup-action:hover {
    background: #1c3558 !important;
    color: #fff !important;
}

body[data-theme="night"] #screen-career-hub.active .career-team-card,
body[data-theme="night"] #screen-career-hub.active .career-contract-card,
body[data-theme="night"] #screen-career-hub.active .career-history-card,
body[data-theme="night"] #screen-career-hub.active .career-training-card,
body[data-theme="night"] #screen-career-hub.active .career-agent-message,
body.theme-night #screen-career-hub.active .career-team-card,
body.theme-night #screen-career-hub.active .career-contract-card,
body.theme-night #screen-career-hub.active .career-history-card,
body.theme-night #screen-career-hub.active .career-training-card,
body.theme-night #screen-career-hub.active .career-agent-message {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-team-card strong,
body[data-theme="night"] #screen-career-hub.active .career-contract-card strong,
body[data-theme="night"] #screen-career-hub.active .career-history-card strong,
body[data-theme="night"] #screen-career-hub.active .career-training-card h4,
body.theme-night #screen-career-hub.active .career-team-card strong,
body.theme-night #screen-career-hub.active .career-contract-card strong,
body.theme-night #screen-career-hub.active .career-history-card strong,
body.theme-night #screen-career-hub.active .career-training-card h4 {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-team-card span,
body[data-theme="night"] #screen-career-hub.active .career-contract-card span,
body[data-theme="night"] #screen-career-hub.active .career-history-card span,
body[data-theme="night"] #screen-career-hub.active .career-training-card p,
body[data-theme="night"] #screen-career-hub.active .career-training-card span,
body.theme-night #screen-career-hub.active .career-team-card span,
body.theme-night #screen-career-hub.active .career-contract-card span,
body.theme-night #screen-career-hub.active .career-history-card span,
body.theme-night #screen-career-hub.active .career-training-card p,
body.theme-night #screen-career-hub.active .career-training-card span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-squad-player,
body.theme-night #screen-career-hub.active .career-squad-player {
    background: #091524 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-squad-player strong,
body.theme-night #screen-career-hub.active .career-squad-player strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-squad-player small,
body.theme-night #screen-career-hub.active .career-squad-player small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-club-panel,
body.theme-night #screen-career-hub.active .career-club-panel {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-club-panel-copy strong,
body.theme-night #screen-career-hub.active .career-club-panel-copy strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-club-panel-copy span,
body.theme-night #screen-career-hub.active .career-club-panel-copy span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-section-heading h3,
body.theme-night #screen-career-hub.active .career-section-heading h3 {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-section-heading span,
body.theme-night #screen-career-hub.active .career-section-heading span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-section-label,
body.theme-night #screen-career-hub.active .career-section-label {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-metric,
body[data-theme="night"] #screen-career-hub.active .career-season-info,
body[data-theme="night"] #screen-career-hub.active .career-stats-row,
body.theme-night #screen-career-hub.active .career-metric,
body.theme-night #screen-career-hub.active .career-season-info,
body.theme-night #screen-career-hub.active .career-stats-row {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-metric strong,
body.theme-night #screen-career-hub.active .career-metric strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-metric span,
body.theme-night #screen-career-hub.active .career-metric span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-attr-item,
body.theme-night #screen-career-hub.active .career-attr-item,
body.night-mode #screen-career-hub.active .career-attr-item,
body[data-theme="night"] #screen-career-hub .career-attribute-card,
body.theme-night #screen-career-hub .career-attribute-card,
body.night-mode #screen-career-hub .career-attribute-card {
    background: #0d1a2d !important;
    background-color: #0d1a2d !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

body[data-theme="night"] #screen-career-hub .career-attribute-card:hover,
body.theme-night #screen-career-hub .career-attribute-card:hover,
body.night-mode #screen-career-hub .career-attribute-card:hover {
    border-color: rgba(255, 255, 255, 0.24) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-attr-name,
body.theme-night #screen-career-hub.active .career-attr-name,
body.night-mode #screen-career-hub.active .career-attr-name,
body[data-theme="night"] #screen-career-hub .career-attribute-title,
body.theme-night #screen-career-hub .career-attribute-title,
body.night-mode #screen-career-hub .career-attribute-title {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-attr-val,
body.theme-night #screen-career-hub.active .career-attr-val,
body.night-mode #screen-career-hub.active .career-attr-val,
body[data-theme="night"] #screen-career-hub .career-attr-heading strong,
body.theme-night #screen-career-hub .career-attr-heading strong,
body.night-mode #screen-career-hub .career-attr-heading strong {
    color: #ffaa00 !important;
}

body[data-theme="night"] #screen-career-hub .career-attribute-desc,
body.theme-night #screen-career-hub .career-attribute-desc,
body.night-mode #screen-career-hub .career-attribute-desc {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub .career-attr-effect,
body.theme-night #screen-career-hub .career-attr-effect,
body.night-mode #screen-career-hub .career-attr-effect {
    color: #ff9b73 !important;
}

body[data-theme="night"] #screen-career-hub .career-meter,
body.theme-night #screen-career-hub .career-meter,
body.night-mode #screen-career-hub .career-meter {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 99px;
}

body[data-theme="night"] #screen-career-hub .career-meter span,
body.theme-night #screen-career-hub .career-meter span,
body.night-mode #screen-career-hub .career-meter span {
    background: linear-gradient(90deg, #ff6d3e, #ffa45d) !important;
    border-radius: 99px;
}

body[data-theme="night"] #screen-career-hub.active .career-action-button,
body.theme-night #screen-career-hub.active .career-action-button,
body.night-mode #screen-career-hub.active .career-action-button,
body[data-theme="night"] #screen-career-hub .career-action-button,
body.theme-night #screen-career-hub .career-action-button,
body.night-mode #screen-career-hub .career-action-button {
    background: var(--fuzzbol-orange-fill) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 800 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-action-button:hover,
body.theme-night #screen-career-hub.active .career-action-button:hover,
body.night-mode #screen-career-hub.active .career-action-button:hover,
body[data-theme="night"] #screen-career-hub .career-action-button:hover:not(:disabled),
body.theme-night #screen-career-hub .career-action-button:hover:not(:disabled),
body.night-mode #screen-career-hub .career-action-button:hover:not(:disabled) {
    background: var(--fuzzbol-orange-fill-hover) !important;
    box-shadow: 0 4px 14px rgba(255, 75, 24, 0.4) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-action-button:disabled,
body.theme-night #screen-career-hub.active .career-action-button:disabled,
body.night-mode #screen-career-hub.active .career-action-button:disabled,
body[data-theme="night"] #screen-career-hub .career-action-button:disabled,
body.theme-night #screen-career-hub .career-action-button:disabled,
body.night-mode #screen-career-hub .career-action-button:disabled {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #64748b !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

body[data-theme="night"] #screen-career-hub.active .career-training-item,
body.theme-night #screen-career-hub.active .career-training-item {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] #screen-career-hub.active .btn-training,
body.theme-night #screen-career-hub.active .btn-training {
    background: #142842 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .btn-training:hover,
body.theme-night #screen-career-hub.active .btn-training:hover {
    background: #1c3558 !important;
    color: #fff !important;
}

body[data-theme="night"] #screen-career-hub.active .career-trophies-grid .career-trophy-card,
body.theme-night #screen-career-hub.active .career-trophies-grid .career-trophy-card {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-log-row,
body.theme-night #screen-career-hub.active .career-log-row {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] #screen-career-hub.active .career-log-opponent,
body.theme-night #screen-career-hub.active .career-log-opponent {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-log-score,
body.theme-night #screen-career-hub.active .career-log-score {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-log-meta,
body.theme-night #screen-career-hub.active .career-log-meta {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-transfer-offer,
body[data-theme="night"] #screen-career-hub.active .career-transfer-panel,
body.theme-night #screen-career-hub.active .career-transfer-offer,
body.theme-night #screen-career-hub.active .career-transfer-panel {
    background: #102137 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-transfer-offer strong,
body.theme-night #screen-career-hub.active .career-transfer-offer strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-transfer-panel p,
body.theme-night #screen-career-hub.active .career-transfer-panel p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub.active .career-objective,
body.theme-night #screen-career-hub.active .career-objective {
    background: rgba(255, 75, 24, 0.12) !important;
    border: 1px solid rgba(255, 75, 24, 0.28) !important;
    border-left: 3px solid #ff4b18 !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub.active .career-objective strong,
body.theme-night #screen-career-hub.active .career-objective strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .table-team-name,
body.theme-night .table-team-name {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub .career-table-wrap,
body.theme-night #screen-career-hub .career-table-wrap {
    background: #0d1a2d !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

body[data-theme="night"] #screen-career-hub .career-table-wrap .league-table th,
body.theme-night #screen-career-hub .career-table-wrap .league-table th {
    background: #091524 !important;
    color: #94a3b8 !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-hub .career-table-wrap .league-table td,
body.theme-night #screen-career-hub .career-table-wrap .league-table td {
    color: #f0f6fc !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

body[data-theme="night"] #screen-career-hub .career-table-wrap .league-table tr:hover td,
body.theme-night #screen-career-hub .career-table-wrap .league-table tr:hover td {
    background: rgba(255, 255, 255, 0.05) !important;
}

body[data-theme="night"] #screen-career-hub .career-table-wrap .league-table tr.career-club-row td,
body.theme-night #screen-career-hub .career-table-wrap .league-table tr.career-club-row td {
    background: rgba(255, 75, 24, 0.18) !important;
    color: #ffffff !important;
}

body[data-theme="night"] #screen-career-hub .career-section-heading .career-season-info .career-stat-item,
body.theme-night #screen-career-hub .career-section-heading .career-season-info .career-stat-item,
body[data-theme="night"] .career-season-info .career-stat-item,
body.theme-night .career-season-info .career-stat-item {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-hub .career-section-heading .career-season-info .career-stat-value,
body.theme-night #screen-career-hub .career-section-heading .career-season-info .career-stat-value,
body[data-theme="night"] .career-season-info .career-stat-value,
body.theme-night .career-season-info .career-stat-value {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub .career-section-heading .career-season-info .career-stat-label,
body.theme-night #screen-career-hub .career-section-heading .career-season-info .career-stat-label,
body[data-theme="night"] .career-season-info .career-stat-label,
body.theme-night .career-season-info .career-stat-label {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .career-notifications-panel,
body.theme-night .career-notifications-panel {
    background: #0d1a2d !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4) !important;
}

body[data-theme="night"] .career-notifications-caption,
body.theme-night .career-notifications-caption {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .career-notification-item,
body.theme-night .career-notification-item {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .career-notification-copy strong,
body.theme-night .career-notification-copy strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .career-notification-copy p,
body.theme-night .career-notification-copy p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .tone-blue .career-notification-icon,
body.theme-night .tone-blue .career-notification-icon {
    color: #60a5fa !important;
    background: rgba(34, 114, 169, 0.22) !important;
}

body[data-theme="night"] .tone-gold .career-notification-icon,
body.theme-night .tone-gold .career-notification-icon {
    color: #facc15 !important;
    background: rgba(216, 149, 22, 0.22) !important;
}

body[data-theme="night"] .tone-green .career-notification-icon,
body.theme-night .tone-green .career-notification-icon {
    color: #4ade80 !important;
    background: rgba(25, 135, 84, 0.22) !important;
}

body[data-theme="night"] .tone-muted .career-notification-icon,
body.theme-night .tone-muted .career-notification-icon {
    color: #94a3b8 !important;
    background: rgba(152, 165, 173, 0.2) !important;
}

body[data-theme="night"] #screen-career-hub .career-howto,
body.theme-night #screen-career-hub .career-howto {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub .career-howto summary,
body.theme-night #screen-career-hub .career-howto summary {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub .career-howto > div,
body.theme-night #screen-career-hub .career-howto > div {
    background: #0d1a2d !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-hub kbd,
body.theme-night #screen-career-hub kbd {
    background: #152b45 !important;
    color: #f0f6fc !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

body[data-theme="night"] .career-decision,
body.theme-night .career-decision,
body[data-theme="night"] #screen-career-hub .career-decision,
body.theme-night #screen-career-hub .career-decision {
    background: #0d1a2d !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-hub .career-decision h3,
body.theme-night #screen-career-hub .career-decision h3 {
    color: #f0f6fc !important;
}

body[data-theme="night"] .career-decision p,
body.theme-night .career-decision p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .career-decision-choices button,
body.theme-night .career-decision-choices button {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .career-decision-choices button:hover,
body.theme-night .career-decision-choices button:hover {
    background: #182e4a !important;
    border-color: #ec591f !important;
}

body[data-theme="night"] .career-decision-choices small,
body.theme-night .career-decision-choices small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .career-decision .career-eyebrow,
body.theme-night .career-decision .career-eyebrow {
    color: var(--fuzzbol-orange) !important;
}

body[data-theme="night"] .career-decision-heading > span:last-child,
body.theme-night .career-decision-heading > span:last-child {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .career-decision-resolved,
body.theme-night .career-decision-resolved {
    background: rgba(54, 100, 71, 0.25) !important;
    border: 1px solid rgba(74, 222, 128, 0.3) !important;
    color: #86efac !important;
}

body[data-theme="night"] #screen-career-hub .career-reward-recap,
body.theme-night #screen-career-hub .career-reward-recap {
    background: #0d1a2d !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] .career-result-copy > strong,
body.theme-night .career-result-copy > strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .career-result-copy p,
body.theme-night .career-result-copy p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub .career-season-finale,
body.theme-night #screen-career-hub .career-season-finale {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub .career-season-finale span,
body.theme-night #screen-career-hub .career-season-finale span {
    color: var(--fuzzbol-orange) !important;
}

body[data-theme="night"] #screen-career-hub .career-season-finale h3,
body.theme-night #screen-career-hub .career-season-finale h3 {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub .career-season-finale p,
body.theme-night #screen-career-hub .career-season-finale p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub .career-relegation-notice,
body.theme-night #screen-career-hub .career-relegation-notice {
    background: linear-gradient(135deg, rgba(239, 84, 31, 0.18), rgba(215, 72, 25, 0.1)) !important;
    border-color: rgba(239, 84, 31, 0.35) !important;
    color: #f0f6fc !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

body[data-theme="night"] #screen-career-hub .career-relegation-notice strong,
body.theme-night #screen-career-hub .career-relegation-notice strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub .career-relegation-notice p,
body.theme-night #screen-career-hub .career-relegation-notice p {
    color: #cbd5e1 !important;
}

body[data-theme="night"] .career-training-card,
body.theme-night .career-training-card {
    background-image: none !important;
    background-color: #0d1a2d !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .career-development-note,
body.theme-night .career-development-note,
body[data-theme="night"] .career-calendar-match,
body.theme-night .career-calendar-match,
body[data-theme="night"] .career-achievement,
body.theme-night .career-achievement,
body[data-theme="night"] .training-toolbar,
body.theme-night .training-toolbar {
    background-color: #0d1a2d !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] .career-development-note strong,
body.theme-night .career-development-note strong,
body[data-theme="night"] .career-calendar-match strong,
body.theme-night .career-calendar-match strong,
body[data-theme="night"] .career-achievement strong,
body.theme-night .career-achievement strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] .career-development-note p,
body.theme-night .career-development-note p,
body.night-mode .career-development-note p,
body[data-theme="night"] .career-calendar-match p,
body.theme-night .career-calendar-match p,
body.night-mode .career-calendar-match p,
body[data-theme="night"] .career-achievement p,
body.theme-night .career-achievement p,
body.night-mode .career-achievement p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub .career-development-hero,
body.theme-night #screen-career-hub .career-development-hero,
body.night-mode #screen-career-hub .career-development-hero {
    background: linear-gradient(110deg, #091729, #0d2238 68%, #0b2528) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-hub .career-development-hero::after,
body.theme-night #screen-career-hub .career-development-hero::after,
body.night-mode #screen-career-hub .career-development-hero::after {
    background: linear-gradient(90deg, rgba(9, 23, 41, 0.9) 0%, rgba(13, 34, 56, 0.8) 48%, rgba(11, 37, 40, 0.4) 100%) !important;
}

body[data-theme="night"] #screen-career-hub .career-development-hero h3,
body.theme-night #screen-career-hub .career-development-hero h3,
body.night-mode #screen-career-hub .career-development-hero h3 {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-hub .career-development-hero p,
body.theme-night #screen-career-hub .career-development-hero p,
body.night-mode #screen-career-hub .career-development-hero p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub .career-development-overall strong,
body.theme-night #screen-career-hub .career-development-overall strong,
body.night-mode #screen-career-hub .career-development-overall strong {
    color: #ff9b73 !important;
}

body[data-theme="night"] #screen-career-hub .career-development-overall span,
body.theme-night #screen-career-hub .career-development-overall span,
body.night-mode #screen-career-hub .career-development-overall span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-hub .career-skillpoints-badge,
body.theme-night #screen-career-hub .career-skillpoints-badge,
body.night-mode #screen-career-hub .career-skillpoints-badge {
    background: rgba(255, 129, 82, 0.12) !important;
    border-color: rgba(255, 154, 115, 0.35) !important;
}

body[data-theme="night"] #screen-career-hub .career-skillpoints-badge b,
body.theme-night #screen-career-hub .career-skillpoints-badge b,
body.night-mode #screen-career-hub .career-skillpoints-badge b {
    color: #ff9b73 !important;
}

body[data-theme="night"] #screen-career-hub .career-skillpoints-badge span,
body.theme-night #screen-career-hub .career-skillpoints-badge span,
body.night-mode #screen-career-hub .career-skillpoints-badge span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #career-skillpoints-label,
body.theme-night #career-skillpoints-label,
body.night-mode #career-skillpoints-label {
    color: #ffaa00 !important;
}

/* ==========================================================================
   CAREER SETUP / PLAYER CREATION IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] #screen-career-setup .career-setup-card,
body.theme-night #screen-career-setup .career-setup-card {
    background: #0d1a2d !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5) !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-header .card-title,
body.theme-night #screen-career-setup .career-setup-header .card-title,
body[data-theme="night"] #screen-career-setup .career-setup-form-heading h3,
body.theme-night #screen-career-setup .career-setup-form-heading h3 {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-header .form-desc,
body.theme-night #screen-career-setup .career-setup-header .form-desc,
body[data-theme="night"] #screen-career-setup .career-setup-form-heading p,
body.theme-night #screen-career-setup .career-setup-form-heading p,
body[data-theme="night"] #screen-career-setup .career-setup-note,
body.theme-night #screen-career-setup .career-setup-note {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-journey > div,
body.theme-night #screen-career-setup .career-setup-journey > div {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-journey > div + div,
body.theme-night #screen-career-setup .career-setup-journey > div + div {
    border-left-color: rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-journey strong,
body.theme-night #screen-career-setup .career-setup-journey strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-journey small,
body.theme-night #screen-career-setup .career-setup-journey small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-fields .form-field label,
body.theme-night #screen-career-setup .career-setup-fields .form-field label {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-fields .geometric-select,
body.theme-night #screen-career-setup .career-setup-fields .geometric-select,
body[data-theme="night"] #screen-career-setup .career-setup-fields input.geometric-select,
body.theme-night #screen-career-setup .career-setup-fields input.geometric-select {
    background-color: #102137 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-map-option,
body.theme-night #screen-career-setup .career-map-option {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-map-option-copy strong,
body.theme-night #screen-career-setup .career-map-option-copy strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-map-option-copy small,
body.theme-night #screen-career-setup .career-map-option-copy small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-setup #career-emoji-picker,
body.theme-night #screen-career-setup #career-emoji-picker {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-setup #career-emoji-picker .btn-mode,
body.theme-night #screen-career-setup #career-emoji-picker .btn-mode {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-setup #career-emoji-picker .btn-mode.active,
body.theme-night #screen-career-setup #career-emoji-picker .btn-mode.active {
    background: var(--fuzzbol-orange-fill) !important;
    color: #fff !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-actions .btn-secondary,
body.theme-night #screen-career-setup .career-setup-actions .btn-secondary {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-setup .career-setup-actions .btn-secondary:hover,
body.theme-night #screen-career-setup .career-setup-actions .btn-secondary:hover {
    background: rgba(255, 75, 24, 0.18) !important;
    border-color: var(--fuzzbol-orange) !important;
}

/* ==========================================================================
   MATCH INTRO CINEMATIC IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] .match-intro-overlay,
body.theme-night .match-intro-overlay {
    background:
        radial-gradient(ellipse at 15% 15%, rgba(255, 75, 24, 0.22), transparent 45%),
        radial-gradient(ellipse at 85% 85%, rgba(26, 75, 128, 0.25), transparent 50%),
        linear-gradient(135deg, #050c16 0%, #091524 50%, #0d1e34 100%) !important;
}

body[data-theme="night"] .match-intro-overlay::before,
body.theme-night .match-intro-overlay::before {
    background: repeating-linear-gradient(124deg, transparent 0 68px, rgba(255, 255, 255, 0.025) 69px 70px, transparent 71px 136px) !important;
}

body[data-theme="night"] .intro-topline,
body.theme-night .intro-topline {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .intro-topline b,
body.theme-night .intro-topline b {
    color: #fff !important;
    background: var(--fuzzbol-orange-fill) !important;
    box-shadow: 0 2px 10px rgba(255, 75, 24, 0.4) !important;
}

body[data-theme="night"] .intro-stadium-card,
body.theme-night .intro-stadium-card {
    background: rgba(13, 26, 45, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
    backdrop-filter: blur(14px) !important;
}

body[data-theme="night"] .intro-stadium-kicker,
body[data-theme="night"] .intro-team-side,
body.theme-night .intro-stadium-kicker,
body.theme-night .intro-team-side {
    color: #ff7043 !important;
}

body[data-theme="night"] .intro-stadium-card strong,
body.theme-night .intro-stadium-card strong {
    color: #f0f6fc !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

body[data-theme="night"] .intro-stadium-card small,
body.theme-night .intro-stadium-card small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .intro-team,
body.theme-night .intro-team {
    background: rgba(16, 33, 55, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-left: 4px solid var(--team-color) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
    backdrop-filter: blur(14px) !important;
}

body[data-theme="night"] .intro-team-mark,
body.theme-night .intro-team-mark {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

body[data-theme="night"] .intro-team-name,
body.theme-night .intro-team-name {
    color: #f0f6fc !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

body[data-theme="night"] .intro-vs-badge,
body.theme-night .intro-vs-badge {
    color: #ff7043 !important;
    text-shadow: 0 0 16px rgba(255, 112, 67, 0.4) !important;
}

body[data-theme="night"] .intro-vs-badge i,
body.theme-night .intro-vs-badge i {
    background: #ff7043 !important;
    box-shadow: 0 0 8px rgba(255, 112, 67, 0.5) !important;
}

body[data-theme="night"] .intro-bottomline,
body.theme-night .intro-bottomline {
    color: #8b9bb4 !important;
}

/* ==========================================================================
   GOAL & COUNTDOWN OVERLAY IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] .overlay-goal,
body[data-theme="night"] #screen-game.active .overlay-goal,
body.theme-night .overlay-goal,
body.theme-night #screen-game.active .overlay-goal {
    background: rgba(10, 21, 37, 0.95) !important;
    border: 2px solid rgba(255, 75, 24, 0.6) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(255, 75, 24, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(16px) !important;
}

body[data-theme="night"] .overlay-goal .goal-kicker,
body[data-theme="night"] #screen-game.active .overlay-goal .goal-kicker,
body.theme-night .overlay-goal .goal-kicker,
body.theme-night #screen-game.active .overlay-goal .goal-kicker {
    color: #ff7043 !important;
    letter-spacing: .15em !important;
}

body[data-theme="night"] .overlay-goal h2,
body[data-theme="night"] #screen-game.active .overlay-goal h2,
body.theme-night .overlay-goal h2,
body.theme-night #screen-game.active .overlay-goal h2 {
    color: #ffffff !important;
    text-shadow: 0 0 24px rgba(255, 75, 24, 0.5), 0 2px 10px rgba(0, 0, 0, 0.6) !important;
}

body[data-theme="night"] .overlay-goal p,
body[data-theme="night"] #screen-game.active .overlay-goal p,
body.theme-night .overlay-goal p,
body.theme-night #screen-game.active .overlay-goal p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .overlay-goal .goal-scoreline,
body[data-theme="night"] #screen-game.active .overlay-goal .goal-scoreline,
body.theme-night .overlay-goal .goal-scoreline,
body.theme-night #screen-game.active .overlay-goal .goal-scoreline {
    color: #f0f6fc !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

/* ==========================================================================
   PAUSE OVERLAY IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"] .pause-overlay,
body[data-theme="night"] #screen-game.active .pause-overlay,
body.theme-night .pause-overlay,
body.theme-night #screen-game.active .pause-overlay {
    background: rgba(3, 8, 16, 0.78) !important;
    backdrop-filter: blur(20px) saturate(1.2) !important;
}

body[data-theme="night"] .pause-card,
body[data-theme="night"] #screen-game.active .pause-card,
body.theme-night .pause-card,
body.theme-night #screen-game.active .pause-card {
    background: linear-gradient(180deg, #0d1a2d 0%, #0a1525 100%) !important;
    border: 1px solid rgba(255, 75, 24, 0.38) !important;
    color: #f0f6fc !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;
}

body[data-theme="night"] #screen-game.active .pause-card::before,
body.theme-night #screen-game.active .pause-card::before {
    background: linear-gradient(90deg, var(--fuzzbol-orange-fill), #ffad42 52%, #1e4570) !important;
}

body[data-theme="night"] #screen-game.active .pause-card::after,
body.theme-night #screen-game.active .pause-card::after {
    background: rgba(255, 75, 24, 0.15) !important;
    border-color: rgba(255, 75, 24, 0.32) !important;
    color: #ff7043 !important;
}

body[data-theme="night"] .pause-kicker,
body[data-theme="night"] #screen-game.active .pause-card .pause-kicker,
body.theme-night .pause-kicker,
body.theme-night #screen-game.active .pause-card .pause-kicker {
    color: #ff7043 !important;
}

body[data-theme="night"] .pause-card h2,
body[data-theme="night"] #screen-game.active .pause-card h2,
body.theme-night .pause-card h2,
body.theme-night #screen-game.active .pause-card h2 {
    color: #f0f6fc !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}

body[data-theme="night"] .pause-card > p,
body[data-theme="night"] #screen-game.active .pause-card > p,
body.theme-night .pause-card > p,
body.theme-night #screen-game.active .pause-card > p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .pause-actions .btn-secondary,
body[data-theme="night"] #screen-game.active .pause-actions .btn-secondary,
body.theme-night .pause-actions .btn-secondary,
body.theme-night #screen-game.active .pause-actions .btn-secondary {
    background: #14243b !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #dce6f2 !important;
}

body[data-theme="night"] .pause-actions .btn-secondary:hover,
body[data-theme="night"] #screen-game.active .pause-actions .btn-secondary:hover,
body.theme-night .pause-actions .btn-secondary:hover,
body.theme-night #screen-game.active .pause-actions .btn-secondary:hover {
    background: #1c3252 !important;
    color: #ffffff !important;
    border-color: rgba(255, 75, 24, 0.5) !important;
}

body[data-theme="night"] .pause-settings,
body[data-theme="night"] #screen-game.active .pause-settings,
body.theme-night .pause-settings,
body.theme-night #screen-game.active .pause-settings {
    background: #08121f !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .pause-settings-kicker,
body[data-theme="night"] #screen-game.active .pause-settings-kicker,
body.theme-night .pause-settings-kicker,
body.theme-night #screen-game.active .pause-settings-kicker {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .pause-settings .setting-row,
body[data-theme="night"] #screen-game.active .pause-settings .setting-row,
body.theme-night .pause-settings .setting-row,
body.theme-night #screen-game.active .pause-settings .setting-row {
    background: #0e1c2e !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="night"] .pause-settings .setting-name,
body[data-theme="night"] #screen-game.active .pause-settings .setting-name,
body.theme-night .pause-settings .setting-name,
body.theme-night #screen-game.active .pause-settings .setting-name {
    color: #f0f6fc !important;
}

body[data-theme="night"] .pause-settings .setting-help,
body[data-theme="night"] #screen-game.active .pause-settings .setting-help,
body.theme-night .pause-settings .setting-help,
body.theme-night #screen-game.active .pause-settings .setting-help {
    color: #8b9bb4 !important;
}

body[data-theme="night"] .pause-fullscreen-btn,
body[data-theme="night"] #screen-game.active .pause-fullscreen-btn,
body.theme-night .pause-fullscreen-btn,
body.theme-night #screen-game.active .pause-fullscreen-btn {
    background: #14243b !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #dce6f2 !important;
}

body[data-theme="night"] .pause-fullscreen-btn:hover,
body[data-theme="night"] #screen-game.active .pause-fullscreen-btn:hover,
body.theme-night .pause-fullscreen-btn:hover,
body.theme-night #screen-game.active .pause-fullscreen-btn:hover {
    background: #1c3252 !important;
    color: #ffffff !important;
    border-color: rgba(255, 75, 24, 0.5) !important;
}

body[data-theme="night"] .reconnect-spinner,
body.theme-night .reconnect-spinner {
    border-color: rgba(255, 255, 255, 0.15) !important;
    border-top-color: var(--fuzzbol-orange) !important;
}

/* ==========================================================================
   MATCH HUD & CONTROLS IN NIGHT MODE
   ========================================================================== */

body[data-theme="night"].match-view #screen-game.active .scoreboard-hud,
body.theme-night.match-view #screen-game.active .scoreboard-hud {
    background: rgba(10, 21, 37, 0.88) !important;
    border: 1px solid rgba(255, 75, 24, 0.35) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(12px) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"].match-view #screen-game.active .team-name,
body.theme-night.match-view #screen-game.active .team-name {
    color: #f0f6fc !important;
}

body[data-theme="night"].match-view #screen-game.active .btn-pause,
body.theme-night.match-view #screen-game.active .btn-pause {
    background: rgba(10, 21, 37, 0.88) !important;
    border: 1px solid rgba(255, 75, 24, 0.35) !important;
    color: #f0f6fc !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(12px) !important;
}

body[data-theme="night"].match-view #screen-game.active .btn-pause:hover,
body.theme-night.match-view #screen-game.active .btn-pause:hover {
    background: var(--fuzzbol-orange-fill) !important;
    color: #fff !important;
}

body[data-theme="night"].match-view #screen-game.active .hud-penalties-container,
body.theme-night.match-view #screen-game.active .hud-penalties-container {
    background: rgba(10, 21, 37, 0.88) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"].match-view #screen-game.active .penalty-label,
body.theme-night.match-view #screen-game.active .penalty-label {
    color: #8b9bb4 !important;
}

/* Career transitions: make the start and season boundary impossible to miss. */
body:has(#screen-career-welcome.active),
body:has(#screen-career-season-recap.active) {
    background-color: #edf2f4;
    background-image:
        linear-gradient(90deg, rgba(237, 242, 244, .86), rgba(237, 242, 244, .58) 50%, rgba(237, 242, 244, .84)),
        url('assets/menu_background.webp');
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

body[data-theme="night"]:has(#screen-career-welcome.active),
body.theme-night:has(#screen-career-welcome.active),
body[data-theme="night"]:has(#screen-career-season-recap.active),
body.theme-night:has(#screen-career-season-recap.active) {
    background-color: #08101c !important;
    background-image:
        linear-gradient(90deg, rgba(8, 16, 28, 0.94), rgba(8, 16, 28, 0.82) 50%, rgba(8, 16, 28, 0.94)),
        url('assets/menu_background.webp') !important;
    background-attachment: fixed !important;
}

body:has(#screen-career-welcome.active) #app-container,
body:has(#screen-career-season-recap.active) #app-container {
    max-width: 1500px;
    padding: 18px 28px 26px;
}

#screen-career-welcome.active,
#screen-career-season-recap.active {
    width: 100%;
    max-width: 1360px;
    padding: 0;
    align-items: stretch;
}

.career-transition-shell {
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #d8e1e5;
    border-radius: 12px;
    background: rgba(255, 255, 255, .97);
    color: var(--fuzzbol-navy);
    box-shadow: 0 20px 48px rgba(25, 43, 58, .12);
}

.career-welcome-shell {
    min-height: calc(100vh - 142px);
    display: grid;
    grid-template-columns: minmax(360px, .92fr) minmax(0, 1.08fr);
}

.career-transition-visual {
    position: relative;
    isolation: isolate;
    min-height: 590px;
    overflow: hidden;
    background: #102d43;
}

.career-cinematic-slot > img {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
    object-position: center;
    opacity: .7;
    transform: scale(1.04);
    animation: careerCinematicDrift 12s ease-in-out infinite alternate;
}

.career-cinematic-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(6, 20, 34, .12), rgba(6, 20, 34, .82) 82%),
        linear-gradient(90deg, rgba(6, 20, 34, .78), transparent 75%);
}

.career-cinematic-mark,
.career-video-placeholder {
    position: absolute;
    z-index: 2;
}

.career-cinematic-mark {
    top: 22px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #fff;
}

.career-cinematic-mark span,
.career-video-placeholder-kicker,
.career-transition-kicker,
.career-recap-section-kicker {
    color: var(--fuzzbol-orange);
    font: 900 .62rem/1.1 var(--font-mono);
    letter-spacing: .14em;
    text-transform: uppercase;
}

.career-cinematic-mark span { color: #ffb39c; }
.career-cinematic-mark strong {
    color: rgba(255, 255, 255, .84);
    font: 900 clamp(1.3rem, 2.5vw, 2.2rem)/.85 var(--font-display);
    letter-spacing: .04em;
}

.career-video-placeholder {
    left: 26px;
    right: 26px;
    bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    border-left: 3px solid var(--fuzzbol-orange);
    background: rgba(8, 25, 41, .72);
    backdrop-filter: blur(8px);
}

.career-video-placeholder strong {
    color: #fff;
    font: 900 clamp(1.5rem, 3vw, 2.55rem)/.95 var(--font-display);
    text-transform: uppercase;
}

.career-video-placeholder small { color: #cbd9e1; font-size: .72rem; }

@keyframes careerCinematicDrift {
    from { transform: scale(1.04) translate3d(0, 0, 0); }
    to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}

.career-transition-copy {
    min-width: 0;
    padding: clamp(30px, 5vw, 68px) clamp(28px, 6vw, 82px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.career-transition-copy h1,
.career-recap-heading h1 {
    margin: 12px 0 14px;
    color: var(--fuzzbol-navy);
    font: 900 clamp(2.8rem, 5.5vw, 5.7rem)/.86 var(--font-display);
    letter-spacing: -.015em;
    text-transform: uppercase;
}

.career-transition-lead { max-width: 600px; margin: 0; color: #5e7180; font-size: .95rem; line-height: 1.7; }

.career-welcome-profile {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 30px;
    border-top: 1px solid #dfe6e9;
    border-bottom: 1px solid #dfe6e9;
}

.career-welcome-profile > div { min-width: 0; padding: 14px 12px 14px 0; }
.career-welcome-profile > div + div { padding-left: 14px; border-left: 1px solid #dfe6e9; }
.career-welcome-profile span,
.career-welcome-profile > div > span { display: block; color: #5c6b77; font: 800 .56rem/1.2 var(--font-mono); letter-spacing: .08em; }
.career-welcome-profile strong { display: block; overflow: hidden; margin-top: 6px; color: var(--fuzzbol-navy); font: 900 .94rem/1.1 var(--font-display); text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.career-welcome-profile strong span { display: inline; color: inherit; font: inherit; letter-spacing: normal; }
.career-welcome-profile strong b { color: var(--fuzzbol-orange); }

.career-transition-route { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.career-transition-route > div { min-width: 0; padding: 12px; border: 1px solid #dfe6e9; background: #f7f9fa; }
.career-transition-route b { display: block; color: var(--fuzzbol-orange); font: 900 .68rem var(--font-mono); }
.career-transition-route span { display: block; margin-top: 7px; color: var(--fuzzbol-navy); font: 900 .86rem var(--font-display); text-transform: uppercase; }
.career-transition-route small { display: block; margin-top: 4px; color: #5c6b77; font-size: .64rem; line-height: 1.35; }

.career-transition-actions { display: flex; gap: 10px; align-items: center; margin-top: 30px; }
.career-transition-actions .btn-primary-start { min-height: 52px; border-radius: 7px; background: var(--fuzzbol-orange-fill); box-shadow: 0 9px 18px rgba(255, 75, 24, .18); }
.career-transition-actions .btn-primary-start:hover { background: var(--fuzzbol-orange-fill-hover); }

/* Between-season recap */
.career-recap-shell { padding: clamp(24px, 4vw, 48px); }
.career-recap-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid #dfe6e9; }
.career-recap-heading h1 { max-width: 760px; margin-bottom: 9px; font-size: clamp(2.7rem, 5vw, 5.15rem); }
.career-recap-heading p { max-width: 660px; color: #687b88; font-size: .88rem; line-height: 1.55; }
.career-recap-season-badge { flex: 0 0 auto; min-width: 96px; padding: 10px 14px; border-left: 3px solid var(--fuzzbol-orange); background: #f5f7f8; text-align: center; }
.career-recap-season-badge strong { display: block; color: var(--fuzzbol-navy); font: 900 2.6rem/.9 var(--font-mono); }
.career-recap-season-badge span { color: #7b8b95; font: 800 .53rem var(--font-mono); letter-spacing: .13em; }
.career-recap-result { display: flex; align-items: center; gap: 18px; margin: 24px 0 14px; padding: 20px; border: 1px solid #e6d4a8; background: #fff9ed; }
.career-recap-result-mark { flex: 0 0 58px; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; color: #ac751b; background: #f6e2ad; }
.career-recap-result-mark.is-negative { color: #a94437; background: #f5d6d1; }
.career-recap-result-mark svg { width: 30px; height: 30px; }
.career-recap-result h2 { margin: 4px 0 5px; color: var(--fuzzbol-navy); font: 900 clamp(1.6rem, 3vw, 2.55rem)/.95 var(--font-display); text-transform: uppercase; }
.career-recap-result p { color: #806b45; font-size: .75rem; line-height: 1.45; }
.career-recap-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.career-recap-stat-grid > div { min-width: 0; min-height: 102px; padding: 14px 16px; border: 1px solid #dfe6e9; background: #f7f9fa; }
.career-recap-stat-grid span { display: block; color: #7a8b95; font: 800 .57rem var(--font-mono); letter-spacing: .1em; }
.career-recap-stat-grid strong { display: block; overflow: hidden; margin: 10px 0 4px; color: var(--fuzzbol-navy); font: 900 clamp(1.35rem, 2.4vw, 2rem)/1 var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.career-recap-stat-grid small { color: #778792; font-size: .65rem; line-height: 1.35; }
.career-recap-next { margin-top: 28px; padding-top: 24px; border-top: 1px solid #dfe6e9; }
.career-recap-next-heading h2 { margin: 6px 0 4px; color: var(--fuzzbol-navy); font: 900 clamp(1.75rem, 3vw, 2.65rem)/.95 var(--font-display); text-transform: uppercase; }
.career-recap-next-heading p { color: #6b7d88; font-size: .76rem; }
.career-recap-next-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.career-recap-next-card { min-width: 0; min-height: 128px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; border: 1px solid #dfe6e9; border-top: 3px solid #cbd7dc; background: #fff; }
.career-recap-next-card.focus { border-top-color: var(--fuzzbol-orange); background: #fff7f2; }
.career-recap-next-card > span { color: #82919a; font: 800 .56rem var(--font-mono); letter-spacing: .1em; }
.career-recap-next-card strong { color: var(--fuzzbol-navy); font: 900 1.2rem/1 var(--font-display); text-transform: uppercase; }
.career-recap-next-card small { color: #687b87; font-size: .68rem; line-height: 1.4; }
.career-recap-actions { justify-content: flex-end; margin-top: 26px; }
.career-recap-actions .btn-secondary { min-height: 52px; padding: 0 18px; border: 1px solid #cbd8de; border-radius: 7px; color: var(--fuzzbol-navy); background: #fff; cursor: pointer; font: 800 .74rem var(--font-body); }
.career-recap-actions .btn-secondary:hover { border-color: var(--fuzzbol-orange); background: #fff7f2; }

@media (max-width: 980px) {
    .career-welcome-shell { grid-template-columns: 1fr; }
    .career-transition-visual { min-height: 400px; }
    .career-transition-copy { padding: 34px 28px 38px; }
}

@media (max-width: 680px) {
    body:has(#screen-career-welcome.active) #app-container,
    body:has(#screen-career-season-recap.active) #app-container { padding: 10px 14px 22px; }
    #screen-career-welcome.active,
    #screen-career-season-recap.active { padding: 0; }
    .career-transition-visual { min-height: 330px; }
    .career-video-placeholder { left: 16px; right: 16px; bottom: 16px; }
    .career-transition-copy { padding: 28px 20px 24px; }
    .career-transition-copy h1,
    .career-recap-heading h1 { font-size: 3.2rem; }
    .career-welcome-profile { grid-template-columns: 1fr; }
    .career-welcome-profile > div,
    .career-welcome-profile > div + div { padding: 12px 0; border-left: 0; }
    .career-welcome-profile > div + div { border-top: 1px solid #dfe6e9; }
    .career-transition-route,
    .career-recap-stat-grid,
    .career-recap-next-grid { grid-template-columns: 1fr; }
    .career-recap-shell { padding: 22px 16px; }
    .career-recap-heading { gap: 12px; }
    .career-recap-season-badge { min-width: 72px; padding: 8px 6px; }
    .career-recap-season-badge strong { font-size: 2rem; }
    .career-recap-result { align-items: flex-start; padding: 16px; }
    .career-recap-result-mark { flex-basis: 46px; width: 46px; height: 46px; }
    .career-recap-result-mark svg { width: 24px; height: 24px; }
    .career-recap-actions { flex-direction: column-reverse; align-items: stretch; }
    .career-recap-actions > * { width: 100%; }
}

/* ========================================================================
   CAREER INFORMATION ARCHITECTURE — clear route, priority and hierarchy
   ======================================================================== */

#screen-career-hub .career-nav {
    gap: 17px;
}

#screen-career-hub .career-nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#screen-career-hub .career-nav-group + .career-nav-group {
    padding-top: 13px;
    border-top: 1px solid rgba(119, 142, 162, .2);
}

#screen-career-hub .career-nav-group-label {
    padding: 0 11px 4px;
    color: var(--ink-3);
    font: 800 .56rem var(--font-mono);
    letter-spacing: .13em;
    text-transform: uppercase;
}

#screen-career-hub .career-nav-item {
    min-height: 40px;
    border-left: 2px solid transparent;
    border-radius: 5px;
}

#screen-career-hub .career-nav-item.active {
    border-left-color: var(--fuzzbol-orange, #ff4b18);
    background: rgba(255, 75, 24, .11);
}

#screen-career-hub .career-workspace-header {
    padding-bottom: 18px;
}

#screen-career-hub .career-workspace-header > div:first-child {
    min-width: min(440px, 100%);
}

#screen-career-hub #career-view-description {
    margin: 5px 0 3px;
    color: var(--ink-2);
    font-size: .84rem;
    font-weight: 650;
    line-height: 1.4;
}

#screen-career-hub #career-club-line {
    color: var(--ink-3);
    font-size: .68rem;
}

#screen-career-hub .career-view {
    padding-top: 24px;
}

#screen-career-hub .career-view > .career-section-heading {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(119, 142, 162, .22);
}

#screen-career-hub [data-career-panel="home"] > .career-section-label {
    margin-top: 25px;
    color: var(--fuzzbol-orange);
    font-size: .61rem;
    letter-spacing: .13em;
}

#screen-career-hub [data-career-panel="home"] > .career-next-match-label {
    margin-top: 20px;
    margin-bottom: 9px;
}

#screen-career-hub .career-next-match {
    margin-bottom: 0;
    box-shadow: 0 9px 24px rgba(18, 48, 70, .08);
}

#screen-career-hub .career-next-match-copy {
    align-self: center;
}

#screen-career-hub .career-match-actions {
    grid-template-columns: minmax(180px, .82fr) minmax(240px, 1.18fr);
}

#screen-career-hub .career-match-action {
    min-height: 112px;
}

#screen-career-hub .career-match-action.featured {
    background: var(--fuzzbol-orange-fill);
    border-color: var(--fuzzbol-orange, #ff4b18);
    box-shadow: 0 8px 18px rgba(255, 75, 24, .2);
}

#screen-career-hub .career-match-action.featured:hover:not(:disabled) {
    background: var(--fuzzbol-orange-fill-hover);
    border-color: #e94313;
    box-shadow: 0 10px 22px rgba(255, 75, 24, .28);
}

#screen-career-hub .career-match-action.featured strong,
#screen-career-hub .career-match-action.featured small,
#screen-career-hub .career-match-action.featured .career-match-action-icon {
    color: #fff;
}

#screen-career-hub .career-club-panel {
    margin-top: 0;
    box-shadow: 0 5px 16px rgba(18, 48, 70, .05);
}

#screen-career-hub .career-metrics-grid {
    margin-top: 20px;
}

#screen-career-hub .career-objective {
    margin-top: 10px;
}

@media (max-width: 980px) {
    #screen-career-hub .career-nav {
        align-items: stretch;
        gap: 14px;
    }

    #screen-career-hub .career-nav-group {
        flex: 0 0 auto;
        min-width: max-content;
    }

    #screen-career-hub .career-nav-group + .career-nav-group {
        padding-top: 0;
        padding-left: 14px;
        border-top: 0;
        border-left: 1px solid rgba(119, 142, 162, .2);
    }

    #screen-career-hub .career-nav-group-label {
        padding-left: 4px;
    }

    #screen-career-hub .career-nav-item {
        width: auto;
    }
}

@media (max-width: 620px) {
    #screen-career-hub .career-match-actions {
        grid-template-columns: 1fr;
    }

    #screen-career-hub .career-match-action.featured {
        order: -1;
    }

    #screen-career-hub #career-view-description {
        font-size: .78rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .career-cinematic-slot > img { animation: none; }
}

/* ==========================================================================
   CAREER TRANSITIONS IN NIGHT MODE (WELCOME & SEASON RECAP)
   ========================================================================== */

body[data-theme="night"] .career-transition-shell,
body.theme-night .career-transition-shell {
    background: #0d1a2d !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f0f6fc !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5) !important;
}

body[data-theme="night"] #screen-career-welcome .career-transition-copy,
body.theme-night #screen-career-welcome .career-transition-copy,
body[data-theme="night"] #screen-career-season-recap .career-recap-shell,
body.theme-night #screen-career-season-recap .career-recap-shell {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-welcome .career-transition-copy h1,
body.theme-night #screen-career-welcome .career-transition-copy h1,
body[data-theme="night"] #screen-career-season-recap .career-recap-heading h1,
body.theme-night #screen-career-season-recap .career-recap-heading h1,
body[data-theme="night"] #screen-career-season-recap .career-recap-result h2,
body.theme-night #screen-career-season-recap .career-recap-result h2,
body[data-theme="night"] #screen-career-season-recap .career-recap-next-heading h2,
body.theme-night #screen-career-season-recap .career-recap-next-heading h2,
body[data-theme="night"] #screen-career-welcome .career-welcome-profile strong,
body.theme-night #screen-career-welcome .career-welcome-profile strong,
body[data-theme="night"] #screen-career-welcome .career-transition-route span,
body.theme-night #screen-career-welcome .career-transition-route span,
body[data-theme="night"] #screen-career-season-recap .career-recap-season-badge strong,
body.theme-night #screen-career-season-recap .career-recap-season-badge strong,
body[data-theme="night"] #screen-career-season-recap .career-recap-stat-grid strong,
body.theme-night #screen-career-season-recap .career-recap-stat-grid strong,
body[data-theme="night"] #screen-career-season-recap .career-recap-next-card strong,
body.theme-night #screen-career-season-recap .career-recap-next-card strong {
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-welcome .career-transition-lead,
body.theme-night #screen-career-welcome .career-transition-lead,
body[data-theme="night"] #screen-career-season-recap .career-recap-heading p,
body.theme-night #screen-career-season-recap .career-recap-heading p,
body[data-theme="night"] #screen-career-season-recap .career-recap-next-heading p,
body.theme-night #screen-career-season-recap .career-recap-next-heading p {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-welcome .career-welcome-profile,
body.theme-night #screen-career-welcome .career-welcome-profile {
    border-top-color: rgba(255, 255, 255, 0.12) !important;
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-welcome .career-welcome-profile > div + div,
body.theme-night #screen-career-welcome .career-welcome-profile > div + div {
    border-left-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-welcome .career-welcome-profile span,
body.theme-night #screen-career-welcome .career-welcome-profile span,
body[data-theme="night"] #screen-career-welcome .career-transition-route small,
body.theme-night #screen-career-welcome .career-transition-route small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-welcome .career-transition-route > div,
body.theme-night #screen-career-welcome .career-transition-route > div {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-heading,
body.theme-night #screen-career-season-recap .career-recap-heading {
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-season-badge,
body.theme-night #screen-career-season-recap .career-recap-season-badge {
    background: #102137 !important;
    border-left-color: var(--fuzzbol-orange) !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-season-badge span,
body.theme-night #screen-career-season-recap .career-recap-season-badge span {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-result,
body.theme-night #screen-career-season-recap .career-recap-result {
    background: rgba(255, 75, 24, 0.12) !important;
    border-color: rgba(255, 75, 24, 0.28) !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-result p,
body.theme-night #screen-career-season-recap .career-recap-result p {
    color: #cbd9e1 !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-result-mark,
body.theme-night #screen-career-season-recap .career-recap-result-mark {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #facc15 !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-result-mark.is-negative,
body.theme-night #screen-career-season-recap .career-recap-result-mark.is-negative {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-stat-grid > div,
body.theme-night #screen-career-season-recap .career-recap-stat-grid > div {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-stat-grid span,
body.theme-night #screen-career-season-recap .career-recap-stat-grid span,
body[data-theme="night"] #screen-career-season-recap .career-recap-stat-grid small,
body.theme-night #screen-career-season-recap .career-recap-stat-grid small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-next,
body.theme-night #screen-career-season-recap .career-recap-next {
    border-top-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-next-card,
body.theme-night #screen-career-season-recap .career-recap-next-card {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    border-top-color: rgba(255, 255, 255, 0.25) !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-next-card.focus,
body.theme-night #screen-career-season-recap .career-recap-next-card.focus {
    background: rgba(255, 75, 24, 0.14) !important;
    border-color: rgba(255, 75, 24, 0.3) !important;
    border-top-color: var(--fuzzbol-orange) !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-next-card small,
body.theme-night #screen-career-season-recap .career-recap-next-card small {
    color: #8b9bb4 !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-next-card > span,
body.theme-night #screen-career-season-recap .career-recap-next-card > span {
    color: var(--fuzzbol-orange) !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-actions .btn-secondary,
body.theme-night #screen-career-season-recap .career-recap-actions .btn-secondary {
    background: #102137 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f0f6fc !important;
}

body[data-theme="night"] #screen-career-season-recap .career-recap-actions .btn-secondary:hover,
body.theme-night #screen-career-season-recap .career-recap-actions .btn-secondary:hover {
    background: rgba(255, 75, 24, 0.18) !important;
    border-color: var(--fuzzbol-orange) !important;
}

body[data-theme="night"] #screen-career-hub .career-attr-actions .career-action-button.secondary,
body.theme-night #screen-career-hub .career-attr-actions .career-action-button.secondary,
body.night-mode #screen-career-hub .career-attr-actions .career-action-button.secondary {
    color: #d7e2ef !important;
    background: transparent !important;
    border: 1px solid #607188 !important;
    box-shadow: none !important;
}

body[data-theme="night"] #screen-career-hub .career-attr-actions .career-action-button.secondary:hover:not(:disabled),
body.theme-night #screen-career-hub .career-attr-actions .career-action-button.secondary:hover:not(:disabled),
body.night-mode #screen-career-hub .career-attr-actions .career-action-button.secondary:hover:not(:disabled) {
    color: #ff9b73 !important;
    background: rgba(255, 75, 24, .10) !important;
    border-color: #ff7d56 !important;
}

body[data-theme="night"] #screen-career-hub .career-attr-actions .career-action-button.secondary:disabled,
body.theme-night #screen-career-hub .career-attr-actions .career-action-button.secondary:disabled,
body.night-mode #screen-career-hub .career-attr-actions .career-action-button.secondary:disabled {
    color: #64748b !important;
    background: rgba(255, 255, 255, .06) !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    box-shadow: none !important;
}

body[data-theme="night"] #screen-career-hub .career-attr-allocation,
body.theme-night #screen-career-hub .career-attr-allocation,
body.night-mode #screen-career-hub .career-attr-allocation {
    color: #9fb0c7 !important;
}

/* ==========================================================================
   SHARED HEADER ON PHONES — every screen except the home dashboard. The
   per-screen `body:has(#screen-…)` blocks above carry an id in their
   selector, so these use #app-container to outrank them on order alone.
   Row one: logo + icon actions. Row two: the section tabs, scrollable.
   ========================================================================== */
@media (max-width: 640px) {
    html body:not(.home-view) #app-container .app-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 8px;
        min-height: 0;
        margin-bottom: 12px;
        padding: 6px 10px 0;
        border-left-width: 3px;
    }
    html body:not(.home-view) #app-container .app-header .js-home-logo {
        width: auto;
        min-height: 0;
        margin-right: auto;
    }
    html body:not(.home-view) #app-container .app-header .brand-lockup {
        width: 72px;
        height: 52px;
    }
    html body:not(.home-view) #app-container .header-actions {
        width: auto;
        gap: 4px;
        justify-content: flex-end;
    }
    html body:not(.home-view) #app-container .header-actions .btn-icon {
        min-width: 40px;
        min-height: 40px;
        padding: 0 10px;
        justify-content: center;
    }
    html body:not(.home-view) #app-container .btn-icon .btn-text { display: none; }
    html body:not(.home-view) #app-container .match-nav {
        order: 3;
        width: 100%;
        min-height: 0;
        margin: 0 -10px;
        padding: 0 10px;
        display: flex;
        justify-content: flex-start;
        gap: 0;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid rgba(128, 140, 155, .22);
    }
    html body:not(.home-view) #app-container .match-nav::-webkit-scrollbar { display: none; }
    html body:not(.home-view) #app-container .match-nav-item {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 0 12px;
        font-size: .68rem;
        white-space: nowrap;
        scroll-snap-align: start;
    }
    html body:not(.home-view) #app-container .match-nav-item.active::after {
        right: 12px;
        left: 12px;
        bottom: 0;
    }
}

/* ==========================================================================
   CAREER HUB ON PHONES — the grouped sidebar navigation flattens into one
   scrollable chip row. Group labels stay for screen readers only.
   ========================================================================== */
@media (max-width: 980px) {
    #screen-career-hub .career-sidebar {
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 10px 10px 4px;
    }
    #screen-career-hub .career-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        margin: 0 -10px;
        padding: 2px 10px 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 10px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    #screen-career-hub .career-nav::-webkit-scrollbar { display: none; }
    #screen-career-hub .career-nav-group { display: contents; }
    #screen-career-hub .career-nav-group-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
    #screen-career-hub .career-nav-item {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        width: auto;
        min-height: 40px;
        padding: 0 13px 0 10px;
        border: 1px solid rgba(119, 142, 162, .28);
        border-radius: 999px;
        font-size: .74rem;
        white-space: nowrap;
        scroll-snap-align: start;
    }
    #screen-career-hub .career-nav-item.active {
        border-color: var(--fuzzbol-orange, #ff4b18);
        background: rgba(255, 75, 24, .14);
    }
    #screen-career-hub .career-exit {
        display: block;
        width: 100%;
        margin: 4px 0 6px;
        min-height: 42px;
    }
    #screen-career-hub .career-workspace { padding: 14px 12px 20px; }
    #screen-career-hub .career-workspace-header { flex-wrap: wrap; gap: 10px; }
    #screen-career-hub .career-header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    #screen-career-hub .career-header-actions > button { flex: 1 1 120px; min-height: 42px; padding-left: 10px; padding-right: 10px; }
    #screen-career-hub .career-header-actions .career-save-status { flex: 1 1 100%; }
}

@media (max-width: 620px) {
    /* The later 4-column showcase rule (crest · copy · tactics board · honors)
       outranks the phone one above by order; the board is hidden here anyway. */
    #screen-career-hub .career-team-showcase { grid-template-columns: 62px minmax(0, 1fr); }
    #screen-career-hub .career-team-honors { grid-column: 1 / -1; width: auto; }
    /* Five stat filters do not fit one row on a phone. */
    #screen-career-hub .career-stats-analytics-head { flex-wrap: wrap; }
    #screen-career-hub .career-stats-filter-pills { flex-wrap: wrap; width: 100%; }
    #screen-career-hub .career-stats-filter-pills .btn-mode { flex: 1 1 30%; padding: 9px 6px; font-size: .78rem; }
}
@media (max-width: 620px) {
    /* The floating action lands on the overall badge at phone widths. */
    #screen-career-hub .career-player-spotlight .career-spotlight-action {
        position: static;
        grid-column: 1 / -1;
        justify-self: start;
        margin-top: 10px;
    }
}

/* ========================================================================
   CAREER MODE — user-first order and guided entry
   ======================================================================== */

#screen-career-hub .career-view[data-career-panel="home"].active {
    display: flex;
    flex-direction: column;
}

#screen-career-hub .career-view[data-career-panel="home"] > .career-story-hero {
    order: 3;
    min-height: 190px;
    margin-top: 22px;
}

#screen-career-hub .career-view[data-career-panel="home"] > .career-season-finale,
#screen-career-hub .career-view[data-career-panel="home"] > .career-relegation-notice,
#screen-career-hub .career-view[data-career-panel="home"] > .career-reward-recap {
    order: 0;
}

#screen-career-hub .career-view[data-career-panel="home"] > .career-next-match-label {
    order: 1;
}

#screen-career-hub .career-view[data-career-panel="home"] > .career-next-match {
    order: 2;
}

#screen-career-hub .career-view[data-career-panel="home"] > .career-section-label:not(.career-next-match-label) {
    order: 4;
}

#screen-career-hub .career-view[data-career-panel="home"] > .career-club-panel,
#screen-career-hub .career-view[data-career-panel="home"] > .career-metrics-grid,
#screen-career-hub .career-view[data-career-panel="home"] > .career-objective,
#screen-career-hub .career-view[data-career-panel="home"] > .career-howto,
#screen-career-hub .career-view[data-career-panel="home"] > .career-decision,
#screen-career-hub .career-view[data-career-panel="home"] > .career-notifications-panel {
    order: 5;
}

/* The full trophy wall belongs to History. Keep only the actionable season
   status on Home, so the next match remains the visual priority. */
#screen-career-hub .career-view[data-career-panel="home"] > .career-honor-shelf {
    display: none;
}

#screen-career-hub .career-view[data-career-panel="home"] > .career-story-hero .career-journey {
    max-width: 560px;
}

#screen-career-hub .career-guide-button > span:first-child {
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font: 800 .72rem/1 var(--font-mono);
}

#screen-career-hub.career-guide-open .career-guide-highlight {
    position: relative;
    z-index: 1003;
    border-color: var(--fuzzbol-orange, #ff4b18) !important;
    background: var(--fuzzbol-orange, var(--fuzzbol-orange-fill)) !important;
    color: #fff !important;
    box-shadow: 0 0 0 7px rgba(255, 75, 24, .2), 0 8px 24px rgba(10, 26, 42, .26);
    pointer-events: none;
}

#screen-career-hub .career-guide-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #122d42;
}

#screen-career-hub .career-guide-overlay[aria-hidden="true"] {
    display: none;
}

#screen-career-hub .career-guide-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 15, 27, .76);
    backdrop-filter: blur(3px);
}

#screen-career-hub .career-guide-dialog {
    position: relative;
    z-index: 1001;
    width: min(100%, 510px);
    padding: 25px 27px 22px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 18px;
    background: #f8fbfd;
    box-shadow: 0 24px 70px rgba(2, 10, 20, .42);
}

#screen-career-hub .career-guide-dialog-topline {
    display: flex;
    align-items: center;
    gap: 12px;
}

#screen-career-hub .career-guide-kicker {
    color: var(--fuzzbol-orange);
    font: 800 .62rem var(--font-mono);
    letter-spacing: .13em;
}

#screen-career-hub .career-guide-step {
    margin-left: auto;
    color: #5c6b77;
    font: 800 .65rem var(--font-mono);
    letter-spacing: .08em;
}

#screen-career-hub .career-guide-close {
    display: grid;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    place-items: center;
    border: 1px solid #c7d4dc;
    border-radius: 50%;
    background: transparent;
    color: #476277;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

#screen-career-hub .career-guide-dialog h3 {
    margin: 24px 0 10px;
    color: #102d43;
    font: 900 clamp(1.55rem, 3vw, 2.05rem)/1.05 var(--font-display);
    letter-spacing: -.025em;
}

#screen-career-hub .career-guide-dialog h3:focus {
    outline: none;
}

#screen-career-hub .career-guide-dialog > p {
    min-height: 66px;
    margin: 0;
    color: #4f687c;
    font-size: .95rem;
    line-height: 1.6;
}

#screen-career-hub .career-guide-route {
    margin-top: 19px;
    padding: 11px 13px;
    border-left: 3px solid #e65a28;
    background: rgba(230, 90, 40, .08);
    color: #9b3a1b;
    font: 800 .62rem/1.4 var(--font-mono);
    letter-spacing: .08em;
}

#screen-career-hub .career-guide-dots {
    display: flex;
    gap: 6px;
    margin: 20px 0 22px;
}

#screen-career-hub .career-guide-dots span {
    width: 20px;
    height: 4px;
    border-radius: 999px;
    background: #d1dce2;
}

#screen-career-hub .career-guide-dots span.active {
    background: #e65a28;
}

#screen-career-hub .career-guide-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#screen-career-hub .career-guide-actions > div {
    display: flex;
    gap: 8px;
}

#screen-career-hub .career-guide-actions button {
    min-height: 42px;
}

body[data-theme="night"] #screen-career-hub .career-guide-dialog,
body.theme-night #screen-career-hub .career-guide-dialog,
body.night-mode #screen-career-hub .career-guide-dialog {
    border-color: rgba(255, 255, 255, .14);
    background: #12263d;
    color: #eff6fb;
}

body[data-theme="night"] #screen-career-hub .career-guide-dialog h3,
body.theme-night #screen-career-hub .career-guide-dialog h3,
body.night-mode #screen-career-hub .career-guide-dialog h3 {
    color: #f5f8fb;
}

body[data-theme="night"] #screen-career-hub .career-guide-dialog > p,
body.theme-night #screen-career-hub .career-guide-dialog > p,
body.night-mode #screen-career-hub .career-guide-dialog > p {
    color: #b6c7d5;
}

body[data-theme="night"] #screen-career-hub .career-guide-close,
body.theme-night #screen-career-hub .career-guide-close,
body.night-mode #screen-career-hub .career-guide-close {
    border-color: rgba(255, 255, 255, .2);
    color: #d6e2eb;
}

@media (max-width: 620px) {
    #screen-career-hub .career-guide-overlay {
        align-items: end;
        padding: 12px;
    }

    #screen-career-hub .career-guide-dialog {
        padding: 20px 18px 16px;
        border-radius: 15px;
    }

    #screen-career-hub .career-guide-dialog h3 {
        margin-top: 19px;
        font-size: 1.55rem;
    }

    #screen-career-hub .career-guide-dialog > p {
        min-height: 0;
        font-size: .88rem;
    }

    #screen-career-hub .career-guide-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    #screen-career-hub .career-guide-actions > div,
    #screen-career-hub .career-guide-actions > button {
        width: 100%;
    }

    #screen-career-hub .career-guide-actions > div > button {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    #screen-career-hub .career-guide-backdrop { backdrop-filter: none; }
}

/* The guide is promoted to <body> while open to escape the career shell's
   independent scroll/overflow context. Keep an id-scoped copy of the modal
   rules so its visual contract survives that promotion. */
#career-guide.career-guide-overlay {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #122d42;
}

#career-guide.career-guide-overlay[aria-hidden="true"] { display: none; }
#career-guide .career-guide-backdrop { position: absolute; inset: 0; background: rgba(5, 15, 27, .76); backdrop-filter: blur(3px); }
#career-guide .career-guide-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 510px);
    padding: 25px 27px 22px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 18px;
    background: #f8fbfd;
    box-shadow: 0 24px 70px rgba(2, 10, 20, .42);
}

#career-guide .career-guide-dialog-topline { display: flex; align-items: center; gap: 12px; }
#career-guide .career-guide-kicker { color: var(--fuzzbol-orange); font: 800 .62rem var(--font-mono); letter-spacing: .13em; }
#career-guide .career-guide-step { margin-left: auto; color: #5c6b77; font: 800 .65rem var(--font-mono); letter-spacing: .08em; }
#career-guide .career-guide-close {
    display: grid; width: 32px; height: 32px; margin-left: 4px; place-items: center;
    border: 1px solid #c7d4dc; border-radius: 50%; background: transparent; color: #476277;
    font-size: 1.4rem; line-height: 1; cursor: pointer;
}

#career-guide .career-guide-dialog h3 { margin: 24px 0 10px; color: #102d43; font: 900 clamp(1.55rem, 3vw, 2.05rem)/1.05 var(--font-display); letter-spacing: -.025em; }
#career-guide .career-guide-dialog h3:focus { outline: none; }
#career-guide .career-guide-dialog > p { min-height: 66px; margin: 0; color: #4f687c; font-size: .95rem; line-height: 1.6; }
#career-guide .career-guide-route { margin-top: 19px; padding: 11px 13px; border-left: 3px solid #e65a28; background: rgba(230, 90, 40, .08); color: #9b3a1b; font: 800 .62rem/1.4 var(--font-mono); letter-spacing: .08em; }
#career-guide .career-guide-dots { display: flex; gap: 6px; margin: 20px 0 22px; }
#career-guide .career-guide-dots span { width: 20px; height: 4px; border-radius: 999px; background: #d1dce2; }
#career-guide .career-guide-dots span.active { background: #e65a28; }
#career-guide .career-guide-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#career-guide .career-guide-actions > div { display: flex; gap: 8px; }
#career-guide .career-guide-actions button { min-height: 42px; }

body[data-theme="night"] #career-guide .career-guide-dialog,
body.theme-night #career-guide .career-guide-dialog,
body.night-mode #career-guide .career-guide-dialog { border-color: rgba(255, 255, 255, .14); background: #12263d; color: #eff6fb; }
body[data-theme="night"] #career-guide .career-guide-dialog h3,
body.theme-night #career-guide .career-guide-dialog h3,
body.night-mode #career-guide .career-guide-dialog h3 { color: #f5f8fb; }
body[data-theme="night"] #career-guide .career-guide-dialog > p,
body.theme-night #career-guide .career-guide-dialog > p,
body.night-mode #career-guide .career-guide-dialog > p { color: #b6c7d5; }
body[data-theme="night"] #career-guide .career-guide-close,
body.theme-night #career-guide .career-guide-close,
body.night-mode #career-guide .career-guide-close { border-color: rgba(255, 255, 255, .2); color: #d6e2eb; }

@media (max-width: 620px) {
    #career-guide.career-guide-overlay { align-items: end; padding: 12px; }
    #career-guide .career-guide-dialog { padding: 20px 18px 16px; border-radius: 15px; }
    #career-guide .career-guide-dialog h3 { margin-top: 19px; font-size: 1.55rem; }
    #career-guide .career-guide-dialog > p { min-height: 0; font-size: .88rem; }
    #career-guide .career-guide-actions { align-items: stretch; flex-direction: column-reverse; }
    #career-guide .career-guide-actions > div,
    #career-guide .career-guide-actions > button { width: 100%; }
    #career-guide .career-guide-actions > div > button { flex: 1; }
}

/* ==========================================================================
   QUICK MATCH + ONLINE — night-theme legibility and phone spacing
   ========================================================================== */
/* The night rule above paints every span in the stadium preview white; the
   surface tags keep their light pill background, so give them a dark one. */
body[data-theme="night"] .stadium-preview-box .setup-stadium-tags span,
body.theme-night .stadium-preview-box .setup-stadium-tags span {
    color: #c9d6e2 !important;
    background: rgba(255, 255, 255, .09);
}
body[data-theme="night"] .stadium-preview-box .setup-stadium-tags span:first-child,
body.theme-night .stadium-preview-box .setup-stadium-tags span:first-child {
    color: #7fd6a4 !important;
    background: rgba(37, 189, 114, .16);
}
/* --fuzzbol-navy flips to near-white at night, which the forced white
   background of the secondary lobby button did not account for. */
body[data-theme="night"] #btn-join-room.btn-online-secondary,
body.theme-night #btn-join-room.btn-online-secondary {
    background: rgba(255, 255, 255, .06) !important;
    color: #f0f6fc !important;
    border-color: rgba(255, 255, 255, .22);
}
body[data-theme="night"] #btn-join-room.btn-online-secondary:hover,
body.theme-night #btn-join-room.btn-online-secondary:hover {
    background: rgba(255, 75, 24, .18) !important;
}

@media (max-width: 760px) {
    /* The 2rem arrow glyph is 32px wide and hung past the card edge. */
    .setup-team-picker { grid-template-columns: 26px minmax(52px, 1fr) 26px; padding-inline: 0; }
    .team-step { font-size: 1.5rem; min-width: 26px; padding: 0; justify-self: center; }
    .team-step:hover { transform: none; }
}

@media (max-width: 620px) {
    /* Three nested cards left ~200px for the lobby inputs. */
    #screen-online .glass-card.center-card { padding: 18px 14px; }
    #screen-online .settings-section.online-lobby-card { padding: 16px 12px; }
    #screen-online .online-setup-block { padding: 12px 10px; }
    #screen-online .online-lobby-card .btn-primary-start,
    #screen-online .online-lobby-card .btn-secondary { min-height: 46px; }
}

/* Final alignment pass for every in-match overlay. */
.pause-overlay .pause-card { text-align: center; }
.pause-overlay .pause-actions { align-items: stretch; }
.pause-overlay .pause-actions button,
.pause-overlay .pause-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    text-align: center;
    line-height: 1.15;
    white-space: normal;
}

/* Community hub: a compact bridge from the game to retention surfaces. */
.community-hub {
    display: grid;
    gap: 14px;
    margin: 18px 0 8px;
    padding: 18px;
    border: 1px solid #dfe5e8;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff 0%, #f5f9fa 100%);
    box-shadow: 0 8px 18px rgba(25, 43, 58, .06);
}
.community-hub-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.community-hub-heading h2 { margin-top: 7px; color: #18324a; font: 900 1.14rem/1.1 var(--font-display); text-transform: uppercase; }
.community-hub-heading p { margin-top: 6px; color: #5c6b77; font-size: .78rem; }
.community-hub-heading .btn-primary-start { flex: 0 0 auto; min-height: 38px; padding: 9px 13px; text-decoration: none; }
.community-hub-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.community-panel { min-width: 0; padding: 13px; border: 1px solid #e1e7e9; border-radius: 10px; background: rgba(255,255,255,.78); }
.community-panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid #e7ecee; }
.community-panel-heading h3 { color: #233a50; font: 900 .78rem/1.15 var(--font-body); }
.community-panel-heading span { color: #5c6b77; font: 800 .48rem var(--font-mono); letter-spacing: .08em; white-space: nowrap; }
.community-leaderboard, .community-events { display: grid; gap: 7px; padding-top: 9px; }
.community-leaderboard-row { display: grid; grid-template-columns: 34px minmax(0,1fr) 38px 42px; align-items: center; gap: 7px; min-height: 29px; }
.community-leaderboard-columns { display: grid; grid-template-columns: 34px minmax(0,1fr) 38px 52px; gap: 7px; padding-top: 8px; color: #5c6b77; font: 800 .5rem var(--font-mono); text-align: right; }
.community-leaderboard-row { grid-template-columns: 34px minmax(0,1fr) 38px 52px; }
.online-presence-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 20px; }
.online-presence-summary > div { display: flex; align-items: baseline; gap: 7px; padding: 9px 14px; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; }
.online-presence-summary strong { color: var(--fuzzbol-orange); font: 900 1.2rem var(--font-display); }
.online-presence-summary span { font: 800 .65rem var(--font-mono); letter-spacing: .05em; }
.community-rank { color: var(--fuzzbol-orange); font: 900 .7rem var(--font-mono); }
.community-leaderboard-row strong { overflow: hidden; color: #294257; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.community-leaderboard-row small { color: #5c6b77; font: 800 .55rem var(--font-mono); }
.community-leaderboard-row b { color: #18324a; font: 900 .82rem var(--font-display); text-align: right; }
.community-empty { color: #5c6b77; font-size: .73rem; line-height: 1.35; }
.community-event-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; }
.community-event-row strong { overflow: hidden; color: #294257; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.community-event-row small { grid-column: 1; color: #5c6b77; font: 700 .58rem var(--font-mono); }
.community-event-row a { grid-column: 2; grid-row: 1 / span 2; color: #e94d1e; font: 800 .62rem var(--font-body); text-decoration: none; }
.community-event-row a:hover { text-decoration: underline; }
@media (max-width: 720px) {
    .community-hub { padding: 14px; }
    .community-hub-heading { align-items: flex-start; flex-direction: column; }
    .community-hub-heading .btn-primary-start { width: auto; }
    .community-hub-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   VISUAL AUDIT FIXES — found by `npm run audit:visual` (scripts/visual-audit.js)
   ========================================================================== */

/* Quick match on portrait tablets: two columns left each team card ~125px,
   so names, stats and the team arrows collided with the crest. One column
   gives the duel the full width, as on phones. The tournament setup had the
   same squeeze: cut team name, summary labels and a wrapped start button. */
@media (min-width: 461px) and (max-width: 900px) {
    #screen-setup.match-setup-screen .match-setup-shell,
    #screen-tournament-setup .competition-setup-shell { grid-template-columns: 1fr; }
    #screen-setup.match-setup-screen .match-setup-shell > .glass-card,
    #screen-tournament-setup .competition-setup-shell > .glass-card { height: auto; overflow: visible; }
}

/* Competition summaries carry the real rules ("Eliminación directa · cuartos,
   semis y final"); cutting them with an ellipsis hid exactly that. Let the
   short meta lines wrap onto a second line instead. */
#tourney-create-meta,
#tourney-match-meta,
.competition-summary-meta strong,
.competition-summary-meta em {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Tournament bracket preview: the semifinal slots were placed with fixed
   paddings tuned for one height, so in the compact desktop layout the lower
   semifinal drifted away from its pair and the last quarterfinal ran into
   the summary row. Center each semifinal in its half of the bracket and let
   the decorative banner give up height first. */
body:has(#screen-tournament-setup.active) #screen-tournament-setup .bracket-semis {
    display: grid;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    padding: 0;
}
#screen-tournament-setup .competition-summary-card .competition-bracket-preview { flex: 0 0 auto; }
#screen-tournament-setup .bracket-grid { height: auto; }
#screen-tournament-setup .competition-banner-image-only {
    flex: 1 1 72px;
    min-height: 0;
}
#screen-tournament-setup .competition-banner-image-only img { height: 100%; min-height: 0; }

/* Volume sliders were 16px tall: hard to grab with a thumb mid-match. */
input[type="range"] { min-height: 28px; }
@media (pointer: coarse) {
    input[type="range"] { min-height: 44px; }
}

/* Touch targets: on phones and tablets several controls were 7–19px tall
   (stadium dots, the Explora links, Export/Import save, the theme button).
   Grow the hit area to at least 40px without changing how they look. */
@media (pointer: coarse) {
    .home-seo-nav a {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
        padding-inline: 2px;
    }
    #home-theme-button,
    #home-view-all-stadiums,
    .weather-row > button,
    .coverflow-arrow,
    #btn-career-guide-close {
        min-width: 40px;
        min-height: 40px;
    }
    .setup-stadium-dot {
        box-sizing: content-box;
        border: 12px solid transparent;
        margin: -12px -6px;
        background-clip: content-box;
    }
    #screen-settings.active .settings-action-btn { min-height: 44px; }
}

/* Community hub was never given night colors: a white card whose kicker
   turned white too, so "COMUNIDAD FUZZBOL" vanished on the default theme. */
body[data-theme="night"] .community-hub,
body.theme-night .community-hub {
    border-color: rgba(255, 255, 255, .1);
    background: #0c1828;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
body[data-theme="night"] .community-hub .feature-kicker,
body.theme-night .community-hub .feature-kicker { color: #ff6a3d; }
.community-hub .feature-kicker {
    display: block;
    font: 900 .66rem/1.05 var(--font-mono);
    letter-spacing: .04em;
}
body[data-theme="night"] .community-hub-heading h2,
body.theme-night .community-hub-heading h2,
body[data-theme="night"] .community-panel-heading h3,
body.theme-night .community-panel-heading h3,
body[data-theme="night"] .community-leaderboard-row strong,
body.theme-night .community-leaderboard-row strong,
body[data-theme="night"] .community-leaderboard-row b,
body.theme-night .community-leaderboard-row b,
body[data-theme="night"] .community-event-row strong,
body.theme-night .community-event-row strong { color: #f0f6fc; }
body[data-theme="night"] .community-hub-heading p,
body.theme-night .community-hub-heading p,
body[data-theme="night"] .community-empty,
body.theme-night .community-empty,
body[data-theme="night"] .community-leaderboard-row small,
body.theme-night .community-leaderboard-row small,
body[data-theme="night"] .community-event-row small,
body.theme-night .community-event-row small { color: #9aabc2; }
body[data-theme="night"] .community-panel,
body.theme-night .community-panel {
    border-color: rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .03);
}
body[data-theme="night"] .community-panel-heading,
body.theme-night .community-panel-heading { border-bottom-color: rgba(255, 255, 255, .1); }
body[data-theme="night"] .community-panel-heading span,
body.theme-night .community-panel-heading span { color: #8193aa; }

/* Home feature cards: "CONTINUAR CARRERA" missed fitting by a few pixels and
   was cut to "CARRER…". The copy column is narrower than the card, so let
   the button run past it; the card itself still clips at its own edge. */
.feature-card:not(.stadium-feature-card) button {
    max-width: none;
    padding-inline: 10px;
}

/* Night mode contrast. The diagnostics card kept its white day background,
   so its near-white title read at 1.1:1; several secondary labels used day
   greys (#5f7383, #65798a) that sit near 3:1 on navy. All of these now use
   the night muted tone, which clears 4.5:1 on every navy surface. */
body[data-theme="night"] #screen-settings.active .settings-diagnostics,
body.theme-night #screen-settings.active .settings-diagnostics {
    border-color: rgba(255, 255, 255, .1);
    background: #102137;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
body[data-theme="night"] #screen-settings.active .settings-diagnostics h3,
body.theme-night #screen-settings.active .settings-diagnostics h3 { color: #f0f6fc; }
body[data-theme="night"] #screen-settings.active .settings-diagnostics p,
body.theme-night #screen-settings.active .settings-diagnostics p,
body[data-theme="night"] #screen-settings.active .diagnostics-actions > span,
body.theme-night #screen-settings.active .diagnostics-actions > span { color: #9aabc0; }
body[data-theme="night"] .setup-team-country,
body.theme-night .setup-team-country,
body[data-theme="night"] .bracket-team small,
body.theme-night .bracket-team small,
body[data-theme="night"] .competition-summary-meta small,
body.theme-night .competition-summary-meta small,
body[data-theme="night"] .competition-summary-meta em,
body.theme-night .competition-summary-meta em,
body[data-theme="night"] .competition-team-stats small,
body.theme-night .competition-team-stats small,
body[data-theme="night"] #btn-career-simulate small,
body.theme-night #btn-career-simulate small,
body[data-theme="night"] .home-welcome-subtitle,
body.theme-night .home-welcome-subtitle { color: #9aabc0 !important; }

/* Career guide on the night dialog: the day kicker and step colors sat at
   ~3.6:1 on navy. */
body[data-theme="night"] #career-guide .career-guide-kicker,
body.theme-night #career-guide .career-guide-kicker,
body.night-mode #career-guide .career-guide-kicker { color: #ff7a4d; }
body[data-theme="night"] #career-guide .career-guide-step,
body.theme-night #career-guide .career-guide-step,
body.night-mode #career-guide .career-guide-step { color: #9aabc0; }
#tourney-match-meta { color: rgba(255, 255, 255, .92); }

/* During a match the canvas covers the menu header completely, yet its
   buttons stayed in the Tab order and in the screen-reader tree. Hide it for
   real while the match view is up (the pause menu has its own controls). */
body.match-view #app-container > .app-header { visibility: hidden; }
@media (pointer: coarse) {
    #modal-gameover .modal-card button { min-height: 40px; }
}

/* Next tournament match: team names keep the theme's text color (a white or
   pale team color made them invisible on the day theme) and show the team
   color as an accent line underneath. */
#t-home,
#t-away {
    text-decoration: underline;
    text-decoration-color: var(--team-color, transparent);
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
}

/* Day theme: the shared muted grey sat at ~4:1 on white panels. */
:root { --fuzzbol-muted: #5c6b77; }
body:not([data-theme="night"]):not(.theme-night) .home-seo-nav > span { color: #5c6b77; }
body:not([data-theme="night"]):not(.theme-night) #career-market-value { color: #1d7f4c; }

/* Career welcome profile: overflow:hidden with a 1.1 line-height clipped the
   bottom of "TEMPORADA 01". A little more line box keeps the ellipsis guard. */
.career-welcome-profile strong { line-height: 1.3; }

/* Long addresses in help text (ws://192.168.1.5:3000) pushed past the field. */
.setting-help { overflow-wrap: anywhere; }

/* Text on the darker orange fill: the old brown and pale-pink secondary
   lines (#3a2705, #6d2d07, #f6cec2) fell under 4.5:1 on #d9390c. Every line
   inside an orange action is plain white now. */
.btn-primary-start.btn-gold .action-copy strong,
.btn-primary-start .action-copy strong,
body[data-theme="night"] .btn-primary-start .action-copy strong,
body.theme-night .btn-primary-start .action-copy strong { color: #fff !important; }
.btn-primary-start .action-copy small,
#home-play-meta,
#setup-start-game-meta,
#tourney-create-meta,
#tourney-match-meta,
body[data-theme="night"] .btn-primary-start .action-copy small,
body.theme-night .btn-primary-start .action-copy small { color: #fff !important; }
.setup-team-home { --team-color: var(--fuzzbol-orange-fill); }
body[data-theme="night"] .setup-stadium-mapline p,
body.theme-night .setup-stadium-mapline p { color: #9aabc0; }
/* The day greys above also reach these two labels in night mode, where no
   night rule recolored them. */
body[data-theme="night"] .bracket-heading-row,
body.theme-night .bracket-heading-row,
body[data-theme="night"] .competition-team-copy > small,
body.theme-night .competition-team-copy > small { color: #9aabc0; }
body:not([data-theme="night"]):not(.theme-night) .competition-summary-brand span { color: #5c6b77; }

/* Home top bar: the theme and account buttons floated right after the
   welcome copy, which put "Iniciar sesión" in the middle of the bar on wide
   screens. Push the pair to the right edge. */
.home-topbar > .home-theme-button { margin-left: auto; }
.home-topbar > .home-account-button { margin-left: 0; }
/* Tablets and phones wrapped the pair onto a row of its own; keep it beside
   the title at every width. */
.home-topbar { flex-wrap: nowrap; }
.home-topbar > .home-welcome { flex: 1 1 0; min-width: 0; }
.home-topbar > .home-theme-button,
.home-topbar > .home-account-button { flex: 0 0 auto; align-self: flex-start; }

/* ============================================================================
   EMOJI REACTIONS — in-match wheel, Settings favourites and catalog picker
   ========================================================================== */
.btn-emote {
    position: absolute;
    z-index: 50;
    top: 12px;
    right: 66px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(10, 21, 37, .88);
    cursor: pointer;
    font: 20px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
    backdrop-filter: blur(10px);
}
.btn-emote:hover,
.btn-emote[aria-expanded="true"] { border-color: var(--fuzzbol-orange); }
.btn-emote:focus-visible { outline: 3px solid var(--fuzzbol-orange); outline-offset: 2px; }
html.is-touch #screen-game.active .btn-emote {
    top: max(8px, env(safe-area-inset-top));
    right: calc(max(8px, env(safe-area-inset-right)) + 52px);
    width: 44px;
    height: 44px;
}
@media (max-width: 760px) {
    #screen-game.active .btn-emote { top: 8px; right: 52px; }
}

.emote-wheel {
    position: absolute;
    z-index: 60;
    top: 56px;
    right: 18px;
    display: grid;
    grid-template-columns: repeat(4, 48px);
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 14px;
    background: rgba(8, 16, 28, .94);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
    backdrop-filter: blur(12px);
}
.emote-wheel[hidden] { display: none; }
.emote-wheel-item {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    cursor: pointer;
}
.emote-wheel-item:hover,
.emote-wheel-item:focus-visible { border-color: var(--fuzzbol-orange); background: rgba(255, 75, 24, .16); outline: none; }
.emote-wheel-emoji { font: 24px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emote-wheel-item kbd,
.emote-favorite-slot kbd {
    position: absolute;
    right: 3px;
    bottom: 2px;
    color: #9aabc0;
    font: 700 .58rem var(--font-mono);
}

/* Settings: eight favourite slots */
.emote-section-icon { font-size: 18px; }
.emote-favorites {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.emote-favorite-slot {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 52px;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
}
.emote-favorite-slot:hover,
.emote-favorite-slot:focus-visible { border-color: var(--fuzzbol-orange); outline: none; box-shadow: 0 0 0 2px rgba(255, 75, 24, .25); }
.emote-favorite-emoji { font: 26px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emote-favorites-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}
@media (max-width: 560px) {
    .emote-favorites { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Catalog picker */
.emoji-picker-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(560px, calc(100vw - 32px));
    max-height: min(640px, calc(100vh - 48px));
    padding: 18px;
    text-align: left;
}
.emoji-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.emoji-picker-head h2 { margin: 0; font: 900 1.3rem/1 var(--font-display); text-transform: uppercase; }
.emoji-picker-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--fuzzbol-line);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 1.4rem;
    cursor: pointer;
}
.emoji-picker-search { width: 100%; }
.emoji-picker-groups { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.emoji-picker-group {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    font: 20px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    cursor: pointer;
}
.emoji-picker-group[aria-selected="true"] { border-color: var(--fuzzbol-orange); background: rgba(255, 75, 24, .14); }
.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 4px;
    min-height: 120px;
    overflow-y: auto;
    padding-right: 2px;
}
.emoji-picker-item {
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: 24px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    cursor: pointer;
}
.emoji-picker-item:hover,
.emoji-picker-item:focus-visible { background: rgba(255, 75, 24, .16); outline: 2px solid var(--fuzzbol-orange); }
.emoji-picker-status { min-height: 1.2em; margin: 0; color: var(--fuzzbol-muted); font-size: .8rem; }
