/* ══════════ ДИМАБОКС · Мику-эстетика ══════════ */
:root {
  --bg: #0a1416;
  --panel: #102226;
  --panel2: #16303a;
  --miku: #39c5bb;
  --miku-dim: #1f7a74;
  --pink: #ff77a8;
  --gold: #ffd166;
  --text: #eafffd;
  --muted: #7fb5b0;
  --danger: #ff5c7a;
  --grad: linear-gradient(90deg, #39c5bb, #ff77a8);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  background: radial-gradient(1200px 700px at 70% -10%, #123236 0%, var(--bg) 60%) no-repeat var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
h1, h2, h3 { font-weight: 800; letter-spacing: .02em; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.pink { color: var(--pink); }
.miku { color: var(--miku); }

/* ── Мику ── */
body.screen #app { position: relative; z-index: 1; }
.miku {
  position: fixed; bottom: 0; right: -40px; z-index: 0; pointer-events: none;
  opacity: .95; filter: drop-shadow(0 0 30px #39c5bb33);
  transform-origin: bottom center;
}
.miku.size-l { height: 38vh; }
.miku.size-m { height: 28vh; }
.miku.size-s { height: 22vh; }
.miku.left { left: -40px; right: auto; }
.miku.sway { animation: sway 5s ease-in-out infinite; }
.miku.pop { animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: translateY(-10px) rotate(1.2deg); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: .95; } }

/* эмодзи ответившего игрока взлетает вверх */
.fly {
  position: fixed; bottom: 6vh; font-size: 46px; z-index: 40; pointer-events: none;
  animation: flyUp 1.7s ease-out forwards;
}
@keyframes flyUp {
  from { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  to { transform: translateY(-48vh) scale(1.35) rotate(12deg); opacity: 0; }
}

/* код комнаты в лобби */
.roomcode { font-size: 26px; color: var(--muted); text-align: center; letter-spacing: .1em; }
.roomcode b {
  display: block; font-size: 88px; line-height: 1.15; color: var(--gold);
  letter-spacing: .18em; text-shadow: 0 0 30px #ffd16644;
}

/* ── таймер-полоса сверху ── */
.timerwrap { position: fixed; top: 0; left: 0; right: 0; height: 10px; background: #0006; z-index: 50; }
#timerbar { height: 100%; width: 0%; background: var(--grad); border-radius: 0 6px 6px 0; transition: width .18s linear; }

/* ══════════ ЭКРАН (проектор) ══════════ */
body.screen #app {
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 34px 48px 16px;
  gap: 18px;
}
.s-top { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.s-top .rtitle { font-size: 34px; font-weight: 800; }
.s-top .rprog { font-size: 22px; color: var(--muted); white-space: nowrap; }
.s-main { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 28px; }
.s-bottom { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-bottom: 6px; position: relative; z-index: 3; }
.s-main { position: relative; z-index: 2; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid #ffffff14;
  border-radius: 999px; padding: 5px 12px; font-size: 16px;
}
.chip.done { border-color: var(--miku); box-shadow: 0 0 8px #39c5bb55; }
.chip.off { opacity: .35; }
.chip .sc { color: var(--miku); font-weight: 700; }

.bigq { font-size: 52px; font-weight: 800; max-width: 1200px; line-height: 1.2; }
.prompt-blank { color: var(--pink); }

.optgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: min(1150px, 92vw); }
.opt {
  background: var(--panel); border: 2px solid #ffffff14; border-radius: 18px;
  padding: 22px 26px; font-size: 30px; font-weight: 600; text-align: left;
  display: flex; align-items: center; gap: 16px; position: relative;
}
.opt .letter {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel2); color: var(--miku); font-weight: 800; font-size: 24px;
}
.opt.correct { border-color: var(--miku); background: #103a36; box-shadow: 0 0 24px #39c5bb44; }
.opt.wrongpick { opacity: .75; }
.opt .voters { margin-left: auto; font-size: 26px; letter-spacing: 2px; }

.answered-pill {
  font-size: 24px; color: var(--muted);
  background: var(--panel); border-radius: 999px; padding: 10px 26px;
}

/* lobby */
.lobby-title { font-size: 110px; line-height: 1; filter: drop-shadow(0 0 30px #39c5bb44); }
.lobby-sub { font-size: 30px; color: var(--muted); margin-top: 6px; }
.lobby-row { display: flex; gap: 60px; align-items: center; justify-content: center; flex-wrap: wrap; }
.qrbox { background: #fff; padding: 16px; border-radius: 22px; box-shadow: 0 0 40px #39c5bb33; }
.qrbox img { display: block; width: 300px; height: 300px; }
.joinurl { font-size: 30px; font-weight: 700; color: var(--miku); margin-top: 14px; text-align: center; }
.lobby-players { max-width: 640px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hint { color: var(--muted); font-size: 20px; }

/* intro */
.intro-round { font-size: 26px; color: var(--pink); font-weight: 700; letter-spacing: .2em; }
.intro-title { font-size: 88px; }
.intro-desc { font-size: 30px; color: var(--muted); max-width: 900px; line-height: 1.45; }

/* fibbage reveal */
.reveal-list { display: flex; flex-direction: column; gap: 12px; width: min(1100px, 92vw); }
.reveal-item {
  background: var(--panel); border: 2px solid #ffffff14; border-radius: 16px;
  padding: 14px 22px; font-size: 26px; text-align: left;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  opacity: 0; animation: fadeUp .5s ease forwards;
}
.reveal-item .who { color: var(--muted); font-size: 20px; }
.reveal-item .voters { margin-left: auto; font-size: 24px; letter-spacing: 2px; }
.reveal-item.truth { border-color: var(--miku); background: #103a36; font-weight: 800; box-shadow: 0 0 24px #39c5bb44; }
.reveal-item.truth .tag { color: var(--miku); }
.reveal-item .tag { font-weight: 800; font-size: 18px; letter-spacing: .1em; color: var(--pink); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* who reveal */
.who-row {
  display: flex; align-items: center; gap: 16px; width: min(900px, 90vw);
  background: var(--panel); border-radius: 14px; padding: 12px 20px;
  font-size: 26px; opacity: 0; animation: fadeUp .5s ease forwards;
}
.who-row .bar { height: 14px; border-radius: 7px; background: var(--grad); }
.who-row.win { border: 2px solid var(--gold); box-shadow: 0 0 20px #ffd16633; }

/* auction */
.auc-answer { font-size: 96px; font-weight: 800; }
.bid-row {
  display: flex; gap: 18px; align-items: center; font-size: 26px;
  background: var(--panel); border-radius: 12px; padding: 8px 20px;
  width: min(700px, 90vw); opacity: 0; animation: fadeUp .4s ease forwards;
}
.bid-row.win { border: 2px solid var(--miku); box-shadow: 0 0 16px #39c5bb44; }
.bid-row .num { margin-left: auto; font-weight: 800; color: var(--miku); }

/* scoreboard */
.score-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; width: min(1150px, 94vw); }
.score-row {
  display: flex; align-items: center; gap: 12px; font-size: 24px;
  background: var(--panel); border-radius: 12px; padding: 8px 18px;
}
.score-row .rank { width: 40px; text-align: center; font-weight: 800; color: var(--muted); }
.score-row .name { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-row .gain { color: var(--pink); font-weight: 700; }
.score-row .total { font-weight: 800; color: var(--miku); min-width: 80px; text-align: right; }
.score-row.top1 { border: 2px solid var(--gold); }

/* final */
.podium { display: flex; align-items: flex-end; gap: 26px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pod .box {
  width: 200px; border-radius: 16px 16px 0 0; background: var(--panel2);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 14px;
  border: 2px solid #ffffff14; border-bottom: none;
}
.pod.p1 .box { height: 240px; border-color: var(--gold); box-shadow: 0 0 40px #ffd16633; }
.pod.p2 .box { height: 180px; }
.pod.p3 .box { height: 140px; }
.pod .medal { font-size: 52px; }
.pod .pname { font-size: 26px; font-weight: 800; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .pscore { font-size: 22px; color: var(--miku); font-weight: 700; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti span {
  position: absolute; top: -8vh; font-size: 30px;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translateY(115vh) rotate(360deg); }
}

/* ══════════ ПУЛЬТ (телефон) ══════════ */
body.controller #app {
  min-height: 100vh; min-height: 100dvh; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; padding: 18px 16px 28px; gap: 14px;
}
.c-head {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border-radius: 14px; padding: 10px 14px; font-size: 17px;
}
.c-head .cscore { margin-left: auto; font-weight: 800; color: var(--miku); }
.c-head .cgain { color: var(--pink); font-weight: 700; }
.c-title { font-size: 44px; text-align: center; margin-top: 8vh; }
.c-sub { text-align: center; color: var(--muted); }
.c-center { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; text-align: center; }
.c-status { font-size: 26px; font-weight: 700; line-height: 1.35; }
.c-note { color: var(--muted); font-size: 17px; line-height: 1.4; }

input.txt {
  width: 100%; font-size: 18px; padding: 15px 16px; border-radius: 14px;
  border: 2px solid var(--miku-dim); background: var(--panel); color: var(--text);
  outline: none;
}
input.txt:focus { border-color: var(--miku); }

.btn {
  width: 100%; font-size: 19px; font-weight: 700; padding: 16px;
  border-radius: 14px; border: 2px solid var(--miku); cursor: pointer;
  background: #123a37; color: var(--text);
  transition: transform .06s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); border: none; color: #06211f; }
.btn.opt-a, .btn.opt-b, .btn.opt-c, .btn.opt-d { text-align: left; }
.btn:disabled { opacity: .45; }
.btn .mini { display: block; font-size: 13px; font-weight: 400; color: #06211f99; }
.btn.ghost .mini { color: var(--muted); }

.optcol { display: flex; flex-direction: column; gap: 10px; }
.playersgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.playersgrid .btn { font-size: 16px; padding: 13px 8px; }

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--danger); color: #fff; font-weight: 700;
  padding: 12px 22px; border-radius: 12px; opacity: 0; transition: all .25s ease;
  max-width: 90vw; text-align: center; z-index: 99;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.ok { background: var(--miku); color: #06211f; }
