/* ============ Player (phone) ============ */
.play { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.play-body { flex: 1; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 16px 16px; max-width: 640px; width: 100%; margin: 0 auto; }

.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.screen.center { align-items: center; justify-content: center; text-align: center; }
.screen-title { font-size: clamp(1.8rem, 7vw, 2.6rem); text-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.screen-sub { font-size: 1.1rem; font-weight: 700; opacity: .9; max-width: 28ch; }
.kicker { font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; opacity: .8; }
.big-emoji { font-size: 5rem; line-height: 1; }

/* ---- join ---- */
.join-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px 16px; }
.join-brand .brand { font-size: 2rem; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.join-brand .brand-mark { width: 48px; height: 48px; border-radius: 14px; gap: 4px; padding: 6px; }
.join-card { width: min(380px, 100%); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.join-card .input-xl { border-width: 3px; }
.join-quiz { display: flex; flex-direction: column; text-align: center; gap: 2px; font-size: 1.05rem; }
.join-quiz strong { font-size: 1.25rem; font-weight: 900; }
.input-wrap { position: relative; }
.input-wrap .counter { position: absolute; right: 12px; bottom: 8px; font-size: .75rem; font-weight: 800; color: var(--ink-3); }
.form-error { color: var(--bad); font-weight: 800; min-height: 1.2em; text-align: center; font-size: .95rem; }
.btn-dark { --b: var(--ink); --b-dark: #000; --b-ink: #fff; }
.join-foot { font-size: .9rem; opacity: .85; text-align: center; }
.join-foot a { color: #fff; }
.link-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; color: var(--ink-3); font-weight: 800; cursor: pointer; padding: 6px; }
.link-btn.light { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.shake { animation: shake .4s; }

/* ---- lobby ---- */
.lobby-avatar {
  font-size: 5.5rem; line-height: 1; width: 150px; height: 150px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .18); display: grid; place-items: center; cursor: pointer; box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
  transition: transform .15s var(--ease);
}
.lobby-avatar:active { transform: scale(.94); }
.lobby-avatar.wobble { animation: popIn .4s var(--ease); }
.avatar-hint { font-size: .85rem; font-weight: 700; opacity: .7; margin-top: -6px; }
.leave { margin-top: 20px; }
.dots { display: flex; gap: 8px; margin-top: 8px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #fff; opacity: .4; animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-10px); opacity: 1; } }

/* ---- question ---- */
.q-top { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.q-count { font-weight: 900; background: rgba(0, 0, 0, .2); padding: .3em .9em; border-radius: 99px; font-size: .9rem; }
.pill-gold { background: var(--gold); color: #5a3d00; }
.intro-text { font-size: clamp(1.5rem, 6vw, 2.2rem); max-width: 22ch; }
.intro-ring {
  --p: 0;
  width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--p) * 360deg), rgba(255, 255, 255, .2) 0);
  margin: 10px 0;
}
.intro-ring span { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-size: 2.4rem; font-weight: 1000; }

.q-head { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; margin-bottom: 14px; position: relative; }
.q-timer { position: absolute; right: 0; top: -4px; }
.timer-num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--ink); font-weight: 1000; font-size: 1.2rem; box-shadow: var(--shadow-s); }
.timer-bar { width: 100%; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.timer-bar i { display: block; height: 100%; background: #fff; transform-origin: left; border-radius: 99px; }
.timer-bar.urgent i { background: var(--gold); }
.q-image { max-height: 22vh; border-radius: var(--radius); object-fit: contain; box-shadow: var(--shadow); background: rgba(255, 255, 255, .1); }
.q-text { font-size: clamp(1.15rem, 4.8vw, 1.6rem); font-weight: 900; }

.answers { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 260px; }
.answers-long { grid-template-columns: 1fr; }
.answers-tf { grid-template-columns: 1fr 1fr; }
.answer {
  position: relative; border: 0; border-radius: var(--radius-l); background: var(--ans); color: #fff; cursor: pointer;
  box-shadow: 0 6px 0 var(--ans-dark); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 12px; font-weight: 900; font-size: clamp(1rem, 4.4vw, 1.25rem); text-shadow: 0 2px 0 rgba(0, 0, 0, .15);
  transition: transform .1s ease, box-shadow .1s ease, opacity .25s, filter .25s; min-height: 100px; touch-action: manipulation;
  animation: popIn .35s var(--ease) both;
}
.answer:nth-child(2) { animation-delay: .05s; }
.answer:nth-child(3) { animation-delay: .1s; }
.answer:nth-child(4) { animation-delay: .15s; }
.answers-long .answer { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 70px; padding: 14px 18px; }
.answer:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ans-dark); }
.answer-icon { width: 2.2em; height: 2.2em; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .15)); }
.answers-long .answer-icon { width: 1.8em; height: 1.8em; }
.answer-text { overflow-wrap: anywhere; }
.answers.locked .answer { pointer-events: none; opacity: .35; filter: grayscale(.4); }
.answers.locked .answer.chosen { opacity: 1; filter: none; transform: scale(1.03); }

