/* ============================================================
   Monday-XI — design tokens (extracted from delivered design)
   ============================================================ */
:root {
  --gold:      #EBC85A;
  --cream:     #F1EEE2;
  --bg:        #0E1812;
  --bg-deep:   #06140C;
  --panel:     #16231A;
  --safe:      #5FD08A;
  --contested: #E8A13C;
  --risk:      #E0584B;
  --sage:      #8FA89A;
  --sage-dim:  #5f7567;
  --line:      rgba(241, 238, 226, 0.16);
  --line-soft: rgba(241, 238, 226, 0.08);

  --f-display: 'Anton', sans-serif;
  --f-cond:    'Saira Condensed', sans-serif;
  --f-script:  'Caveat', cursive;
  --f-body:    'Hanken Grotesk', sans-serif;

  --maxw: 980px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: radial-gradient(120% 90% at 50% -10%, #15241a 0%, var(--bg) 45%, var(--bg-deep) 100%);
  color: var(--cream);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
  overflow-x: hidden;
}

#app { min-height: 100vh; }
.screen { display: none; }
.screen.active { display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.kicker { font-family: var(--f-cond); font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; font-size: 12px; color: var(--gold); }
.script { font-family: var(--f-script); color: var(--cream); }
.muted { color: var(--sage); }

.btn {
  font-family: var(--f-cond); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 15px;
  border: 1.5px solid var(--gold); color: var(--bg-deep); background: var(--gold);
  border-radius: 8px; padding: 14px 26px; cursor: pointer; transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--cream); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--sage); }

.badge-xi {
  width: 40px; height: 40px; flex: 0 0 40px; border: 1.5px solid var(--gold); border-radius: 9px;
  display: grid; place-items: center; font-family: var(--f-display); color: var(--gold); font-size: 16px; position: relative;
}
.badge-xi::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; border-bottom: 1.5px solid rgba(235,200,90,.5); }
.brand-home { appearance: none; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; border-radius: 10px; }
.brand-home:hover .badge-xi { background: rgba(235,200,90,.08); }
.brand-home:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.sound-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: rgba(20,33,24,.6);
  color: var(--sage); cursor: pointer; font-size: 16px; display: grid; place-items: center; transition: color .15s, border-color .15s;
}
.sound-btn:hover { color: var(--cream); border-color: var(--sage); }

/* ============================================================ HOME ============================================================ */
.home-nav { display: flex; align-items: center; gap: 12px; padding: 22px 0; }
.home-nav .word { font-family: var(--f-display); font-size: 26px; letter-spacing: .02em; }
.home-nav .word b { color: var(--gold); font-weight: 400; }
.home-nav .spacer { flex: 1; }

.home-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding: 28px 0 60px; }
.home-hero .kicker { margin-bottom: 18px; }
.home-hero h1 { font-family: var(--f-display); font-size: clamp(56px, 9vw, 112px); line-height: .92; letter-spacing: .01em; text-transform: uppercase; }
.home-hero h1 .g { color: var(--gold); }
.home-hero p { margin: 22px 0 30px; max-width: 30ch; font-size: 18px; line-height: 1.55; color: #d7ddd4; }
.home-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.home-card { background: linear-gradient(180deg, rgba(22,35,26,.9), rgba(11,18,10,.9)); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.preview-board {
  border: 1px solid var(--line); border-radius: 12px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 26px, transparent 26px 52px), linear-gradient(180deg, #16271c, #0c1710);
  padding: 14px 16px 16px;
}
.pb-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--f-cond); font-size: 13px; letter-spacing: .08em; }
.pb-score b { font-size: 22px; font-family: var(--f-display); }
.pb-score .sep { color: var(--sage); margin: 0 8px; }
.pb-mini { position: relative; height: 150px; margin: 10px 0; }
.pb-foot { display: flex; justify-content: space-between; align-items: center; }
.pb-foot .script { font-size: 21px; }
.pb-foot .play { font-family: var(--f-cond); font-weight: 700; letter-spacing: .1em; color: var(--gold); cursor: pointer; }

.table { margin-top: 16px; }
.table h4 { font-family: var(--f-cond); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; color: var(--sage); display: flex; justify-content: space-between; margin-bottom: 8px; }
.table .row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-top: 1px solid var(--line-soft); font-family: var(--f-cond); font-size: 16px; }
.table .row .rank { color: var(--sage); }
.table .row .pts { color: var(--safe); font-weight: 700; }
.table .row.you { background: rgba(235,200,90,.10); border-radius: 6px; border-top-color: transparent; }
.table .row.you span, .table .row.you .pts { color: var(--gold); }

