/* MWT Picks live match screen, laid out like a livescore app (js/match-view.js, js/timeline.js, js/pitch.js).
   Neutral like the rest of the app: tokens come from css/play.css, so light and dark follow the phone.
   The pitch is the match, so it may be green; card glyphs use card colours, because that is what they are. */

/* ---------- header and scoreboard ---------- */
.screen-live { gap: 10px; }
.match-head { display: flex; align-items: center; gap: 4px; min-height: 48px; }
.match-head-end { width: 34px; flex: none; }
.live-title { flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; text-align: center; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.scoreboard { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 8px;
  padding: 16px 10px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.crest { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700;
  letter-spacing: 0.02em; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.team { font-weight: 600; font-size: 15px; max-width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-mid { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 2px; }
.sb-score { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 40px; line-height: 1; font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sb-num { display: inline-block; min-width: 0.65em; text-align: center; }
.sb-dash { color: var(--muted); font-weight: 400; font-size: 28px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.is-live { background: rgba(244, 63, 94, 0.14); color: #FDA4AF; }   /* live = red dot, like every sports app */
.status.is-live .status-dot { background: var(--live, #F43F5E); }
.status.is-live .status-dot { display: inline-block; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
/* Match clock: a thin track inside the card, so an early minute reads as progress, not a stray mark in the corner. */
.sb-progress { position: absolute; left: 16px; right: 16px; bottom: 8px; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.sb-progress-bar { display: block; height: 100%; width: 0; background: var(--text); opacity: 0.55; transition: width 1s linear; }

/* Goal: the board rings and the scorer's number pops for a moment. */
.scoreboard.sb-goal { box-shadow: 0 0 0 2px var(--text); animation: sb-glow 1.8s ease-out; }
.sb-num.sb-flash { animation: sb-pop 0.7s cubic-bezier(.2,.9,.3,1.4); }
@keyframes sb-pop { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes sb-glow { 0% { background: var(--surface-2); } 100% { background: var(--surface); } }

/* ---------- stats strip ---------- */
.stats { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stats-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stat { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; row-gap: 5px; font-size: 14px; }
.stat-label { text-align: center; color: var(--muted); font-size: 13px; }
.stat-num { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.stat-num.lead { color: var(--text); font-weight: 700; }
.stat-a { text-align: right; }
.stat-bar { grid-column: 1 / -1; display: flex; gap: 3px; height: 5px; }
.stat-bar-h, .stat-bar-a { display: block; height: 100%; border-radius: 3px; background: var(--border); transition: width 0.5s; }
/* A side on 0 keeps a grey stub, so "Red cards 0 - 1" never reads as one full white bar from the left. */
.stat-bar-h, .stat-bar-a { min-width: 8px; }
.stat-bar-h.lead, .stat-bar-a.lead { background: var(--text); }

/* ---------- balance strip and live body ---------- */
.strip { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); padding: 10px 2px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.strip b { color: var(--text); }
.live-body { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; text-align: center; }
.match-orb { display: block; width: 100%; height: 150px; margin: -4px 0 -6px; }
.live-state { margin: 0; font-size: 15px; color: var(--muted); max-height: 6em; overflow: hidden; transition: opacity 0.3s, max-height 0.3s; }
/* While a card is up the line also gives back its space, so Your picks sits right under the strip, not behind the card. */
body.card-open .live-state { opacity: 0; max-height: 0; }
.live-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }   /* no opacity: --muted already passes AA */
.ht { margin: 4px auto 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; }

/* ---------- timeline and the collapsible mini-pitch ---------- */
.events { text-align: left; margin-top: 6px; }
.events-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.events-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.pitch-toggle { font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 0 12px; margin-right: -8px;
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text); cursor: pointer;
  border-radius: 999px; touch-action: manipulation; }
.pitch-toggle::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform 0.2s; }
.pitch-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.live-pitch { width: 100%; max-width: 320px; margin: 0 auto 8px; display: flex; flex-direction: column; gap: 6px; }
.pitch-wrap { position: relative; width: 100%; }
.pitch { display: block; width: 100%; height: auto; border-radius: 10px; background: linear-gradient(180deg, #1C4A2C, #163D24); }
.pitch-lines rect, .pitch-lines line, .pitch-lines circle { stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.4; }
.pitch-ball { fill: #FFFFFF; transition: cx 0.9s cubic-bezier(.2,.7,.2,1), cy 0.9s cubic-bezier(.2,.7,.2,1); }
.pitch-trail { stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.5; stroke-dasharray: 1.2 1.2; }
.pitch-flash { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800;
  letter-spacing: 0.06em; color: #FFFFFF; opacity: 0; transform: scale(0.92); transition: opacity 0.25s, transform 0.25s;
  pointer-events: none; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.pitch-flash.on { opacity: 1; transform: scale(1); }
.pitch-flash.goal { background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%); border-radius: 10px; }
.pitch-flash.red { color: #FCA5A5; }
.pitch-sides { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.timeline:empty { display: none; }
.tl-empty { margin: 0; padding: 14px; font-size: 14px; color: var(--muted); text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius); }
.tl-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-top: 1px solid var(--border);
  font-size: 14px; animation: tl-in 0.35s ease; }
.tl-row:first-child, .tl-divider:first-child { border-top: 0; }
.tl-away { flex-direction: row-reverse; text-align: right; }
.tl-min { flex: none; width: 40px; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-away .tl-min { text-align: right; }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-main { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-sub { font-size: 12px; color: var(--muted); }
.tl-goal .tl-main { font-weight: 800; }
.tl-goal .tl-sub { color: var(--text); font-weight: 600; }
.tl-ico { position: relative; flex: none; width: 22px; height: 22px; display: grid; place-items: center;
  font-size: 9px; font-weight: 800; line-height: 1; color: var(--text); }
/* Goal: a ball. Cards: small upright cards. Corner: a flag on a pole. VAR and penalty: a boxed label. */
.tl-goal .tl-ico::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--text);
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 5px var(--text); }
.tl-yellow-card .tl-ico::before, .tl-red-card .tl-ico::before { content: ""; width: 11px; height: 15px; border-radius: 2px; background: #FACC15; }
.tl-red-card .tl-ico::before { background: #EF4444; }
.tl-corner .tl-ico::before { content: ""; position: absolute; left: 7px; top: 3px; width: 2px; height: 16px; background: var(--muted); }
.tl-corner .tl-ico::after { content: ""; position: absolute; left: 9px; top: 3px; border-left: 9px solid var(--text);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.tl-var .tl-ico, .tl-penalty .tl-ico { width: auto; min-width: 22px; height: 18px; padding: 0 3px; border: 1.5px solid var(--text); border-radius: 4px; }
.tl-divider { display: flex; justify-content: center; padding: 8px 12px; background: var(--surface-2); border-top: 1px solid var(--border); }
.tl-divider-text { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase;
  font-variant-numeric: tabular-nums; }
@keyframes tl-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Small phones: a little tighter so long names still fit at 320 px. */
@media (max-width: 359px) {
  .crest { width: 40px; height: 40px; font-size: 13px; }
  .sb-score { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .pitch-ball, .sb-progress-bar, .stat-bar-h, .stat-bar-a { transition: none; }
  .tl-row, .status.is-live .status-dot, .scoreboard.sb-goal, .sb-num.sb-flash { animation: none; }
  .scoreboard.sb-goal { background: var(--surface-2); }   /* still marks the goal, without movement */
}
.follow-slot { margin: 4px 0 0; }
.follow-slot:empty { display: none; }
.follow-slot .follow-btn { width: 100%; }

/* "Only ..." focus (js/focus.js) */
.mic-btn { font-size: 18px; }
.mic-btn.on { color: #FFB3C9; box-shadow: 0 0 0 1px #FF2E7E inset; border-radius: 999px; }
.mic-btn.listening { animation: mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 46, 126, 0.6); } 50% { box-shadow: 0 0 0 8px rgba(255, 46, 126, 0); } }
.focus-bar { padding: 0 0 8px; }   /* the screen's own side margin lines it up with the panels */
.focus-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 999px; background: rgba(255, 46, 126, 0.14); border: 1px solid #FF2E7E; color: #FFB3C9; font-size: 14px; }
.focus-chip button { border: 0; background: transparent; color: inherit; font-size: 16px; min-width: 44px; min-height: 44px; margin: -6px -6px -6px 0; border-radius: 999px; }   /* a 44 px tap target; the chip stays 44 px tall */
.focus-form { margin: 0 0 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.focus-form .row { display: flex; gap: 8px; }
.focus-form input { flex: 1; }
.focus-form > p:first-child { margin-top: 0; }   /* no empty band above the hint */
@media (prefers-reduced-motion: reduce) { .mic-btn.listening { animation: none; } }
