/* CALLED OUT — styles. Mobile-first, portrait-first, 48px tap targets,
   themed popups only (no native grey menus). Edition skin via --ec. */
:root {
  --ec: #e94f64;
  --ink: #241a1e;
  --bg: #fff8f6;
  --card: #ffffff;
  --muted: #6b5a60;
  --plum: #2b0f1e;
  --pink: #ff6b9d;
  --radius: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); }
button { font-family: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
h1 { font-size: 1.7rem; margin: .4rem 0; }
h2 { font-size: 1.2rem; margin: 1.1rem 0 .4rem; }
h3 { font-size: 1.05rem; margin: .8rem 0 .3rem; }
.hint { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.warn { color: #9a6700; }
.error { color: #b91c1c; font-weight: 600; }
.fineprint { color: var(--muted); font-size: .8rem; line-height: 1.5; text-align: center; padding: 0 1rem; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: .6rem .9rem; position: sticky; top: 0; background: var(--bg); z-index: 20; }
.brand { font-weight: 900; letter-spacing: .12em; color: var(--ec); font-size: 1.05rem; }
.icon-btn { min-width: 48px; min-height: 48px; font-size: 1.3rem; background: none; border: none; border-radius: 12px; }
.icon-btn:active { background: #0001; }

.screen { padding: .4rem 1rem 2.5rem; }

/* buttons */
.big-btn {
  display: block; width: 100%; min-height: 56px; margin: .55rem 0; padding: .8rem 1rem;
  font-size: 1.12rem; font-weight: 800; border-radius: 16px; border: 2px solid var(--ec);
  background: #fff; color: var(--ec);
}
.big-btn.primary { background: var(--ec); color: #fff; border-color: var(--ec); box-shadow: 0 4px 0 color-mix(in srgb, var(--ec) 70%, #000); }
.big-btn:active { transform: translateY(2px); box-shadow: none; }
.small-btn {
  min-height: 48px; padding: .6rem 1rem; font-size: 1rem; font-weight: 700;
  border-radius: 12px; border: 2px solid var(--ec); background: #fff; color: var(--ec);
}
.mini-btn { min-height: 40px; padding: .35rem .7rem; font-size: .9rem; font-weight: 700; border-radius: 10px; border: 1.5px solid var(--ec); background: #fff; color: var(--ec); }
.chip-btn {
  min-height: 48px; padding: .55rem .9rem; margin: .2rem; font-size: .98rem; font-weight: 700;
  border-radius: 999px; border: 2px solid #d8cdd2; background: #fff; color: var(--ink);
}
.chip-btn.sel { background: var(--ec); border-color: var(--ec); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: .1rem; margin: .3rem 0; }
.check { display: flex; align-items: center; gap: .6rem; min-height: 48px; font-size: 1rem; font-weight: 600; }
.check input { width: 24px; height: 24px; accent-color: var(--ec); }
.text-input {
  width: 100%; min-height: 52px; padding: .7rem .9rem; margin: .35rem 0; font-size: 1.05rem;
  border: 2px solid #d8cdd2; border-radius: 14px; background: #fff; color: var(--ink);
}
.text-input:focus { outline: 3px solid var(--ec); outline-offset: 1px; border-color: var(--ec); }
.field-row { margin: .7rem 0; }
.field-row > label { font-weight: 800; display: block; margin-bottom: .2rem; }

/* home */
.logo-block { text-align: center; padding: 1.2rem 0 .4rem; }
.logo {
  font-size: 3.4rem; font-weight: 900; line-height: .95; letter-spacing: .02em;
  color: var(--ec); text-shadow: 3px 3px 0 #ffd166;
}
.tagline { font-size: 1.1rem; color: var(--muted); margin: .6rem 0 1rem; }
.ed-strip { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.ed-chip { border: 2px solid; border-radius: 999px; padding: .3rem .7rem; font-weight: 800; font-size: .85rem; background: #fff; }
.home-actions { margin-top: 1.2rem; }
.home-row { display: flex; gap: .5rem; justify-content: center; margin-top: .4rem; }

/* edition picker */
.ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ed-card {
  text-align: left; padding: .8rem; border-radius: 16px; border: 3px solid var(--ec);
  background: #fff; min-height: 96px; display: flex; flex-direction: column; gap: .15rem;
}
.ed-card.sel { background: var(--ec); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--ec) 70%, #000); }
.ed-card.sel .ed-ages, .ed-card.sel .ed-promise { color: #fff; }
.ed-name { font-weight: 900; font-size: 1.05rem; }
.ed-ages { font-size: .8rem; font-weight: 700; opacity: .75; }
.ed-promise { font-size: .82rem; line-height: 1.3; opacity: .85; }
.gate-box { background: #fff3cd; border: 2px solid #e0a800; border-radius: 14px; padding: .7rem .9rem; margin: .6rem 0; }

/* profiles */
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; margin: .4rem 0; }
.avatar-pick { min-width: 48px; min-height: 48px; font-size: 1.6rem; border-radius: 50%; border: 3px solid transparent; padding: 0; }
.avatar-pick.sel { border-color: var(--ec); transform: scale(1.12); }
.photo-btn { display: inline-flex; min-height: 48px; align-items: center; padding: .5rem .9rem; border: 2px dashed var(--ec); border-radius: 12px; font-weight: 700; color: var(--ec); cursor: pointer; }
.photo-preview { display: flex; align-items: center; gap: .7rem; margin: .4rem 0; }
.bio-count { text-align: right; color: var(--muted); font-size: .85rem; }
.face { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.9rem; overflow: hidden; flex: none; }
.face.photo img { width: 100%; height: 100%; object-fit: cover; }

/* join */
.pin-display { font-size: 2.6rem; font-weight: 900; letter-spacing: .35em; text-align: center; margin: 1rem 0; font-variant-numeric: tabular-nums; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; max-width: 340px; margin: 0 auto; }
.key { min-height: 64px; font-size: 1.6rem; font-weight: 800; border-radius: 16px; border: 2px solid #d8cdd2; background: #fff; }
.key.go { background: var(--ec); color: #fff; border-color: var(--ec); }

/* lobby */
.lobby-head { text-align: center; }
.ed-badge { display: inline-block; color: #fff; font-weight: 900; letter-spacing: .1em; padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; }
.pin-box { text-align: center; background: #fff; border: 3px dashed var(--ec); border-radius: var(--radius); padding: 1rem; margin: .8rem 0; }
.pin-label { font-size: .8rem; font-weight: 800; letter-spacing: .2em; color: var(--muted); }
.pin-big { font-size: 3rem; font-weight: 900; letter-spacing: .25em; }
.pin-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .5rem; }
.player-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.lobby-face { background: #fff; border: 2px solid #eee; border-radius: 16px; padding: .6rem .3rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; min-height: 110px; }
.lf-name { font-weight: 800; font-size: .95rem; }
.lf-team { color: #fff; font-size: .72rem; font-weight: 800; padding: .15rem .5rem; border-radius: 999px; }
.custom-box { background: #fff; border-radius: var(--radius); padding: .9rem; margin: 1rem 0; }
.custom-row { display: flex; gap: .5rem; }
.custom-row .text-input { flex: 1; }
.approve-queue { margin-top: .7rem; }
.queue-item { display: flex; gap: .5rem; align-items: center; justify-content: space-between; background: #f7f2f3; border-radius: 10px; padding: .5rem .6rem; margin: .35rem 0; }
.queue-item span { flex: 1; }

/* game chrome */
.game-top { display: flex; align-items: center; gap: .6rem; margin: .3rem 0 .6rem; }
.round-label { font-weight: 800; }
.timer-ring {
  margin-left: auto; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.2rem; color: #fff; background: conic-gradient(var(--ec) calc(var(--p, 100) * 1%), #e5dfe1 0);
}
.timer-ring span { background: var(--plum); width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.timer-ring.urgent span { background: #b91c1c; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
.hype-meter { display: flex; align-items: center; gap: .5rem; margin: .2rem 0 .6rem; }
.hype-bar { flex: 1; height: 10px; background: #eee; border-radius: 999px; overflow: hidden; }
.hype-bar div { height: 100%; background: linear-gradient(90deg, #ffb703, #ff6b9d, #e94f64); transition: width .5s; }
.host-line {
  display: flex; gap: .6rem; align-items: flex-start; background: var(--plum); color: #fff;
  border-radius: 16px; padding: .8rem .9rem; margin: .5rem 0; font-size: 1rem; line-height: 1.4;
}
.host-ava { font-size: 1.4rem; }
.host-line .mini-btn { margin-left: auto; border-color: #fff; color: #fff; background: transparent; }
.conn-banner { background: #fff3cd; border: 2px solid #e0a800; border-radius: 10px; padding: .5rem .8rem; text-align: center; font-weight: 700; margin: .4rem 0; }

/* cards + flip */
.deck-row { display: flex; justify-content: space-between; align-items: center; margin: .4rem 0; }
.mini-deck { font-weight: 800; }
.flip-stage { perspective: 900px; margin: 1rem 0; }
.card {
  background: #fff; border-radius: 24px; border: 3px solid var(--ec); padding: 1.2rem;
  min-height: 300px; display: flex; flex-direction: column; box-shadow: 0 10px 24px #0002;
}
.card.flip-in { animation: flipIn .9s cubic-bezier(.2, .7, .3, 1.2); transform-style: preserve-3d; }
@keyframes flipIn {
  0% { transform: rotateY(90deg) scale(.85); opacity: 0; }
  60% { transform: rotateY(-8deg) scale(1.03); opacity: 1; }
  100% { transform: rotateY(0) scale(1); }
}
.card-band { font-weight: 900; letter-spacing: .12em; color: var(--ec); font-size: .85rem; }
.card-type { font-weight: 900; font-size: 1rem; color: var(--muted); margin-top: .4rem; }
.card-text { font-size: 1.55rem; font-weight: 800; line-height: 1.25; margin: auto 0; text-align: center; }
.card-custom { text-align: center; color: var(--muted); font-size: .85rem; }
.card-mini { background: #fff; border: 2px solid var(--ec); border-radius: 18px; padding: .9rem 1rem; margin: .6rem 0; }
.card-mini .card-text { font-size: 1.25rem; margin: .3rem 0; }
.twist-announce { text-align: center; padding: 1rem 0; }
.twist-burst { font-size: 2.6rem; font-weight: 900; animation: burst 1s ease infinite alternate; }
@keyframes burst { to { transform: scale(1.08) rotate(-2deg); } }
.twist-tag { background: #ffe08a; border: 2px solid #e0a800; border-radius: 12px; padding: .5rem; font-weight: 800; text-align: center; margin: .4rem 0; }

/* voting */
.vote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .7rem 0; }
.vote-cell { position: relative; }
.vote-face {
  width: 100%; background: #fff; border: 2px solid #eee; border-radius: 16px; padding: .6rem .2rem;
  display: flex; flex-direction: column; align-items: center; gap: .25rem; min-height: 108px;
}
.vote-face.picked { border-color: var(--ec); background: color-mix(in srgb, var(--ec) 12%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ec) 35%, transparent); }
.vf-name { font-weight: 800; font-size: .92rem; }
.vf-team { color: #fff; font-size: .68rem; font-weight: 800; padding: .1rem .45rem; border-radius: 999px; }
.bio-dot { position: absolute; top: 4px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: none; background: #00000010; font-size: 1rem; }
.vote-progress { margin: .6rem 0; font-weight: 700; }
.vp-bar { height: 10px; background: #eee; border-radius: 999px; overflow: hidden; margin-top: .3rem; }
.vp-bar div { height: 100%; background: var(--ec); transition: width .4s; }
.yn-row { display: flex; gap: .6rem; margin: .8rem 0; }
.yn-btn { flex: 1; min-height: 64px; font-size: 1.2rem; font-weight: 900; border-radius: 16px; border: 3px solid; background: #fff; }
.yn-btn.yes { border-color: #0e7a3d; color: #0e7a3d; }
.yn-btn.no { border-color: #b91c1c; color: #b91c1c; }
.yn-btn.sel.yes { background: #0e7a3d; color: #fff; }
.yn-btn.sel.no { background: #b91c1c; color: #fff; }
.yn-result { display: flex; gap: .6rem; margin: .8rem 0; }
.yn-count { flex: 1; text-align: center; font-weight: 900; font-size: 1.2rem; padding: .8rem; border-radius: 14px; }
.yn-count.yes { background: #eaf7ee; color: #0e7a3d; }
.yn-count.no { background: #fdf0f0; color: #b91c1c; }
.opt-list { display: flex; flex-direction: column; gap: .55rem; margin: .8rem 0; }
.opt-btn { min-height: 56px; font-size: 1.1rem; font-weight: 800; border-radius: 14px; border: 2px solid var(--ec); background: #fff; color: var(--ink); padding: .6rem; }
.opt-btn.sel { background: var(--ec); color: #fff; }
.spotlight-big { font-size: 3rem; text-align: center; }
.km-answer { background: #fff3cd; border: 2px solid #e0a800; border-radius: 14px; padding: .9rem; font-size: 1.15rem; text-align: center; margin: .7rem 0; }
.waiting-dots span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--ec); margin: 0 3px; animation: bounce 1s infinite; }
.waiting-dots span:nth-child(2) { animation-delay: .15s; }
.waiting-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-8px); } }
.duel-faces { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: .6rem; }
.vs { font-weight: 900; font-size: 1.3rem; color: var(--ec); }
.duel-result { display: flex; align-items: center; justify-content: space-around; margin: .8rem 0; }
.duelist { display: flex; flex-direction: column; align-items: center; gap: .4rem; font-weight: 800; opacity: .6; }
.duelist.win { opacity: 1; }
.duelist.win .face { box-shadow: 0 0 0 4px gold; }

/* reveal */
.bars { margin: .8rem 0; }
.bar-row { display: flex; align-items: center; gap: .6rem; margin: .45rem 0; background: #fff; border-radius: 12px; padding: .4rem .6rem; }
.bar-row.winner { border: 2px solid gold; background: #fffbe6; }
.bar-name { font-weight: 800; min-width: 74px; }
.bar-track { flex: 1; height: 16px; background: #f0e8ea; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--ec); border-radius: 999px; animation: growBar .8s ease; }
@keyframes growBar { from { width: 0 !important; } }
.bar-count { font-weight: 900; min-width: 24px; text-align: right; }
.crown-banner, .tie-banner, .unanimous {
  text-align: center; font-size: 1.25rem; font-weight: 900; padding: .9rem; border-radius: 16px; margin: .6rem 0;
  background: #fffbe6; border: 2px solid gold;
}
.unanimous { background: var(--plum); color: #fff; border-color: gold; animation: burst 1s ease infinite alternate; }
.tie-banner { background: #eef4ff; border-color: #2563eb; }
.crown-banner span, .tie-banner span, .unanimous span { font-size: 1rem; font-weight: 600; }
.who-voted { margin: .6rem 0; background: #fff; border-radius: 12px; padding: .6rem .8rem; }
.who-voted summary { font-weight: 800; cursor: pointer; min-height: 32px; }
.wv-row { padding: .25rem 0; border-top: 1px solid #f0e8ea; }
.reaction-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .8rem 0 .3rem; }
.react-btn { min-height: 56px; font-size: 1rem; font-weight: 800; border-radius: 14px; border: 2px solid #d8cdd2; background: #fff; }
.react-btn:active { background: var(--ec); color: #fff; border-color: var(--ec); }
.reaction-counts { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .9rem; color: var(--muted); }
.guilty-row { display: flex; gap: .6rem; margin: .6rem 0; }
.bluff-reveal { background: #f3eefe; border-radius: 14px; padding: .8rem; margin: .7rem 0; }
.bluff-line { padding: .3rem 0; border-top: 1px solid #e2d9f5; }

/* stakes / wheel */
.stakes-card { background: #fff; border: 3px solid var(--ec); border-radius: 24px; padding: 1.2rem; min-height: 220px; display: flex; flex-direction: column; }
.wheel { position: relative; width: 260px; height: 260px; margin: 1rem auto; border-radius: 50%; border: 6px solid var(--plum); overflow: hidden; display: flex; flex-wrap: wrap; }
.wheel-seg { flex: 1 1 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.05rem; color: #fff; }
.wheel-seg.q { background: #2563eb; }
.wheel-seg.g { background: #e94f64; }
.wheel-seg.c { background: #0e7a3d; }
.wheel-pointer { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); font-size: 2rem; }
.gossip-lines { margin: .7rem 0; }
.gossip-line { background: #fff; border-left: 4px solid var(--ec); border-radius: 8px; padding: .6rem .8rem; margin: .4rem 0; font-size: 1.05rem; }
.pass-screen, .voter-pick { text-align: center; padding: 1.5rem 0; }
.pass-big { font-size: 4rem; }

/* leaderboard / awards */
.leaderboard .bar-row { padding: .6rem; }
.team-dot { width: 20px; height: 20px; border-radius: 50%; flex: none; }
.awards-show { position: relative; text-align: center; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.award-card { background: #fff; border: 3px solid gold; border-radius: 24px; padding: 1.4rem 1rem; margin: 1rem 0; box-shadow: 0 10px 24px #0002; }
.award-title { font-size: 1.5rem; font-weight: 900; margin-bottom: .6rem; }
.award-winner h3 { margin: .4rem 0; font-size: 1.4rem; }
.award-stat { font-weight: 800; color: var(--ec); font-size: 1.1rem; }
.mvp-ladder { background: #fffbe6; border-radius: 12px; padding: .7rem; margin: .6rem 0; }
.team-champs { background: #eaf7ee; border-radius: 12px; padding: .7rem; margin: .6rem 0; font-size: 1.1rem; }

/* recap */
.recap-canvas { width: 100%; max-width: 320px; display: block; margin: .8rem auto; border-radius: 16px; border: 2px solid var(--ec); }
.recap-actions { display: flex; flex-direction: column; gap: .2rem; }
.sv-panel { background: #fff; border: 2px solid var(--ec); border-radius: 18px; padding: .9rem; margin: 1rem 0; }
.sv-card { display: flex; justify-content: space-between; align-items: center; gap: .6rem; border-top: 1px solid #f0e8ea; padding: .6rem 0; }
.sv-code { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: .08em; }

/* modals + toast */
.modal-veil { position: fixed; inset: 0; background: #000a; display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 24px 24px 0 0; padding: 1.2rem 1.2rem 2rem; max-width: 520px; width: 100%; max-height: 85vh; overflow-y: auto; }
.modal h2 { margin-top: 0; }
.bio-pop { text-align: center; }
.bio-text { font-size: 1.2rem; font-style: italic; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--plum); color: #fff;
  padding: .8rem 1.2rem; border-radius: 999px; font-weight: 700; opacity: 0; transition: all .25s; z-index: 100;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.pp-list { margin-top: .6rem; }
.pp-item { display: flex; align-items: center; gap: .6rem; background: #fff; border-radius: 12px; padding: .5rem .7rem; margin: .35rem 0; }
.pp-item span { flex: 1; }
.team-setup { background: #fff; border-radius: 14px; padding: .7rem; margin: .5rem 0; }

/* reduced motion: animation becomes a quick fade */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .card.flip-in { animation: fadeIn .2s ease; }
  @keyframes fadeIn { from { opacity: 0; } }
}
@media (min-width: 560px) {
  .modal-veil { align-items: center; }
  .modal { border-radius: 24px; }
}
