:root {
  color-scheme: dark;
  --ink: #f7f4ec;
  --muted: #9da8ba;
  --canvas: #0b111e;
  --panel: rgba(21, 30, 47, .82);
  --panel-solid: #151e2f;
  --line: rgba(255, 255, 255, .1);
  --lime: #c8f04b;
  --lime-dark: #9abd30;
  --red: #ff635b;
  --blue: #55a8ff;
  --gold: #f5bc51;
  --shadow: 0 28px 80px rgba(0, 0, 0, .34);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--ink); background: radial-gradient(circle at 50% -20%, #233554 0, var(--canvas) 44rem); }
button, input, select { font: inherit; }
button { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }

.ambient { position: fixed; z-index: -1; filter: blur(2px); opacity: .55; pointer-events: none; }
.ambient-one { width: 18rem; height: 18rem; top: 14rem; right: -10rem; border: 1px solid rgba(200,240,75,.3); border-radius: 50%; }
.ambient-two { width: 12rem; height: 12rem; top: 31rem; left: -7rem; background: rgba(52,115,204,.13); border-radius: 40%; transform: rotate(28deg); }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: calc(12px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); background: rgba(11,17,30,.78); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; }
.brand-ball { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--ink); font-size: 1.25rem; box-shadow: 0 6px 16px rgba(0,0,0,.24); }
.brand b, .brand small { display: block; }
.brand b { font-size: .88rem; letter-spacing: .14em; }
.brand small { margin-top: .1rem; color: var(--muted); font-size: .62rem; letter-spacing: .09em; }
.season-switcher { display: flex; align-items: center; gap: .55rem; min-height: 42px; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.05); font-size: .82rem; font-weight: 700; cursor: pointer; }
.topbar-actions { display: flex; align-items: center; gap: .55rem; }
.account-button { width: 42px; height: 42px; border: 1px solid rgba(200,240,75,.35); border-radius: 50%; color: #121803; background: var(--lime); font-size: .9rem; font-weight: 950; cursor: pointer; }

.app-shell { width: min(1120px, 100%); margin: 0 auto; padding: 26px 18px calc(42px + env(safe-area-inset-bottom)); }
.loading-card { min-height: 55vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loading-mark { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--lime); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow { display: block; color: var(--lime); font-size: .72rem; font-weight: 900; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .4rem; font-size: clamp(2rem, 8vw, 4.5rem); line-height: .95; letter-spacing: -.055em; }
h2 { margin-bottom: .4rem; font-size: 1.45rem; letter-spacing: -.035em; }
h3 { margin-bottom: .25rem; font-size: 1rem; }

.empty-state { min-height: calc(100vh - 120px); display: grid; align-content: center; justify-items: start; max-width: 700px; padding: 2rem 0 7rem; }
.empty-state .season-ring { width: 78px; height: 78px; display: grid; place-items: center; margin-bottom: 1.5rem; border: 1px solid rgba(200,240,75,.5); border-radius: 50%; font-size: 2.4rem; background: rgba(200,240,75,.08); box-shadow: 0 0 0 12px rgba(200,240,75,.025); }
.empty-state p { max-width: 34rem; color: var(--muted); font-size: 1.08rem; line-height: 1.6; }

.button { min-height: 48px; padding: .75rem 1rem; border: 1px solid transparent; border-radius: 14px; background: transparent; font-weight: 850; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:active { transform: scale(.98); }
.button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.button.primary { color: #121803; background: var(--lime); box-shadow: 0 12px 28px rgba(200,240,75,.16); }
.button.primary:hover { background: #d7ff57; }
.button.secondary { background: var(--ink); color: #101827; }
.button.ghost { border-color: var(--line); background: rgba(255,255,255,.04); }
.button.danger { color: white; background: #c83e3a; }
.button.danger-subtle { border-color: rgba(255,99,91,.32); color: #ffaaa6; background: rgba(255,99,91,.07); box-shadow: none; }
.button.danger-subtle:hover { border-color: rgba(255,99,91,.55); background: rgba(255,99,91,.12); }
.button.full { width: 100%; }
.icon-button { width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.05); font-size: 1.45rem; cursor: pointer; }

.season-head { display: flex; flex-direction: column; gap: 1.4rem; margin-bottom: 1.5rem; }
.season-title-row { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.season-head-copy { min-width: 0; }
.season-head-copy p { margin-bottom: 0; color: var(--muted); }
.season-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.season-settings-button { min-width: 44px; min-height: 44px; width: 44px; height: 44px; color: var(--muted); font-size: 1.05rem; }
.season-settings-button:hover { color: var(--ink); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
.dashboard-grid { display: grid; gap: 1rem; }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(18px); }

.standings { padding: 1.2rem; }
.section-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.section-label strong { color: var(--ink); font-size: .8rem; }
.leaderboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: .55rem; }
.player-score { min-width: 0; padding: 1rem .7rem; border: 0; border-radius: 18px; color: inherit; background: rgba(255,255,255,.045); text-align: center; cursor: pointer; }
.player-score.leading { outline: 1px solid rgba(200,240,75,.5); background: rgba(200,240,75,.08); }
.player-score:hover { background: rgba(255,255,255,.075); }
.player-score .cups { display: block; margin: .3rem 0; font-size: clamp(2.7rem, 14vw, 4.6rem); font-weight: 950; letter-spacing: -.07em; line-height: 1; }
.player-score .name { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 800; white-space: nowrap; }
.player-score small { color: var(--muted); }
.leaderboard-vs { align-self: center; color: #647187; font-size: .72rem; font-weight: 950; letter-spacing: .1em; }

.active-series { position: relative; padding: 1.25rem; background: linear-gradient(145deg, rgba(31,45,68,.98), rgba(16,25,41,.98)); }
.active-series::after { content: ""; position: absolute; width: 140px; height: 140px; right: -65px; bottom: -76px; border: 24px solid rgba(200,240,75,.05); border-radius: 50%; pointer-events: none; }
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .65rem; margin: 1.3rem 0; }
.team { min-width: 0; }
.team:last-child { text-align: right; }
.team .team-name { display: block; color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team .win-count { display: block; margin-top: .15rem; font-size: clamp(3.4rem, 15vw, 5.8rem); font-weight: 950; line-height: .9; letter-spacing: -.08em; }
.matchup-divider { color: #6f7a8b; font-size: .76rem; font-weight: 900; }
.game-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: 1rem; }
.game-dot { height: 7px; border-radius: 99px; background: rgba(255,255,255,.09); }
.game-dot.p1 { background: var(--blue); }
.game-dot.p2 { background: var(--red); }
.active-series .button { position: relative; z-index: 1; }
.next-venue { position: relative; z-index: 1; display: grid; gap: .18rem; margin-bottom: .75rem; padding: .75rem .85rem; border: 1px solid rgba(85,168,255,.28); border-radius: 14px; background: rgba(85,168,255,.07); }
.next-venue span { color: var(--blue); font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.next-venue b { font-size: 1rem; }
.next-venue small { color: var(--muted); line-height: 1.4; }
.venue-missing { position: relative; z-index: 1; display: grid; gap: .35rem; padding: .8rem; border: 1px dashed rgba(245,188,81,.4); border-radius: 14px; background: rgba(245,188,81,.07); }
.venue-missing small { color: var(--muted); }
.venue-missing .button { margin-top: .35rem; }

.history { margin-top: 1rem; padding: 1.2rem; }
.history-list { display: grid; gap: .65rem; }
.history-empty { padding: 1.6rem 0 .5rem; color: var(--muted); text-align: center; }
.series-row { border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); }
.series-summary { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .9rem; border: 0; background: transparent; text-align: left; cursor: pointer; }
.series-number { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--lime); background: rgba(200,240,75,.1); font-size: .74rem; font-weight: 900; }
.series-summary-copy { min-width: 0; }
.series-summary-copy b, .series-summary-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-summary-copy b { font-size: .92rem; }
.series-summary-copy small { margin-top: .2rem; color: var(--muted); font-size: .74rem; }
.series-result { color: var(--lime); font-weight: 950; }
.game-list { display: none; margin: 0 .8rem .8rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.series-row.open .game-list { display: block; }
.legacy-team-notice { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .45rem; padding: .75rem; border: 1px dashed rgba(200,240,75,.3); border-radius: 13px; background: rgba(200,240,75,.045); }
.legacy-team-notice span { min-width: 0; }
.legacy-team-notice b, .legacy-team-notice small { display: block; }
.legacy-team-notice small { margin-top: .15rem; color: var(--muted); }
.legacy-team-notice .button { flex: 0 0 auto; min-height: 40px; padding: .55rem .7rem; font-size: .78rem; }
.game-row { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .65rem 0; }
.game-row + .game-row { border-top: 1px solid rgba(255,255,255,.06); }
.game-row small { display: block; color: var(--muted); margin-top: .15rem; }
.game-score { font-weight: 950; letter-spacing: .08em; }
.game-actions { display: flex; gap: .3rem; }
.mini-action { min-width: 36px; min-height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.04); color: var(--muted); text-decoration: none; cursor: pointer; }
.mini-action.delete:hover { color: var(--red); border-color: rgba(255,99,91,.4); }
.champion-banner { margin-bottom: 1rem; padding: 1.15rem; border: 1px solid rgba(245,188,81,.36); border-radius: var(--radius); background: linear-gradient(120deg, rgba(245,188,81,.15), rgba(245,188,81,.03)); }
.champion-banner span { color: var(--gold); }
.champion-banner h2 { margin: .35rem 0 0; }

.no-series { min-height: 360px; display: grid; place-content: center; justify-items: center; padding: 2rem; text-align: center; }
.no-series .big-number { color: rgba(255,255,255,.1); font-size: 6rem; font-weight: 950; line-height: 1; }
.no-series p { max-width: 24rem; color: var(--muted); }

.season-menu { position: fixed; z-index: 30; top: 72px; right: 18px; width: min(330px, calc(100vw - 36px)); max-height: 60vh; overflow: auto; padding: .45rem; border: 1px solid var(--line); border-radius: 16px; background: #192338; box-shadow: var(--shadow); }
.season-option { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.season-option:hover, .season-option.active { background: rgba(255,255,255,.07); }
.season-option small { color: var(--muted); }

.modal { width: min(580px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--panel-solid); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(3,7,14,.78); backdrop-filter: blur(6px); }
.modal-card { display: grid; gap: 1rem; padding: 1.25rem; }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.modal-head h2 { margin-top: .2rem; }
.modal label { display: grid; gap: .45rem; color: #dce1e9; font-size: .82rem; font-weight: 750; }
.modal input, .modal select { width: 100%; min-height: 50px; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: 13px; outline: 0; color: var(--ink); background: #202b40; font-size: 1rem; }
.modal input:focus, .modal select:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200,240,75,.09); }
.form-grid { display: grid; grid-template-columns: 1.4fr .75fr; gap: .75rem; }
.versus-fields { display: grid; grid-template-columns: 1fr auto 1fr; gap: .55rem; align-items: end; }
.versus-fields > span { padding-bottom: 1rem; color: var(--muted); font-size: .7rem; font-weight: 900; }
.season-players { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .55rem; align-items: stretch; }
.season-players label { min-width: 0; }
.player-vs { align-self: center; color: var(--muted); font-size: .7rem; font-weight: 950; }
.inline-user-create { padding: .8rem; border: 1px dashed rgba(200,240,75,.28); border-radius: 14px; background: rgba(200,240,75,.035); }
.inline-user-create summary { color: var(--lime); font-size: .82rem; font-weight: 850; cursor: pointer; }
.inline-user-fields { display: grid; gap: .7rem; margin-top: .8rem; }
.form-intro { color: var(--muted); }
.settings-roster { padding: .9rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.settings-roster .section-label { margin-bottom: .65rem; }
.settings-player-list { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.settings-player { min-width: 0; display: flex; align-items: center; gap: .65rem; padding: .7rem; border-radius: 13px; background: rgba(255,255,255,.04); }
.settings-player > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #121803; background: var(--lime); font-size: .8rem; font-weight: 950; }
.settings-player div { min-width: 0; }
.settings-player small, .settings-player b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-player small { color: var(--muted); font-size: .62rem; font-weight: 900; letter-spacing: .09em; }
.settings-player b { margin-top: .12rem; font-size: .88rem; }
.settings-roster > p { margin: .7rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.danger-zone { display: grid; gap: .75rem; margin-top: .35rem; padding-top: 1rem; border-top: 1px solid rgba(255,99,91,.2); }
.danger-zone[hidden] { display: none; }
.danger-zone b { color: #ffaaa6; }
.danger-zone p { margin: .25rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.team-fields { display: grid; gap: .8rem; }
.team-field { padding: .85rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.team-field strong { display: block; margin-bottom: .5rem; }
.home-choice small { color: var(--muted); font-weight: 500; line-height: 1.4; }
.score-fields { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: .6rem; }
.score-fields > span { padding-bottom: 1.15rem; color: var(--muted); font-weight: 900; }
.score-fields label { text-align: center; }
.score-fields input { min-height: 84px; text-align: center; font-size: 2.2rem; font-weight: 950; }
.upload-field input { padding: .55rem; font-size: .85rem; }
.upload-field small { color: var(--muted); font-weight: 500; }
.compact { width: min(410px, calc(100vw - 24px)); text-align: center; }
.confirm-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; color: var(--red); background: rgba(255,99,91,.12); font-size: 1.4rem; font-weight: 900; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.install-button { border-color: rgba(200,240,75,.35); color: var(--lime); background: rgba(200,240,75,.07); }
.install-help { text-align: left; }
.install-step { padding: .85rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.install-step p { margin: .35rem 0 0; color: var(--muted); line-height: 1.5; }
.screenshot-modal { width: min(920px, calc(100vw - 24px)); }
.screenshot-frame { display: grid; place-items: center; min-height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #080d17; }
.screenshot-frame img { display: block; max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; }
.profile-modal { width: min(680px, calc(100vw - 24px)); }
.profile-modal .modal-card { max-height: calc(100vh - 24px); overflow-y: auto; }
.profile-body { display: grid; gap: 1rem; }
.profile-hero { display: flex; align-items: center; gap: .9rem; }
.profile-hero h2 { margin: .15rem 0; }
.profile-hero p { margin: 0; color: var(--muted); }
.profile-avatar { width: 62px; height: 62px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 18px; color: #121803; background: var(--lime); font-size: 1.35rem; font-weight: 950; }
.profile-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.profile-stat-grid > div { padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); }
.profile-stat-grid strong, .profile-stat-grid span, .profile-stat-grid small { display: block; }
.profile-stat-grid strong { font-size: 2.2rem; line-height: 1; }
.profile-stat-grid span { margin-top: .35rem; font-weight: 800; }
.profile-stat-grid small { margin-top: .25rem; color: var(--muted); }
.profile-current { padding: 1rem; border: 1px solid rgba(200,240,75,.25); border-radius: 16px; background: rgba(200,240,75,.055); }
.profile-current .section-label { margin-bottom: .65rem; }
.profile-current div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .2rem .8rem; }
.profile-current strong { color: var(--lime); font-size: 1.45rem; }
.profile-current small { grid-column: 1 / -1; color: var(--muted); }
.profile-current p { margin: 0; color: var(--muted); }
.team-stat-list { display: grid; gap: .45rem; }
.team-stat-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.team-stat-row b, .team-stat-row small { display: block; }
.team-stat-row small { margin-top: .12rem; color: var(--muted); }
.team-stat-row strong { font-size: 1rem; }
.team-stat-row em { min-width: 64px; color: var(--lime); font-size: .76rem; font-style: normal; font-weight: 850; text-align: right; }
.cup-patterns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.cup-patterns span { padding: .75rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); text-align: center; }
.cup-patterns b, .cup-patterns small { display: block; }
.cup-patterns b { font-size: 1.2rem; }
.cup-patterns small { margin-top: .2rem; color: var(--muted); }

.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 36px); padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 13px; background: #222e43; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255,99,91,.45); }

.auth-page { min-height: 100svh; }
.auth-shell { width: min(980px, 100%); min-height: 100svh; display: grid; align-content: center; gap: 2rem; margin: 0 auto; padding: 36px 20px calc(36px + env(safe-area-inset-bottom)); }
.auth-brand { max-width: 540px; }
.auth-brand h1 { margin-top: .55rem; }
.auth-brand p { max-width: 32rem; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.auth-ball { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 1.35rem; border: 1px solid rgba(200,240,75,.45); border-radius: 22px; background: rgba(200,240,75,.07); font-size: 2.2rem; box-shadow: 0 0 0 10px rgba(200,240,75,.025); }
.auth-card { padding: 1.3rem; border: 1px solid var(--line); border-radius: 24px; background: rgba(21,30,47,.9); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card-head { display: flex; justify-content: space-between; margin-bottom: 1.25rem; color: var(--muted); font-size: .72rem; font-weight: 900; letter-spacing: .14em; }
.auth-card-head b { color: var(--lime); }
.auth-form { display: grid; gap: .9rem; }
.auth-form label { display: grid; gap: .42rem; color: #dce1e9; font-size: .82rem; font-weight: 750; }
.auth-form input { width: 100%; min-height: 52px; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 13px; outline: 0; color: var(--ink); background: rgba(255,255,255,.055); font-size: 1rem; }
.auth-form input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200,240,75,.09); }
.auth-error { padding: .8rem .9rem; border: 1px solid rgba(255,99,91,.35); border-radius: 12px; color: #ffc0bd; background: rgba(255,99,91,.1); font-size: .86rem; }
.auth-note { margin: 1rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; text-align: center; }

.account-modal { width: min(680px, calc(100vw - 24px)); }
.account-modal .modal-card { max-height: calc(100vh - 26px); overflow-y: auto; }
.user-create-panel { padding: 1rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); }
.user-create-panel h3 { margin-bottom: .85rem; }
.user-form { display: grid; gap: .75rem; }
.user-list { display: grid; gap: .6rem; }
.user-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .75rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); }
.user-row.inactive { opacity: .58; }
.user-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #121803; background: var(--lime); font-weight: 950; }
.user-copy { min-width: 0; }
.user-copy b, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { margin-top: .15rem; color: var(--muted); font-size: .72rem; }
.self-badge { padding: .35rem .5rem; border-radius: 8px; color: var(--lime); background: rgba(200,240,75,.08); font-size: .7rem; font-weight: 900; }
.password-reset { grid-column: 1 / -1; padding-top: .55rem; border-top: 1px solid rgba(255,255,255,.07); }
.password-reset summary { color: var(--muted); font-size: .76rem; font-weight: 750; cursor: pointer; }
.password-reset form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-top: .6rem; }
.password-reset input { min-height: 44px; }
.password-reset .button { min-height: 44px; }

@media (min-width: 760px) {
  .app-shell { padding: 44px 28px 70px; }
  .season-head { flex-direction: row; justify-content: space-between; align-items: end; }
  .season-title-row { flex: 1; justify-content: flex-start; align-items: end; }
  .dashboard-grid { grid-template-columns: .82fr 1.18fr; grid-template-areas: "standings active"; align-items: stretch; }
  .standings { grid-area: standings; }
  .active-series, .no-series { grid-area: active; }
  .standings, .active-series { padding: 1.5rem; }
  .history { padding: 1.5rem; }
  .modal-card { padding: 1.6rem; }
  .auth-shell { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 5rem; padding: 50px 34px; }
  .auth-card { padding: 1.6rem; }
  .user-form { grid-template-columns: 1fr 1fr; }
  .user-form .button { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .topbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .brand { gap: .45rem; min-width: 0; }
  .brand-ball { width: 34px; height: 34px; border-radius: 10px; font-size: 1.05rem; }
  .brand b { font-size: .72rem; letter-spacing: .08em; }
  .brand small { display: none; }
  .topbar-actions { gap: .4rem; min-width: 0; }
  .season-switcher { max-width: 100px; min-width: 0; min-height: 38px; padding: .5rem .6rem; }
  .season-switcher span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-button { width: 38px; height: 38px; }
  .season-players { grid-template-columns: 1fr; }
  .settings-player-list { grid-template-columns: 1fr; }
  .player-vs { justify-self: center; }
  .legacy-team-notice { align-items: stretch; flex-direction: column; }
  .standings { padding: .8rem; }
  .standings .section-label { margin-bottom: .6rem; }
  .standings .section-label strong { font-size: .68rem; }
  .leaderboard { gap: .35rem; }
  .player-score { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .45rem; padding: .65rem; text-align: left; }
  .player-score .cups { margin: 0; font-size: 1.75rem; text-align: right; }
  .player-score small { display: none; }
  .profile-stat-grid { gap: .5rem; }
  .profile-stat-grid > div { padding: .8rem; }
  .profile-stat-grid strong { font-size: 1.8rem; }
  .team-stat-row { grid-template-columns: minmax(0, 1fr) auto; }
  .team-stat-row em { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 350px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .modal-card { padding: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .score-fields { gap: .35rem; }
  .score-fields input { min-height: 74px; padding-left: .35rem; padding-right: .35rem; }
}

@media (min-width: 1020px) {
  .topbar { padding-left: 34px; padding-right: 34px; }
  .standings { grid-row: span 1; }
  .history { margin-top: 1.15rem; }
}

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