/* ============================================================ GAME — top bar ============================================================ */
.game-shell { max-width: 1040px; margin: 0 auto; padding: 14px 18px 24px; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 4px 2px 14px; }
.tb-left { display: flex; align-items: center; gap: 12px; }
.tb-score { font-family: var(--f-cond); font-weight: 600; letter-spacing: .1em; font-size: 17px; }
.tb-score b { font-family: var(--f-display); font-size: 24px; margin: 0 4px; vertical-align: -1px; }
.tb-score .away { color: var(--sage); }
.tb-center { text-align: center; }
.pill { display: inline-block; font-family: var(--f-cond); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: 11px; color: var(--gold); border: 1px solid rgba(235,200,90,.4); border-radius: 999px; padding: 4px 12px; margin-bottom: 6px; }
.tb-clock { font-family: var(--f-display); font-size: 30px; letter-spacing: .02em; }
.tb-right { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.touch-label { text-align: right; line-height: 1; }
.touch-label .n { font-family: var(--f-display); font-size: 20px; color: var(--gold); }
.touch-label .s { font-family: var(--f-cond); font-size: 11px; letter-spacing: .14em; color: var(--sage); text-transform: uppercase; }
.ring-wrap { position: relative; width: 46px; height: 46px; }
.ring { width: 46px; height: 46px; transform: rotate(-90deg); }
.ring .track { stroke: rgba(235,200,90,.18); }
.ring .fill { stroke: var(--gold); stroke-linecap: round; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: 15px; color: var(--gold); }

/* ============================================================ GAME — pitch (2.5D) ============================================================ */
.pitch {
  position: relative; width: 100%; height: clamp(360px, 56vh, 600px); border-radius: 16px; overflow: visible;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.022) 0 7%, transparent 7% 14%), radial-gradient(125% 85% at 50% 2%, #1c2e21 0%, #102014 50%, #060f08 100%);
  border: 1px solid var(--line);
}
.field-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.chip {
  position: absolute; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-cond); font-weight: 800; font-size: 16px; z-index: 3; border: 2px solid;
  box-shadow: 0 7px 12px rgba(0,0,0,.45); transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
  cursor: default; appearance: none; padding: 0;
}
.chip.teammate-action { cursor: pointer; }
.chip.teammate-action:hover, .chip.teammate-action:focus-visible { filter: brightness(1.12); box-shadow: 0 0 0 5px rgba(235,200,90,.20), 0 10px 16px rgba(0,0,0,.5); outline: none; }
.chip .ovr { line-height: 1; }
.chip::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(from -90deg, var(--sta-col, var(--sage)) var(--sta-deg, 360deg), rgba(241,238,226,.12) 0); -webkit-mask: radial-gradient(closest-side, transparent 77%, #000 79%); mask: radial-gradient(closest-side, transparent 77%, #000 79%); z-index: -1; }
.chip .pos { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); font-size: 9px; letter-spacing: .06em; color: var(--sage); background: var(--bg); padding: 0 3px; border-radius: 3px; }
.chip.team { background: rgba(235,200,90,.16); border-color: var(--gold); color: var(--gold); }
.chip.opp  { background: rgba(224,88,75,.20);  border-color: var(--risk); color: #ffb3aa; }
.chip.gk   { background: rgba(120,150,200,.22); border-color: #7d9fd6; color: #cfe0ff; width: 34px; height: 34px; font-size: 12px; }
.chip.you  { background: rgba(235,200,90,.92); border-color: #fff3cf; color: #2a2208; box-shadow: 0 0 0 5px rgba(235,200,90,.16), 0 10px 16px rgba(0,0,0,.5); z-index: 6; }
.chip.you .pos { color: var(--gold); background: transparent; top: -12px; }
.you-tag { position: absolute; transform: translate(-50%, 0); font-family: var(--f-cond); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; background: rgba(6,20,12,.7); z-index: 6; white-space: nowrap; }
.dribble-path {
  fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 5 5;
  opacity: .9;
}
.dribble-path.safe { --accent: var(--safe); }
.dribble-path.contested { --accent: var(--contested); }
.dribble-path.risk { --accent: var(--risk); }
.dribble-path.dim { --accent: rgba(241,238,226,.2); opacity: .75; }
.dribble-lane {
  position: absolute; z-index: 8; transform: translate(-50%, -50%); min-width: 68px; min-height: 44px;
  border: 1px solid var(--accent); border-radius: 999px; background: rgba(6,20,12,.88); color: var(--cream);
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px;
  cursor: pointer; box-shadow: 0 8px 18px rgba(0,0,0,.35);
}
.dribble-lane.safe { --accent: var(--safe); }
.dribble-lane.contested { --accent: var(--contested); }
.dribble-lane.risk { --accent: var(--risk); }
.dribble-lane.dim { --accent: rgba(241,238,226,.3); }
.dribble-lane:hover, .dribble-lane:focus-visible { outline: none; background: rgba(14,30,18,.96); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent), 0 10px 20px rgba(0,0,0,.45); }
.dl-name { font-family: var(--f-cond); font-weight: 800; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.dl-read { font-family: var(--f-display); font-size: 18px; line-height: 1; color: var(--cream); }

.statcard {
  position: absolute; width: 168px; background: linear-gradient(180deg, rgba(20,33,24,.97), rgba(10,18,11,.97));
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; z-index: 12; animation: pop .18s ease; box-shadow: 0 8px 18px rgba(0,0,0,.4);
  color: var(--cream); text-align: left; font-family: var(--f-body);
}
.statcard-action { cursor: pointer; }
.statcard-action:hover, .statcard-action:focus-visible { border-color: var(--gold); outline: none; }
.statcard.open { border-color: rgba(95,208,138,.5); }
.statcard.covered { border-color: rgba(224,88,75,.45); }
.statcard.contested { border-color: rgba(232,161,60,.5); }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.97); } }
.sc-head { display: flex; align-items: baseline; justify-content: space-between; }
.sc-ovr { font-family: var(--f-display); font-size: 26px; color: var(--gold); line-height: 1; }
.sc-name { font-family: var(--f-cond); font-weight: 700; font-size: 14px; }
.sc-arch { font-family: var(--f-cond); font-weight: 700; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: -2px 0 6px; }
.sc-pos { font-family: var(--f-cond); font-size: 11px; color: var(--sage); letter-spacing: .1em; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 9px 0 7px; }
.t-stat { background: rgba(255,255,255,.05); border-radius: 6px; text-align: center; padding: 5px 0 4px; }
.t-stat b { font-family: var(--f-cond); font-weight: 700; font-size: 16px; display: block; line-height: 1; }
.t-stat span { font-size: 8.5px; letter-spacing: .06em; color: var(--sage); }
.sta-bar { display: flex; align-items: center; gap: 8px; }
.sta-bar .sl { font-family: var(--f-cond); font-weight: 700; letter-spacing: .12em; font-size: 9px; color: var(--sage); text-transform: uppercase; }
.sta-bar .st-track { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.sta-bar .st-track i { display: block; height: 100%; }
.sta-bar b { font-family: var(--f-cond); font-weight: 700; font-size: 12px; min-width: 18px; text-align: right; }

.onball { display: flex; align-items: center; gap: 16px; margin-top: 12px; background: linear-gradient(90deg, rgba(235,200,90,.10), rgba(8,15,10,.55)); border: 1px solid rgba(235,200,90,.35); border-radius: 12px; padding: 8px 14px; }
.ob-id { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.ob-ovr { font-family: var(--f-display); font-size: 30px; color: var(--gold); line-height: 1; }
.ob-meta { display: flex; flex-direction: column; }
.cc-tag { font-family: var(--f-cond); font-weight: 700; letter-spacing: .14em; font-size: 9px; color: var(--gold); text-transform: uppercase; }
.ob-name { font-family: var(--f-cond); font-weight: 700; font-size: 14px; }
.ob-arch { font-family: var(--f-cond); font-size: 11px; color: var(--sage); letter-spacing: .02em; }
.onball .stat-grid { margin: 0; flex: 0 0 auto; width: 300px; }
.ob-sta { flex: 1; min-width: 120px; }
.sc-status { font-family: var(--f-cond); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.sc-status.open { color: var(--safe); }
.sc-status.covered { color: var(--risk); }
.sc-status.contested { color: var(--contested); }

.xg-box { position: absolute; z-index: 6; display: flex; align-items: center; gap: 9px; background: rgba(6,16,10,.9); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.xg-box .lab { font-family: var(--f-cond); font-size: 10px; letter-spacing: .12em; color: var(--sage); text-transform: uppercase; }
.xg-box .val { font-family: var(--f-display); font-size: 24px; }
.xg-box .bar { width: 54px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.xg-box .bar i { display: block; height: 100%; background: var(--risk); }
.zone-label { position: absolute; transform: translate(-50%, -50%); background: var(--bg-deep); padding: 2px 9px; border-radius: 5px; z-index: 2; font-family: var(--f-cond); font-weight: 700; letter-spacing: .16em; font-size: 10px; color: var(--risk); text-transform: uppercase; }
.goal-target {
  position: absolute; z-index: 8; width: 132px; height: 44px; transform: translate(-50%, -35%);
  border: 1.5px solid rgba(235,200,90,.55); border-radius: 0 0 10px 10px;
  background: rgba(235,200,90,.05); cursor: pointer;
}
.goal-target::after {
  content: "SHOOT"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--f-cond); font-weight: 800; font-size: 11px; letter-spacing: .16em; color: var(--gold);
}
.goal-target:hover, .goal-target:focus-visible { background: rgba(235,200,90,.13); outline: none; box-shadow: 0 0 0 4px rgba(235,200,90,.12); }

.pitch-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 12px; min-height: 40px; }
.scan-btn { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(20,33,24,.7); color: var(--cream); font-family: var(--f-cond); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; padding: 9px 16px; cursor: pointer; transition: border-color .15s, color .15s; }
.scan-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.scan-btn:hover:not(.on):not(.spent) { border-color: var(--safe); }
.scan-btn small { color: var(--sage); font-weight: 600; }
.scan-btn.on { border-color: rgba(95,208,138,.6); color: var(--safe); }
.scan-btn.on .dot { background: var(--safe); box-shadow: 0 0 8px var(--safe); }
.scan-btn.spent { opacity: .5; cursor: not-allowed; }
.coach { font-family: var(--f-script); font-size: 23px; color: var(--cream); text-align: right; flex: 1; }
.coach.locked { color: var(--sage-dim); }

/* ============================================================ GAME — action bar ============================================================ */
.actionbar { display: grid; grid-template-columns: minmax(260px, 420px); gap: 12px; margin-top: 14px; justify-content: center; }
.actionbar:empty { display: none; }
.action { position: relative; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(22,35,26,.8), rgba(11,18,10,.85)); padding: 16px 18px; cursor: pointer; transition: transform .08s ease, border-color .15s ease; overflow: hidden; }
.action::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--sage)); }
.action:hover { transform: translateY(-2px); border-color: var(--accent); }
.action.safe { --accent: var(--safe); }
.action.contested { --accent: var(--contested); }
.action.risk { --accent: var(--risk); }
.action .a-name { font-family: var(--f-display); font-size: 26px; letter-spacing: .02em; }
.action .a-sub { font-family: var(--f-body); font-size: 13px; color: #cdd6cd; margin-top: 2px; }
.action .a-meta { position: absolute; right: 16px; top: 14px; text-align: right; }
.action .a-pct { font-family: var(--f-display); font-size: 26px; color: var(--accent); line-height: 1; }
.action .a-risk { font-family: var(--f-cond); font-size: 10px; letter-spacing: .12em; color: var(--sage); text-transform: uppercase; }
.action.dim .a-pct { color: var(--sage); }

/* ============================================================ PASS picker ============================================================ */
.pass-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(4,10,6,.8); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.pass-card { width: min(560px, 96vw); background: linear-gradient(180deg, var(--panel), #0c1710); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 22px; max-height: 92vh; overflow: auto; }
.pass-head { display: flex; align-items: center; justify-content: space-between; }
.pass-head .kicker { color: var(--sage); }
.pass-close { background: none; border: 1px solid var(--line); color: var(--cream); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 15px; }
.pass-step { font-family: var(--f-cond); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 11px; color: var(--sage); margin: 16px 0 8px; }
.target-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.target { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); color: var(--cream); padding: 10px 12px; cursor: pointer; }
.target:hover { border-color: var(--gold); }
.target.sel, .target.selected { border-color: var(--gold); background: rgba(235,200,90,.12); }
.target.selected { cursor: default; }
.target .t-ovr { font-family: var(--f-display); font-size: 22px; color: var(--gold); }
.target .t-mid { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.target .t-name { font-family: var(--f-cond); font-weight: 700; font-size: 15px; line-height: 1.1; }
.target .t-stats { font-family: var(--f-cond); font-size: 11px; color: var(--cream); letter-spacing: .02em; }
.target .t-stats.dim { color: var(--sage); }
.target .t-name small { color: var(--sage); font-weight: 600; margin-left: 4px; }
.t-lane { font-family: var(--f-cond); font-weight: 700; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.t-lane.open { color: var(--safe); background: rgba(95,208,138,.14); }
.t-lane.covered { color: var(--risk); background: rgba(224,88,75,.14); }
.t-lane.contested { color: var(--contested); background: rgba(232,161,60,.14); }
.t-lane.unknown { color: var(--sage); background: rgba(255,255,255,.05); }
.type-row { display: grid; gap: 8px; }
.ptype { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); color: var(--cream); padding: 12px 14px; cursor: pointer; }
.ptype:hover:not(:disabled) { border-color: var(--gold); }
.ptype:disabled { opacity: .4; cursor: not-allowed; }
.ptype .pt-name { font-family: var(--f-cond); font-weight: 700; font-size: 16px; width: 116px; flex: 0 0 116px; }
.ptype .pt-copy { display: grid; gap: 3px; flex: 1; min-width: 0; }
.ptype .pt-desc { font-size: 12px; color: #c9d2c9; line-height: 1.3; }
.ptype .pt-read { font-family: var(--f-cond); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sage); line-height: 1.2; }
.pt-fit { font-family: var(--f-cond); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; }
.pt-fit.good { color: var(--safe); background: rgba(95,208,138,.14); }
.pt-fit.ok { color: var(--contested); background: rgba(232,161,60,.14); }
.pt-fit.risky { color: var(--risk); background: rgba(224,88,75,.14); }
.pt-fit.unknown { color: var(--sage); background: rgba(255,255,255,.05); }
.pt-fit.goal { color: #0b150d; background: var(--safe); }
.pt-fit.shot { color: var(--risk); background: rgba(224,88,75,.16); }
.pt-fit.keep { color: var(--safe); background: rgba(95,208,138,.14); }

/* ============================================================ RESOLVE reveal ============================================================ */
.resolve-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(4,10,6,.88); animation: fade .2s ease; padding: 20px; }
.resolve-card { text-align: center; animation: rvPop .35s ease-out both; }
.reveal-card {
  width: min(620px, 96vw); max-height: min(92vh, 840px); display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line); border-radius: 18px; padding: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(22,35,26,.98), rgba(6,20,12,.98));
  box-shadow: 0 28px 90px rgba(0,0,0,.55);
}
.rv-play { font-family: var(--f-cond); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-size: 12px; color: var(--sage); }
.rv-story { margin-top: -8px; font-family: var(--f-display); font-size: clamp(22px, 4vw, 34px); line-height: 1; letter-spacing: .02em; text-transform: uppercase; color: var(--cream); animation: rvRise .38s ease-out .15s both; }
.rv-diagram {
  position: relative; border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.024) 0 9%, transparent 9% 18%), radial-gradient(110% 80% at 50% 0%, #1c2e21 0%, #102014 55%, #07120a 100%);
}
.rv-field { width: 100%; aspect-ratio: 16 / 10; display: block; }
.rv-line { fill: none; stroke: rgba(241,238,226,.14); stroke-width: .8; vector-effect: non-scaling-stroke; }
.rv-line.strong { stroke: rgba(241,238,226,.26); }
.rv-goal { fill: none; stroke: rgba(241,238,226,.65); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.rv-zone { stroke: rgba(224,88,75,.75); stroke-width: .9; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.rv-player { fill: none; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.rv-team { stroke: rgba(235,200,90,.55); }
.rv-team.lit { stroke: var(--gold); fill: rgba(235,200,90,.16); }
.rv-gk { stroke: #7d9fd6; fill: rgba(120,150,200,.15); }
.rv-you { stroke: var(--gold); fill: rgba(235,200,90,.24); }
.rv-mini-label, .rv-end-label, .rv-route-label {
  font-family: var(--f-cond); font-weight: 800; font-size: 4px; letter-spacing: .08em; text-anchor: middle;
  dominant-baseline: middle; text-transform: uppercase; fill: rgba(241,238,226,.62);
  paint-order: stroke; stroke: rgba(5,16,9,.82); stroke-width: 1.25px;
}
.rv-defender circle { fill: rgba(224,88,75,.12); stroke: rgba(224,88,75,.52); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.rv-defender text { fill: #ffb3aa; font-family: var(--f-cond); font-weight: 800; font-size: 3.8px; text-anchor: middle; dominant-baseline: middle; }
.rv-defender.lit circle { animation: rvPressure .7s ease-out 1.75s both; }
.rv-keeper.active .rv-gk { animation: rvPressure .7s ease-out 1.75s both; }
.rv-ghost-route {
  fill: none; stroke: rgba(241,238,226,.22); stroke-width: .9; stroke-dasharray: 3 3;
  animation: rvGhost .9s ease-out .15s both; vector-effect: non-scaling-stroke;
}
.rv-route {
  fill: none; stroke-width: 2.15; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: rvDraw 1.35s cubic-bezier(.4,0,.2,1) .25s forwards; vector-effect: non-scaling-stroke;
  filter: url(#rvGlow);
}
.rv-route-two { animation-delay: 1.28s; stroke-dasharray: 1; stroke-dashoffset: 1; }
.rv-keeper-dive {
  fill: none; stroke: #7d9fd6; stroke-width: 1.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: rvDraw .55s ease-out 1.85s forwards; vector-effect: non-scaling-stroke;
}
.rv-shot-touch { fill: rgba(241,238,226,.05); stroke-width: 1.2; opacity: 0; animation: rvDot .38s ease-out 1.22s forwards; vector-effect: non-scaling-stroke; }
.rv-ball { animation: rvBallGlow 1.8s ease .85s both; filter: drop-shadow(0 0 3px rgba(241,238,226,.55)); }
.rv-end {
  fill: none; stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: rvDraw .55s ease-out 2.55s forwards; vector-effect: non-scaling-stroke;
}
.rv-end-star {
  font-family: var(--f-display); font-size: 8px; text-anchor: middle; dominant-baseline: middle;
  transform-box: fill-box; transform-origin: center; transform: scale(0);
  animation: rvMark .45s cubic-bezier(.2,1.35,.35,1) 2.75s forwards;
}
.rv-route-label { opacity: 0; animation: rvRise .35s ease-out .7s forwards; fill: var(--sage); }
.rv-end-label { opacity: 0; animation: rvRise .35s ease-out 2.8s forwards; }
.rv-net-burst path { fill: none; stroke-width: 1.5; stroke-linecap: round; opacity: 0; animation: rvBurst .48s ease-out 2.5s forwards; vector-effect: non-scaling-stroke; }
.rv-caption { animation: rvRise .38s ease-out 3s both; }
.resolve-card .verdict { font-family: var(--f-display); font-size: clamp(44px, 10vw, 82px); line-height: .92; }
.resolve-card .verdict.good { color: var(--safe); }
.resolve-card .verdict.goal { color: var(--gold); }
.resolve-card .verdict.bad { color: var(--risk); }
.resolve-card .gain { font-family: var(--f-script); font-size: 26px; margin-top: 6px; }
.resolve-card .booth { display: inline-block; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 16px; font-family: var(--f-script); font-size: 20px; color: var(--sage); }
.resolve-card .booth b { color: var(--gold); font-family: var(--f-cond); font-weight: 700; letter-spacing: .14em; font-size: 11px; margin-right: 8px; text-transform: uppercase; }
.resolve-next {
  width: 100%; border: 1.5px solid var(--gold); border-radius: 10px; background: rgba(235,200,90,.08);
  color: var(--gold); cursor: pointer; padding: 13px 16px;
  font-family: var(--f-cond); font-weight: 800; font-size: 15px; letter-spacing: .12em; text-transform: uppercase;
}
.resolve-next:hover { background: rgba(235,200,90,.14); }
@keyframes rvPop { 0% { transform: scale(.96); } 70% { transform: scale(1.015); } 100% { transform: scale(1); } }
@keyframes rvDraw { to { stroke-dashoffset: 0; } }
@keyframes rvGhost { from { opacity: 0; stroke-dashoffset: 6; } to { opacity: 1; stroke-dashoffset: 0; } }
@keyframes rvBallGlow { 0% { filter: drop-shadow(0 0 0 rgba(241,238,226,0)); } 60% { filter: drop-shadow(0 0 6px rgba(241,238,226,.75)); } 100% { filter: drop-shadow(0 0 2px rgba(241,238,226,.35)); } }
@keyframes rvMark { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes rvRise { from { transform: translateY(10px); opacity: .35; } to { transform: translateY(0); opacity: 1; } }
@keyframes rvDot { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: scale(1); } }
@keyframes rvPressure { 0% { stroke-width: 1.4; filter: none; } 60% { stroke-width: 3; filter: drop-shadow(0 0 5px rgba(224,88,75,.8)); } 100% { stroke-width: 1.8; filter: none; } }
@keyframes rvBurst { 0% { opacity: 0; transform: translateY(2px) scale(.6); } 70% { opacity: 1; transform: translateY(0) scale(1.08); } 100% { opacity: .85; transform: scale(1); } }

/* ============================================================ RESULT / SHARE ============================================================ */
.result-shell { max-width: 560px; margin: 0 auto; padding: 30px 20px 60px; }
.result-card { background: linear-gradient(180deg, var(--panel), #0b150d); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.rc-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.rc-top .word { font-family: var(--f-display); font-size: 18px; }
.rc-top .word b { color: var(--gold); font-weight: 400; }
.rc-top .drive { font-family: var(--f-cond); letter-spacing: .14em; font-size: 12px; color: var(--sage); }
.rc-hero { text-align: center; padding: 22px 20px 8px; }
.rc-hero .script { font-size: 28px; color: var(--gold); }
.rc-hero h2 { font-family: var(--f-display); font-size: clamp(56px, 14vw, 92px); line-height: .9; letter-spacing: .02em; }
.rc-hero h2.miss { color: var(--cream); }
.rc-hero h2 .g { color: var(--gold); }
.rc-hero h2.goalpop { animation: goalpop .6s cubic-bezier(.2,.9,.2,1); }
@keyframes goalpop { 0% { transform: scale(.6); letter-spacing: -4px; opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.rc-finalscore { font-family: var(--f-cond); font-weight: 600; letter-spacing: .1em; font-size: 16px; margin-top: 4px; }
.rc-finalscore b { font-family: var(--f-display); font-size: 22px; margin: 0 5px; }
.rc-finalscore .away { color: var(--sage); }

.rc-grade { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); margin-top: 14px; }
.grade-badge { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 12px; display: grid; place-items: center; font-family: var(--f-display); font-size: 30px; color: var(--bg-deep); background: var(--gold); }
.rc-grade .pts { font-family: var(--f-display); font-size: 30px; }
.rc-grade .pts small { font-family: var(--f-cond); font-size: 14px; color: var(--sage); letter-spacing: .1em; margin-left: 4px; }
.rc-grade .sub { font-family: var(--f-cond); font-size: 13px; color: var(--sage); letter-spacing: .06em; }

.bars { padding: 16px 22px 6px; }
.bar-row { margin-bottom: 12px; }
.bar-row .bl { display: flex; justify-content: space-between; font-family: var(--f-cond); font-weight: 700; letter-spacing: .1em; font-size: 13px; text-transform: uppercase; margin-bottom: 5px; }
.bar-row .bl b { color: var(--gold); }
.bar-track { height: 8px; border-radius: 5px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 5px; background: var(--safe); width: 0; transition: width .8s cubic-bezier(.2,.8,.2,1); }

.share-box { margin: 8px 22px 0; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.share-box .sh-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--f-cond); font-weight: 700; letter-spacing: .12em; font-size: 12px; text-transform: uppercase; color: var(--sage); }
.emoji-grid { font-size: 26px; letter-spacing: 4px; margin: 12px 0 6px; }
.share-box .dom { font-family: var(--f-cond); letter-spacing: .12em; font-size: 12px; color: var(--sage); text-align: center; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 22px 22px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--gold); color: var(--bg-deep); font-family: var(--f-cond); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; padding: 10px 20px; border-radius: 8px; z-index: 80; animation: pop .2s ease; }

/* ============================================================ Celebration ============================================================ */
.flash { position: fixed; inset: 0; background: var(--gold); z-index: 70; opacity: 0; pointer-events: none; animation: flash .6s ease; }
@keyframes flash { 0% { opacity: 0; } 14% { opacity: .42; } 100% { opacity: 0; } }
.confetti { position: fixed; top: -14px; width: 9px; height: 14px; z-index: 71; pointer-events: none; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .85; } }

/* ============================================================ How to play modal ============================================================ */
.hiw-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(4,10,6,.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease; }
.hiw-modal { width: min(660px, 100%); max-height: min(92vh, 920px); display: flex; flex-direction: column; background: linear-gradient(180deg, var(--panel), #0b150d); border: 1.5px solid rgba(235,200,90,.45); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; animation: hiwpop .32s cubic-bezier(.2,.9,.3,1.2); }
@keyframes hiwpop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.hiw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 2px dashed var(--line); flex: 0 0 auto; }
.hiw-eyebrow { font-family: var(--f-cond); font-weight: 700; letter-spacing: .22em; text-transform: uppercase; font-size: 11px; color: var(--gold); }
.hiw-title { font-family: var(--f-script); font-size: 34px; line-height: 1; color: var(--cream); }
.hiw-close { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--cream); cursor: pointer; font-size: 16px; }
.hiw-close:hover { border-color: var(--sage); }
.hiw-body { overflow-y: auto; padding: 18px 20px; flex: 1; }
.hiw-intro { font-size: 15px; line-height: 1.6; color: #cdd6cd; margin-bottom: 16px; }
.hiw-intro b, .hiw-objtext b { color: var(--gold); font-weight: 600; }
.hiw-sec { border: 1px solid rgba(241,238,226,.06); border-radius: 12px; padding: 12px; margin-bottom: 12px; display: grid; gap: 10px; animation: hiwrise .4s ease both; }
@keyframes hiwrise { from { opacity: 0; transform: translateY(10px); } }
@media (min-width: 560px) { .hiw-sec { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; } }
.hiw-art { width: 100%; }
.hiw-art svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.hiw-kick { display: flex; align-items: center; gap: 8px; font-family: var(--f-cond); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 11px; color: var(--gold); margin-bottom: 4px; }
.hiw-badge { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: var(--gold); color: var(--bg-deep); display: grid; place-items: center; font-family: var(--f-display); font-size: 12px; }
.hiw-h3 { font-family: var(--f-script); font-size: 25px; color: var(--cream); line-height: 1; margin-bottom: 5px; }
.hiw-text p { font-size: 14px; line-height: 1.55; color: var(--sage); }
.hiw-text p b { color: var(--cream); font-weight: 600; }
.hiw-objective { border: 1.5px dashed rgba(235,200,90,.5); background: rgba(235,200,90,.05); border-radius: 12px; padding: 12px 14px; margin-top: 4px; }
.hiw-objlabel { font-family: var(--f-cond); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 10px; color: var(--gold); margin-bottom: 3px; }
.hiw-objtext { font-family: var(--f-script); font-size: 21px; color: var(--cream); }
.hiw-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 2px dashed var(--line); flex: 0 0 auto; }
.hiw-cta { display: block; width: 100%; height: 52px; border: none; border-radius: 10px; background: var(--gold); color: var(--bg-deep); font-family: var(--f-cond); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 15px; cursor: pointer; transition: filter .15s; }
.hiw-cta:hover { filter: brightness(1.05); }
@media (max-width: 520px) {
  .hiw-backdrop { padding: 0; }
  .hiw-modal { width: 100%; height: 100dvh; max-height: 100dvh; border: none; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .hiw-backdrop, .hiw-modal, .hiw-sec { animation: none !important; } }

/* ============================================================ Responsive ============================================================ */
@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr; gap: 26px; padding-top: 8px; }
  .home-card { order: 2; }
  .pitch { height: 50vh; }
  .actionbar { grid-template-columns: 1fr; }
  .action .a-name { font-size: 22px; }
  .topbar { grid-template-columns: 1fr; gap: 10px; }
  .tb-left, .tb-right { justify-content: space-between; }
  .tb-score { white-space: nowrap; font-size: 15px; }
  .tb-score b { font-size: 21px; }
  .tb-center { display: none; }
  .coach { font-size: 19px; }
  .chip { width: 34px; height: 34px; font-size: 13px; }
  .chip.you { width: 44px; height: 44px; font-size: 16px; }
  .dribble-lane { min-width: 50px; padding: 5px 8px; gap: 4px; }
  .dl-name { display: none; }
  .dl-read { font-size: 16px; }
  .xg-box { left: auto !important; right: 8px; padding: 7px 9px; gap: 6px; }
  .xg-box .bar { display: none; }
  .statcard { display: none; }
  .onball { flex-wrap: wrap; gap: 10px; }
  .onball .stat-grid { width: 100%; order: 3; }
  .ob-sta { width: 100%; order: 4; }
  .target-row { grid-template-columns: 1fr; }
  .ptype .pt-name { width: 92px; flex-basis: 92px; }
  .resolve-overlay { padding: 12px; }
  .reveal-card { padding: 14px; gap: 10px; }
  .rv-field { aspect-ratio: 9 / 10; }
  .rv-story { font-size: clamp(20px, 7vw, 30px); }
  .resolve-card .verdict { font-size: clamp(42px, 16vw, 74px); }
  .resolve-card .booth { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .resolve-card,
  .rv-route,
  .rv-route-two,
  .rv-ghost-route,
  .rv-keeper-dive,
  .rv-end,
  .rv-end-star,
  .rv-end-label,
  .rv-route-label,
  .rv-shot-touch,
  .rv-net-burst path,
  .rv-caption,
  .rv-ball {
    animation: none !important;
  }
  .rv-route,
  .rv-route-two,
  .rv-ghost-route,
  .rv-keeper-dive,
  .rv-end {
    stroke-dashoffset: 0;
  }
  .rv-end-star {
    transform: scale(1);
  }
}
