:root {
  --bg: #0b0b10; --card: #16161f; --card2: #1e1e2a; --line: #2a2a3a;
  --text: #f4f4f8; --muted: #9a9ab0;
  --short: #25f4ee; --full: #fe2c55; --ok: #3ddc84; --warn: #ffb020;
  --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }
input, select { font: inherit; color: var(--text); background: var(--card2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; width: 100%; }

/* Buttons */
.btn { border: 0; border-radius: 12px; padding: 12px 16px; background: var(--card2); font-weight: 600;
  cursor: pointer; touch-action: manipulation; user-select: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(90deg, var(--short), var(--full)); color: #000; }
.btn.danger { background: #3a1520; color: #ff8aa0; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.big { padding: 16px; font-size: 18px; width: 100%; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.muted { color: var(--muted); }
.err { color: #ff8aa0; min-height: 1.4em; text-align: center; }

/* Login */
.screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card .logo { font-size: 64px; }
.login-card h1 { margin: 8px 0 24px; }
.login-card form { display: grid; gap: 12px; }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px; background: rgba(11,11,16,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; }
.conn { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.conn.on .dot { background: var(--ok); }
main { padding: 16px 16px calc(96px + var(--safe-b)); max-width: 640px; margin: 0 auto; display: grid; gap: 14px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: rgba(11,11,16,.96);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 5; }
.tabs a { flex: 1; display: grid; place-items: center; padding: 10px 0; color: var(--muted); text-decoration: none; font-size: 22px; }
.tabs a span { font-size: 12px; }
.tabs a.active { color: var(--text); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card h2 { margin: 0 0 10px; font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.banner { border-radius: 12px; padding: 12px 14px; background: #3a2a0a; color: #ffd27a; font-size: 14px; }
.banner.info { background: #10283a; color: #8fd3ff; }

/* Now playing */
.now { display: grid; gap: 8px; }
.now .title { font-size: 18px; font-weight: 700; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; color: #000; }
.badge.short { background: var(--short); } .badge.full { background: var(--full); color: #fff; }
.badge.test { background: #555; color: #fff; }
.bar { height: 8px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--short), var(--full)); }

/* Counters */
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.counter { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-align: center; }
.counter.short { border-color: color-mix(in srgb, var(--short) 45%, var(--line)); }
.counter.full { border-color: color-mix(in srgb, var(--full) 45%, var(--line)); }
.counter .label { font-weight: 700; }
.counter .sub { font-size: 12px; color: var(--muted); }
.counter .num { font-size: 56px; font-weight: 900; line-height: 1.1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.counter.short .num { color: var(--short); } .counter.full .num { color: var(--full); }
.counter .row .btn { font-size: 26px; padding: 10px 0; }
.counter .plus.short { background: var(--short); color: #000; }
.counter .plus.full { background: var(--full); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #000; }
.chip.short { background: var(--short); } .chip.full { background: var(--full); color: #fff; }
.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* Library */
.vlist { display: grid; gap: 10px; }
.vitem { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card2);
  border-radius: 12px; padding: 12px; cursor: pointer; }
.vitem .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vitem .meta { font-size: 13px; color: var(--muted); }
.editor video { width: 100%; max-height: 50vh; background: #000; border-radius: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card2); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button.on.short { background: var(--short); color: #000; }
.seg button.on.full { background: var(--full); color: #fff; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.timebig { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; }
.clip { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.clip:first-child { border-top: 0; }
.clip .info { flex: 1; font-size: 14px; }
.progress { height: 6px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--short); width: 0; }
.stack { display: grid; gap: 10px; }

/* Player */
#player { position: fixed; inset: 0; background: #000; z-index: 50; }
#pv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.p-overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }
.p-overlay.clear { pointer-events: none; }
.p-idle .big { font-size: 22px; color: var(--muted); }
.p-counts { display: flex; gap: 28px; justify-content: center; margin: 18px 0; }
.p-counts div { font-size: 18px; font-weight: 700; }
.p-counts b { display: block; font-size: 84px; line-height: 1; font-weight: 900; }
.p-counts .s b { color: var(--short); } .p-counts .f b { color: var(--full); }
.p-count { font-size: 180px; font-weight: 900; line-height: 1; text-shadow: 0 0 40px rgba(254,44,85,.6); }
.p-hud { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 12px; right: 56px; display: flex;
  gap: 10px; align-items: center; font-weight: 800; text-shadow: 0 1px 4px #000; pointer-events: none; }
.p-hud .t { font-size: 34px; font-variant-numeric: tabular-nums; margin-left: auto; }
.p-exit { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 12px; width: 36px; height: 36px;
  border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; text-decoration: none; z-index: 2; }

.lang-btn { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.login-card > .btn.ghost { margin-top: 16px; }
.p-lang { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 12px; z-index: 2; }
select { appearance: none; -webkit-appearance: none; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-head .title { font-size: 18px; font-weight: 800; text-align: center; flex: 1; }
.cal-head .btn { flex: 0 0 44px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-day { min-height: 58px; background: var(--card2); border-radius: 10px; padding: 4px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; cursor: pointer; border: 2px solid transparent; font-variant-numeric: tabular-nums; }
.cal-day.empty { background: transparent; cursor: default; }
.cal-day .d { font-size: 13px; color: var(--muted); }
.cal-day.has .d { color: var(--text); font-weight: 700; }
.cal-day.today { border-color: #555; }
.cal-day.sel { border-color: var(--short); }
.cal-day .n { font-size: 11px; font-weight: 800; line-height: 1.2; }
.cal-day .n.s { color: var(--short); } .cal-day .n.f { color: var(--full); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat-row b { display: block; font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat-row .s b { color: var(--short); } .stat-row .f b { color: var(--full); }
.stat-row span { font-size: 13px; color: var(--muted); }
.topbar .row > * { flex: 0 0 auto; }
.conn { white-space: nowrap; }
.brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stat-row .btn.plus.short { background: var(--short); color: #000; }
.stat-row .btn.plus.full { background: var(--full); color: #fff; }
.stat-row .btn { font-size: 20px; }

/* Background music */
.bgm-now { font-weight: 700; overflow-wrap: anywhere; }
.bgm-state { font-size: 13px; color: var(--muted); }
input[type=range] { -webkit-appearance: none; appearance: none; padding: 0; height: 32px; background: transparent; border: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--short), var(--full)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; border: 0; }
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--short), var(--full)); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; }
.track { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.track:first-child { border-top: 0; }
.track .info { flex: 1; min-width: 0; }
.track .name { font-weight: 600; overflow-wrap: anywhere; }
.track.on .name { color: var(--short); }
.p-bgm { margin-top: 14px; color: var(--muted); font-size: 15px; }

/* Message to dancer */
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick .btn { padding: 8px 10px; font-size: 13px; font-weight: 600; }
.note-status { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.note-status .txt { overflow-wrap: anywhere; }
.p-note { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 60px); z-index: 3;
  background: rgba(255, 176, 32, .96); color: #1a1200; border-radius: 18px; padding: 18px 20px; text-align: center;
  font-size: 30px; font-weight: 900; line-height: 1.25; box-shadow: 0 10px 40px rgba(0,0,0,.6); overflow-wrap: anywhere;
  animation: notePop .35s ease-out; }
.p-note small { display: block; font-size: 13px; font-weight: 600; opacity: .7; margin-top: 8px; }
@keyframes notePop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Player music bar */
.p-bar { position: absolute; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 3;
  background: rgba(22,22,31,.94); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: grid; gap: 8px;
  backdrop-filter: blur(10px); }
.p-bar .song { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-bar .row .btn { padding: 10px 0; }
.p-hint { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); left: 0; right: 0; text-align: center;
  font-size: 12px; color: #555; pointer-events: none; }

/* Clip rows with on/off + favourite */
.clip2 { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.clip2:first-child { border-top: 0; }
.clip2 .top { display: flex; align-items: center; gap: 10px; }
.clip2 .info { flex: 1; font-size: 14px; }
.clip2 .hint { font-size: 12px; color: var(--muted); }
.clip2 .hint.fav { color: #ffd166; }
.clip2 .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.clip2.off .top { opacity: .45; }
.btn.fav-on { background: #3a3010; color: #ffd166; }
.btn.toggle { display: inline-flex; align-items: center; gap: 8px; }
.btn.toggle .sw { width: 30px; height: 18px; border-radius: 99px; background: #444; position: relative; transition: background .2s; }
.btn.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .2s; }
.btn.toggle.is-on .sw { background: var(--ok); }
.btn.toggle.is-on .sw::after { left: 14px; }
.clip2 .acts { flex-wrap: nowrap; }
.clip2 .acts .btn { flex: 0 0 auto; }
.clip2 .acts [data-act=clipFav] { font-size: 18px; padding: 6px 12px; }
.clip2 .acts [data-act=loadClip] { flex: 1 1 auto; }

.p-off { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 4px; font-size: 14px; }

#pv.fill { object-fit: cover; object-position: center center; }
.p-fill { border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; cursor: pointer; }

/* Picture messages */
.note-prev { display: flex; align-items: center; gap: 10px; }
.note-prev img { max-height: 90px; max-width: 60%; border-radius: 10px; }
.note-thumb { height: 40px; width: 40px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.p-note.has-img { background: rgba(20,20,28,.96); color: #fff; border: 3px solid #ffb020; padding: 12px; }
.p-note img { display: block; max-width: 100%; max-height: 55vh; margin: 0 auto 8px; border-radius: 12px; object-fit: contain; }
.p-note.has-img div { font-size: 26px; }

/* Auto gift counting */
.trk-status { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.trk-status .dot { width: 10px; height: 10px; border-radius: 50%; background: #555; flex: 0 0 auto; }
.trk-status .dot.live { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.trk-status .dot.connecting, .trk-status .dot.notlive { background: var(--warn); }
.trk-status .dot.error { background: var(--full); }
.trk-rules summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.trk-rule { font-size: 14px; }

.badge.minus { background: transparent !important; border: 2px solid currentColor; }
.badge.short.minus { color: var(--short); } .badge.full.minus { color: var(--full); }
.trk-quick { width: auto; padding: 4px 8px; font-size: 12px; flex: 0 0 auto; }

/* Play button before the first dance */
.p-ready { background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.55)); }
.p-go { font-size: 34px; padding: 22px 54px; border-radius: 999px; box-shadow: 0 10px 40px rgba(254,44,85,.45); }
.p-go-hint { color: #ddd; font-size: 14px; max-width: 260px; text-shadow: 0 1px 4px #000; }

/* Calendar: day tabs, ranking, comments, wishes */
.cal-day .n.c { color: #ffd166; font-size: 10px; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg3 button { border: 0; background: transparent; padding: 10px 4px; border-radius: 9px; font-weight: 700; color: var(--muted); font-size: 13px; }
.seg3 button.on { background: var(--text); color: #000; }
.rk { border-top: 1px solid var(--line); }
.rk:first-of-type { border-top: 0; }
.rk-head { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; }
.rk-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.rk-n.top1 { background: #ffd166; color: #000; } .rk-n.top2 { background: #cfd3dc; color: #000; } .rk-n.top3 { background: #d8935a; color: #000; }
.rk-who { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.rk-coins { font-weight: 800; color: #ffd166; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rk-arrow { color: var(--muted); }
.rk-list { padding: 0 0 10px 36px; display: grid; gap: 4px; }
.rk-gift, .cl { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 4px 8px; border-radius: 8px; }
.rk-gift .tm, .cl .tm { color: var(--muted); font-size: 11px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.rk-gift .nm { flex: 1; }
.cn { color: #ffd166; white-space: nowrap; font-size: 12px; }
.pk { background: rgba(254, 44, 85, .16); box-shadow: inset 3px 0 0 var(--full); }
.pk-tag { background: var(--full); color: #fff; font-size: 10px; font-weight: 900; padding: 1px 6px; border-radius: 6px; }
.pk-chip { display: inline-block; margin-left: 6px; font-size: 11px; color: #ff8aa0; }
.chat-log { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; }
.cl .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cl.gift .tx { color: #ffe3a3; }

/* Live tab */
.live-wrap { display: grid; gap: 12px; }
.live-sum { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 12px; }
.ls-coins { display: grid; align-content: center; gap: 4px; background: var(--card2); border-radius: 12px; padding: 10px 12px; }
.ls-coins .muted { font-size: 12px; }
.ls-coins b { font-size: 24px; color: #ffd166; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ls-top { background: var(--card2); border-radius: 12px; padding: 8px 10px; cursor: pointer; display: grid; gap: 3px; font-size: 13px; }
.ls-top .muted { font-size: 12px; }
.ls-row { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 0; }
.ls-row .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-all { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 8px; max-height: 40vh; overflow-y: auto; }
.ls-all .ls-row { padding: 5px 0; font-size: 14px; }
.live-card { position: relative; padding: 8px; }
.live-feed { height: calc(100dvh - 430px); min-height: 220px; overflow-y: auto; display: grid; align-content: start; gap: 2px; }
.live-empty { padding: 20px 10px; text-align: center; font-size: 14px; }
.live-new { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); box-shadow: 0 4px 20px rgba(0,0,0,.6); background: var(--short); color: #000; }
.cl .trk-quick { margin-left: auto; }
.live-wrap #cNote .card { gap: 8px; padding: 12px; }
.live-wrap #cNote h2 { margin: 0; font-size: 13px; }
.live-wrap #cNote .quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.live-wrap #cNote .quick::-webkit-scrollbar { display: none; }
.live-wrap #cNote .quick .btn { flex: 0 0 auto; white-space: nowrap; }
.live-feed { height: calc(100dvh - 560px); min-height: 260px; }

/* Coin sources (validated categorical palette, dark surface) */
:root { --src-pk: #f0325a; --src-wish: #10a8a2; --src-other: #c08a12; }
.ls-coins { cursor: pointer; }
.ls-sumbtn { grid-column: 1 / -1; }
.src-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.src-bar i { display: block; min-width: 3px; }
.src-pk { background: var(--src-pk); } .src-wish { background: var(--src-wish); } .src-other { background: var(--src-other); }
.dot-k { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

/* Calendar month link + dances row */
a.month-link { display: block; color: inherit; text-decoration: none; }
.month-coins { font-size: 26px; color: #ffd166; flex: 0 0 auto; }
.month-go { text-align: right; color: var(--short); font-weight: 700; font-size: 14px; }
.dances-row { border-top: 1px solid var(--line); padding-top: 10px; }
.s-txt { color: var(--short); } .f-txt { color: var(--full); }

/* Insights */
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: 13px; }
.chip-btn.on { background: var(--text); color: #000; border-color: var(--text); }
.ins-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ins-tiles div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 2px; }
.ins-tiles span { font-size: 12px; color: var(--muted); }
.ins-tiles b { font-size: 22px; font-variant-numeric: tabular-nums; }
.src-bar.big { height: 18px; border-radius: 6px; }
.rate-row { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; }
.rate-row .rb { height: 14px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.rate-row .rb i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.rate-row .rv { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate-row .rm { font-size: 11px; min-width: 44px; text-align: right; }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line); }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.col:hover .stack-col { outline: 2px solid var(--text); outline-offset: 1px; }
.stack-col { width: 100%; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 0; }
.stack-col i { display: block; min-height: 2px; }
.cols-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.rec { display: flex; gap: 10px; font-size: 14px; line-height: 1.45; background: var(--card2); border-radius: 12px; padding: 10px 12px; }
.tag { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 99px; margin: 3px 4px 0 0; background: var(--card2); color: var(--muted); }
.tag-top { background: #3a3010; color: #ffd166; } .tag-pk { background: rgba(240,50,90,.2); color: #ff8aa0; }
.tag-wish { background: rgba(16,168,162,.2); color: #6fe3de; } .tag-lapsed { background: #2a2a2a; color: #aaa; }
.g-detail { padding: 0 0 12px 36px; display: grid; gap: 6px; }
.g-facts { font-size: 13px; }
.g-tip { font-size: 13px; background: var(--card2); border-radius: 10px; padding: 8px 10px; }
a.btn { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.trk-alert { display: grid; gap: 6px; background: var(--card2); border-radius: 12px; padding: 10px 12px; }
.trk-alert input { background: var(--card); }
.ok-txt { color: var(--ok); } .err-txt { color: #ff8aa0; overflow-wrap: anywhere; }
.trk-status .dot.ended { background: #888; }

/* Viewer card */
body.no-scroll { overflow: hidden; }
.vc-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.vc { width: 100%; max-width: 640px; max-height: 88dvh; overflow-y: auto; background: var(--card); border-radius: 20px 20px 0 0; border: 1px solid var(--line);
  padding: 16px 16px calc(16px + var(--safe-b)); display: grid; gap: 12px; align-content: start; animation: vcUp .2s ease-out; }
@keyframes vcUp { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.vc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vc-head .btn { flex: 0 0 auto; }
.vc-name { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.vc-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.vc-stats span:first-child { color: #ffd166; font-weight: 700; }
.vc-note { display: grid; gap: 6px; background: var(--card2); border-radius: 12px; padding: 10px; }
.vc-note label { font-size: 12px; }
.vc-note textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }
.vc-days { display: grid; gap: 10px; }
.vc-day { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; display: grid; gap: 6px; }
.vc-date { font-size: 13px; font-weight: 800; color: var(--muted); }
.vc-gifts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.vc-sum { font-size: 14px; line-height: 1.45; background: rgba(16,168,162,.12); border-radius: 10px; padding: 8px 10px; }
.vc-toggle { justify-self: start; font-size: 12px; padding: 4px 8px; }
.vc-comments { display: grid; gap: 2px; max-height: 240px; overflow-y: auto; }
.vname { cursor: pointer; }
.vname:hover { text-decoration: underline; }
.ls-all .ls-row[data-act=viewer] { cursor: pointer; }
.rk-card { padding: 4px 8px; flex: 0 0 auto; }

/* "is back" reminders */
.live-back { display: grid; gap: 6px; }
.back-chip { background: rgba(255,209,102,.1); border: 1px solid rgba(255,209,102,.35); border-radius: 14px; padding: 8px 10px; cursor: pointer; display: grid; gap: 3px; }
.bc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.bc-top .btn { padding: 2px 8px; flex: 0 0 auto; }
.bc-line { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }

.trk-home { font-size: 13px; display: grid; gap: 4px; }
.trk-home .btn { justify-self: start; padding: 4px 10px; }
.test-line { color: #ffb020; font-size: 13px; }
.trk-test { display: grid; gap: 6px; background: rgba(255,176,32,.08); border: 1px solid rgba(255,176,32,.3); border-radius: 12px; padding: 10px 12px; font-size: 14px; }

.trk-sum { display: grid; gap: 4px; background: rgba(16,168,162,.08); border: 1px solid rgba(16,168,162,.3); border-radius: 12px; padding: 10px 12px; }
.vc-vip { font-size: 12px; color: #6fe3de; }

.brief { border-color: rgba(255,209,102,.45); background: linear-gradient(180deg, rgba(255,209,102,.08), var(--card)); }
.brief-text { font-size: 14px; line-height: 1.55; }

/* Player: dance controls in the bar + Dance now picker */
.pb-dance { display: grid; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.pb-dance .btn { padding: 10px 4px; font-size: 13px; }
.p-reroll { color: #fff; border-color: rgba(255,255,255,.35); }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card2);
  border-radius: 12px; padding: 12px; font: inherit; color: var(--text); cursor: pointer; }
.pick-row .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pick-row:active { transform: scale(.98); }
#pickSheet { z-index: 70; }
/* Disabled buttons must look disabled */
.btn:disabled, .btn[disabled] { opacity: .35; cursor: not-allowed; filter: saturate(.4); }
.btn:disabled:active { transform: none; }

/* Control: one Dances bubble, gift-counting line */
.dance-card .sub-box { background: var(--card2); border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.dance-card .sub-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.dance-card .counter { background: var(--card2); }
.gear { padding: 6px 9px; }
.cl.cap .tx { font-style: italic; color: var(--muted); }
.cl.cap .tx b { color: #9ad; font-style: normal; }
.trk-feedcheck { margin-top: 4px; }

/* Player controls: two matching sections */
.p-bar { gap: 10px; max-height: calc(100% - 20px); overflow-y: auto; }
.pb-sec { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pb-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pb-h { flex: 0 0 auto; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pb-now { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pb-btns.two { grid-template-columns: 1fr 1fr; }
.pb-btns .btn { padding: 10px 4px; font-size: 13px; }
.pb-more summary { font-size: 13px; color: var(--muted); font-weight: 700; cursor: pointer; }
.pick-row .fav-mark { flex: 0 0 22px; text-align: center; }
.pick-row.on { border-color: var(--accent, #10a8a2); }

/* Talk to English viewers */
.p-talk { position: absolute; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 4; height: 64px;
  border-radius: 18px; border: 2px solid var(--line); background: rgba(22,22,31,.94); color: #fff; font-size: 16px; font-weight: 800;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.p-talk .tb-main { font-size: 20px; letter-spacing: .02em; }
.p-talk .tb-sub { font-size: 12px; font-weight: 600; color: var(--muted); }
.p-talk.rec { background: #f0325a; border-color: #fff; box-shadow: 0 0 0 6px rgba(240,50,90,.25); }
.p-talk.busy { opacity: .75; }
#player.talk-on .p-bar { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); max-height: calc(100% - 104px); }
.p-talk-card { position: absolute; left: 12px; right: 56px; top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 4;
  background: rgba(22,22,31,.95); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 8px; }
.p-talk-card.ok { left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 56px); }
.p-talk-card .talk-en { font-size: 24px; font-weight: 800; line-height: 1.3; }
.p-talk-card .talk-zh { font-size: 14px; color: var(--muted); }
.p-talk-card .talk-st { font-weight: 700; }
.p-talk-card .btn { justify-self: end; }

/* Watched streamers */
.cal-room { width: 100%; font-weight: 700; }
.src-split { display: flex; gap: 6px; flex-wrap: wrap; }
.src-split .src { flex: 1; min-width: 0; border-radius: 10px; padding: 6px 8px; font-size: 12px; background: var(--card2); border-left: 4px solid; }
.src-split .src b { display: block; font-size: 16px; }
.src-split .src.pk { border-color: var(--src-pk); } .src-split .src.wish { border-color: var(--src-wish); } .src-split .src.other { border-color: var(--src-other); }
.watch-item { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }

.rb-stack { display: flex; height: 100%; border-radius: 4px; overflow: hidden; gap: 2px; }
.rb-stack i { display: block; height: 100%; }
.rk-gift .wish-tag { font-size: 12px; }
.rate-row .rb .rb-stack i { border-radius: 0; }
.rate-row .rb .rb-stack i:last-child { border-radius: 0 4px 4px 0; }

/* Audience languages */
.lang-tag { display: inline-block; font-size: 10px; font-weight: 800; line-height: 1; padding: 3px 5px; border-radius: 6px;
  background: var(--card2); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; }
.lang-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(30px, 1fr) 64px 92px; gap: 8px; align-items: center; font-size: 13px; }
.lang-row .nm { overflow-wrap: anywhere; }
.lang-row .rb { height: 10px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.lang-row .rb i { display: block; height: 100%; background: var(--muted); border-radius: 4px; }
.lang-row .lv { color: var(--muted); white-space: nowrap; }
.lang-row .cn { white-space: nowrap; text-align: right; }
.ins-step { align-items: center; }
