:root {
  --ink: #f4efe5;
  --muted: #9ba5ae;
  --bg: #0b0f14;
  --panel: #131a22;
  --panel-2: #1a232d;
  --line: #2a3541;
  --gold: #c59a58;
  --gold-soft: #efd59d;
  --red: #df6a62;
  --green: #6db994;
  --blue: #70a7d8;
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-height: 100dvh; overflow-x: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }

#app {
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 85% -10%, rgba(197,154,88,.15), transparent 34rem),
    linear-gradient(180deg, #10161d 0%, var(--bg) 68%);
}

#app::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: url("assets/brand-logo.png") center 12% / min(86vw, 660px) auto no-repeat;
  opacity: .055;
}

.screen {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.topbar h1 { margin: 0; font: 650 24px/1.15 Georgia, serif; letter-spacing: .01em; }
.back, .icon-button {
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%;
  color: var(--ink); background: rgba(19,26,34,.84); display: grid; place-items: center;
}

.brand { margin: 6vh 0 32px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 750; }
.brand h1 { font: 600 clamp(40px, 12vw, 68px)/.96 Georgia, serif; margin: 10px 0 16px; letter-spacing: -.035em; }
.brand h1.product-title { font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: clamp(38px, 11vw, 64px); line-height: 1.04; }
.brand p { color: var(--muted); margin: 0; font-size: 17px; line-height: 1.55; max-width: 32rem; }

.menu, .stack { display: grid; gap: 14px; }
.menu-card, .card {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
  background: linear-gradient(145deg, rgba(28,37,47,.95), rgba(18,25,33,.95));
  padding: 20px; text-align: left;
}
.menu-card { display: flex; align-items: center; justify-content: space-between; min-height: 84px; }
.menu-card strong { display: block; font-size: 18px; margin-bottom: 0; }
.menu-card span, .subtle { color: var(--muted); font-size: 14px; line-height: 1.4; }
.menu-card .arrow { color: var(--gold); font-size: 25px; }
.menu-card.primary { border-color: rgba(197,154,88,.62); background: linear-gradient(145deg, #352a1c, #191b1f); }

.section-title { margin: 0 0 8px; font: 600 31px/1.1 Georgia, serif; }
.section-copy { color: var(--muted); margin: 0 0 26px; line-height: 1.55; }
.mode-grid { display: grid; gap: 14px; }
.mode-card { position: relative; overflow: hidden; min-height: 132px; }
.mode-card h2 { margin: 0 0 10px; font: 600 24px Georgia, serif; }
.mode-card p { margin: 4px 0; color: var(--muted); }
.mode-card::after { content: attr(data-mark); position: absolute; right: 14px; bottom: -24px; color: rgba(197,154,88,.08); font: 700 100px Georgia, serif; }

.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice-grid.two { grid-template-columns: repeat(2, 1fr); }
.choice {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 20px;
  padding: 20px 10px; min-height: 106px; text-align: center;
}
.choice strong { display: block; font-size: 26px; margin-bottom: 0; }
.choice.selected { border-color: var(--gold); background: #2b241b; box-shadow: 0 0 0 1px var(--gold) inset; }

.actions { margin-top: auto; padding-top: 28px; display: grid; gap: 12px; }
.button {
  min-height: 54px; border: 1px solid transparent; border-radius: 18px; padding: 0 22px;
  color: #17130d; background: var(--gold-soft); font-weight: 750;
}
.button.secondary { color: var(--ink); background: var(--panel); border-color: var(--line); }
.button.danger { color: #fff; background: #713a3a; }
.button:disabled { opacity: .38; cursor: default; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { color: var(--muted); font-size: 13px; font-weight: 650; }
.field input {
  width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 15px;
  color: var(--ink); background: #0e141b; padding: 0 15px; outline: none;
}
.field input:focus { border-color: var(--gold); }
.field input:disabled { opacity: .42; }
.row { display: flex; align-items: center; gap: 12px; }
.row > * { flex: 1; }
.computed { padding: 15px; border-radius: 16px; color: var(--gold-soft); background: rgba(197,154,88,.1); line-height: 1.5; }

.score-setup-card { margin-top: 8px; }
.check-row {
  width: 100%; min-height: 54px; margin: 0 0 22px; padding: 0 14px; display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: #0e141b; text-align: left;
}
.check-box { width: 24px; height: 24px; border: 1px solid var(--muted); border-radius: 7px; display: grid; place-items: center; }
.check-row.checked { border-color: var(--gold); }
.check-row.checked .check-box { color: #17130d; border-color: var(--gold-soft); background: var(--gold-soft); }
.empty-state { color: var(--muted); text-align: center; }
.deletable-card { position: relative; padding-right: 68px; }
.deletable-main { width: 100%; min-height: 42px; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; }
.delete-icon { position: absolute; z-index: 2; top: 12px; right: 12px; width: 42px; height: 42px; padding: 10px; border: 1px solid rgba(223,106,98,.5); border-radius: 13px; color: #f19a94; background: rgba(113,58,58,.28); }
.delete-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.delete-icon.compact { top: 8px; right: 8px; width: 36px; height: 36px; padding: 8px; }
.match-result > strong { display: block; margin-bottom: 12px; }
.match-result > div, .final-score { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: clamp(22px, 6vw, 34px); }
.match-result p { margin: 12px 0 0; color: var(--gold-soft); text-align: center; }
.blue-text { color: #8fc9ff; }
.red-text { color: #ffaaa4; }

.wide-screen { width: min(1040px, 100%); }
.player-input-list { gap: 10px; }
.player-input-row { display: grid; grid-template-columns: 1fr 44px; gap: 9px; }
.player-input-row input { min-width: 0; min-height: 50px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: #0e141b; padding: 0 15px; outline: none; }
.player-input-row input:focus { border-color: var(--gold); }
.add-player { margin-top: 12px; }
.player-pool { margin-bottom: 18px; padding: 18px; border: 1px dashed rgba(197,154,88,.5); border-radius: 20px; background: rgba(197,154,88,.05); }
.player-pool h2, .group-box h2, .group-schedule h2 { margin: 0 0 12px; font: 600 21px Georgia, "Noto Serif SC", serif; }
.player-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.player-chip { min-height: 39px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: #101720; }
.player-chip.selected { border-color: var(--gold); color: #17130d; background: var(--gold-soft); }
.player-chip-list.assigned { margin-top: 13px; }
.group-grid, .group-schedule-grid { display: grid; gap: 14px; }
.group-box { min-height: 146px; }
.group-box.full { border-color: rgba(109,185,148,.48); }
.group-drop { width: 100%; min-height: 48px; padding: 0; border: 0; color: var(--ink); background: transparent; display: flex; justify-content: space-between; align-items: center; text-align: left; }
.group-drop strong { font: 600 21px Georgia, "Noto Serif SC", serif; }
.group-drop span { color: var(--gold-soft); }
.fixture-list { display: grid; gap: 9px; }
.fixture { position: relative; width: 100%; min-height: 58px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: #0d141c; display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; }
.fixture.pending { border-color: rgba(197,154,88,.5); }
.fixture.completed { grid-template-columns: auto 1fr; padding-right: 52px; }
.fixture-meta { min-width: 48px; display: grid; gap: 2px; color: var(--muted); text-align: left; }
.fixture-meta b { color: var(--gold); font-size: 13px; }
.fixture-meta small { font-size: 11px; white-space: nowrap; }
.fixture-bout { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.recommended-schedule { max-width: 760px; margin-inline: auto; }
.standings-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: rgba(19,26,34,.9); }
.standings-head, .standings-row { display: grid; grid-template-columns: 38px minmax(110px, 1fr) 42px repeat(4, 48px); align-items: center; gap: 6px; min-width: 480px; padding: 12px 14px; }
.standings-head { color: var(--muted); font-size: 12px; background: #0e141b; }
.standings-row { border-top: 1px solid var(--line); }
.standings-row > span:not(:nth-child(2)), .standings-row > b, .standings-head > span:not(:nth-child(2)) { text-align: center; }
.seed-preview { display: grid; gap: 8px; margin-bottom: 16px; }
.seed-preview > div { min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); display: flex; align-items: center; gap: 14px; }
.seed-preview b { width: 28px; color: var(--gold); }
.knockout-count-card { margin-top: 22px; }
.bracket-screen { width: min(1280px, 100%); }
.bracket-scroll { min-height: 520px; display: grid; grid-auto-flow: column; grid-auto-columns: 250px; gap: 34px; overflow-x: auto; padding: 4px 4px 22px; overscroll-behavior-x: contain; }
.bracket-round { display: flex; flex-direction: column; min-height: 500px; }
.bracket-round h2 { margin: 0 0 15px; color: var(--muted); font-size: 15px; text-align: center; }
.bracket-match-list { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 16px; }
.bracket-match { position: relative; width: 100%; min-height: 92px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: linear-gradient(145deg, rgba(28,37,47,.96), rgba(15,21,28,.96)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.bracket-match.pending { border-color: rgba(197,154,88,.65); }
.bracket-match.waiting { opacity: .48; }
.bracket-match.bye { border-style: dashed; }
.bracket-match small { position: absolute; left: 0; right: 0; bottom: 6px; color: var(--muted); font-size: 10px; }
.bracket-round:not(:last-child) .bracket-match::after { content: ""; position: absolute; right: -35px; top: 50%; width: 35px; border-top: 1px solid rgba(197,154,88,.28); }

.scoreboard-screen {
  position: fixed; z-index: 100; inset: 0; width: 100vw; height: 100dvh; display: flex;
  overflow: hidden; touch-action: none; user-select: none; background: #080b0f;
}
.score-half { width: 50%; height: 100%; display: grid; place-items: center; transition: filter .15s; }
.score-half.blue { background: radial-gradient(circle at 50% 48%, #28628d, #102e49 68%, #071722); }
.score-half.red { background: radial-gradient(circle at 50% 48%, #8b3e3a, #4d1d20 68%, #22090d); }
.score-player { width: 100%; padding: 7vw; text-align: center; }
.score-name { min-height: 1.3em; margin-bottom: 2vh; font: 650 clamp(24px, 5vw, 64px)/1.05 Georgia, "Noto Serif SC", serif; overflow-wrap: anywhere; }
.score-value { font: 700 clamp(100px, 25vw, 300px)/.82 Georgia, serif; text-shadow: 0 12px 45px rgba(0,0,0,.34); }
.score-center {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%);
  min-width: 136px; padding: 13px 18px; border: 1px solid rgba(255,255,255,.2); border-radius: 22px;
  background: rgba(7,10,14,.88); box-shadow: 0 18px 60px rgba(0,0,0,.4); text-align: center; pointer-events: none;
}
.score-exit { position: absolute; top: -50px; left: 50%; transform: translateX(-50%); width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: #fff; background: rgba(7,10,14,.8); pointer-events: auto; }
.score-timer { font: 650 clamp(25px, 4vw, 46px)/1 Georgia, serif; }
.score-target { margin-top: 6px; color: #b8c0c9; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.score-paused { display: none; margin-top: 8px; color: var(--gold-soft); font-size: 12px; }
.scoreboard-screen.is-paused .score-half { filter: saturate(.34) brightness(.58); }
.scoreboard-screen.is-paused .score-paused { display: block; }
.score-intro {
  position: absolute; z-index: 8; inset: 0; width: 100%; height: 100%; border: 0; padding: 22px;
  color: var(--ink); background: rgba(4,7,10,.88); display: grid; place-items: center; text-align: center;
}
.score-intro-panel { width: min(760px, 92vw); }
.score-intro h1 { margin: 0 0 28px; font: 650 clamp(27px, 5vw, 48px)/1 Georgia, "Noto Serif SC", serif; }
.score-intro-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.score-intro-actions > div { min-height: 128px; padding: 18px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 22px; background: rgba(20,28,37,.88); display: grid; place-items: center; }
.score-intro-actions b { display: block; color: var(--gold-soft); font: 650 clamp(34px, 7vw, 66px)/1 Georgia, serif; }
.score-intro-actions span { display: block; margin-top: 10px; font-size: clamp(14px, 2.2vw, 20px); }
.score-intro p { margin: 26px 0 0; color: var(--muted); font-size: 15px; }
.score-up { animation: scoreUp .25s ease-out; }
.score-down { animation: scoreDown .25s ease-out; }
@keyframes scoreUp { 0% { filter: brightness(1.8); } }
@keyframes scoreDown { 0% { filter: brightness(.45); } }
.final-score { margin-top: 28px; }

.ready-hero { text-align: center; margin: auto 0; }
.ready-icon { width: 118px; height: 118px; margin: 0 auto 30px; border: 1px solid rgba(197,154,88,.55); border-radius: 50%; display: grid; place-items: center; color: var(--gold-soft); font-size: 48px; box-shadow: 0 0 70px rgba(197,154,88,.12); }
.ready-hero h1 { font: 600 35px/1.12 Georgia, serif; margin: 0 0 14px; }
.ready-hero p { color: var(--muted); font-size: 17px; line-height: 1.6; }

.countdown { display: grid; place-items: center; text-align: center; }
.countdown-number { font: 600 min(42vw, 210px)/1 Georgia, serif; color: var(--gold-soft); text-shadow: 0 0 80px rgba(197,154,88,.3); }
.countdown p { color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }

.training { width: 100%; max-width: none; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.training-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.training-head .timer { font: 600 30px/1 Georgia, serif; text-align: center; }
.training-head .end { justify-self: end; }
.training-body { flex: 1; display: grid; place-items: center; text-align: center; }
.cue-symbol { font-size: min(26vw, 154px); line-height: 1; color: var(--gold-soft); }
.cue-label { font: 600 clamp(34px, 9vw, 66px)/1 Georgia, serif; margin-top: 20px; }
.metrics { display: flex; justify-content: center; gap: 34px; color: var(--muted); margin-top: 24px; }
.metric strong { color: var(--ink); display: block; font-size: 20px; }
.flash-forward { animation: flashForward .24s ease-out; }
.flash-back { animation: flashBack .24s ease-out; }
.flash-lunge { animation: flashLunge .5s ease-out; }
@keyframes flashForward { 0% { background-color: rgba(112,167,216,.35); } }
@keyframes flashBack { 0% { background-color: rgba(223,106,98,.3); } }
@keyframes flashLunge { 0% { background-color: rgba(197,154,88,.44); } }

.coach-screen { max-width: none; padding: 0; position: relative; background: #090d12; overflow: hidden; touch-action: none; user-select: none; }
.coach-head {
  position: absolute; z-index: 5; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 7px; border: 1px solid var(--line); border-radius: 22px; background: rgba(11,15,20,.9);
}
.coach-head .timer { min-width: 86px; text-align: center; font: 600 24px Georgia, serif; }
.coach-zone { position: absolute; inset-block: 0; width: 50%; border: 0; color: var(--ink); display: grid; place-items: center; touch-action: none; }
.coach-zone.left { left: 0; background: linear-gradient(135deg, #22191b, #11151b); border-right: 1px solid #303842; }
.coach-zone.right { right: 0; background: linear-gradient(225deg, #172230, #11151b); }
.coach-zone.active.left { background: #703f43; }
.coach-zone.active.right { background: #315b7c; }
.coach-zone .zone-label { text-align: center; pointer-events: none; }
.coach-zone strong { display: block; font: 600 clamp(30px, 8vw, 58px) Georgia, serif; }
.coach-zone span { color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.coach-lunge { position: absolute; inset: 0; display: none; place-items: center; z-index: 4; background: rgba(165,121,61,.8); font: 600 clamp(42px, 12vw, 86px) Georgia, serif; pointer-events: none; }
.coach-lunge.show { display: grid; }

.modal-wrap { position: fixed; inset: 0; z-index: 20; display: grid; place-items: end center; background: rgba(0,0,0,.68); padding: 18px; }
.modal { width: min(620px, 100%); border: 1px solid var(--line); border-radius: 28px; background: #151c24; padding: 24px; box-shadow: 0 30px 100px #000; }
.modal h2 { margin: 0 0 10px; font: 600 27px Georgia, serif; }
.modal p { color: var(--muted); line-height: 1.5; }
.modal-actions { display: grid; gap: 10px; margin-top: 20px; }

.record-slot { display: flex; align-items: center; gap: 14px; }
.slot-number { flex: 0 0 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: var(--gold); background: rgba(197,154,88,.1); font-weight: 800; }
.slot-content { min-width: 0; flex: 1; }
.slot-content strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-actions { display: flex; gap: 7px; }
.mini { min-width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: #10161d; color: var(--ink); }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 5px; background: #0d131a; border: 1px solid var(--line); border-radius: 17px; margin-bottom: 22px; }
.tab { min-height: 42px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); }
.tab.active { background: var(--panel-2); color: var(--ink); }
.setting-block { margin-bottom: 16px; }
.setting-block h2 { margin: 0 0 4px; font-size: 18px; }
.step-weight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; }
.step-weight-grid .field { margin-bottom: 4px; }
.step-weight-grid output { color: var(--gold-soft); font-size: 13px; }
.screen.coach-screen { position: fixed; inset: 0; width: 100vw; height: 100dvh; min-height: 0; padding: 0; z-index: 10; }
.scoreboard-screen, .screen.coach-screen,
body:has(.scoreboard-screen, .coach-screen) .modal-wrap {
  position: fixed; inset: auto; left: 50%; top: 50%;
  width: 100dvh; height: 100dvw; max-width: none; min-height: 0;
  transform: translate(-50%, -50%) rotate(90deg); transform-origin: center;
}
body:has(.scoreboard-screen, .coach-screen) .modal-wrap { z-index: 200; place-items: center; }
body:has(.scoreboard-screen, .coach-screen) .modal { max-height: 95%; overflow-y: auto; }
.score-intro-panel { width: min(760px, 92dvh); }
.sound-card .sound-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sound-card .play { flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid var(--gold); border-radius: 50%; background: transparent; color: var(--gold-soft); }
.warning { color: #efb06a; font-size: 13px; line-height: 1.45; margin-top: 12px; }

.splash-screen {
  position: fixed; z-index: 10; inset: 0; min-height: 100dvh; overflow: hidden;
  display: grid; place-items: center; color: #f9f8f4;
  background: radial-gradient(circle at 50% 38%, #29333a 0, #151b20 42%, #090d11 88%);
}
.splash-glow {
  position: absolute; width: min(92vw, 500px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(242,197,82,.17); box-shadow: 0 0 0 35px rgba(242,197,82,.035), 0 0 0 90px rgba(242,197,82,.025);
  animation: splashHalo 1.8s ease-out both;
}
.splash-content { position: relative; z-index: 1; display: grid; justify-items: center; text-align: center; padding: 24px; }
.splash-logo-wrap { width: clamp(138px, 34vw, 215px); aspect-ratio: 1; overflow: hidden; border-radius: 30px; box-shadow: 0 24px 65px rgba(0,0,0,.38); animation: splashLogo 1.3s cubic-bezier(.2,.8,.2,1) both; }
.splash-logo { width: 100%; height: 100%; display: block; object-fit: cover; }
.splash-rule { width: 46px; height: 3px; margin: 34px 0 22px; border-radius: 3px; background: #f4c83f; animation: splashText .75s .45s ease-out both; }
.splash-content h1 { margin: 0; font-size: clamp(26px, 7vw, 38px); font-weight: 750; letter-spacing: .035em; animation: splashText .75s .55s ease-out both; }
.splash-content p { margin: 12px 0 0; color: #c9cbd0; font-size: 12px; font-weight: 650; letter-spacing: .09em; animation: splashText .75s .7s ease-out both; }
.splash-skip { position: absolute; z-index: 2; right: max(22px, env(safe-area-inset-right)); bottom: max(26px, env(safe-area-inset-bottom)); border: 0; padding: 10px 12px; color: #d1d3d5; background: transparent; font-size: 14px; }
@keyframes splashLogo { from { opacity: 0; transform: scale(.78) rotate(-8deg); filter: blur(8px); } to { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); } }
@keyframes splashText { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splashHalo { from { opacity: 0; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }

.home-shell {
  position: relative; z-index: 1; width: min(720px, 100%); min-height: 100dvh; margin: 0 auto;
  display: flex; flex-direction: column; background: #f7f8fa; color: #24272d;
  box-shadow: 0 0 48px rgba(0,0,0,.13);
}
.home-shell::before {
  content: ""; position: absolute; inset: 78px 0 0; pointer-events: none;
  background: url("assets/brand-logo.png") center 45% / min(76vw, 440px) auto no-repeat;
  filter: invert(1); mix-blend-mode: multiply; opacity: .04;
}
.home-header {
  min-height: 78px; padding: max(17px, env(safe-area-inset-top)) 24px 15px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; background: #fff;
}
.home-header h1 { margin: 0; font-size: 18px; font-weight: 750; }
.home-header-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home-header-brand img { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; }
.home-header-brand span { font-size: 10px; font-weight: 800; letter-spacing: .035em; white-space: nowrap; }
.home-content { flex: 1; padding: 48px 24px 110px; }
.home-section { max-width: 560px; margin: 0 auto; }
.home-section-head { margin-bottom: 42px; }
.home-kicker { color: #bd9127; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.home-section-head h2 { margin: 12px 0 0; font-size: clamp(30px, 8vw, 48px); line-height: 1.1; letter-spacing: -.04em; font-weight: 780; }
.home-section-head p { margin: 13px 0 0; color: #737980; font-size: 14px; font-weight: 600; }
.home-action-list { display: grid; gap: 14px; }
.home-action {
  width: 100%; min-height: 102px; padding: 20px; border: 1px solid #e9ebee; border-radius: 25px;
  display: flex; align-items: center; gap: 18px; color: #262a2f; background: #fff; text-align: left;
  box-shadow: 0 10px 30px rgba(28,36,45,.035); transition: transform .15s ease, box-shadow .15s ease;
}
.home-action:active { transform: scale(.985); box-shadow: 0 4px 12px rgba(28,36,45,.05); }
.home-action strong { font-size: 19px; line-height: 1.25; }
.home-action-icon { width: 55px; height: 55px; flex: 0 0 55px; border-radius: 18px; display: grid; place-items: center; color: #606b75; background: #f1f3f5; }
.home-action-icon svg { width: 29px; height: 29px; }
.home-action.home-gold .home-action-icon { color: #ad7f00; background: #fff3c9; }
.home-action.home-blue .home-action-icon { color: #387ac5; background: #e8f2ff; }
.home-profile-card { min-height: 110px; padding: 18px; margin-bottom: 18px; border-radius: 24px; display: flex; align-items: center; gap: 16px; background: #fff; }
.home-profile-card img { width: 66px; height: 66px; border-radius: 18px; object-fit: cover; }
.home-profile-card strong, .home-profile-card span { display: block; }
.home-profile-card strong { font-size: 16px; letter-spacing: .025em; }
.home-profile-card span { margin-top: 6px; color: #737980; font-size: 13px; }
.home-stats { margin: 0 0 26px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.home-stats > div { min-width: 0; padding: 18px 8px; border-radius: 19px; background: #fff; text-align: center; }
.home-stats strong { display: block; font-size: 28px; line-height: 1; }
.home-stats span { display: block; margin-top: 8px; color: #747b83; font-size: 11px; }
.home-nav {
  position: fixed; z-index: 5; left: 50%; bottom: 0; width: min(720px, 100%); transform: translateX(-50%);
  padding: 8px 12px max(9px, env(safe-area-inset-bottom)); border-top: 1px solid #e9eaed;
  display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255,255,255,.97); backdrop-filter: blur(14px);
}
.home-nav-item { min-height: 62px; border: 0; display: grid; justify-items: center; align-content: center; gap: 3px; color: #6c737b; background: transparent; font-size: 12px; font-weight: 700; }
.home-nav-item svg { width: 25px; height: 25px; }
.home-nav-item.active { color: #d3a600; }
.home-nav-item.active span { color: #aa8200; }

@media (max-width: 390px) {
  .home-header-brand span { display: none; }
  .home-content { padding-inline: 20px; }
  .home-action { min-height: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-glow, .splash-logo-wrap, .splash-rule, .splash-content h1, .splash-content p { animation: none; }
  .home-action { transition: none; }
}

#toast {
  position: fixed; z-index: 50; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: #ece2cf; color: #18130d; padding: 12px 18px; border-radius: 14px; opacity: 0; pointer-events: none; transition: .2s; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 680px) {
  .screen:not(.training):not(.coach-screen) { padding-inline: 34px; }
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .group-grid, .group-schedule-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (orientation: landscape) and (max-height: 520px) {
  .coach-head { top: 8px; }
  .coach-zone strong { font-size: 36px; }
  .score-name { font-size: clamp(22px, 4vw, 46px); }
  .score-value { font-size: clamp(90px, 20vw, 220px); }
  .score-intro-actions > div { min-height: 104px; }
}
