/* Live-room widgets (poll, words, parking lot, live quiz, Impossible Wall, hiding cards) — stage + phone. */

/* ---- Poll bars ---- */
.w-poll { display: flex; flex-direction: column; gap: 18px; height: 100%; }
.w-poll .poll-q { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1.1; }
.w-poll .bars { display: flex; flex-direction: column; gap: 14px; flex: 1; justify-content: center; }
.w-poll .bar-row { display: grid; grid-template-columns: minmax(max-content, 34%) 1fr auto; align-items: center; gap: 18px; font-size: 32px; }
.w-poll .bar-label { font-weight: 700; }
.w-poll .bar-track { height: 56px; background: var(--paper-2); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.w-poll .bar-fill { height: 100%; background: var(--field); width: 0; transition: width 0.5s ease; border-radius: 0 10px 10px 0; }
.w-poll .bar-row:nth-child(4n+2) .bar-fill { background: var(--harvest); }
.w-poll .bar-row:nth-child(4n+3) .bar-fill { background: var(--plum); }
.w-poll .bar-row:nth-child(4n+4) .bar-fill { background: var(--sky); }
.w-poll .bar-row.correct .bar-label::after { content: "  ✓"; color: var(--good); }
.w-poll .bar-count { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-weight: 700; }
.w-poll .hands { display: inline-flex; gap: 6px; }
.w-poll .hands .btn { min-height: 44px; min-width: 44px; padding: 0; font-size: 26px; }
.w-poll .poll-meta { display: flex; gap: 18px; align-items: center; font-size: 24px; color: var(--ink-2); }
.w-poll .poll-meta .spacer { flex: 1; }
.w-poll.hidden-results .bar-fill, .w-poll.hidden-results .num { visibility: hidden; }

/* ---- Word wall ---- */
.w-words { height: 100%; display: flex; flex-direction: column; gap: 16px; }
.w-words .cloud { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 14px 18px; padding: 10px; overflow: hidden; }
.w-words .word { font-family: var(--font-display); font-weight: 800; padding: 0.15em 0.55em; border-radius: 14px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); animation: pop 0.4s ease both; }
.w-words .word:nth-child(5n+1) { color: var(--field); }
.w-words .word:nth-child(5n+2) { color: var(--barn); }
.w-words .word:nth-child(5n+3) { color: var(--plum); }
.w-words .word:nth-child(5n+4) { color: var(--sky); }
.w-words .word:nth-child(5n+5) { color: var(--soil); }
:root[data-theme="dark"] .w-words .word:nth-child(5n+5) { color: var(--harvest); }
.w-words .empty { color: var(--ink-3); font-size: 34px; }

/* ---- Parking lot ---- */
.w-parking { height: 100%; display: flex; flex-direction: column; gap: 14px; }
.w-parking .qlist { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; align-content: start; }
.w-parking .q { font-size: 26px; background: var(--harvest-2); border: 2px solid var(--harvest); border-radius: 14px; padding: 14px 18px; transform: rotate(-0.6deg); display: flex; gap: 12px; align-items: flex-start; }
.w-parking .q:nth-child(even) { transform: rotate(0.7deg); background: var(--field-2); border-color: var(--field); }
.w-parking .q.answered { opacity: 0.45; text-decoration: line-through; }
.w-parking .q input { width: 28px; height: 28px; flex: none; margin-top: 4px; }

