:root {
  --bg: #12131a; --panel: #1c1e29; --panel2: #252838; --text: #f3f1ea; --muted: #9a9cb0;
  --duck: #ffcf33; --beak: #ff8a2a; --rec: #ff4d5e; --ok: #3ddc97; --line: #2f3247;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(1200px 600px at 80% -10%, #2a2440 0, transparent 60%), var(--bg);
  color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
.hidden { display: none !important; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.logo { color: var(--text); text-decoration: none; font-size: 20px; }
.logo b { color: var(--duck); }
.badge { background: var(--panel2); padding: 6px 12px; border-radius: 999px; font-weight: 700; letter-spacing: 2px; cursor: pointer; }
main { max-width: 1100px; margin: 0 auto; padding: 8px 16px 60px; }
h1 { font-size: clamp(28px, 5vw, 46px); margin: 24px 0 8px; line-height: 1.1; }
h1 em { color: var(--duck); font-style: normal; }
h2 { margin: 0 0 12px; }
p.sub { color: var(--muted); margin: 0 0 24px; max-width: 640px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
label { display: block; color: var(--muted); font-size: 13px; margin: 0 0 6px; }
input[type=text] { width: 100%; padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; font-size: 16px; outline: none; }
input[type=text]:focus { border-color: var(--duck); }
.code-input { text-transform: uppercase; letter-spacing: 6px; font-weight: 800; text-align: center; }
button, .btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; border: 0; border-radius: 10px;
  padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; background: var(--panel2); color: var(--text);
  text-decoration: none; transition: transform .06s, filter .15s; }
button:hover:not(:disabled), .btn:hover { filter: brightness(1.15); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--duck); color: #1a1400; }
.rec { background: var(--rec); color: white; }
.ok { background: var(--ok); color: #062317; }
.ghost { background: transparent; border: 1px solid var(--line); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mt { margin-top: 14px; } .mt2 { margin-top: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.players { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--panel2); border-radius: 999px; padding: 6px 12px; display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.chip.off { opacity: .45; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.done .dot { background: var(--ok); }
.chip.host::after { content: "👑"; }
.bigcode { font-size: 44px; font-weight: 900; letter-spacing: 10px; color: var(--duck); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 34px; text-align: center; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--duck); background: #ffcf330d; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--panel2); border-top-color: var(--duck);
  animation: spin 1s linear infinite; margin: 10px auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { background: #ff4d5e22; border: 1px solid #ff4d5e66; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }

/* studio */
.studio { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
@media (max-width: 860px) { .studio { grid-template-columns: 1fr; } }
.stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; }
.stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; font-weight: 900;
  color: var(--duck); background: #0007; text-shadow: 0 6px 30px #000; }
.recdot { position: absolute; top: 12px; left: 12px; background: var(--rec); color: #fff; font-weight: 800; font-size: 13px;
  padding: 4px 10px; border-radius: 999px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .5; } }
.subtitle { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; padding: 0 16px; }
.subtitle span { background: #000b; padding: 4px 10px; border-radius: 6px; font-size: clamp(15px, 2.4vw, 22px); }
.lineCard { margin-top: 14px; }
.lineText { font-size: clamp(20px, 3vw, 28px); font-weight: 700; margin: 6px 0 10px; }
.bar { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--duck); }
.lines { max-height: 540px; overflow: auto; padding: 8px; }
.lineItem { display: flex; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; align-items: flex-start; }
.lineItem:hover { background: var(--panel2); }
.lineItem.cur { background: #ffcf3322; outline: 1px solid #ffcf3366; }
.lineItem .n { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22px; }
.lineItem .st { margin-left: auto; }
.lineItem .t { font-size: 14px; }
.reviewLine { display: grid; grid-template-columns: 24px 1fr; gap: 6px 8px; align-items: start; padding: 8px 6px;
  border-bottom: 1px solid var(--line); }
.reviewLine .n { color: var(--muted); padding-top: 9px; font-variant-numeric: tabular-nums; }
.reviewLine textarea { width: 100%; resize: none; overflow: hidden; padding: 8px 10px; font: inherit; font-size: 15px; line-height: 1.35;
  background: var(--panel2); color: var(--text); border: 1px solid transparent; border-radius: 8px; outline: none; }
.reviewLine textarea:hover { border-color: var(--line); }
.reviewLine textarea:focus { border-color: var(--duck); }
.reviewLine .times { grid-column: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.reviewLine .times button { padding: 5px 10px; font-size: 13px; }
.reviewLine input.num { width: 58px; padding: 3px 6px; font-size: 13px; font-variant-numeric: tabular-nums; display: inline-block; }
.editBtn { background: none; border: 0; padding: 2px 6px; font-size: 16px; cursor: pointer; opacity: .7; }
.editBtn:hover { opacity: 1; }

/* showcase */
.dubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dub { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dub video { width: 100%; display: block; background: #000; aspect-ratio: 16/9; }
.dub .meta { padding: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dub.voted { outline: 3px solid var(--duck); }
.dub.winner { outline: 3px solid var(--duck); box-shadow: 0 0 40px #ffcf3344; }
.theater { margin-bottom: 18px; }
.theater video { width: 100%; max-height: 70vh; background: #000; border-radius: var(--radius); display: block; }
/* account + projects */
.acct { display: flex; align-items: center; gap: 8px; }
.acct img { width: 30px; height: 30px; border-radius: 50%; }
.acct .nm { font-weight: 700; font-size: 14px; }
.meter { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.meter .bar { width: 120px; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.proj { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.proj .th { aspect-ratio: 16/9; background: #000 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.proj .bd { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.proj .ttl { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj .exp.soon { color: var(--beak); }
.proj .row button { padding: 8px 12px; font-size: 14px; }
.authForm { display: flex; flex-direction: column; gap: 10px; }
.authForm input { width: 100%; padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; font-size: 16px; outline: none; }
.authForm input:focus { border-color: var(--duck); }
.authForm .tabs { display: flex; gap: 4px; background: var(--panel2); padding: 4px; border-radius: 10px; }
.authForm .tabs button { flex: 1; padding: 8px; background: transparent; font-size: 14px; }
.authForm .tabs button.on { background: var(--panel); }
.authErr { color: #ff8b97; font-size: 14px; }
.signin { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pickList { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.pickItem { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 10px; padding: 8px; }
.pickItem img { width: 64px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: #000; }
.pickItem .t { flex: 1; min-width: 0; font-size: 14px; }
.pickItem .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 12px; z-index: 9; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 28px; }
.steps div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 14px; color: var(--muted); }
.steps b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.linkBtn { background: none; border: 0; padding: 4px 0; color: var(--muted); font-weight: 600; font-size: 14px; align-self: flex-start; }
.linkBtn:hover { color: var(--duck); filter: none; }
.modalBack { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; padding: 16px; z-index: 8; }
/* sound waves + match score */
.waveBox { position: relative; margin-top: 10px; background: #0f1017; border: 1px solid var(--line); border-radius: 10px; }
.wave { display: block; width: 100%; height: 84px; }
.waveMsg { position: absolute; inset: 0; display: grid; place-items: center; }
.waveKey { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.waveKey i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.waveKey .kOrig { background: #7c7f99; } .waveKey .kYou { background: var(--duck); margin-left: 8px; }
.score { display: inline-block; font-weight: 800; padding: 3px 10px; border-radius: 999px; font-size: 14px; font-variant-numeric: tabular-nums; }
.score.mini { padding: 1px 7px; font-size: 12px; }
.score.great { background: #3ddc9733; color: #6ff0b9; } .score.good { background: #ffcf3330; color: var(--duck); }
.score.ok { background: #ff8a2a30; color: #ffad6b; } .score.low { background: #ff4d5e30; color: #ff8b97; }
.bigScore { font-size: 64px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.bigScore.great { color: #6ff0b9; } .bigScore.good { color: var(--duck); } .bigScore.ok { color: #ffad6b; } .bigScore.low { color: #ff8b97; }
/* mimic */
.gameTabs { display: flex; gap: 4px; background: var(--panel2); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.gameTabs button { flex: 1; padding: 9px; background: transparent; font-size: 15px; }
.gameTabs button.on { background: var(--panel); outline: 1px solid var(--line); }
.srcList { display: flex; flex-direction: column; gap: 8px; }
.src { display: flex; gap: 10px; align-items: flex-start; background: var(--panel2); border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; cursor: pointer; margin: 0; color: var(--text); font-size: 15px; }
.src:has(input:checked) { border-color: var(--duck); }
.src.off { opacity: .5; cursor: not-allowed; }
.src input { margin-top: 4px; accent-color: var(--duck); }
.src > span { display: flex; flex-direction: column; gap: 2px; }
.sel { width: 100%; padding: 10px 12px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.pill { background: var(--panel2); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.soundTitle { display: flex; flex-direction: column; gap: 2px; font-size: clamp(20px, 3vw, 28px); font-weight: 800; }
.soundTitle .quote { font-style: italic; }
.wave.tall { height: 120px; }
.mResult { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 14px; background: var(--panel2); border-radius: 12px; }
.entries { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.entry { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 10px; padding: 8px 12px; flex-wrap: wrap; }
.entry.voted, .entry.winner { outline: 2px solid var(--duck); }
.entry .pts { font-weight: 800; color: var(--duck); min-width: 44px; text-align: right; }
.entry button { padding: 6px 12px; }
.lb { display: flex; flex-direction: column; gap: 4px; }
.lbRow { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.lbRow.me { background: #ffcf3318; }
.lbRow .n { width: 26px; text-align: center; } .lbRow .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
