/* ---------- prematch ---------- */
.pre-screen .scenery.tall { height: 420px; }
.pre-wrap { max-width: 1040px; margin: 0 auto; padding: 8px 16px 20px; }
.pre-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; padding: 10px 0 18px; }
.pre-team { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; min-width: 0; }
.pre-team .kit { filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .6)); }
.pre-team b { font: 900 22px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.pre-team i { font: 700 10px/1 var(--f-cond); letter-spacing: .3em; color: var(--amber); font-style: normal; text-transform: uppercase; }
.pre-ovr { font: 800 22px/1 var(--f-display); color: var(--gold); display: flex; align-items: baseline; gap: 4px; }
.pre-ovr em { font: 700 10px/1 var(--f-cond); letter-spacing: .2em; color: var(--mute); font-style: normal; }
.pre-mid { align-self: center; }
.pre-mid span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--red); font: 900 20px/1 var(--f-display); letter-spacing: .04em; box-shadow: 0 0 0 5px rgba(224, 56, 62, .25); }
.pre-odds { display: grid; gap: 6px; justify-items: center; margin-bottom: 18px; }
.pre-odds-bar { width: min(100%, 420px); height: 6px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; }
.pre-odds-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--chalk), var(--chalk-2)); }
.pre-odds span { font: 700 12px/1 var(--f-cond); letter-spacing: .16em; text-transform: uppercase; color: var(--chalk-2); }
.pre-grid { display: grid; gap: 12px; }
.pre-card { padding: 14px; display: grid; gap: 10px; }
.pre-status { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 4px; background: rgba(82, 199, 127, .1); border: 1px solid rgba(82, 199, 127, .3); }
.pre-status .ic { grid-row: span 2; color: var(--good); }
.pre-status.warn { background: rgba(242, 179, 61, .1); border-color: rgba(242, 179, 61, .35); } .pre-status.warn .ic { color: var(--warn); }
.pre-status b { font: 800 18px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; }
.pre-status em { font-style: normal; color: var(--chalk-2); font-size: 13px; }
.pre-warn { margin: 0; color: var(--warn); font-size: 13px; }
.pre-cond { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pre-cond li { display: flex; gap: 10px; align-items: center; color: var(--chalk-2); }
.pre-cond .ic { width: 18px; height: 18px; color: var(--mute); }
.keys { display: flex; flex-wrap: wrap; gap: 8px 14px; font: 600 13px/1 var(--f-cond); letter-spacing: .04em; color: var(--chalk-2); }
kbd { display: inline-block; min-width: 26px; padding: 4px 6px; margin-right: 4px; border-radius: 3px; background: #0b1324; border: 1px solid var(--line-2); border-bottom-width: 2px; font: 700 12px/1 var(--f-cond); color: var(--chalk); text-align: center; }
.touch-only { display: none; margin: 0; font-size: 13px; }
@media (hover: none) and (pointer: coarse) { .pre-keys .keys { display: none; } .touch-only { display: block; } }
.pre-foot { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; padding: 12px max(16px, var(--sr)) calc(12px + var(--sb)) max(16px, var(--sl)); border-top: 1px solid var(--line); background: rgba(8, 13, 25, .94); }
@media (min-width: 900px) and (orientation: landscape) {
  .pre-wrap { padding-top: 20px; }
  .pre-team b { font-size: 30px; }
  .pre-team .kit { width: 130px; height: 130px; }
  .pre-mid span { width: 64px; height: 64px; font-size: 24px; }
  .pre-grid { grid-template-columns: 1.1fr 1fr 1fr; }
  .pre-foot { grid-template-columns: 220px 320px; justify-content: end; padding-right: 40px; }
}

/* ---------- match host ---------- */
.match-screen { background: #050a12; animation: none; }
.match-host { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.match-fail { margin: auto; text-align: center; display: grid; gap: 14px; padding: 24px; }

/* ---------- text-sim fallback ---------- */
.ts { flex: 1; display: flex; flex-direction: column; min-height: 0; max-width: 760px; width: 100%; margin: 0 auto; padding: calc(10px + var(--st)) 14px calc(10px + var(--sb)); gap: 10px; }
.ts-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px 10px; background: #04070d; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
.ts-team { display: flex; align-items: center; gap: 8px; font: 900 20px/1 var(--f-display); letter-spacing: .05em; }
.ts-team.r { justify-content: flex-end; }
.ts-team em { font: 700 9px/1 var(--f-cond); letter-spacing: .28em; color: var(--amber); font-style: normal; }
.ts-score { display: flex; align-items: center; gap: 8px; position: relative; padding-bottom: 14px; }
.ts-score b { font: 800 46px/.9 var(--f-display); color: var(--amber); text-shadow: 0 0 14px rgba(255, 177, 68, .5); min-width: 28px; text-align: center; }
.ts-score i { color: rgba(255, 177, 68, .5); font: 800 30px/1 var(--f-display); font-style: normal; }
.ts-clock { position: absolute; bottom: -2px; left: 0; right: 0; text-align: center; font: 700 13px/1 var(--f-cond); letter-spacing: .16em; color: #ff6b4a; }
.ts-strip { height: 4px; background: rgba(255, 255, 255, .08); border-radius: 2px; overflow: hidden; }
.ts-prog { height: 100%; width: 0; background: var(--red); }
.ts-pitch { width: 100%; height: auto; aspect-ratio: 16 / 10; max-height: 34vh; border-radius: 4px; display: block; }
.ts-pitch circle { transition: cx .3s linear, cy .3s linear; }
.ts-feed { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.ts-feed p { margin: 0; padding: 9px 12px; border-radius: 3px; background: var(--panel); border-left: 3px solid var(--line-2); font-size: 15px; animation: rise .25s both; }
.ts-feed p b { font: 800 14px/1 var(--f-display); color: var(--mute); margin-right: 6px; }
.ts-feed p.goal { border-left-color: var(--gold); background: linear-gradient(90deg, rgba(242, 194, 92, .18), var(--panel)); }
.ts-feed p.goal-team { border-left-color: var(--good); }
.ts-feed p.conc { border-left-color: var(--red); }
.ts-feed p.ft { border-left-color: var(--chalk); font-weight: 700; }
.ts-moment { padding: 14px; border-radius: 6px; background: linear-gradient(180deg, #1d2d4b, #14213a); border: 1px solid rgba(242, 194, 92, .45); box-shadow: 0 -10px 30px -10px rgba(0, 0, 0, .6); animation: rise .25s both; }
.ts-mtime { font: 800 13px/1 var(--f-display); letter-spacing: .14em; color: var(--gold); }
.ts-mtext { margin: 8px 0 12px; font: 600 18px/1.3 var(--f-body); }
.ts-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ts-acts .btn { min-height: 58px; padding: 0 8px; font-size: 17px; }
.ts-timer { height: 3px; background: rgba(255, 255, 255, .08); margin-top: 10px; border-radius: 2px; overflow: hidden; }
.ts-timer i { display: block; height: 100%; width: 100%; background: var(--gold); }
.ts-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ts-drill { justify-content: center; }
.ts-drill-head h2 { font: 900 40px/1 var(--f-display); text-transform: uppercase; margin: 8px 0 16px; }

/* ---------- timing minigame (PT + practice fallback) ---------- */
.tg { display: grid; gap: 14px; padding: 18px 16px; border-radius: 8px; background: linear-gradient(180deg, #16233c, #0f182b); border: 1px solid var(--line); }
.tg-head { display: flex; justify-content: space-between; align-items: baseline; }
.tg-title { font: 800 20px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; }
.tg-reps { font: 700 14px/1 var(--f-cond); color: var(--mute); letter-spacing: .1em; }
.tg-reps b { font: 900 28px/1 var(--f-display); color: var(--chalk); }
.tg-track { position: relative; height: 64px; border-radius: 4px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 10%), #070c16; box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.tg-zone { position: absolute; top: 0; bottom: 0; background: linear-gradient(180deg, rgba(82, 199, 127, .45), rgba(82, 199, 127, .25)); border-left: 2px solid var(--good); border-right: 2px solid var(--good); transition: left .25s, width .25s; }
.tg-sweet { position: absolute; top: 8px; bottom: 8px; width: 2px; margin-left: -1px; background: #fff; opacity: .7; transition: left .25s; }
.tg-mark { position: absolute; top: -2px; bottom: -2px; width: 8px; margin-left: -4px; background: var(--gold); border-radius: 2px; box-shadow: 0 0 14px rgba(242, 194, 92, .9); }
.tg-track.flash-great { animation: flashG .4s; } .tg-track.flash-ok { animation: flashO .4s; } .tg-track.flash-miss { animation: flashM .4s; }
@keyframes flashG { 30% { box-shadow: inset 0 0 0 3px var(--gold), 0 0 24px rgba(242, 194, 92, .6); } }
@keyframes flashO { 30% { box-shadow: inset 0 0 0 3px var(--good); } }
@keyframes flashM { 30% { box-shadow: inset 0 0 0 3px var(--red); transform: translateX(-3px); } 60% { transform: translateX(3px); } }
.tg-pips { display: flex; gap: 6px; }
.tg-pips i { flex: 1; height: 8px; border-radius: 1px; background: rgba(255, 255, 255, .08); }
.tg-pips i.great { background: var(--gold); } .tg-pips i.ok { background: var(--good); } .tg-pips i.miss { background: var(--red); }
.tg-hint { margin: 0; color: var(--chalk-2); font-size: 14px; }
.tg-hit { min-height: 72px; font-size: 26px; touch-action: manipulation; }
