@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Anton'; font-weight: 400; font-display: swap; src: url('/fonts/anton-400.woff2') format('woff2'); }

:root {
  --gold: #f6c445;
  --gold-2: #e09a10;
  --ink: #f4f1e8;
  --dim: rgba(244, 241, 232, 0.66);
  --panel: rgba(7, 24, 16, 0.74);
  --line: rgba(255, 255, 255, 0.09);
  --display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #07150e; color: var(--ink); font-family: var(--ui); -webkit-font-smoothing: antialiased; }
img { display: block; height: auto; }

/* ---------- TV stage (1920 × 1080, scaled to fit) ---------- */
body.tv { overflow: hidden; cursor: none; }
.stage {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: 0 0;
  overflow: hidden; background: #0a1f15;
}
.bg { position: absolute; inset: 0; background: url('/img/bg-river.jpg') center 40% / cover no-repeat; transform: scale(1.04); }
.shade { position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(6, 20, 13, 0.05) 0%, rgba(6, 20, 13, 0.18) 34%, rgba(6, 20, 13, 0.80) 47%, rgba(6, 20, 13, 0.90) 100%),
  linear-gradient(180deg, rgba(6, 20, 13, 0.55) 0%, rgba(6, 20, 13, 0) 28%, rgba(6, 20, 13, 0) 62%, rgba(6, 20, 13, 0.75) 100%); }