.locked-tile { width: 140px; height: 140px; border-radius: 32px; background: var(--ans); box-shadow: 0 8px 0 var(--ans-dark); display: grid; place-items: center; color: #fff; animation: popIn .45s var(--ease), pulse 1.6s 0.5s infinite; }
.locked-tile .icon { width: 72px; height: 72px; }

/* ---- result ---- */
body.flash-good { background: linear-gradient(160deg, #16a34a, #0f7a35); }
body.flash-bad { background: linear-gradient(160deg, #e5484d, #b4232a); }
body.flash-good .bg-shapes, body.flash-bad .bg-shapes { opacity: .6; }
.result-icon { width: 120px; height: 120px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.result-good .result-icon { color: var(--good); }
.result-bad .result-icon { color: var(--bad); animation: popIn .45s var(--ease), shake .45s .45s; }
.result-icon .icon { width: 64px; height: 64px; }
.points-pill { background: rgba(0, 0, 0, .22); padding: .4em 1.1em; border-radius: 99px; font-size: 1.6rem; font-weight: 1000; }
.result-bad .points-pill { font-size: 1.05rem; font-weight: 800; }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; background: rgba(255, 255, 255, .2); padding: .3em .9em; border-radius: 99px; }
.streak .icon { color: var(--gold); }
.bonus { font-weight: 800; opacity: .9; }
.rank-line { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.rank-big { font-size: 1.5rem; font-weight: 1000; }
.rank-behind { font-weight: 700; opacity: .9; }
.standing-rank { font-size: 5.5rem; font-weight: 1000; line-height: 1; text-shadow: 0 5px 0 rgba(0, 0, 0, .15); }
.standing-rank .hash { font-size: .5em; opacity: .7; vertical-align: top; }

/* ---- final ---- */
.final-medal { font-size: 6rem; line-height: 1; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .25)); }
.final-stats { display: flex; gap: 12px; margin: 6px 0 12px; }
.final-stats div { background: rgba(255, 255, 255, .16); border-radius: var(--radius); padding: 12px 18px; display: flex; flex-direction: column; min-width: 120px; }
.final-stats strong { font-size: 1.6rem; font-weight: 1000; }
.final-stats span { font-size: .85rem; font-weight: 700; opacity: .85; }

/* ---- footer ---- */
.play-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .95); color: var(--ink); font-weight: 900; box-shadow: 0 -4px 20px rgba(0, 0, 0, .12);
}
.me { display: flex; align-items: center; gap: 8px; min-width: 0; }
.me-avatar { font-size: 1.5rem; }
.me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-score { background: var(--ink); color: #fff; padding: .3em .9em; border-radius: 99px; font-variant-numeric: tabular-nums; }

/* ---- connection ---- */
.conn-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-weight: 800; box-shadow: var(--shadow-l);
}
.spinner-sm { width: 18px; height: 18px; border-width: 3px; }
.join-brand .brand-logo { height: 64px; max-width: 280px; border-radius: 16px; padding: 6px 12px; }

/* ---- intermission slide ---- */
.slide-phone-img { max-height: 30vh; border-radius: var(--radius); box-shadow: var(--shadow); object-fit: contain; }
.slide-phone-body { font-size: 1.1rem; font-weight: 700; opacity: .95; white-space: pre-line; max-width: 32ch; }
