/* ===== PLAYER (mobile) ===== */
body {
  background:
    radial-gradient(800px 400px at 80% -10%, rgba(124,92,255,.35), transparent 60%),
    linear-gradient(160deg, #0b1f3a, #18365f);
  color: #fff; min-height: 100dvh;
}
.screen { min-height: 100dvh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* JOIN */
.join-screen { align-items: center; justify-content: center; padding: 24px; }
.join-box {
  background: #fff; color: var(--ink); border-radius: 24px; padding: 30px 26px;
  width: min(420px, 100%); box-shadow: var(--shadow-lg); text-align: center;
}
.join-box .logo { font-size: 3rem; }
.join-box h1 { margin: 6px 0 2px; font-size: 2rem; }
.join-box .tag { color: var(--muted); margin: 0 0 22px; font-weight: 600; }
.field {
  width: 100%; font-family: var(--font); font-size: 1.3rem; font-weight: 600; text-align: center;
  padding: 0.7em; border: 2px solid var(--line); border-radius: 14px; margin-bottom: 14px; outline: none;
}
.field:focus { border-color: var(--brand); }
#pin { letter-spacing: .3em; }
.block { width: 100%; justify-content: center; }
.err { color: var(--danger); font-weight: 600; margin-top: 10px; min-height: 1.2em; }
.hosthint { margin-top: 20px; opacity: .7; font-size: .95rem; }
.hosthint a { color: #cdd9ff; }

/* GAME header */
.g-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: rgba(8,18,34,.5); border-bottom: 1px solid rgba(255,255,255,.08);
}
.me-name { font-weight: 700; font-size: 1.1rem; }
.me-stats { display: flex; align-items: center; gap: 12px; }
.me-rank { opacity: .85; font-weight: 700; }
.me-score { font-weight: 800; font-size: 1.3rem; color: var(--gold); }

#gstage { flex: 1; display: flex; flex-direction: column; padding: 16px; }

/* waiting / watch screen */
.watch { flex: 1; display: grid; place-items: center; text-align: center; gap: 10px; }
.watch .big { font-size: 3.2rem; }
.watch .msg { font-size: 1.3rem; font-weight: 600; opacity: .92; }
.watch .sub { opacity: .7; }

/* QUIZ answer buttons */
.q-prompt { text-align: center; font-weight: 700; font-size: 1.05rem; opacity: .85; margin-bottom: 12px; }
.ans-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans {
  border: none; border-radius: 18px; color: #fff; font-family: var(--font);
  font-weight: 700; font-size: 1.05rem; padding: 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s, opacity .25s, filter .25s; min-height: 22vh;
}
.ans .ico { font-size: 2rem; }
.ans:active { transform: scale(.97); }
.ans.a0 { background: var(--a0); }
.ans.a1 { background: var(--a1); }
.ans.a2 { background: var(--a2); }
.ans.a3 { background: var(--a3); }
.ans.dim { opacity: .3; filter: grayscale(.5); }
.ans.chosen { outline: 5px solid #fff; }
.ans:disabled { cursor: default; }

/* result */
.result { flex: 1; display: grid; place-items: center; text-align: center; gap: 6px; }
.result .emoji { font-size: 4rem; }
.result .headline { font-size: 1.8rem; font-weight: 800; }
.result .pts { font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.result.correct .headline { color: #7ef0b0; }
.result.wrong .headline { color: #ff9ab0; }
.psrc { margin-top: 14px; font-size: .8rem; opacity: .9; padding: 0 16px; }
.psrc a { color: #cdd9ff; text-decoration: underline; }

/* SIM */
.sim-p { display: flex; flex-direction: column; gap: 12px; }
.sim-p .budget-bar { position: sticky; top: 0; background: rgba(8,18,34,.8); padding: 10px; border-radius: 14px; text-align: center; font-weight: 800; }
.sim-p .budget-bar.over { color: #ff9ab0; }
.iv-pick {
  display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.08);
  border: 2px solid transparent; border-radius: 14px; padding: 12px 14px; cursor: pointer;
}
.iv-pick.on { border-color: var(--accent); background: rgba(24,194,156,.16); }
.iv-pick .nm { font-weight: 700; }
.iv-pick .ds { font-size: .85rem; opacity: .8; }
.iv-pick .cost { margin-left: auto; font-weight: 800; color: var(--gold); white-space: nowrap; }
.iv-pick .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid rgba(255,255,255,.4); display: grid; place-items: center; flex: none; }
.iv-pick.on .box { background: var(--accent); border-color: var(--accent); }
.sim-submit { position: sticky; bottom: 0; padding-top: 8px; }

/* leaderboard (player) */
.lb-p { flex: 1; display: grid; place-items: center; text-align: center; gap: 10px; }
.lb-p .rankbig { font-size: 4rem; font-weight: 800; color: var(--gold); }
.lb-p .top3 { display: grid; gap: 8px; margin-top: 10px; width: min(360px,100%); }
.lb-p .top3 .r { background: rgba(255,255,255,.1); border-radius: 12px; padding: 10px 14px; display: flex; gap: 10px; }
.lb-p .top3 .r .sc { margin-left: auto; font-weight: 800; color: var(--gold); }