/* ---- Live quiz ---- */
.w-quizlive { height: 100%; display: flex; flex-direction: column; gap: 18px; }
.w-quizlive .qnum { font-size: 22px; color: var(--ink-2); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.w-quizlive .explain { font-size: 30px; background: var(--card); border: 2px solid var(--good); border-radius: 16px; padding: 16px 22px; }

/* ---- Impossible Wall ---- */
.w-wall { height: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.w-wall .tile { background: var(--card); border: 3px solid var(--ink); border-radius: 22px; padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: 6px 6px 0 var(--line); position: relative; }
.w-wall .tile .num { position: absolute; top: -22px; left: 20px; background: var(--barn); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 26px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.w-wall .tile h3 { font-size: 34px; margin: 6px 0 0; }
.w-wall .bits { font-family: var(--font-mono); font-weight: 700; font-size: 31px; white-space: nowrap; line-height: 1.45; letter-spacing: 0.04em; }
.w-wall .bits .gap { display: inline-block; width: 0.8em; }
.w-wall pre.prog { font-family: var(--font-mono); font-weight: 700; font-size: 30px; line-height: 1.35; margin: 0; background: var(--paper-2); border-radius: 12px; padding: 12px 16px; }
.w-wall .mini-grid { display: grid; grid-template-columns: repeat(5, 34px); gap: 5px; }
.w-wall .mini-grid i { width: 34px; height: 34px; border-radius: 6px; background: color-mix(in srgb, var(--soil) 22%, var(--paper-2)); display: grid; place-items: center; font-style: normal; font-size: 20px; }
.w-wall .mini-grid i.start { outline: 3px solid var(--harvest); }
.w-wall .path { font-size: 64px; display: flex; align-items: center; justify-content: space-around; flex: 1; }
.w-wall .path .q { font-family: var(--font-display); font-weight: 800; color: var(--barn); font-size: 90px; }
.w-wall .tile .rating { margin-top: auto; font-size: 22px; color: var(--ink-2); }
.w-wall .tile .rating b { font-family: var(--font-display); font-size: 40px; color: var(--ink); }
.w-wall .tile.solved { border-color: var(--good); box-shadow: 6px 6px 0 var(--field-2); }
.w-wall .stamp-now { position: absolute; right: 16px; top: 16px; color: var(--good); font-size: 22px; }

/* Decoder */
.w-decode { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 30px; }
.w-decode .letters { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.w-decode .letter { display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; padding: 16px 18px; min-width: 170px; cursor: pointer; font: inherit; color: var(--ink); }
.w-decode .letter .b { font-family: var(--font-mono); font-weight: 700; font-size: 34px; letter-spacing: 0.06em; }
.w-decode .letter .n { font-size: 26px; color: var(--ink-2); min-height: 1.3em; }
.w-decode .letter .l { font-family: var(--font-display); font-weight: 800; font-size: 96px; line-height: 1; min-height: 1em; color: var(--field); }
.w-decode .letter.space { visibility: hidden; min-width: 40px; }
.w-decode .pv { display: flex; justify-content: center; gap: 0; font-family: var(--font-mono); font-size: 26px; color: var(--ink-2); }
.w-decode .hint { text-align: center; font-size: 28px; color: var(--ink-2); }

/* Compare chart */
.w-compare { height: 100%; display: flex; flex-direction: column; gap: 20px; justify-content: center; }
.w-compare .crow { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: center; font-size: 30px; }
.w-compare .cbars { display: flex; flex-direction: column; gap: 8px; }
.w-compare .cbar { height: 44px; border-radius: 10px; display: flex; align-items: center; padding: 0 14px; color: #fff; font-weight: 700; font-size: 24px; min-width: 190px; white-space: nowrap; transition: width 0.8s ease; }
.w-compare .cbar.before { background: var(--barn); }
.w-compare .cbar.after { background: var(--field); }
:root[data-theme="dark"] .w-compare .cbar { color: #10170f; }

/* Where's the computer hiding? */
.w-hiding { height: 100%; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; gap: 20px; }
.w-hiding .hcard { perspective: 1000px; cursor: pointer; border: 0; padding: 0; background: none; font: inherit; color: var(--ink); text-align: left; }
.w-hiding .hinner { position: relative; width: 100%; height: 100%; transition: transform 0.5s ease; transform-style: preserve-3d; }
.w-hiding .hcard.flipped .hinner { transform: rotateY(180deg); }
.w-hiding .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 20px; border: 3px solid var(--ink); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; background: var(--card); box-shadow: 5px 5px 0 var(--line); }
.w-hiding .front { align-items: center; justify-content: center; text-align: center; }
.w-hiding .front .emo { font-size: 84px; line-height: 1; }
.w-hiding .front .name { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.1; }
.w-hiding .back { transform: rotateY(180deg); background: var(--field-2); border-color: var(--field); font-size: 21px; line-height: 1.3; }
.w-hiding .back b { font-family: var(--font-display); font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--field); }
.w-hiding .back .job { margin-top: auto; background: var(--card); border-radius: 10px; padding: 8px 10px; font-weight: 700; }

/* Learning engine diagram */
.engine-wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; flex: 1; min-height: 0; align-items: center; }
.engine-svg text { font-family: var(--font-display); font-weight: 800; }
.phrases { display: flex; flex-direction: column; gap: 18px; }
.phrase { font-family: var(--font-display); font-weight: 800; font-size: 46px; line-height: 1.1; padding: 16px 22px; border-radius: 18px; background: var(--card); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--harvest); }
.phrase small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 24px; color: var(--ink-2); margin-top: 6px; }

/* ---------- Phone (join page) ---------- */
.phone-shell { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.phone-top { display: flex; align-items: center; gap: 10px; padding-top: env(safe-area-inset-top, 0px); margin-bottom: 14px; }
.phone-top .brand { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.phone-top .spacer { flex: 1; }
.phone-status { font-size: 0.85rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.phone-status i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.phone-status.live i { background: var(--good); }
.phone-status.offline { color: var(--bad); }
.phone-card { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.phone-q { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; line-height: 1.15; margin-bottom: 14px; }
.phone-opts { display: grid; gap: 10px; }
.phone-opts .btn { justify-content: flex-start; text-align: left; min-height: 58px; font-size: 1.05rem; width: 100%; }
.phone-opts .btn.chosen { --bg: var(--field); --fg: #fff; --bd: var(--field); }
.phone-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.phone-scale .btn { min-height: 64px; flex-direction: column; gap: 2px; font-size: 1.3rem; padding: 6px 0; }
.phone-scale .btn small { font-size: 0.7rem; font-weight: 400; }
.phone-scale .btn.chosen { --bg: var(--field); --fg: #fff; --bd: var(--field); }
.phone-lobby { text-align: center; padding: 28px 10px; }
.phone-lobby .eyes { font-size: 64px; }
.phone-links { display: grid; gap: 10px; margin-top: 18px; }
.phone-note { font-size: 0.9rem; color: var(--ink-2); margin-top: 10px; }
.phone-banner { background: var(--barn-2); border: 2px solid var(--barn); color: var(--ink); padding: 10px 14px; border-radius: 12px; font-weight: 700; margin-bottom: 12px; }
.phone-sent { color: var(--good); font-weight: 700; margin-top: 10px; }
