@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url(/vendor/font/be-vietnam-pro-vietnamese-500-normal.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url(/vendor/font/be-vietnam-pro-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url(/vendor/font/be-vietnam-pro-vietnamese-700-normal.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url(/vendor/font/be-vietnam-pro-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 800; font-display: swap; src: url(/vendor/font/be-vietnam-pro-vietnamese-800-normal.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 800; font-display: swap; src: url(/vendor/font/be-vietnam-pro-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F5F5FA;
  --primary: #3734A6;
  --deep: #2E2C73;
  --hero: #E9E9FA;
  --ink: #1E1C45;
  --sub: #5E5C80;
  --orange: #FFB680;
  --peach: #FFD8B8;
  --white: #FFFFFF;
  --good: #1F8A63;
  --bad: #B83A32;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(46, 44, 115, 0.14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: "Be Vietnam Pro", system-ui, sans-serif; font-weight: 500; line-height: 1.45; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; font-weight: 800; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 800; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.error { color: var(--bad); font-weight: 700; }
.brand { display: flex; align-items: center; justify-content: center; gap: 8px; align-self: center; color: var(--primary); font-weight: 800; font-size: 22px; letter-spacing: -.01em; }
.brand img { height: 44px; width: 44px; }

.panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.tile { background: var(--hero); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.tile b { font-weight: 800; }
.tile.dark { background: var(--deep); color: #fff; }
.tile.dark span { color: var(--peach); }

.btn { min-height: 52px; padding: 0 22px; border-radius: 16px; font-weight: 800; font-size: 17px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:disabled { background: #BDBCDD; cursor: not-allowed; }
.btn.ghost { background: var(--hero); color: var(--primary); }

.seg { display: flex; background: var(--hero); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; white-space: nowrap; min-height: 44px; padding: 0 12px; border-radius: 11px; font-weight: 700; font-size: 15px; color: var(--sub); }
.seg button.on { background: var(--primary); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--hero); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.chips li .dot { width: 10px; height: 10px; border-radius: 50%; }
.roster-head { display: flex; justify-content: space-between; align-items: center; }

/* ---- Màn học sinh ---- */
body.play { overflow: hidden; position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.play input { user-select: text; -webkit-user-select: text; }
.screen { position: absolute; inset: 0; overflow-y: auto; touch-action: pan-y; display: flex; padding: 20px; padding-top: max(20px, env(safe-area-inset-top)); }
.screen > .panel { margin: auto; width: 100%; max-width: 440px; }
.join { text-align: center; }
.join label { text-align: left; font-weight: 700; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.join input { min-height: 54px; border: 2px solid var(--hero); border-radius: 14px; padding: 0 16px; font-size: 18px; background: var(--bg); outline: none; }
.join input:focus { border-color: var(--primary); }
.join .code-input { text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-weight: 800; font-size: 26px; }
.wait .bento { display: grid; gap: 10px; }
@media (min-width: 620px) { .screen > .panel.wait { max-width: 620px; } .wait .bento { grid-template-columns: 1fr 1fr 1fr; } }

#screen-game, #view, #surface { position: absolute; inset: 0; width: 100%; height: 100%; }
#view { display: block; }
#surface { touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.hud button { pointer-events: auto; touch-action: none; }
.hud-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; }
.pill { background: rgba(255,255,255,0.92); border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow); }
.stats { justify-self: start; display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.stats .time { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 18px; color: var(--primary); }
.stats .sep { width: 1px; height: 18px; background: var(--hero); }
.prompt { position: relative; background: var(--deep); color: #fff; border-radius: 16px; padding: 7px 18px 11px; text-align: center; box-shadow: var(--shadow); max-width: 46vw; display: flex; flex-direction: column; align-items: center; }
.prompt small { color: var(--peach); font-size: 12px; }
.prompt .word-row { display: flex; align-items: center; gap: 8px; }
.prompt strong { font-size: clamp(20px, 3.4vw, 34px); font-weight: 800; line-height: 1.15; }
.prompt span { color: var(--peach); font-size: 13px; }
.prompt .listen { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; display: flex; align-items: center; justify-content: center; }
.prompt .listen svg { width: 20px; height: 20px; }
.prompt .listen:active { background: var(--orange); color: var(--ink); }
.word-bar { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; }
.word-bar i { display: block; height: 100%; background: var(--peach); transform-origin: left center; }
.word-bar i.low { background: var(--orange); }
/* Nhãn "Từ mới" thay chỗ dòng chữ nhỏ trong lúc đổi từ, không che chữ nào. */
#hud-new { display: none; background: var(--orange); color: var(--ink); font-style: normal; font-weight: 800; font-size: 12px; line-height: 1.5; padding: 0 10px; border-radius: 999px; white-space: nowrap; }
.prompt.fresh #hud-new { display: inline-block; animation: badge .35s ease-out; }
.prompt.fresh > small { display: none; }
.prompt.fresh { animation: flipin .55s ease-out; }
@keyframes flipin { 0% { transform: perspective(500px) rotateX(85deg); } 60% { transform: perspective(500px) rotateX(-12deg); } 100% { transform: none; } }
@keyframes badge { from { transform: scale(.5); } }
.corner { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#minimap { width: 112px; height: 81px; border-radius: 12px; box-shadow: var(--shadow); background: #fff; }
.mini { background: rgba(255,255,255,0.92); color: var(--primary); font-weight: 700; font-size: 12px; border-radius: 10px; padding: 6px 10px; min-height: 30px; }

#crosshair { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.95); box-shadow: 0 0 0 1.5px rgba(30,28,69,0.45); transition: transform .1s, border-color .1s; }
#crosshair.hot { border-color: var(--orange); transform: scale(1.5); }

#toast { position: absolute; left: 50%; top: 27%; transform: translate(-50%, -8px); background: #fff; color: var(--ink); padding: 10px 18px; border-radius: 14px; font-weight: 700; font-size: 16px; box-shadow: var(--shadow); opacity: 0; transition: opacity .18s, transform .18s; text-align: center; max-width: min(84vw, 440px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.good { background: var(--good); color: #fff; }
#toast.bad { background: var(--bad); color: #fff; }
#toast.info { background: var(--deep); color: #fff; }
#toast.info small { color: var(--peach); }
#toast small { display: block; font-weight: 500; font-size: 13px; opacity: .95; }

@keyframes pulse { to { transform: scale(1.06); } }
#gl-lost { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; background: var(--bg); z-index: 20; }
#gl-lost[hidden] { display: none; }
#gl-lost b { font-size: 20px; }
#gl-lost span { color: var(--sub); max-width: 320px; }
#gl-lost button { margin-top: 8px; }
#net-warn { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); background: var(--bad); color: #fff; font-weight: 700; padding: 8px 16px; border-radius: 12px; }

#stick-zone { position: absolute; inset: 0; pointer-events: none; }
#stick-hint { position: absolute; left: max(40px, env(safe-area-inset-left)); bottom: 44px; width: 112px; height: 112px; border-radius: 50%; border: 2px dashed rgba(255,255,255,0.85); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 3px rgba(30,28,69,.7); }
#stick-base { position: absolute; left: 0; top: 0; width: 128px; height: 128px; border-radius: 50%; background: rgba(255,255,255,0.28); border: 2px solid rgba(255,255,255,0.85); display: none; align-items: center; justify-content: center; }
#stick-base.on { display: flex; }
#stick-zone:has(#stick-base.on) #stick-hint { opacity: 0; }
#stick-knob { width: 60px; height: 60px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); }
#pad { position: absolute; left: max(24px, env(safe-area-inset-left)); bottom: 24px; display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(2, 58px); gap: 6px; }
#pad button { border-radius: 14px; background: rgba(255,255,255,0.82); color: var(--primary); font-size: 20px; }
#pad button:active { background: var(--peach); }
#pad [data-dir=up] { grid-column: 2; grid-row: 1; }
#pad [data-dir=left] { grid-column: 1; grid-row: 2; }
#pad [data-dir=down] { grid-column: 2; grid-row: 2; }
#pad [data-dir=right] { grid-column: 3; grid-row: 2; }

.actions { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, auto); grid-template-rows: auto auto; gap: 10px; align-items: end; justify-items: center; }
.round { position: relative; overflow: hidden; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; box-shadow: var(--shadow); }
.round span { position: relative; z-index: 1; }
.round .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(30,28,69,0.42); }
.small-btn { width: 56px; height: 56px; font-size: 13px; background: rgba(255,255,255,0.92); color: var(--primary); }
.big { width: 86px; height: 86px; font-size: 19px; }
.big.hit { background: var(--peach); color: var(--ink); grid-column: 2; grid-row: 2; }
.big.main { background: #BDBCDD; color: #fff; grid-column: 3; grid-row: 2; }
.big.main.ready { background: var(--primary); }
.big.main.deliver { background: var(--orange); color: var(--ink); }
#btn-say { grid-column: 1; grid-row: 1; }
#say-menu { position: absolute; right: calc(max(14px, env(safe-area-inset-right)) + 256px); bottom: max(14px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; pointer-events: auto; }
#say-menu button { background: #fff; color: var(--ink); font-weight: 800; font-size: 14px; min-height: 40px; padding: 0 14px; border-radius: 12px; box-shadow: var(--shadow); white-space: nowrap; }
#say-menu button:active { background: var(--peach); }
#say-echo { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 170px); background: #fff; color: var(--ink); font-weight: 800; padding: 6px 12px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; }
#say-echo.on { opacity: 1; transform: none; }
#btn-hint { grid-column: 2; grid-row: 1; }
#btn-sprint { grid-column: 3; grid-row: 1; }
.round:active { transform: scale(.94); }

#flash { position: absolute; inset: 0; pointer-events: none; background: var(--orange); opacity: 0; transition: opacity .35s; }
#flash.on { opacity: .55; transition: none; }
#countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 120px; font-weight: 800; color: #fff; text-shadow: 0 6px 24px rgba(30,28,69,.55); pointer-events: none; }
#lock-hint { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); background: var(--deep); color: #fff; padding: 12px 22px; border-radius: 14px; text-align: center; display: flex; flex-direction: column; pointer-events: none; }
#lock-hint span { color: var(--peach); font-size: 13px; }
#rotate-hint { display: none; position: absolute; left: 50%; top: 40%; transform: translateX(-50%); background: rgba(30,28,69,0.8); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 13px; white-space: nowrap; pointer-events: none; }
@media (orientation: portrait) and (pointer: coarse) {
  #rotate-hint { display: block; animation: fadeout 5s forwards; }
  .hud-top { grid-template-columns: 1fr auto; }
  .prompt { grid-row: 2; grid-column: 1 / -1; justify-self: center; max-width: 90vw; }
  .big { width: 74px; height: 74px; }
  .small-btn { width: 50px; height: 50px; }
  #stick-hint { bottom: 40px; }
  #say-menu { right: max(14px, env(safe-area-inset-right)); bottom: 190px; }
  #say-echo { bottom: 150px; }
}
@media (max-height: 430px) {
  .prompt { padding: 3px 18px 5px; }
  .prompt small { font-size: 11px; }
  .prompt span { font-size: 12px; }
  .big { width: 74px; height: 74px; font-size: 17px; }
  .small-btn { width: 48px; height: 48px; font-size: 12px; }
  .actions { gap: 6px; }
}
@keyframes fadeout { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

#settings { position: absolute; inset: 0; background: rgba(30,28,69,0.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 20; touch-action: auto; }
.sheet { width: 100%; max-width: 360px; max-height: 100%; overflow-y: auto; }
#settings p { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
#settings p.muted { font-weight: 500; font-size: 13px; }
@media (max-height: 430px) {
  .sheet { max-width: 560px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 14px; padding: 16px 20px; }
  .sheet h2, .sheet .btn, .sheet p.muted { grid-column: 1 / -1; }
  #settings p { margin: 0; }
  #set-scheme-row { display: contents; }
  .sheet .seg button { min-height: 38px; }
  .sheet .btn { min-height: 44px; }
}

.end .end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.end .end-stats .tile { text-align: center; }
.end .end-stats b { font-size: 26px; color: var(--primary); }
.recap { display: flex; flex-direction: column; gap: 8px; }
.recap li { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.recap li b { font-weight: 800; }
.recap li.right { box-shadow: inset 4px 0 0 var(--good); }
.recap li.wrong { box-shadow: inset 4px 0 0 var(--bad); }
.recap li small { display: block; color: var(--sub); }

/* ---- Màn TV ---- */
body.tv { overflow: hidden; background: #DCE4FB; }
body.tv #view { position: fixed; inset: 0; width: 100%; height: 100%; }
.tv-layer { position: fixed; inset: 0; padding: 2vw; font-size: clamp(14px, 1.1vw, 24px); }
.tv-layer h1 { font-size: 2.2em; }
.tv-layer h2 { font-size: 1.35em; }
.tv-layer .muted.small, .tv-layer .small { font-size: .85em; }
.tv-layer .panel { border-radius: 1.5em; padding: 1.4em; gap: .7em; }
.tv-layer .btn { min-height: 3em; font-size: 1.1em; border-radius: 1em; }
.tv-layer .seg button { min-height: 2.6em; font-size: 1em; }

#tv-lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5vw; align-items: stretch; }
.tv-join { text-align: center; justify-content: center; align-items: center; }
.qr { width: min(100%, 17vw); aspect-ratio: 1; }
.qr svg { width: 100%; height: 100%; display: block; }
.url { font-weight: 800; color: var(--primary); font-size: 1.15em; word-break: break-all; }
.big-code { font-size: 4.4em; font-weight: 800; letter-spacing: .14em; color: var(--primary); line-height: 1.1; padding-left: .14em; }
.tv-room { overflow: hidden; }
.count { background: var(--primary); color: #fff; font-weight: 800; border-radius: 999px; padding: .1em .9em; font-size: 1.3em; }
.chips.large { overflow-y: auto; align-content: flex-start; }
.chips.large li { font-size: 1.25em; padding: .35em .5em .35em .9em; }
.chips .kick { width: 1.6em; height: 1.6em; border-radius: 50%; background: rgba(46,44,115,.12); color: var(--deep); line-height: 1; font-weight: 800; }
.chips .kick:hover { background: var(--bad); color: #fff; }
.tv-settings { overflow-y: auto; }
.tv-settings .label { font-weight: 800; margin-top: .3em; }
.tv-settings .btn.primary { margin-top: auto; }
#tv-pack { flex-wrap: wrap; }
summary { cursor: pointer; font-weight: 700; color: var(--primary); }
textarea { width: 100%; border: 2px solid var(--hero); border-radius: .8em; padding: .6em; margin: .5em 0; font-size: .9em; background: var(--bg); resize: vertical; }

.tv-board { position: absolute; left: 1.5vw; top: 1.5vw; bottom: 1.5vw; width: 19vw; overflow: hidden; }
.timer { font-size: 3.8em; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1; }
#tv-rank { display: flex; flex-direction: column; gap: .35em; overflow: hidden; font-size: 1.1em; }
#tv-rank li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto auto; align-items: center; gap: .4em; padding: .28em .3em .28em .5em; background: var(--bg); border-radius: .7em; font-weight: 700; }
#tv-rank li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tv-rank li .pts { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
#tv-rank li .pos { color: var(--sub); }
#tv-rank .kick { width: 1.5em; height: 1.5em; border-radius: 50%; color: var(--sub); opacity: .55; }
#tv-rank .kick:hover { background: var(--bad); color: #fff; opacity: 1; }
#tv-feed { position: absolute; right: 1.5vw; top: 1.5vw; width: 25vw; display: flex; flex-direction: column; gap: .5em; font-size: 1.15em; }
#tv-feed li { background: rgba(255,255,255,.94); border-radius: 1em; padding: .55em .9em; box-shadow: var(--shadow); animation: slidein .25s; }
#tv-feed li b { font-weight: 800; }
#tv-feed li em { font-style: normal; color: var(--primary); font-weight: 800; }
#tv-feed li.hot { background: var(--orange); color: var(--ink); }

/* Từ chung của cả phòng, ở giữa phía trên */
.tv-word { position: absolute; top: 1.5vw; left: 22vw; right: 28vw; margin: 0 auto; width: fit-content; min-width: 26vw; max-width: 50vw; background: var(--deep); color: #fff; border-radius: 1.2em; padding: .5em 1.6em .9em; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; }
.tv-word small { color: var(--peach); font-size: .95em; }
.tv-word strong { font-size: 2.6em; font-weight: 800; line-height: 1.15; }
.tv-word span { color: var(--peach); font-size: 1.05em; }
.tv-word .word-bar { left: 1.2em; right: 1.2em; bottom: .45em; height: .3em; }
.tv-word.fresh { animation: flipin .6s ease-out; }
.tv-solved { position: absolute; left: 22vw; right: 28vw; top: calc(1.5vw + 8.6em); margin: 0 auto; width: fit-content; max-width: 50vw; background: rgba(255,255,255,.97); border-radius: 1.4em; padding: 1em 2em; text-align: center; box-shadow: var(--shadow); border: .25em solid var(--good); animation: popin .3s ease-out; pointer-events: none; }
.tv-solved.timeout { border-color: var(--sub); }
.tv-solved p { margin: .15em 0; }
.tv-solved .who { font-weight: 800; color: var(--good); font-size: 1.3em; }
.tv-solved.timeout .who { color: var(--sub); }
.tv-solved .pair { font-size: 2em; font-weight: 700; }
.tv-solved .pair b { font-weight: 800; color: var(--primary); }
.tv-solved .also { color: var(--sub); font-size: 1.1em; }
.tv-solved .streak { display: inline-block; background: var(--orange); color: var(--ink); font-weight: 800; padding: .15em .9em; border-radius: 999px; font-size: 1.15em; }
.tv-solved .late { color: var(--sub); font-size: .95em; }
@keyframes popin { from { transform: scale(.85); opacity: 0; } }
.locked-note { background: var(--peach); color: var(--ink); font-weight: 700; border-radius: .8em; padding: .3em .8em; }
.tv-auth { margin: auto; width: min(90vw, 26em); text-align: center; position: relative; top: 50%; transform: translateY(-50%); }
.tv-auth input { min-height: 3em; border: 2px solid var(--hero); border-radius: .8em; padding: 0 1em; font-size: 1.1em; background: var(--bg); outline: none; }
.tv-auth input:focus { border-color: var(--primary); }
#tv-auth { background: var(--bg); }
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } }
.tv-tools { position: absolute; right: 1.5vw; bottom: 1.5vw; display: flex; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; gap: .6em; align-items: stretch; font-size: .9em; }
.tv-tools .seg { background: #fff; }
.tv-tools .btn { background: #fff; }
#tv-countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 16vw; font-weight: 800; color: #fff; text-shadow: 0 .05em .2em rgba(30,28,69,.55); padding-left: 19vw; pointer-events: none; }

#tv-end-screen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 1.5vw; background: rgba(233,233,250,.72); }
.tv-podium, .tv-recap { overflow: hidden; }
.podium { display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: end; gap: .7em; }
.podium .col { background: var(--hero); border-radius: 1em; padding: .7em .4em; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .15em; min-width: 0; }
.podium .col.first { background: var(--deep); color: #fff; }
.podium .col.first .pts { color: var(--peach); }
.podium img { height: 6.5em; }
.podium .col.first img { height: 9em; }
.podium .nm { font-weight: 800; font-size: 1.15em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pts { font-weight: 800; color: var(--primary); }
#tv-final { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: .25em; }
#tv-final li { display: flex; justify-content: space-between; gap: 1em; padding: .1em .5em; font-weight: 700; }
.recap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; overflow: hidden; align-content: start; }
.recap-grid .item { background: var(--bg); border-radius: 1em; padding: .6em .9em; text-align: left; width: 100%; }
.recap-grid .item:hover { background: var(--hero); }
.recap-grid .item .by { color: var(--sub); font-size: .85em; }
.recap-grid .item b { font-weight: 800; font-size: 1.15em; }
.recap-grid .item .vi { color: var(--sub); }
.recap-grid .item .ok { color: var(--primary); font-weight: 700; }
.fatal { position: fixed; inset: auto 2vw 2vw 2vw; background: var(--bad); color: #fff; padding: 1em; border-radius: 1em; font-weight: 700; }

.tv-layer .brand { font-size: 1.35vw; gap: .4vw; }
.tv-layer .brand img { height: 2.4vw; width: 2.4vw; }
