:root {
  --bg: #0E0D0C;
  --bg2: #161412;
  --card: #1B1916;
  --card2: #23201C;
  --line: rgba(246, 243, 235, 0.09);
  --text: #F6F3EB;
  --dim: #A9A59C;
  --brass: #E3B341;
  --brass2: #F2CE73;
  --danger: #FF6B7A;
  --good: #7FD1A0;
  /* Powell Play tokens (powellplay-ui.md) */
  --pp-coal: #0B0B0B;
  --pp-card: #151515;
  --pp-bone: #F6F3EB;
  --pp-dim: #A9A59C;
  --pp-lime: #C7F000;
  --pp-danger: #FF6B7A;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ui: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 var(--ui); overscroll-behavior: none; }
body { background: radial-gradient(120% 80% at 50% -10%, #2a2118 0%, var(--bg) 55%) fixed, var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--brass2); }
[hidden] { display: none !important; }
svg use, .icon-btn svg, .btn svg, .row-btn svg { pointer-events: none; }
.btn svg, .icon-btn svg, .pro-pill svg, .row-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wordmark { font-family: var(--display); font-weight: 800; letter-spacing: 0.06em; margin: 0; background: linear-gradient(180deg, #FFF3D6 0%, var(--brass2) 45%, #B9852A 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- loading scene (studio-mark.md 2.3) ---------- */
.pp-loading { position: fixed; inset: 0; z-index: 50; background: var(--bg) radial-gradient(90% 60% at 50% 35%, #2c2318, var(--bg)); display: grid; place-items: center; transition: opacity .35s; }
.pp-loading.out { opacity: 0; pointer-events: none; }
.loading-logo { text-align: center; transform: translateY(-6vh); }
.wordmark.big { font-size: clamp(44px, 11.5vmin, 96px); letter-spacing: 0.02em; display: block; line-height: 1; }
.loading-sub { display: block; margin-top: 6px; letter-spacing: 0.42em; text-transform: uppercase; font-size: 12px; color: var(--dim); }
.loading-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(3.5vh + env(safe-area-inset-bottom, 0px) + clamp(140px, 34vmin, 280px) * 0.42 + 36px); width: 120px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.loading-bar i { display: block; width: 40%; height: 100%; background: var(--brass); border-radius: 3px; animation: load 1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.pp-fade { position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bg) 69%, transparent)); }
.pp-studio { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(3.5vh + env(safe-area-inset-bottom, 0px)); width: clamp(140px, 34vmin, 280px); height: auto; opacity: .92; animation: pp-in .25s ease-out both; }
@keyframes pp-in { from { opacity: 0; } }

/* ---------- screens ---------- */
#app { height: 100%; }
.screen { min-height: 100%; max-width: 980px; margin: 0 auto; padding: calc(12px + var(--safe-t)) 16px calc(16px + var(--safe-b)); display: flex; flex-direction: column; }

/* home */
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.me-chip { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px 5px 5px; min-height: 44px; max-width: 60%; }
.me-text { display: flex; flex-direction: column; text-align: left; line-height: 1.15; min-width: 0; }
.me-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--dim); font-size: 12px; }
.top-icons { display: flex; gap: 6px; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; }
.icon-btn:active { transform: scale(.96); }
.hero { text-align: center; margin: clamp(18px, 6vh, 64px) 0 clamp(14px, 4vh, 36px); }
.home-logo { font-size: clamp(46px, 12.5vw, 104px); line-height: 1; letter-spacing: 0.02em; }
.tagline { margin: 6px 0 0; color: var(--dim); letter-spacing: .02em; }
.play-stack { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.length-pick { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 4px; }
.lp-label { color: var(--dim); font-size: 13px; margin-right: 4px; }
.length-pick button { width: 44px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; }
.length-pick button[aria-checked="true"] { background: var(--brass); color: #1a1408; border-color: transparent; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 16px; transition: transform .12s, filter .12s, background .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.big { min-height: 66px; display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; text-align: left; column-gap: 14px; row-gap: 0; padding: 10px 20px; }
.btn.big svg { grid-row: 1 / 3; width: 26px; height: 26px; }
.btn.big span { font-size: 17px; }
.btn.big small { color: var(--dim); font-weight: 500; font-size: 12.5px; }
.btn.primary { background: linear-gradient(180deg, var(--brass2), var(--brass) 60%, #C9952D); color: #1a1408; border: 0; box-shadow: 0 8px 28px -10px rgba(227, 179, 65, .55); }
.btn.primary small { color: rgba(26, 20, 8, .72); }
.btn.outline { background: transparent; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 14px; border-radius: 12px; }
.btn.danger { background: var(--danger); color: #1d0a0d; border: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.linkish { background: none; border: 0; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; padding: 10px; min-height: 44px; }
.pro-pill { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(227, 179, 65, .4); background: rgba(227, 179, 65, .08); color: var(--brass2); font-weight: 600; font-size: 13px; }
.pro-pill svg { width: 16px; height: 16px; }

/* studio mark on the home screen (studio-mark.md 3) */
.pp-home-studio { display: grid; grid-template-columns: auto 104px; grid-template-areas: 'av mark' '. cue'; column-gap: 8px; row-gap: 6px; align-items: center; margin: auto auto calc(16px + env(safe-area-inset-bottom, 0px)); padding: 6px; padding-top: 30px; min-height: 44px; background: none; border: 0; cursor: pointer; }
.pp-home-mark { grid-area: mark; display: block; width: 104px; height: auto; opacity: .55; transition: opacity .15s; }
.pp-home-studio:hover .pp-home-mark, .pp-home-studio:focus-visible .pp-home-mark, .pp-home-studio:active .pp-home-mark { opacity: .9; }
.pp-home-avatar { grid-area: av; width: 24px; height: 24px; border-radius: 22%; overflow: hidden; }
.pp-home-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-home-cue { grid-area: cue; font: 600 12px/1 var(--ui); color: var(--pp-lime); opacity: .85; text-align: center; }
.pp-connected .pp-home-cue, html.pp-host .pp-home-cue, html.pp-off .pp-home-cue { display: none; }
html.portal .pp-home-studio, html.portal .pp-settings-studio, html.portal a[href="/support"] { display: none; }

/* avatars: rounded squares, never circles */
.avatar { display: inline-grid; place-items: center; position: relative; flex: none; width: 44px; height: 44px; border-radius: 22%; background: var(--pp-card); color: var(--pp-dim); font-weight: 700; overflow: visible; }
.avatar > img.av { width: 100%; height: 100%; border-radius: 22%; object-fit: cover; display: block; }
.avatar > img.frame { position: absolute; width: 114%; height: 114%; left: -7%; top: -7%; pointer-events: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 14px; }
.avatar.xs { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.bot { background: #2b2620; color: var(--brass2); }

/* ---------- game ---------- */
#game { padding-left: 8px; padding-right: 8px; gap: 8px; max-width: 1200px; height: 100%; min-height: 0; }
.bar-top, .bar-bottom { display: flex; align-items: center; gap: 8px; }
.bar-bottom { flex-wrap: wrap; justify-content: space-between; }
.player-strip { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); min-height: 52px; transition: box-shadow .25s, border-color .25s; }
.player-strip.turn { border-color: rgba(227, 179, 65, .55); box-shadow: 0 0 0 1px rgba(227, 179, 65, .25), 0 6px 24px -12px rgba(227, 179, 65, .6); }
.ps-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.ps-name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-name small { color: var(--dim); font-size: 12px; white-space: nowrap; }
.ps-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ps-score { font: 700 20px/1 var(--display); min-width: 28px; text-align: center; }
.ps-score small { display: block; font: 500 10px/1.2 var(--ui); color: var(--dim); letter-spacing: .06em; }
.clock { font: 600 14px/1 var(--ui); font-variant-numeric: tabular-nums; padding: 6px 8px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); min-width: 58px; text-align: center; position: relative; overflow: hidden; }
.clock.run { color: var(--text); border-color: rgba(227, 179, 65, .5); }
.clock.low { color: var(--danger); border-color: rgba(255, 107, 122, .6); }
.clock .delay { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--brass); }
.gone { color: var(--danger); font-size: 12px; }
.board-wrap { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
#board { width: 100%; height: 100%; max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); touch-action: none; user-select: none; -webkit-user-select: none; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55)); }
.actions { display: flex; gap: 8px; align-items: center; }
.actions .btn { min-height: 52px; min-width: 52px; }
.actions .btn.go { min-width: 120px; }
.banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(14, 13, 12, .88); border: 1px solid var(--line); backdrop-filter: blur(6px); padding: 14px 22px; border-radius: 16px; font-weight: 600; text-align: center; pointer-events: none; animation: pop .25s ease-out; max-width: 80%; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.92); opacity: 0; } }
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble { position: absolute; left: 50%; transform: translateX(-50%); background: var(--text); color: #15120e; padding: 8px 14px; border-radius: 14px; font-weight: 600; font-size: 14px; animation: bub 3s ease-out forwards; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.bubble.top { top: 4%; }
.bubble.bottom { bottom: 4%; }
@keyframes bub { 0% { opacity: 0; transform: translate(-50%, 6px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* board svg */
.pt-hl { fill: rgba(227, 179, 65, .22); stroke: var(--brass2); stroke-width: 3; }
.ck { transition: none; cursor: grab; }
.ck.sel circle.body { stroke: var(--brass2); stroke-width: 5; }
.ck.movable circle.body { filter: brightness(1.06); }
.target { fill: rgba(242, 206, 115, .18); stroke: var(--brass2); stroke-width: 3; stroke-dasharray: 8 6; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -28; } }
.die-used { opacity: .35; }

/* waiting room (powellplay-ui.md 8) */
.sub-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; margin-bottom: 10px; }
.sub-top h2 { margin: 0; text-align: center; font: 700 20px/1.2 var(--display); }
.wait-body { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 4vh; }
.qr-panel { background: var(--pp-bone); border-radius: 22px; padding: 12px; box-shadow: 0 0 0 4px var(--pp-lime), 0 0 40px 4px rgba(199, 240, 0, .25); }
.qr-panel img { display: block; width: 220px; height: 220px; }
.room-code { color: var(--pp-lime); font: 800 40px/1 var(--ui); letter-spacing: .22em; margin-top: 8px; padding-left: .22em; }
.wait-actions { display: flex; gap: 10px; }
.waiting-pulse { margin-top: 10px; font-weight: 600; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.wait-guest { display: flex; align-items: center; gap: 10px; }
.dim { color: var(--dim); }
.small { font-size: 13px; }

/* lists */
.list-screen { max-width: 640px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.tabs button { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 600; min-height: 40px; }
.tabs button.on { background: var(--text); color: #15120e; }
.rows { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); min-height: 56px; }
.rows li.me { border-color: rgba(227, 179, 65, .5); }
.rows .rank { width: 26px; text-align: center; font: 700 16px var(--display); color: var(--dim); }
.rows .grow { flex: 1; min-width: 0; }
.rows .grow b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .grow small { color: var(--dim); font-size: 12.5px; }
.rows .val { font: 700 17px var(--display); }
.rows li.click { cursor: pointer; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .03em; }
.tag.win { background: rgba(127, 209, 160, .15); color: var(--good); }
.tag.loss { background: rgba(255, 107, 122, .14); color: var(--danger); }
.tag.blunder { background: rgba(255, 107, 122, .18); color: var(--danger); }
.tag.mistake { background: rgba(242, 160, 80, .18); color: #F2A050; }
.tag.inaccuracy { background: rgba(242, 206, 115, .14); color: var(--brass2); }
.tag.good { background: rgba(127, 209, 160, .15); color: var(--good); }
.section-h { font: 600 12px/1 var(--ui); letter-spacing: .18em; color: var(--dim); margin: 22px 0 6px; text-transform: uppercase; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.stat b { display: block; font: 700 22px var(--display); }
.stat small { color: var(--dim); font-size: 12px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; font-size: 12px; }
.badge img { width: 52px; height: 52px; display: block; margin: 0 auto 6px; }
.badge.locked { opacity: .38; filter: grayscale(1); }
.review-board svg { width: 100%; height: auto; display: block; }
.review-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.review-summary .stat small { display: block; }
@media (max-width: 480px) { .review-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* settings */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-bottom: 12px; }
.card-h { font-size: 11px; letter-spacing: .2em; color: var(--dim); margin-bottom: 10px; }
.name-row { display: flex; gap: 8px; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid rgba(227, 179, 65, .6); outline-offset: 1px; }
.note { color: var(--dim); font-size: 13px; margin: 8px 0 0; min-height: 1em; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-top: 1px solid var(--line); }
.toggle:first-of-type { border-top: 0; }
.toggle input { appearance: none; width: 46px; height: 28px; min-height: 0; padding: 0; border-radius: 999px; background: #3a3631; position: relative; flex: none; cursor: pointer; transition: background .15s; border: 0; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.toggle input:checked { background: var(--brass); }
.toggle input:checked::after { transform: translateX(18px); }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.style { border: 2px solid transparent; border-radius: 14px; padding: 6px; background: var(--bg2); text-align: center; font-size: 12px; position: relative; }
.style.on { border-color: var(--brass); }
.style svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.style .lock { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 2; }
.row-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 48px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; padding: 8px 0; font-weight: 500; }
.row-btn:first-of-type { border-top: 0; }
.row-btn small { color: var(--dim); font-size: 12.5px; font-weight: 400; }
.row-btn.danger { color: var(--danger); }
.pp-settings-studio { text-align: center; margin: 18px 0 8px; color: var(--dim); font-size: 12.5px; }
.pp-settings-studio img { opacity: .7; display: block; margin: 0 auto 10px; }
.pp-settings-studio img:hover { opacity: 1; }
.pp-settings-studio p { margin: 4px 0; }
.pp-settings-studio a { color: var(--dim); }
html.pp-host .pp-settings-studio a[href="/support"] { pointer-events: none; color: inherit; text-decoration: none; }

/* Powell Play ID card (powellplay-ui.md 2) */
.pp-card { background: var(--pp-card); border-radius: 20px; }
.pp-card .card-h { letter-spacing: .2em; color: var(--pp-dim); }
.pp-line { color: var(--pp-dim); font-size: 13px; margin: 0 0 12px; }
.pp-who { display: flex; align-items: center; gap: 12px; }
.pp-who b { font-size: 15px; font-weight: 700; color: var(--pp-bone); }
.pp-who small { display: block; color: var(--pp-dim); font-size: 13px; }

/* Sign in with Powell Play button (powellplay-ui.md 1) */
.pp-signin { display: flex; align-items: center; width: 100%; min-width: 240px; height: 52px; border-radius: 14px; background: var(--pp-lime); color: var(--pp-coal); border: 0; padding: 0 16px; font: 700 17px/1 var(--ui); gap: 0; transition: transform .1s, filter .1s; }
.pp-signin:active { transform: scale(.97); filter: brightness(1.08); }
.pp-signin svg { width: 32px; height: 32px; flex: none; }
.pp-signin span { flex: 1; text-align: center; }
.pp-signin.busy { opacity: .6; pointer-events: none; }
.pp-signin.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pp-link { background: none; border: 0; color: var(--pp-dim); font-size: 13px; text-decoration: underline; padding: 10px 0 0; text-align: left; }

/* sheets */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; background: var(--pp-card); border-radius: 24px 24px 0 0; padding: 10px 20px calc(20px + var(--safe-b)); z-index: 41; animation: up .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translate(-50%, 40px); opacity: 0; } }
@media (min-width: 600px) {
  .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 24px; padding-bottom: 20px; }
  @keyframes up { from { transform: translate(-50%, calc(-50% + 30px)); opacity: 0; } }
}
.handle { width: 40px; height: 5px; border-radius: 3px; background: rgba(246, 243, 235, .2); margin: 0 auto 12px; }
.sheet h3 { font: 700 20px/1.25 var(--ui); margin: 6px 0 12px; color: var(--pp-bone); }
.sheet .game-h { font-family: var(--display); }
.sheet p { margin: 0 0 12px; }
.sheet .stack { display: flex; flex-direction: column; gap: 10px; }
.sheet .rowlink { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 48px; background: none; border: 0; border-top: 1px solid var(--line); padding: 0; text-decoration: none; color: var(--pp-bone); font-weight: 500; }
.sheet .rowlink svg { width: 18px; height: 18px; fill: none; stroke: var(--pp-dim); stroke-width: 2; }
.sheet .rowlink.danger { color: var(--pp-danger); }
.sheet .foot { color: var(--pp-dim); font-size: 12px; text-align: center; margin-top: 14px; }
.sheet .lockup { display: block; width: 120px; margin: 0 auto 14px; }
.option { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: transparent; margin-bottom: 10px; }
.option b { display: block; font-size: 16px; }
.option small { color: var(--pp-dim); }
.option.on { border: 2px solid var(--pp-lime); box-shadow: 0 0 22px -6px rgba(199, 240, 0, .45); padding: 13px; }
.btn.lime { background: var(--pp-lime); color: var(--pp-coal); border: 0; width: 100%; }
.btn.pp-danger { background: var(--pp-danger); color: #1d0a0d; border: 0; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
@media (max-width: 360px) { .choice { grid-template-columns: 1fr; } }
.choice .c { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.choice .c small { color: var(--pp-dim); }
.mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 18px; letter-spacing: .08em; text-align: center; user-select: all; }
.lines { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.lines li { display: flex; gap: 10px; align-items: flex-start; }
.lines svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--pp-lime); stroke-width: 2; margin-top: 1px; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips button { min-height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.seg button { min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.seg button small { color: var(--dim); font-weight: 400; font-size: 11.5px; }
.seg button.on { border-color: var(--brass); background: rgba(227, 179, 65, .1); }
.result-big { font: 800 34px/1.1 var(--display); text-align: center; margin: 6px 0 4px; }
.result-sub { text-align: center; color: var(--dim); margin-bottom: 14px; }
.badge-new { display: flex; align-items: center; gap: 10px; background: var(--card2); border-radius: 14px; padding: 8px 12px; margin-bottom: 8px; animation: pop2 .4s ease-out; }
.badge-new img { width: 40px; height: 40px; }
@keyframes pop2 { from { transform: scale(.9); opacity: 0; } }

/* toast (powellplay-ui.md 6) */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--pp-card); color: var(--pp-bone); border: 1px solid var(--line); padding: 10px 16px; border-radius: 16px; z-index: 60; font-weight: 500; font-size: 14px; line-height: 1.35; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); animation: up2 .25s ease-out; max-width: min(420px, calc(100% - 32px)); text-align: center; }
@keyframes up2 { from { transform: translate(-50%, 12px); opacity: 0; } }

/* portrait phones: my strip on its own row, actions full width beneath */
@media (max-width: 640px) {
  .bar-bottom .player-strip { flex-basis: 100%; }
  .actions { width: 100%; }
  .actions .btn.go { flex: 1; }
  .actions > .dim { width: 100%; text-align: center; padding: 14px 0; }
  #board { max-height: none; }
  .board-wrap { align-items: center; }
}

/* landscape phones: put the strips beside the board */
@media (orientation: landscape) and (max-height: 560px) {
  #game { flex-direction: row; flex-wrap: wrap; }
  #board { max-height: calc(100vh - 80px); }
  .hero { margin: 8px 0; }
  .home-logo { font-size: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }

/* connection lost: stays up until the socket is back */
.offline { position: fixed; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 70; background: var(--danger); color: #1d0a0d; font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }

/* The Powell Play button sits in the bottom-left corner (W1): keep 56 px of it clear of our own controls. */
#game .bar-bottom { padding-left: 52px; }
.list-screen { padding-bottom: calc(72px + var(--safe-b)); }
