/* PAGE 2: live, the stadium LED board */
.p2 { position: relative; height: 230vh; --red: #FF4B3E; --led: "DotGothic16", "Archivo", monospace; }
.p2-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #050505; display: flex; flex-direction: column; }
.p2-bg { position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover; filter: blur(3px) saturate(.8); transform-origin: 50% 40%; will-change: transform; }
.p2-shade { position: absolute; inset: 0; background: radial-gradient(80% 70% at 50% 45%, rgba(5, 5, 5, .55), rgba(5, 5, 5, .9) 75%), linear-gradient(to bottom, rgba(5, 5, 5, .7), transparent 30%, transparent 70%, rgba(5, 5, 5, .95)); }
.p2-in { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; width: min(1160px, 100% - 2 * var(--gut)); margin: 0 auto; padding: 88px 0 70px; }
.p2-head { display: flex; align-items: center; gap: 16px 22px; flex-wrap: wrap; }
.tag-live { background: var(--red); color: #fff; }
.dot.live { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }
.p2-title { margin: 0; font: 700 clamp(36px, 4.4vw, 70px)/.95 var(--f-display); text-transform: uppercase; }
.p2-tabs { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.p2-tabs button { font: 700 12px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); background: rgba(18, 18, 16, .75); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.p2-tabs button:hover { color: var(--ink); border-color: rgba(244, 241, 230, .35); }
.p2-tabs button[aria-selected="true"] { background: var(--y); color: var(--y-ink); border-color: var(--y); }
.p2-tabs button:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; }

/* the board */
.board { position: relative; border-radius: 14px; background: #030303; border: 1px solid #1d1d1a; box-shadow: 0 0 0 8px #0c0c0b, 0 0 0 9px #22221e, 0 40px 120px -30px rgba(0, 0, 0, .9), 0 0 80px -20px rgba(239, 215, 29, calc(.25 * var(--on, 0))); overflow: hidden; font-family: var(--led); color: #F4EFD8; transform: perspective(1400px) rotateX(calc(8deg * (1 - var(--in, 1)))) scale(calc(.94 + .06 * var(--in, 1))); transform-origin: 50% 100%; opacity: calc(.25 + .75 * var(--in, 1)); }
/* dot-matrix: every lit pixel shows as an LED */
.board::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, transparent 0 58%, rgba(0, 0, 0, .22) 78%) 0 0 / 4px 4px; mix-blend-mode: multiply; }
.board-top { display: flex; align-items: center; gap: 18px; padding: 14px 22px; border-bottom: 3px solid var(--y); background: #0a0a09; font-size: clamp(16px, 1.6vw, 24px); letter-spacing: .08em; text-transform: uppercase; }
.board-live { display: inline-flex; align-items: center; gap: 10px; }
.board-live::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--y); box-shadow: 0 0 10px var(--y); }
.board.is-live .board-live::before { background: var(--red); box-shadow: 0 0 12px var(--red); animation: pulse 1.2s ease-in-out infinite; }
.board-lg { color: var(--y); }
.board-clock { margin-left: auto; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.board-body { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 300px; }
.board-matches { border-right: 1px solid #1a1a17; padding: 10px 0; }
.board-matches ol { list-style: none; margin: 0; padding: 0; }
.board-h { margin: 4px 22px 8px; font: 700 11px var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.board-more { display: none; }
.sc { display: grid; justify-items: center; gap: 2px; }
.m { display: grid; grid-template-columns: 1fr 120px 1fr; align-items: center; gap: 12px; padding: 9px 22px; font-size: clamp(15px, 1.35vw, 21px); text-transform: uppercase; letter-spacing: .03em; opacity: 0; transform: translateX(-12px); transition: opacity .35s, transform .45s var(--ease); }
.m.lit { opacity: 1; transform: none; }
.m:nth-child(even) { background: rgba(255, 255, 255, .025); }
.m .h { text-align: right; } .m .h, .m .a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m .s { text-align: center; color: var(--y); font-size: 1.2em; text-shadow: 0 0 12px rgba(239, 215, 29, .55); font-variant-numeric: tabular-nums; }
.m .s.pre { color: var(--ink-soft); text-shadow: none; font-size: .95em; }
.m .t { text-align: center; color: var(--ink-soft); font: 600 10px var(--f-ui); letter-spacing: .1em; text-transform: uppercase; }
.m.in .t { color: var(--red); text-shadow: 0 0 10px rgba(255, 75, 62, .6); }
.m.goal { animation: goalrow 1.6s ease-out 3; }
@keyframes goalrow { 0% { background: rgba(239, 215, 29, .45) } 100% { background: transparent } }
.board-empty { padding: 26px 22px; color: var(--ink-soft); font-size: 18px; }
.board-table { padding: 10px 0; }
.board-table table { width: 100%; border-collapse: collapse; font-size: clamp(14px, 1.25vw, 19px); text-transform: uppercase; }
.board-table th { font-weight: 400; color: var(--ink-soft); text-align: right; padding: 4px 18px 8px 0; font-size: .75em; letter-spacing: .1em; }
.board-table th:nth-child(1), .board-table th:nth-child(2) { text-align: left; }
.board-table th:nth-child(1) { padding-left: 22px; }
.board-table td { padding: 6px 18px 6px 0; text-align: right; font-variant-numeric: tabular-nums; }
.board-table td:nth-child(1) { text-align: left; padding-left: 22px; color: var(--ink-soft); width: 3ch; }
.board-table td:nth-child(2) { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; width: 60%; }
.board-table td:last-child { color: var(--y); text-shadow: 0 0 10px rgba(239, 215, 29, .5); }
.board-table tr.r { opacity: 0; transition: opacity .35s; }
.board-table tr.r.lit { opacity: 1; }
.board-table tr.top td:nth-child(2) { color: var(--y); }
/* a slow scanline sweeps the board */
.board-scan { position: absolute; left: 0; right: 0; height: 30%; top: -30%; pointer-events: none; background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, .045), transparent); animation: scan 5s linear infinite; }
@keyframes scan { to { top: 110% } }
.p2-note { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* the ticker */
.ticker { position: relative; z-index: 2; border-top: 1px solid #22221e; background: var(--y); color: var(--y-ink); overflow: hidden; white-space: nowrap; }
.ticker-run { display: inline-flex; gap: 40px; padding: 12px 0; font: 800 14px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; animation: tick 60s linear infinite; }
.ticker-run span b { font-weight: 900; margin: 0 6px; }
.ticker-run i { font-style: normal; opacity: .55; margin-right: 8px; }
@keyframes tick { to { transform: translateX(-50%) } }
.ticker:hover .ticker-run { animation-play-state: paused; }

/* GOAL: the whole screen flashes yellow */
.p2-flash { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; opacity: 0; background: var(--y); }
.p2-flash span { font: 700 clamp(90px, 20vw, 300px)/1 var(--f-display); color: var(--y-ink); letter-spacing: .02em; transform: scale(.8); }
.p2-flash.on { animation: flashbg 1.6s var(--ease); } .p2-flash.on span { animation: flashtx 1.6s var(--ease); }
@keyframes flashbg { 0% { opacity: 0 } 12% { opacity: 1 } 60% { opacity: .95 } 100% { opacity: 0 } }
@keyframes flashtx { 0% { transform: scale(.7) } 30% { transform: scale(1.05) } 100% { transform: scale(1.12) } }

@media (max-width: 760px) {
  .p2 { height: auto; }
  .p2-stage { position: relative; height: auto; min-height: 100svh; }
  .p2-in { padding: 84px 0 28px; gap: 16px; }
  .p2-tabs { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .p2-tabs button { flex: none; }
  /* the phone: clear first, LED second. Plain readable names, big score chips, labelled blocks, top 6 + "Hele stand" */
  .board { transform: none; opacity: 1; border-radius: 16px; box-shadow: 0 0 0 1px #22221e, 0 30px 80px -30px rgba(0, 0, 0, .9); }
  .board::after { background-size: 3px 3px; }   /* the LED dots, finer on a phone; the bold font stays readable through them */
  .board-top { padding: 12px 16px; font-size: 14px; gap: 10px; }
  .board-body { grid-template-columns: 1fr; min-height: 0; }
  .board-matches { border-right: 0; border-bottom: 1px solid #1f1f1b; padding: 12px 0 6px; }
  .board-h { margin: 0 16px 8px; }
  .m { grid-template-columns: 1fr auto 1fr; gap: 10px; padding: 10px 16px; font: 700 15px/1.2 var(--f-ui); text-transform: none; letter-spacing: 0; }
  .m:nth-child(even) { background: transparent; } .m + .m { border-top: 1px solid #171714; }
  .m .h, .m .a { white-space: normal; overflow: visible; }
  .m .s { min-width: 64px; padding: 5px 10px; border-radius: 8px; background: #121210; border: 1px solid #2a2a24; font: 400 22px/1 var(--led); }
  .m .s.pre { font: 700 14px/1.3 var(--f-ui); }
  .m .t { font-size: 10px; margin-top: 3px; }
  .board-table { padding: 12px 0 14px; }
  .board-table table { font: 600 15px var(--f-ui); text-transform: none; }
  .board-table th { font: 700 10px var(--f-ui); }
  .board-table th:nth-child(1), .board-table td:nth-child(1) { padding-left: 16px; }
  .board-table td, .board-table th { padding-right: 14px; }
  .board-table td { padding-top: 8px; padding-bottom: 8px; border-top: 1px solid #171714; }
  .board-table td:last-child { font: 400 18px var(--led); }
  .board:not(.all-rows) .board-table tr.r:nth-child(n + 7) { display: none; }
  .board-more { display: block; margin: 10px 16px 0; width: calc(100% - 32px); min-height: 44px; border-radius: 10px; border: 1px solid #2a2a24; background: #121210; color: var(--ink); font: 700 13px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
}
@media (prefers-reduced-motion: reduce) {
  .p2 { height: auto; } .p2-stage { position: relative; min-height: 100svh; height: auto; }
  .board { transform: none; opacity: 1; } .m, .board-table tr.r { opacity: 1; transform: none; transition: none; }
  .board-scan, .ticker-run, .dot.live { animation: none; } .p2-flash { display: none; }
}
