/* Pawzzler: a game show in space. Dark purple and gold, big friendly buttons in the four answer colors. */
:root { --a: #ff4d6d; --b: #3a86ff; --c: #ffbe0b; --d: #2ec4b6; --ink: #2b2160; --gold: #ffd166; --panel: rgba(31, 22, 74, 0.92); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #150b2e; color: #fff; font-family: Fredoka, system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; font-weight: 600; cursor: pointer; border: none; border-radius: 14px; padding: 10px 18px; background: var(--gold); color: var(--ink); }
button:disabled { opacity: 0.45; cursor: default; }
button.alt { background: rgba(255, 255, 255, 0.14); color: #fff; }
button.pink { background: #ff5d8f; color: #fff; }
button.big { font-size: 22px; padding: 14px 26px; border-radius: 18px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); }

/* name tags, speech bubbles (laid over the 3D view) */
#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
#tags > * { transition: opacity 0.25s; } #tags.hush > * { opacity: 0; } /* (while "Cashed out!" shows: game.js) */
body:has(#menu:not(.hidden)) #tags { visibility: hidden; } /* (the start card is up: your name tag poked out from behind it on a phone. UAT, 2026-10-23) */
.ntag { position: absolute; left: 0; top: 0; font-size: 12px; font-weight: 600; background: rgba(20, 12, 50, 0.72); border-radius: 9px; padding: 2px 7px; white-space: nowrap; }
.ntag b { color: var(--ink); background: var(--gold); border-radius: 6px; padding: 0 4px; margin-right: 4px; font-size: 10px; }
.ntag.me { background: rgba(255, 209, 102, 0.95); color: var(--ink); font-size: 13px; }
.ntag.me b { background: var(--ink); color: var(--gold); }
.ntag.npc span::after { content: ' 🤖'; font-size: 10px; }
.ntag[data-mark]:not([data-mark=''])::before { content: attr(data-mark); margin-right: 3px; }
.bubble { position: absolute; left: 0; top: 0; background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; border-radius: 14px; padding: 4px 10px; white-space: nowrap; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; }
#qzsay { position: fixed; left: 0; top: 0; z-index: 3; max-width: min(340px, 44vw); background: #fff; color: var(--ink); font-weight: 600; font-size: 16px; line-height: 1.25; border-radius: 16px; padding: 8px 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); border: 3px solid var(--gold); pointer-events: none; transition: opacity 0.25s; }
#qzsay::after { content: ''; position: absolute; right: 26px; bottom: -11px; border: 10px solid transparent; border-top-color: var(--gold); border-bottom: 0; }
#qzsay.off { opacity: 0; }
#qzsay.front { z-index: 9; } /* (over the start menu, only when there's no room beside it: game.js) */

/* top bar: buttons on the left, the question card in the middle, emotes + timer on the right (a flex row, so the card
   can never end up under a button) */
#top { position: fixed; top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); z-index: 5; display: flex; align-items: flex-start; gap: 8px; pointer-events: none; }
#top > * { pointer-events: auto; }
.tb { display: flex; gap: 8px; flex: none; width: 112px; } .tb.right { justify-content: flex-end; align-items: flex-start; }
.round-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--panel); color: #fff; font-size: 20px; border: 2px solid rgba(255, 255, 255, 0.2); }
#qcard { flex: 1; min-width: 0; max-width: 880px; margin: 0 auto; background: var(--panel); border: 3px solid var(--gold); border-radius: 18px; padding: 7px 16px 10px; text-align: center; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4); }
.qhead { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; color: var(--gold); margin-bottom: 3px; }
#q-text { font-size: clamp(18px, 2.4vw, 30px); font-weight: 600; line-height: 1.22; color: #fff; }
#q-text small { display: block; font-size: 0.6em; font-weight: 400; opacity: 0.85; margin-top: 2px; }
#q-ans { margin-top: 6px; font-size: clamp(16px, 2vw, 24px); font-weight: 700; color: #7dff9a; }
#emotes { position: relative; } #emotes .list { position: absolute; top: 50px; right: 0; display: flex; flex-direction: column; gap: 4px; }
#emotes .list button { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 22px; background: var(--panel); border: 2px solid rgba(255, 255, 255, 0.2); }
#timer { width: 62px; height: 62px; position: relative; flex: none; }
#timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#timer .bg { stroke: rgba(255, 255, 255, 0.15); } #timer .fg { stroke: var(--gold); transition: stroke 0.3s; }
#timer.hurry .fg { stroke: #ff4d6d; } #timer.hurry { animation: beat 0.5s ease-in-out infinite; }
#timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
@keyframes beat { 50% { scale: 1.12; } }

/* the prize ladder */
#ladder { position: fixed; right: max(8px, env(safe-area-inset-right)); top: 50%; translate: 0 -50%; z-index: 4; background: var(--panel); border-radius: 16px; padding: 6px; border: 2px solid rgba(255, 209, 102, 0.5); font-size: 13px; }
#ladder div { padding: 2px 10px; border-radius: 8px; display: flex; justify-content: space-between; gap: 10px; color: rgba(255, 255, 255, 0.6); }
#ladder div.now { background: var(--gold); color: var(--ink); font-weight: 700; }
#ladder div.mine { color: #7dff9a; } #ladder div.mine::after { content: '✓'; }
#ladder div.top { color: var(--gold); }

/* the answers */
#answers { position: fixed; left: 50%; translate: -50% 0; bottom: max(8px, env(safe-area-inset-bottom)); width: min(980px, calc(100vw - 16px)); z-index: 5; display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; justify-content: center; }
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex: 1; min-width: 0; }
.choice { display: flex; align-items: center; gap: 8px; text-align: left; color: #fff; font-size: 15px; line-height: 1.15; padding: 6px 8px; border-radius: 14px; border: 3px solid rgba(255, 255, 255, 0.25); min-height: 48px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); overflow: hidden; }
.choice > span:last-child { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.choice .l { flex: none; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.95); display: grid; place-items: center; font-weight: 700; font-size: 19px; }
.choice[data-k='0'] { background: var(--a); } .choice[data-k='0'] .l { color: var(--a); }
.choice[data-k='1'] { background: var(--b); } .choice[data-k='1'] .l { color: var(--b); }
.choice[data-k='2'] { background: #e0a500; } .choice[data-k='2'] .l { color: #c48f00; }
.choice[data-k='3'] { background: var(--d); } .choice[data-k='3'] .l { color: #1f9e93; }
.choice.sel { border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55), 0 4px 0 rgba(0, 0, 0, 0.3); scale: 1.03; }
.choices.locked .choice:not(.sel) { opacity: 0.35; }
.lockrow { display: flex; gap: 10px; align-items: center; justify-content: center; }
.lockrow:has(#lockmsg:not(.hidden)) { flex-basis: 100%; order: -1; }
#lock { font-size: 18px; padding: 8px 18px; background: var(--gold); box-shadow: 0 5px 0 #b8860b; white-space: nowrap; }
#lock:not(:disabled) { animation: glowy 1.2s ease-in-out infinite; }
@keyframes glowy { 50% { box-shadow: 0 5px 0 #b8860b, 0 0 22px rgba(255, 209, 102, 0.9); } }
#lockmsg { background: var(--panel); border-radius: 12px; padding: 7px 14px; font-size: 15px; }

/* decide: cash out or keep going */
#decide { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 6; width: min(560px, calc(100vw - 20px)); background: var(--panel); border: 3px solid var(--gold); border-radius: 22px; padding: 14px 16px; text-align: center; animation: pop 0.4s cubic-bezier(.2, 1.5, .4, 1); }
#decide h2 { margin: 0 0 4px; font-size: 24px; color: var(--gold); } #decide p { margin: 0 0 12px; font-size: 15px; opacity: 0.9; }
#decide .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#decide .bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); margin-top: 12px; overflow: hidden; } #decide .bar i { display: block; height: 100%; background: var(--gold); width: 100%; }
/* Keep going: big and green (Dylan wants players to keep playing). Cash out: smaller and pink. */
#b-risk { background: linear-gradient(#3ee07a, #1fb35a); color: #fff; box-shadow: 0 6px 0 #158a43, 0 0 22px rgba(62, 224, 122, 0.55); font-size: 26px; padding: 16px 30px; animation: go-pulse 1.3s ease-in-out infinite; }
#b-cash { background: #ff5d8f; color: #fff; box-shadow: 0 4px 0 #b33a62; font-size: 15px; padding: 9px 16px; align-self: center; }
@keyframes go-pulse { 50% { scale: 1.05; } }
#decide .row { align-items: center; }
.wheel-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; } .wheel-btns .b-save { background: #ff5d8f; color: #fff; box-shadow: 0 5px 0 #b33a62; font-size: 18px; }
@keyframes pop { from { opacity: 0; scale: 0.85; } to { opacity: 1; scale: 1; } }

/* big banner messages */
#banner { position: fixed; left: 50%; top: 38%; translate: -50% -50%; z-index: 7; width: max-content; max-width: calc(100vw - 32px); font-size: clamp(28px, 6vw, 58px); font-weight: 700; line-height: 1.1;
  text-align: center; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 30px rgba(255, 209, 102, 0.6); pointer-events: none; overflow-wrap: anywhere; }
#banner small { display: block; font-size: max(16px, 0.42em); font-weight: 600; margin-top: 4px; line-height: 1.25;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 0, 0, 0.7); } /* (the line under "Correct!" was hard to read over the contestants: a tighter, darker shadow) */
#spectate { position: fixed; left: 50%; translate: -50% 0; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 5; width: max-content; max-width: calc(100vw - 20px);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; background: var(--panel); border: 2px solid rgba(255, 209, 102, 0.6); border-radius: 18px; padding: 8px 10px 8px 16px; font-size: 16px; }
#spectate button { padding: 8px 14px; }
#banner.show { animation: bannerIn 2.6s ease both; }
#banner.good { color: #7dff9a; } #banner.bad { color: #ff7b8a; } #banner.gold { color: var(--gold); }
@keyframes bannerIn { 0% { opacity: 0; scale: 0.4; } 12% { opacity: 1; scale: 1.15; } 20% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; scale: 1.05; } }
#flash { position: fixed; inset: 0; z-index: 6; pointer-events: none; background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.75)); opacity: 0; transition: opacity 0.6s; }
#flash.on { opacity: 1; }

/* windows: menu, lobby, game over, prize wheel */
.panel { position: fixed; z-index: 8; background: var(--panel); border: 3px solid rgba(255, 209, 102, 0.6); border-radius: 24px; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45); }
#menu { left: 50%; top: 50%; translate: -50% -50%; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; padding: 22px; text-align: center; }
.logo { font-size: clamp(36px, 8vw, 60px); font-weight: 700; letter-spacing: 2px; margin: 0; line-height: 1; white-space: nowrap;
  background: linear-gradient(180deg, #fff6c8, #ffd166 45%, #ff9f43); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #7a3cff); }
.title { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.title .hat { font-size: clamp(30px, 6vw, 46px); display: inline-block; animation: wob 1.6s ease-in-out infinite; }
@keyframes wob { 50% { rotate: 10deg; } }
.sub { margin: 8px 0 16px; opacity: 0.85; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.grades button { padding: 14px 4px; font-size: 20px; background: rgba(255, 255, 255, 0.12); color: #fff; border: 3px solid transparent; }
.grades button small { display: block; font-size: 12px; opacity: 0.8; font-weight: 400; }
.grades button.on { background: var(--gold); color: var(--ink); }
.note { font-size: 13px; opacity: 0.8; margin-top: 10px; line-height: 1.35; }
.msg { margin-top: 10px; font-size: 14px; color: var(--gold); min-height: 1em; }
a.home { color: rgba(255, 255, 255, 0.75); font-size: 14px; display: inline-block; margin-top: 12px; }
#lobby { left: max(12px, env(safe-area-inset-left)); top: 66px; bottom: 12px; width: min(380px, calc(100vw - 24px)); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
#lobby h2 { margin: 0; font-size: 22px; color: var(--gold); display: flex; align-items: center; gap: 8px; }
#lobby .scroll { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
#lobby h3 { margin: 4px 0 2px; font-size: 15px; opacity: 0.85; }
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seat { background: rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 6px 9px; font-size: 14px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.seat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.me { background: rgba(255, 209, 102, 0.25); } .seat.bot { opacity: 0.55; }
.pal { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 6px 8px; }
.pal img { width: 34px; height: 34px; border-radius: 50%; background: #fff3c4; }
.pal .n { flex: 1; font-size: 14px; } .pal .n small { display: block; opacity: 0.7; font-size: 12px; }
.pal .dot { width: 10px; height: 10px; border-radius: 50%; background: #666; flex: none; } .pal .dot.on { background: #4cff7a; box-shadow: 0 0 8px #4cff7a; }
.pal button { padding: 6px 12px; font-size: 14px; }
button.rn { background: none; padding: 0 4px; font-size: 13px; vertical-align: middle; } .seat button.rn { margin-left: auto; }
.lobby-foot { display: flex; gap: 8px; } .lobby-foot button { flex: 1; }
#over { left: 50%; top: 50%; translate: -50% -50%; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; padding: 18px; text-align: center; }
#over h2 { margin: 0 0 6px; color: var(--gold); font-size: 28px; }
/* (a tall prize wheel on a short screen scrolls: Play again and Home stay in sight at the bottom) */
#over .over-btns { position: sticky; bottom: -18px; margin: 10px -18px 0; padding: 10px 18px 14px; background: rgb(31, 22, 74); } /* (no negative bottom margin: on an iPad the standings come after it and slid under it) */
.standings { text-align: left; display: grid; gap: 4px; margin: 10px 0; }
.standings div { display: flex; justify-content: space-between; gap: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 5px 10px; font-size: 14px; }
.standings div.me { background: rgba(255, 209, 102, 0.3); }
.wheelbox { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wheelbox canvas { width: min(300px, 70vw, 52vh); height: auto; aspect-ratio: 1; }
.wheelbox .won { font-size: 20px; font-weight: 700; color: var(--gold); min-height: 1.3em; }
.over-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

#rotate { position: fixed; inset: auto 10px 10px 10px; z-index: 9; background: var(--panel); border-radius: 14px; padding: 8px 12px; font-size: 14px; text-align: center; display: none; }
@media (orientation: portrait) and (max-width: 600px) { body:not([data-phase]) #rotate { display: block; } } /* (only on the menu: in a show it would cover buttons) */

/* small screens (phones turned sideways): tighter, and the question also shows under the big screen */
@media (max-height: 540px) {
  #banner { font-size: 30px; top: 46%; } #spectate { font-size: 14px; padding: 5px 8px 5px 12px; } #spectate button { padding: 6px 10px; }
    .choice { font-size: 14px; min-height: 40px; padding: 5px 8px; border-radius: 12px; } .choice .l { width: 26px; height: 26px; font-size: 15px; }
  .choices { gap: 5px; } #lock { font-size: 16px; padding: 7px 14px; }
  #ladder { display: none; } #timer { width: 48px; height: 48px; } #timer span { font-size: 17px; }
  #menu { padding: 12px 16px; } #menu .sub { margin: 4px 0 6px; font-size: 14px; } .grades { margin: 6px 0; } .grades button { padding: 8px 4px; font-size: 17px; }
  #menu .note { font-size: 12px; margin-top: 6px; } #menu .big { font-size: 18px; padding: 10px 22px; } #over h2 { font-size: 22px; }
  #over { width: min(640px, calc(100vw - 24px)); padding: 12px 16px; }
  .wheelbox { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; text-align: left; justify-items: start; }
  .wheelbox canvas { grid-column: 1; grid-row: 1 / span 4; width: min(210px, 52vh); } .wheelbox > :not(canvas) { grid-column: 2; }
  body[data-phase='reveal'] #answers { display: none !important; } /* (the big screen shows the answer; the platforms need the room) */
  #lobby { top: 58px; width: min(340px, 48vw); } #qzsay { font-size: 13px; max-width: 40vw; }
  .round-btn { width: 38px; height: 38px; font-size: 17px; } #decide { padding: 8px 10px; width: min(480px, calc(100vw - 20px)); } #decide h2 { font-size: 18px; } #decide p { margin-bottom: 6px; font-size: 12px; }
  #decide #b-risk { font-size: 19px; padding: 10px 20px; } #decide #b-cash { font-size: 13px; padding: 7px 12px; } #decide .bar { margin-top: 8px; }
  .wheel-btns .big { font-size: 15px; padding: 9px 14px; }
  #over .over-btns { bottom: -12px; margin: 6px -16px 0; padding: 8px 16px 10px; } #over .over-btns .big { font-size: 18px; padding: 9px 18px; }
  /* (the lobby on a phone held sideways: smaller heading and buttons, so the players list has room instead of a sliver) */
  #lobby { gap: 6px; padding: 10px 12px; } #lobby h2 { font-size: 18px; } .lobby-foot .big { font-size: 16px; padding: 8px 10px; white-space: nowrap; } .lobby-foot .alt { padding: 8px 10px; }
  #lobby h3 { margin: 2px 0 1px; font-size: 13px; } #lobby .grades { margin: 2px 0 !important; gap: 6px; } #lobby .grades button { padding: 5px 4px; font-size: 15px; }
  #lobby .seat { padding: 4px 8px; font-size: 13px; } #lobby .seats { gap: 4px; }
}
@media (max-width: 700px) { #ladder { display: none; } .choices { grid-template-columns: 1fr 1fr; } .lockrow { flex-basis: 100%; } }
/* narrow phones held upright: the card gets its own full-width row under the buttons */
@media (max-width: 600px) { #top { flex-wrap: wrap; } #qcard { order: 3; flex-basis: 100%; } .tb { width: auto; } .tb.right { margin-left: auto; } }