.makdi { position: absolute; left: 80px; bottom: -10px; height: 740px; width: auto; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45)); }
.rocks { position: absolute; left: -140px; bottom: -470px; width: 1120px; height: auto;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 62%, transparent 92%), linear-gradient(180deg, transparent 0%, #000 14%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, #000 0%, #000 62%, transparent 92%); }
.pubgchar { position: absolute; left: 380px; top: 300px; width: 430px; height: auto; opacity: 0; transition: opacity 0.6s;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 56%, transparent 86%); mask-image: linear-gradient(180deg, #000 0%, #000 56%, transparent 86%); }

.tv-brand { position: absolute; left: 70px; top: 54px; display: flex; align-items: center; gap: 26px; }
.tv-brand .pubgm { height: 92px; width: auto; }
.tv-brand .krs { height: 92px; width: auto; }
.tv-title { position: absolute; left: 62px; top: 176px; width: 720px; }
.tv-title .t1 { width: 560px; height: auto; margin-left: 6px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.tv-title .t2 { width: 700px; height: auto; margin-top: 8px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55)); }

.credits { position: absolute; right: 60px; bottom: 26px; height: 34px; width: auto; opacity: 0.7; }

/* right column */
.col { position: absolute; left: 905px; right: 60px; top: 54px; bottom: 76px; display: flex; flex-direction: column; gap: 22px; }
.toprow { display: flex; gap: 22px; align-items: stretch; }
.now { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 132px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.now-main { min-width: 0; }
.now-clock { font-family: var(--display); font-size: 74px; line-height: 1; letter-spacing: 0.02em; flex: none; }
.qrbox { width: 330px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 14px 18px; display: flex; align-items: center; gap: 16px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.qrbox .code { width: 104px; height: 104px; background: #fff; border-radius: 10px; padding: 7px; flex: none; }
.qrbox .code svg { width: 100%; height: 100%; display: block; }
.qrbox span { font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.qrbox span small { display: block; font-size: 13px; font-weight: 500; color: var(--dim); margin-top: 4px; overflow-wrap: anywhere; }
.now .lbl { font-size: 17px; font-weight: 700; letter-spacing: 0.2em; color: var(--gold); text-transform: uppercase; }
.now .txt { font-family: var(--display); font-size: 42px; line-height: 1.05; letter-spacing: 0.01em; margin-top: 6px; }
.now .note { font-size: 22px; font-weight: 500; color: var(--dim); margin-top: 6px; }

.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.ctr { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px 22px; display: grid; grid-template-columns: auto 1fr; gap: 2px 18px; align-items: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ctr .big { grid-row: span 2; font-family: var(--display); font-size: 62px; line-height: 1; color: #fff; }
.ctr .big small { font-size: 32px; color: var(--dim); margin-left: 4px; }
.ctr .k { font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.ctr .v { font-size: 19px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.ctr.full .big { color: var(--gold); }

.boards { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; min-height: 0; }
.board { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px 24px 14px; display: flex; flex-direction: column; min-height: 0;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.board h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 38px; letter-spacing: 0.02em; line-height: 1.05; }
.board .sub { font-size: 18px; color: var(--dim); font-weight: 500; margin-bottom: 12px; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rows li { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 14px; }
.rows li:nth-child(-n+3) { background: linear-gradient(90deg, rgba(246, 196, 69, 0.16), rgba(246, 196, 69, 0.02)); }
.rows .rk { font-family: var(--display); font-size: 40px; line-height: 1; text-align: center; color: var(--dim); }
.rows li:nth-child(-n+3) .rk { color: var(--gold); }
.rows .nm { font-size: 27px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .nm small { display: block; font-size: 17px; font-weight: 500; color: var(--dim); margin-top: 1px; }
.rows .wt { font-family: var(--display); font-size: 42px; line-height: 1; color: #fff; }
.rows .wt small { font-family: var(--ui); font-size: 18px; font-weight: 700; color: var(--dim); margin-left: 4px; }
.rows li:nth-child(-n+3) .wt { color: var(--gold); }
.rows li.out { opacity: 0.45; }
.rows li.empty { display: block; background: none; text-align: center; color: var(--dim); font-size: 24px; line-height: 1.45; padding: 70px 20px; }


/* winners */
.winners { position: absolute; left: 905px; right: 60px; top: 54px; bottom: 76px; display: none; flex-direction: column; gap: 22px; }
.winners .head { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px 30px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.winners .head .lbl { font-size: 18px; font-weight: 700; letter-spacing: 0.2em; color: var(--gold); text-transform: uppercase; }
.winners .head .txt { font-family: var(--display); font-size: 58px; line-height: 1.05; margin-top: 4px; }
.wcols { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.wcol { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.wcol h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 36px; }
.wcard { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 4px 18px; align-items: center; padding: 18px 20px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); }
.wcard:first-of-type { background: linear-gradient(100deg, rgba(246, 196, 69, 0.28), rgba(246, 196, 69, 0.06)); border: 1px solid rgba(246, 196, 69, 0.35); }
.wcard .pos { grid-row: span 2; font-family: var(--display); font-size: 70px; line-height: 1; color: var(--gold); text-align: center; }
.wcard .nm { font-size: 36px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcard .wt { font-family: var(--display); font-size: 40px; line-height: 1; color: #fff; }
.wcard .wt small { font-family: var(--ui); font-size: 18px; font-weight: 700; color: var(--dim); margin-left: 6px; }

/* KV mode */
.kvtext { position: absolute; right: 90px; top: 0; bottom: 0; width: 900px; display: none; flex-direction: column; justify-content: center; align-items: flex-end; gap: 22px; }
.kvtext .t1 { width: 760px; height: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.kvtext .t2 { width: 900px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.55)); }
.kvtext .t3 { width: 640px; margin-top: 18px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.kvtext .ph { margin-top: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 26px; font-family: var(--display); font-size: 40px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.stage.m-kv .col, .stage.m-kv .winners { display: none; }
.stage.m-kv .kvtext { display: flex; }
.stage.m-kv .tv-title { display: none; }
.stage.m-kv .shade { background:
  linear-gradient(90deg, rgba(6, 20, 13, 0.10) 0%, rgba(6, 20, 13, 0.10) 40%, rgba(6, 20, 13, 0.62) 70%, rgba(6, 20, 13, 0.72) 100%),
  linear-gradient(180deg, rgba(6, 20, 13, 0.45) 0%, rgba(6, 20, 13, 0) 30%, rgba(6, 20, 13, 0) 60%, rgba(6, 20, 13, 0.7) 100%); }
.stage.m-kv .pubgchar { opacity: 1; }
.stage.m-pemenang .col { display: none; }
.stage.m-pemenang .winners { display: flex; }

.offline { position: absolute; right: 60px; top: 14px; font-size: 16px; font-weight: 600; color: #ffb98a; display: none; }
.offline.on { display: block; }

/* ---------- Public live page (phone) ---------- */
html:has(> body.live) { background: #0b1f15; }
body.live { height: auto; min-height: 100%; background: #0b1f15; }
.lv-hero { position: relative; padding: calc(18px + env(safe-area-inset-top)) 18px 22px; background: url('/img/bg-river-sm.jpg') center 40% / cover no-repeat; overflow: hidden; }
.lv-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 22, 15, 0.55), rgba(7, 22, 15, 0.92)); }
.lv-hero > * { position: relative; }
.lv-logos { display: flex; justify-content: space-between; align-items: center; }
.lv-logos img { height: 44px; width: auto; }
.lv-logos, .lv-hero .t1, .lv-hero .t2, .lv-now { max-width: 640px; margin-left: auto; margin-right: auto; }
.lv-hero .t1 { width: min(78%, 500px); margin-top: 16px; margin-bottom: 4px; }
.lv-hero .t2 { width: min(100%, 640px); }
.lv-now { margin-top: 14px; font-family: var(--display); font-size: 26px; line-height: 1.1; }
.lv-now small { display: block; font-family: var(--ui); font-size: 13px; font-weight: 700; letter-spacing: 0.16em; color: var(--gold); text-transform: uppercase; margin-bottom: 4px; }
.lv-body { padding: 14px 12px 40px; display: grid; gap: 12px; max-width: 760px; margin: 0 auto; }
.lv-ctrs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lv-ctr { background: #12291d; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.lv-ctr b { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; }
.lv-ctr b small { font-size: 18px; color: var(--dim); }
.lv-ctr span { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--gold); text-transform: uppercase; margin-top: 4px; }
.lv-board { background: #12291d; border: 1px solid var(--line); border-radius: 18px; padding: 16px 14px 8px; }
.lv-board h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; }
.lv-board .sub { font-size: 13px; color: var(--dim); margin: 2px 0 10px; text-wrap: balance; }
.lv-rows { list-style: none; margin: 0; padding: 0; }
.lv-rows li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--line); }
.lv-rows li:first-child { border-top: 0; }
.lv-rows .rk { font-family: var(--display); font-size: 22px; text-align: center; color: var(--dim); }
.lv-rows li:nth-child(-n+3) .rk, .lv-rows li:nth-child(-n+3) .wt { color: var(--gold); }
.lv-rows .nm { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-rows .nm small { display: block; font-size: 12px; font-weight: 500; color: var(--dim); }
.lv-rows .wt { font-family: var(--display); font-size: 24px; }
.lv-rows .wt small { font-family: var(--ui); font-size: 12px; font-weight: 700; color: var(--dim); margin-left: 3px; }
.lv-rows li.lv-empty { display: block; padding: 16px 4px 18px; color: var(--dim); font-size: 14px; border-top: 0; }
.lv-foot { text-align: center; font-size: 12.5px; color: var(--dim); line-height: 1.6; text-wrap: balance; }
.lv-foot img { height: 26px; width: auto; margin: 10px auto 0; opacity: 0.7; }

/* ---------- Bot peserta ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bot { background: #12291d; border: 1px solid rgba(246, 196, 69, 0.22); border-radius: 18px; overflow: hidden; }
.bot-head { display: flex; gap: 11px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #0f241a; }
.bot-head img { width: 38px; height: 38px; border-radius: 11px; flex: none; }
.bot-head b { display: block; font-size: 15.5px; }
.bot-head span { display: block; font-size: 12.5px; color: var(--dim); }
.msgs { padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 90px; }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.42; }
.msg.bot { align-self: flex-start; background: #1d3b2b; border-top-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--gold); color: #2b1c00; font-weight: 600; border-top-right-radius: 6px; }
.msg.card { max-width: 100%; width: 100%; background: #0d2017; border: 1px solid rgba(246, 196, 69, 0.28); border-radius: 16px; padding: 12px 14px 8px; }
.st-name { font-family: var(--display); font-size: 27px; line-height: 1.1; margin-bottom: 4px; }
.st-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.st-k { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); padding-top: 3px; }
.st-v { font-size: 15px; font-weight: 600; }
.st-v small { display: block; color: var(--dim); font-weight: 500; font-size: 12.5px; margin-top: 2px; line-height: 1.35; }
.st-v.big { font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1.1; letter-spacing: 0.01em; }
.st-v.big small { font-family: var(--ui); }
.st-v.gold { color: var(--gold); }
.st-v.ok { color: #8fe0a8; }
.st-v.warn { color: #ffbf8a; }
.st-v.dim { color: var(--ink); opacity: 0.85; }
.st-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; font-size: 12px; color: var(--dim); }
.linkbtn { background: none; border: 0; color: var(--gold); text-decoration: underline; font-size: 13px; font-weight: 600; padding: 4px 0; cursor: pointer; flex: none; }
.bot-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #0f241a; }
.bot-input[hidden] { display: none; }
.bot-input input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.16); background: #0a1b13; color: #fff; }
.bot-input input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246, 196, 69, 0.2); }
.bot-input button { border: 0; border-radius: 12px; padding: 0 18px; background: var(--gold); color: #2b1c00; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.dots::after { content: '…'; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
