/* ================================================================
   Lotto Matrix — TV Ambient Wall styles.
   10-foot UI: large, high-contrast, focus-ring driven, no mouse chrome.
   ================================================================ */
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(80,110,170,.16), transparent 60%),
    linear-gradient(180deg, #0d1220 0%, #060912 100%);
  color: #e9edf4;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* the wall */
.tv-wall {
  position: absolute; inset: 0;
  display: grid; gap: 18px; padding: 28px;
  grid-template-columns: 1fr;
}
.tv-wall.cols-2 { grid-template-columns: 1fr 1fr; }
.tv-wall.grid-2x2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

/* a tile */
.tv-tile {
  position: relative; border-radius: 20px; overflow: hidden;
  background: linear-gradient(180deg, #0e1322 0%, #0a0e18 100%);
  border: 2px solid rgba(255,255,255,.07);
  transition: filter .25s ease, box-shadow .25s ease, transform .2s ease;
  filter: brightness(.8) saturate(.92);
}
/* the focus ring — the heart of remote navigation */
.tv-tile.is-focused {
  filter: none;
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(255,211,77,1), 0 0 46px rgba(255,200,60,.5);
  transform: scale(1.012);
}

/* corner game badge */
.tv-bug {
  position: absolute; top: 16px; left: 16px; z-index: 6;
  display: flex; align-items: center; gap: 10px;
  background: rgba(8,12,20,.55); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 999px;
  padding: 6px 16px 6px 6px; pointer-events: none;
}
.tv-chip {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #0a0e18;
}
.tv-name { font-size: 17px; font-weight: 700; letter-spacing: .02em; }

.tv-prog {
  position: absolute; bottom: 12px; right: 18px; z-index: 6;
  font-size: 13px; color: #8893a6; font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* board */
.tv-board {
  position: absolute; inset: 0; padding: 60px 18px 32px;
  display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.tv-row { display: flex; align-items: center; justify-content: center; }
.tv-head { margin-bottom: 2px; }
.tv-hcell {
  display: flex; align-items: center; justify-content: center;
  color: #8893a6; font-weight: 700; font-variant-numeric: tabular-nums; flex: 0 0 auto;
}
.tv-dot {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; border: 1px solid transparent; flex: 0 0 auto; overflow: hidden;
}
.tv-dot.blank { background: rgba(255,255,255,.05) !important; }
.tv-dot.is-current { box-shadow: inset 0 0 0 2px rgba(255,255,255,.85); }
.tv-dot.sel-ball {
  transform: scale(1.7); z-index: 9;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 16px rgba(255,255,255,.55);
}
.tv-dot.active-ball {
  transform: scale(1.8); z-index: 10;
  box-shadow: 0 0 0 3px rgba(255,255,255,.95), 0 0 24px rgba(255,255,255,.7);
  animation: tv-draw .45s cubic-bezier(.34,1.56,.64,1);
}
@keyframes tv-draw { 0% { transform: scale(1); } 55% { transform: scale(2.05); } 100% { transform: scale(1.8); } }

/* fullscreen one tile */
body.tv-fullscreen .tv-tile:not(.is-expanded) { display: none; }
body.tv-fullscreen .tv-wall { padding: 0; }
.tv-tile.is-expanded {
  position: fixed; inset: 0; z-index: 100; border-radius: 0;
  border: none; box-shadow: none; transform: none; filter: none;
}
.tv-tile.is-expanded .tv-board { padding: 80px 36px 48px; }

/* remote hint bar */
.tv-hints {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
  display: flex; gap: 26px; z-index: 200;
  background: rgba(12,16,26,.82); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 999px;
  padding: 12px 26px; font-size: 15px; color: #cdd5e2;
  opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease;
}
.tv-hints.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tv-hints b { color: #ffd34d; font-weight: 800; margin-right: 4px; }

/* ambient status (focused game name) — top center, subtle */
.tv-status {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 150;
  font-size: 14px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.4); font-weight: 700; pointer-events: none;
}
body.tv-fullscreen .tv-status { display: none; }

/* 4K / large TV scaling */
@media (min-width: 2200px) {
  .tv-name { font-size: 24px; } .tv-chip { width: 46px; height: 46px; font-size: 17px; }
  .tv-hints { font-size: 20px; } .tv-prog { font-size: 17px; }
}

/* ============ CAST-READY POLISH ============ */

/* brand mark — subtle bottom-left watermark (legit-product corner) */
.tv-brand {
  position: fixed; left: 26px; bottom: 22px; z-index: 150;
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.5); pointer-events: none;
  transition: opacity .4s ease;
}
.tv-brand-badge { display: flex; }
.tv-brand-badge svg { width: 26px; height: 26px; color: rgba(255,211,77,.85); }
/* real logo image */
.tv-brand-img { width: 46px; height: 46px; object-fit: contain; display: block; opacity: .92; }
.tv-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.tv-brand-text strong { font-size: 14px; font-weight: 800; letter-spacing: .04em; color: rgba(255,255,255,.7); display: none; }
.tv-brand-text strong.show-fallback { display: block; }
.tv-brand-text small { font-size: 10px; letter-spacing: .03em; color: rgba(255,255,255,.4); }
body.tv-fullscreen .tv-brand { left: 36px; bottom: 30px; }

/* TV = no mouse: hide the cursor unless it just moved */
html, body { cursor: none; }
body.show-cursor { cursor: default; }

/* idle screensaver: after inactivity, dim chrome so it's pure ambient art */
body.tv-idle .tv-hints,
body.tv-idle .tv-status { opacity: 0 !important; }
body.tv-idle .tv-brand { opacity: .25; }
body.tv-idle .tv-tile.is-focused {
  box-shadow: 0 0 0 2px rgba(255,211,77,.35), 0 0 30px rgba(255,200,60,.2);
}

/* prevent text selection / highlight flashes on a TV */
* { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }

/* 4K / large-screen scaling bump */
@media (min-width: 2200px) {
  .tv-brand-text strong { font-size: 20px; }
  .tv-brand-text small { font-size: 14px; }
  .tv-brand-badge svg { width: 36px; height: 36px; }
  .tv-brand-img { width: 68px; height: 68px; }
}

/* SELECTED/FILTERED value: bold highlight on every matching history dot so the
   whole family pops unmistakably against the heat colors (matches dashboard) */
.tv-dot.tv-thermal-sel {
  box-shadow:
    0 0 0 2px rgba(0,0,0,.9),
    0 0 0 6px rgba(255,255,255,1),
    0 0 16px 3px rgba(255,255,255,.85),
    0 0 30px 8px rgba(255,230,120,.6);
  transform: scale(1.2);
  z-index: 6;
  animation: tv-sel-pulse 1.4s ease-in-out infinite;
}
@keyframes tv-sel-pulse {
  0%, 100% { box-shadow:
    0 0 0 2px rgba(0,0,0,.9),
    0 0 0 6px rgba(255,255,255,1),
    0 0 16px 3px rgba(255,255,255,.85),
    0 0 30px 8px rgba(255,230,120,.6); }
  50% { box-shadow:
    0 0 0 2px rgba(0,0,0,.9),
    0 0 0 7px rgba(255,255,255,1),
    0 0 24px 5px rgba(255,255,255,.95),
    0 0 40px 12px rgba(255,230,120,.8); }
}

/* ===== TV Video-Wall Admin — gear + panel ===== */
#tv-admin-gear {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,16,26,.6); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.7); cursor: pointer;
  opacity: .5; transition: opacity .25s ease, transform .15s ease;
}
#tv-admin-gear:hover { opacity: 1; transform: scale(1.06); color: #ffd34d; }
#tv-admin-gear svg { width: 22px; height: 22px; }
/* AMBIENT/IDLE: hide entirely so it never burns into the wall */
/* AMBIENT/IDLE: fade for burn-in, but KEEP it clickable so setup is always reachable */
body.tv-idle #tv-admin-gear { opacity: 0; pointer-events: auto; }
/* cursor hidden (no recent mouse move): fade, still clickable */
body:not(.show-cursor) #tv-admin-gear { opacity: 0; pointer-events: auto; }
/* hovering the bottom-right corner brings the gear back even while idle */
body.tv-idle #tv-admin-gear:hover,
body:not(.show-cursor) #tv-admin-gear:hover { opacity: 1; }

#tv-admin-panel {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
}
.tva-card {
  width: min(440px, 92vw);
  background: #12161f; color: #e8ecf4;
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); padding: 18px 20px; font-size: 14px;
}
.tva-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.tva-x { background: none; border: none; color: rgba(255,255,255,.6); font-size: 22px; line-height: 1; cursor: pointer; }
.tva-x:hover { color: #fff; }
.tva-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; gap: 12px; }
.tva-row span { color: rgba(255,255,255,.7); font-weight: 600; }
.tva-row input, .tva-row select { background: #1b2130; color: #fff; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; padding: 6px 10px; font-size: 14px; min-width: 130px; }
.tva-games-h { margin: 14px 0 8px; font-weight: 700; color: rgba(255,255,255,.55); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.tva-games { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tva-game { display: flex; align-items: center; gap: 8px; background: #1b2130; border: 1px solid rgba(255,255,255,.10); border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.tva-game:hover { border-color: rgba(255,211,77,.5); }
.tva-game input { accent-color: #ffd34d; }
.tva-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.tva-btn { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; border: 1px solid rgba(255,255,255,.16); background: #1b2130; color: #e8ecf4; cursor: pointer; }
.tva-btn:hover { border-color: rgba(255,255,255,.35); }
.tva-ghost { opacity: .8; }
.tva-primary { background: #ffd34d; color: #1a1206; border-color: #ffd34d; }
.tva-primary:hover { filter: brightness(1.05); }
.tva-hint { margin-top: 14px; font-size: 11px; color: rgba(255,255,255,.4); }
.tva-hint code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; }

/* ---- per-tile NEXT DRAW date chip (in the corner game bug) ---- */
.tv-nextdraw {
  display: inline-flex; align-items: baseline; gap: 7px;
  margin-left: 11px; padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.18);
}
.tv-nd-lbl {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: rgba(255,255,255,.5);
}
.tv-nd-val { font-size: 14px; font-weight: 800; color: #ffd34d; white-space: nowrap; }
/* expanded/fullscreen tile: scale up for couch distance */
.tv-tile.is-expanded .tv-nd-lbl { font-size: 14px; }
.tv-tile.is-expanded .tv-nd-val { font-size: 18px; }
/* 4K bump */
@media (min-width: 2200px) {
  .tv-nd-lbl { font-size: 15px; }
  .tv-nd-val { font-size: 20px; }
}

/* ===== floating toolbox (focused/expanded tile only) ===== */
.tv-toolbox {
  position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%) translateY(12px);
  z-index: 120; display: none; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(10,14,24,.72); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 30px rgba(0,0,0,.45);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.tv-toolbox.show { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
/* auto-hide with the ambient idle + cursor-hide chrome so it never burns in */
body.tv-idle .tv-toolbox { opacity: 0 !important; pointer-events: none; }
.tv-tb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
  transition: background .15s ease, transform .12s ease;
}
.tv-tb-btn:hover { background: rgba(255,211,77,.22); border-color: rgba(255,211,77,.5); transform: scale(1.06); }
.tv-tb-play { font-size: 20px; color: #ffd34d; }
.tv-tb-pos {
  min-width: 64px; text-align: center; font-size: 14px; font-weight: 800;
  color: rgba(255,255,255,.8); letter-spacing: .02em; padding: 0 4px;
}
@media (min-width: 2200px) {
  .tv-tb-btn { width: 56px; height: 56px; font-size: 24px; }
  .tv-tb-pos { font-size: 19px; min-width: 84px; }
  .tv-toolbox { bottom: 130px; gap: 14px; padding: 10px 18px; }
}

/* toolbox: zoom readout, separators, wall button */
.tv-tb-zlvl {
  min-width: 48px; text-align: center; font-size: 13px; font-weight: 800;
  color: rgba(255,255,255,.75); letter-spacing: .02em;
}
.tv-tb-sep {
  width: 1px; height: 26px; background: rgba(255,255,255,.16); margin: 0 4px;
}
.tv-tb-wall {
  width: auto !important; border-radius: 999px !important; padding: 0 16px;
  font-size: 14px !important; font-weight: 800; gap: 6px; white-space: nowrap;
  color: #ffd34d; letter-spacing: .02em;
}
.tv-tb-wall:hover { background: rgba(255,211,77,.22); }
@media (min-width: 2200px) {
  .tv-tb-zlvl { font-size: 18px; min-width: 64px; }
  .tv-tb-sep { height: 34px; }
  .tv-tb-wall { font-size: 19px !important; padding: 0 22px; }
}

/* toolbox print button */
.tv-tb-print { font-size: 18px; }
.tv-tb-print:hover { background: rgba(255,211,77,.22); border-color: rgba(255,211,77,.5); }
@media (min-width: 2200px) { .tv-tb-print { font-size: 24px; } }

/* ===== 3D BALL BADGES (original marks, NOT official lottery logos) =====
   Every game badge is a glossy 3D sphere. Paired games (Powerball/Bonus,
   Mega/Bonus, SuperLotto/Bonus) share the same ball family color. */
.tv-chip.is-ball {
  position: relative; border-radius: 50%; overflow: visible;
  color: #fff; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  box-shadow:
    inset 0 -5px 9px rgba(0,0,0,.45),     /* bottom shading -> roundness */
    inset 0 4px 7px rgba(255,255,255,.18),/* top inner light */
    0 3px 7px rgba(0,0,0,.5),             /* drop shadow -> lift off surface */
    0 0 0 1px rgba(0,0,0,.25);
}
/* specular highlight (glossy hotspot, upper-left) */
.tv-chip.is-ball::after {
  content: ""; position: absolute; left: 20%; top: 12%;
  width: 44%; height: 36%; border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(255,255,255,.85), rgba(255,255,255,.15) 55%, rgba(255,255,255,0) 75%);
  pointer-events: none; filter: blur(.4px);
}
/* faint inner ring like a printed lottery ball */
.tv-chip.is-ball::before {
  content: ""; position: absolute; inset: 15%; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.30); pointer-events: none;
}

/* ---- ball families (radial gradient = sphere shading) ---- */
.tv-chip.ball-red    { background: radial-gradient(circle at 38% 30%, #ff6b78 0%, #e0303f 48%, #a8121f 100%); }
.tv-chip.ball-green  { background: radial-gradient(circle at 38% 30%, #7fe3a0 0%, #36b366 48%, #14823f 100%); }
.tv-chip.ball-amber  { background: radial-gradient(circle at 38% 30%, #ffd98a 0%, #e8a72e 48%, #b9781a 100%);
                       color: #3a2606; text-shadow: 0 1px 1px rgba(255,255,255,.35); }
.tv-chip.ball-amber::before { border-color: rgba(90,60,10,.35); }
.tv-chip.ball-teal   { background: radial-gradient(circle at 38% 30%, #8fe9df 0%, #34c2b4 48%, #1a8378 100%); }
.tv-chip.ball-blue   { background: radial-gradient(circle at 38% 30%, #8fc3f0 0%, #3a8fd6 48%, #1a5d9e 100%); }
.tv-chip.ball-purple { background: radial-gradient(circle at 38% 30%, #c6a6f0 0%, #8a5fd6 48%, #5a2f9e 100%); }

/* ===== GAME (TV): ticket builder + picked ball + jackpot ===== */
.tv-tb-game { font-size: 18px; }
.tv-tb-game:hover { background: rgba(255,211,77,.22); border-color: rgba(255,211,77,.5); }

.tv-ticket {
  position: fixed; right: 40px; bottom: 150px; z-index: 130; width: 300px;
  display: none; flex-direction: column;
  background: #141a26; border: 1px solid rgba(255,211,77,.4); border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0,0,0,.6); overflow: hidden; color: #e8ecf4;
}
.tv-ticket.show { display: flex; }
.tv-ticket-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: rgba(255,211,77,.1); font-size: 15px; font-weight: 800; }
.tv-ticket-x { background: none; border: none; color: rgba(255,255,255,.6); font-size: 22px; cursor: pointer; }
.tv-ticket-need { padding: 10px 14px; font-size: 14px; color: rgba(255,255,255,.65); }
.tv-ticket-need b { color: #ffd34d; }
.tv-ticket-picks { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 12px; min-height: 38px; }
.tv-ticket-chip { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 900; font-size: 15px;
  background: radial-gradient(circle at 38% 30%, #ffe488, #e0a52e); color: #1a1206; border: 1px solid #ffd34d; }
.tv-ticket-empty { color: rgba(255,255,255,.35); font-size: 13px; }
.tv-ticket-foot { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.tv-ticket-btn { flex: 1; padding: 10px 0; border-radius: 9px; font-weight: 800; font-size: 14px;
  cursor: pointer; border: 1px solid rgba(255,255,255,.16); background: #1b2130; color: #e8ecf4; }
.tv-ticket-btn.primary { background: #ffd34d; color: #1a1206; border-color: #ffd34d; }
.tv-ticket-btn:disabled { opacity: .4; cursor: not-allowed; }
.tv-ticket-note { padding: 9px 14px; font-size: 11px; color: rgba(255,255,255,.4);
  border-top: 1px solid rgba(255,255,255,.06); }
body.tv-idle .tv-ticket { opacity: 0; pointer-events: none; }

/* picked ball glows gold in the header */
.tv-hcell.tv-game-head {
  background: radial-gradient(circle at 38% 30%, #ffe488, #e0a52e) !important;
  color: #1a1206 !important; font-weight: 900 !important; border-radius: 999px;
  box-shadow: 0 0 0 2px #ffd34d, 0 0 12px rgba(255,211,77,.7); }
.tv-board .tv-hcell[data-ball] { cursor: pointer; }

/* jackpot */
.tv-jackpot { position: fixed; inset: 0; z-index: 300; display: none; align-items: center;
  justify-content: center; overflow: hidden; background: rgba(0,0,0,.74); backdrop-filter: blur(4px); }
.tv-jackpot.show { display: flex; }
.tv-jk-inner { text-align: center; background: linear-gradient(160deg,#1a2236,#0c1220);
  border: 2px solid #ffd34d; border-radius: 22px; padding: 44px 60px;
  box-shadow: 0 0 70px rgba(255,211,77,.45); animation: tvjkpop .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes tvjkpop { from{transform:scale(.6);opacity:0;} to{transform:scale(1);opacity:1;} }
.tv-jk-burst { font-size: 64px; }
.tv-jk-title { font-size: 44px; font-weight: 900; color: #ffd34d; margin: 8px 0; text-shadow: 0 2px 14px rgba(255,211,77,.6); }
.tv-jk-coins { font-size: 32px; font-weight: 900; color: #ffb84d; }
.tv-jk-sub { color: rgba(255,255,255,.7); margin: 8px 0; font-weight: 700; font-size: 18px; }
.tv-jk-note { font-size: 13px; color: rgba(255,255,255,.4); margin-bottom: 20px; }
.tv-confetti { position: absolute; top: -10px; width: 10px; height: 16px; border-radius: 2px; opacity: .9;
  animation: tvfall linear forwards; }
@keyframes tvfall { to { transform: translateY(105vh) rotate(720deg); opacity: .4; } }

/* ===== TV: My Picks history + Achievements ===== */
.tv-ticket-tools { display: flex; align-items: center; gap: 5px; }
.tv-ticket-tool { background: none; border: none; cursor: pointer; font-size: 17px; opacity: .8; padding: 2px 4px; }
.tv-ticket-tool:hover { opacity: 1; }
.tv-stats { padding: 4px 0; max-height: 420px; overflow-y: auto; }
.tv-stats-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tv-stab { flex: 1; padding: 7px 0; font-size: 12px; font-weight: 800; cursor: pointer;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: #1b2130; color: #cfd6e6; }
.tv-stab.on { background: #ffd34d; color: #1a1206; border-color: #ffd34d; }
.tv-stats-title { font-size: 14px; font-weight: 800; color: #ffd34d; margin-bottom: 10px; }
.tv-hist-row, .tv-badge-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  border-bottom: 1px solid rgba(255,255,255,.07); font-size: 14px; }
.tv-hist-tag, .tv-badge-e { width: 26px; text-align: center; font-size: 18px; }
.tv-hist-mid { flex: 1; line-height: 1.3; }
.tv-hist-mid small, .tv-badge-row small { color: rgba(255,255,255,.45); font-size: 11px; }
.tv-hist-pts { font-weight: 900; color: #ffb84d; }
.tv-badge-row.locked { opacity: .4; }
.tv-badge-row.earned b { color: #ffd34d; }

/* ===== 5-line lotto slip (TV ticket) ===== */
.tv-ticket-player { padding: 10px 14px 0; }
.tv-ticket-name { width: 100%; background: #1b2130; border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: 9px; padding: 9px 12px; font-size: 15px; }
.tv-ticket-name::placeholder { color: rgba(255,255,255,.4); }
.tv-slip { display: flex; flex-direction: column; gap: 6px; padding: 2px 0; }
.tv-slip-line { display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: #11161f; cursor: pointer; }
.tv-slip-line.active { border-color: #ffd34d; box-shadow: 0 0 0 1px rgba(255,211,77,.4); }
.tv-slip-line.ready { background: rgba(54,179,102,.13); }
.tv-slip-no { width: 20px; text-align: center; font-weight: 900; color: rgba(255,255,255,.5); font-size: 14px; }
.tv-slip-balls { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-height: 30px; }
.tv-slip-empty { color: rgba(255,255,255,.3); font-size: 13px; }
.tv-slip-ai { background: #232c3d; border: 1px solid rgba(255,211,77,.4); color: #ffd34d;
  border-radius: 8px; padding: 6px 9px; font-size: 13px; font-weight: 800; cursor: pointer; }
.tv-slip-ai:hover { background: rgba(255,211,77,.2); }
.tv-slip-hint { padding: 7px 4px 2px; font-size: 13px; color: rgba(255,255,255,.45); }

/* ---- interactive selection: skip halos / time-travel / divergence ---- */
.tv-dot.tv-pick-hit{ box-shadow:0 0 0 3px #ffd34d, 0 0 16px rgba(255,211,77,.9); z-index:5; }
.tv-dot.tv-fit{ background:#2563eb !important; box-shadow:0 0 0 2px #bfdbfe, 0 0 14px rgba(37,99,235,.9); z-index:4; }
.tv-row.tv-pick-row .tv-dot:not(.blank){ box-shadow:0 0 0 2px #ffd34d, 0 0 12px rgba(255,211,77,.55); z-index:2; }
.tv-hcell.tv-head-on{ color:#fff; background:rgba(255,255,255,.16); border-radius:4px; box-shadow:0 0 0 1px rgba(255,255,255,.5); }
.tv-hcell.tv-diverge{ box-shadow:0 0 0 1px #e8a72e, 0 0 8px rgba(232,167,46,.55); color:#ffd9a0; border-radius:4px; }
.tv-hcell.tv-diverge.big{ box-shadow:0 0 0 1px #e0303f, 0 0 9px rgba(224,48,63,.6); color:#ffb3ba; }
.tv-dot.tv-diverge{ box-shadow:0 0 0 2px #e8a72e, 0 0 10px rgba(232,167,46,.5); z-index:2; }
.tv-dot.tv-diverge.big{ box-shadow:0 0 0 2px #e0303f, 0 0 12px rgba(224,48,63,.6); z-index:2; }
.tv-hcell[data-ball], .tv-dot[data-ball]{ cursor:pointer; }
.tv-datesel{ background:#121829; color:#ffd34d; border:1px solid #2a3550; border-radius:6px; font-size:12px; padding:2px 6px; margin-left:10px; cursor:pointer; max-width:150px; pointer-events:auto; }
.tv-datesel:hover{ border-color:#ffd34d; }
.tv-status{ font-size:12px; color:#9fb0c8; padding:3px 10px 6px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.tv-clear{ background:transparent; border:1px solid #2a3550; color:#ffd34d; border-radius:5px; font-size:11px; padding:1px 8px; cursor:pointer; }
.tv-clear:hover{ border-color:#ffd34d; }

/* dense mode: when a selection expands the board to many rows, tighten spacing + allow scroll */
.tv-tile.is-expanded .tv-board{ overflow-y:auto; }
.tv-board.tv-dense{ gap:1px; }
.tv-tile.is-expanded .tv-board.tv-dense{ padding:40px 28px 18px; }

.tv-skipval{ color:#ffd34d; font-weight:800; letter-spacing:.04em; }

.tv-hcell.tv-head-win{ box-shadow:0 0 0 2px #34d399, 0 0 9px rgba(52,211,153,.55); border-radius:999px; color:#eafff5; }

/* datesel stays visible in wall view so the skip filter's matches are pickable */
.tv-tile:not(.is-expanded) .tv-datesel{ display:inline-block; max-width:150px; }

.tv-toolbox svg, .tv-ticket-tool svg, .tv-ticket-btn svg{ vertical-align:middle; }
.tv-tb-wall svg{ margin-right:5px; }

/* ================================================================
   DEVICE-DEPENDENT  (added — big-screen TV layout above unchanged)
   ================================================================ */

/* ---- iPad / tablet (769–1024px) ---- */
@media (min-width: 769px) and (max-width: 1024px) {
  .tv-tile.is-expanded .tv-board { padding: 48px 20px 28px; }
  .tv-tile.is-expanded .tv-board.tv-dense { padding: 30px 16px 14px; }
  .tv-ticket { width: 280px; right: 16px; bottom: 90px; }
  .tv-toolbox { bottom: 90px; }
}

/* ---- phones (≤768px): single-column wall, bottom-sheet ticket ---- */
@media (max-width: 768px) {
  /* force single column no matter what layout class JS sets */
  .tv-wall,
  .tv-wall.cols-2,
  .tv-wall.grid-2x2 { grid-template-columns: 1fr !important; grid-template-rows: auto !important; }
  .tv-wall { padding: 8px; gap: 8px; }

  /* expanded tile: trim the huge desktop padding */
  .tv-tile.is-expanded .tv-board { padding: 16px 10px 16px; }
  .tv-tile.is-expanded .tv-board.tv-dense { padding: 12px 8px 10px; }
  .tv-board { font-size: 13px; }

  /* toolbox: down near the thumb, a touch smaller */
  .tv-toolbox { bottom: 14px; gap: 7px; padding: 7px 10px; }
  .tv-tb-btn { min-width: 34px; min-height: 34px; }

  /* ticket becomes a full-width bottom sheet */
  .tv-ticket {
    left: 6px; right: 6px; bottom: 6px; width: auto;
    max-height: 70vh; overflow-y: auto;
  }
  .tv-ticket-foot { flex-wrap: wrap; }
  .tv-ticket-btn { flex: 1 1 30%; min-height: 38px; }

  /* hints: keep readable, out of the way */
  .tv-hints { font-size: 12px; }
}

/* very small phones */
@media (max-width: 390px) {
  .tv-board { font-size: 12px; }
  .tv-ticket-btn { flex: 1 1 45%; }
}

/* positional echo: history dot matching its column's current pending value */
.tv-dot.tv-echo { box-shadow: inset 0 0 0 2px #e05252; }

/* ---- the ticket panel's buttons (Al, 2026-11-09, site audit step 1c: "continue") - the same fix as the dashboard's
   panel. The eight buttons sat in ONE row inside a 300 px panel that hides whatever does not fit, so on a computer
   or a TV Export and Lock ticket could not be reached. Now: two rows of four. The panel is never taller than the
   screen: on a short window the list of lines scrolls and the buttons stay put, and on a very short one the whole
   panel scrolls. Phones (768 px and under) already wrap the row inside their scrolling bottom sheet and are left
   as they are. ---- */
@media (min-width: 769px) {
  .tv-ticket { max-height: calc(100vh - 166px); overflow-x: hidden; overflow-y: auto; }
  .tv-ticket-head, .tv-ticket-player, .tv-ticket-foot, .tv-ticket-note { flex: 0 0 auto; }
  .tv-ticket-need { flex: 1 1 auto; min-height: 96px; overflow-y: auto; }
  .tv-ticket-foot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .tv-ticket-foot .tv-ticket-btn { min-height: 44px; padding: 4px 2px; font-size: 13px; line-height: 1.15; }
  .tv-ticket, .tv-ticket-need { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .tv-ticket { max-height: calc(100vh - 106px); }
}
