/* BashGames — calm premium, cozy & playful. Warm cream, wood and felt; rounded type. */

@font-face { font-family: "Nunito"; src: url("/fonts/nunito-latin-wght-normal.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f4ede3; --bg-2: #ece2d3; --card: #fffaf3; --card-2: #f8f1e7; --line: #e5d9c8; --line-2: #d8c9b4;
  --ink: #2e2722; --ink-2: #5b5047; --muted: #8e8277;
  --accent: #e07a5f; --accent-ink: #fff; --teal: #3d8b7a; --gold: #e3a93b; --plum: #8e6c9e; --sky: #4f8fcb; --rose: #d9667e;
  --ok: #3b8c5a; --bad: #c9503f; --warn: #c98a1f;
  --felt: #2f6b58; --felt-2: #245646; --wood: #caa074; --wood-2: #a77b4f; --wood-3: #8a6038;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .08);
  --shadow-lg: 0 18px 50px rgba(60, 40, 20, .18);
  --r: 18px; --r-sm: 12px; --r-xs: 8px;
  --font: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1916; --bg-2: #24201c; --card: #2a2521; --card-2: #312b26; --line: #3b342d; --line-2: #4a4138;
    --ink: #f4ece2; --ink-2: #d4c8ba; --muted: #9e9285; --felt: #26594a; --felt-2: #1e4a3d;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); --shadow-lg: 0 18px 50px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1916; --bg-2: #24201c; --card: #2a2521; --card-2: #312b26; --line: #3b342d; --line-2: #4a4138;
  --ink: #f4ece2; --ink-2: #d4c8ba; --muted: #9e9285; --felt: #26594a; --felt-2: #1e4a3d;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); --shadow-lg: 0 18px 50px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 500 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image: radial-gradient(circle at 10% 0%, rgba(224,122,95,.08), transparent 40%), radial-gradient(circle at 100% 30%, rgba(61,139,122,.07), transparent 40%); background-attachment: fixed; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
h1 { font: 700 30px/1.1 var(--display); letter-spacing: -.01em; }
h2 { font: 700 22px/1.2 var(--display); }
h3 { font-size: 17px; font-weight: 800; }
p { margin: 0 0 .6em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--card); color: var(--ink); font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s ease, filter .15s; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(224,122,95,.35); }
.btn.teal { background: var(--teal); color: #fff; box-shadow: 0 6px 18px rgba(61,139,122,.3); }
.btn.gold { background: var(--gold); color: #3a2a10; }
.btn.ghost { background: transparent; box-shadow: none; border: 1.5px solid var(--line-2); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.big { min-height: 56px; font-size: 17px; padding: 0 26px; }
.btn.wide { width: 100%; }
.btn:disabled, .btn.loading { opacity: .5; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); cursor: pointer; color: var(--ink); position: relative; }
.icon-btn:active { transform: scale(.94); }
.icon-btn .dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 900; line-height: 16px; padding: 0 4px; }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--card-2); color: var(--ink-2); }
.pill.ok { background: rgba(59,140,90,.14); color: var(--ok); }
.pill.warn { background: rgba(227,169,59,.18); color: var(--warn); }
.pill.bad { background: rgba(201,80,63,.14); color: var(--bad); }

/* Layout */
.shell { max-width: 1100px; margin: 0 auto; padding: calc(10px + var(--safe-t)) 16px calc(96px + var(--safe-b)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 14px; }
.logo { display: flex; align-items: center; gap: 10px; font: 800 24px/1 var(--display); letter-spacing: -.02em; text-decoration: none; }
.logo .mark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--gold)); display: grid; place-items: center; color: #fff; font-size: 20px; box-shadow: 0 6px 16px rgba(224,122,95,.35); transform: rotate(-6deg); }
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); z-index: 40; display: flex; gap: 4px; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 64px; padding: 6px 10px; border-radius: 999px; text-decoration: none; font-size: 11px; font-weight: 800; color: var(--muted); }
.tabbar a .em { font-size: 20px; line-height: 1; filter: grayscale(.4); }
.tabbar a.on { background: var(--ink); color: var(--bg); }
.tabbar a.on .em { filter: none; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.section-title h2 { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.center-view { min-height: 100vh; display: grid; place-items: center; padding: 20px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--card); padding: 10px 14px; font-size: 16px; font-weight: 600; }
.field textarea { min-height: 80px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(224,122,95,.15); }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.form-msg { color: var(--bad); font-weight: 700; font-size: 14px; }
.form-msg:empty { display: none; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--teal); }
.switch input:checked::after { transform: translateX(18px); }
.seg { display: inline-flex; background: var(--card-2); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 999px; font-weight: 800; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* Auth */
.auth { width: 100%; max-width: 400px; }
.auth .logo { justify-content: center; font-size: 34px; margin: 10px 0 6px; }
.auth .logo .mark { width: 52px; height: 52px; font-size: 28px; border-radius: 16px; }
.auth .tag { text-align: center; color: var(--muted); font-weight: 700; margin-bottom: 18px; }

/* Lobby */
.hero-card { background: linear-gradient(135deg, #f7d9c4, #f3e3c3 55%, #d8e8d9); border-radius: 26px; padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden; box-shadow: var(--shadow); color: #2e2722; }
:root[data-theme="dark"] .hero-card { background: linear-gradient(135deg, #4a3226, #463a24 55%, #283d33); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-card { background: linear-gradient(135deg, #4a3226, #463a24 55%, #283d33); color: var(--ink); } }
.hero-card h1 { font-size: 26px; margin-bottom: 6px; }
.hero-card .deco { position: absolute; right: -8px; top: -6px; font-size: 64px; opacity: .9; transform: rotate(12deg); }
.join-row { display: flex; gap: 8px; margin-top: 12px; }
.join-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .3em; font-weight: 900; text-align: center; border-radius: 999px; border: 0; padding: 0 14px; min-height: 46px; background: rgba(255,255,255,.75); }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .game-grid { grid-template-columns: repeat(4, 1fr); } }
.game-tile { position: relative; border: 0; text-align: left; cursor: pointer; border-radius: 22px; padding: 14px; min-height: 128px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transition: transform .15s ease; }
.game-tile:active { transform: scale(.97); }
.game-tile .gi { font-size: 38px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.12)); }
.game-tile b { font-size: 16px; font-weight: 900; display: block; margin-top: 10px; }
.game-tile small { color: var(--muted); font-weight: 700; font-size: 12px; }
.game-tile::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--tint, var(--accent)); opacity: .12; }
.room-list .room-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-sm); background: var(--card); box-shadow: var(--shadow); margin-bottom: 8px; text-decoration: none; }
.room-item .gi { font-size: 30px; }
.avatars { display: flex; }
.avatars .av { margin-left: -8px; border: 2px solid var(--card); }
.av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c, #ccc); font-size: 19px; line-height: 1; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.av.big { width: 64px; height: 64px; font-size: 36px; }
.av.xl { width: 88px; height: 88px; font-size: 50px; }
.players-online { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.players-online .p { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; min-width: 56px; }
.players-online .p .av { position: relative; }
.online-dot { position: absolute; bottom: 0; right: 0; width: 11px; height: 11px; border-radius: 50%; background: #bbb; border: 2px solid var(--card); }
.online-dot.on { background: #3fbf6a; }

/* Sheets */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--card); }
dialog::backdrop { background: rgba(30, 20, 10, .45); }
.sheet { width: 100%; max-width: 560px; max-height: 90vh; margin: auto auto 0; border-radius: 26px 26px 0 0; display: flex; flex-direction: column; animation: up .25s cubic-bezier(.2,.9,.3,1.2); }
@keyframes up { from { transform: translateY(60px); opacity: 0; } }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 26px; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 6px 20px; }
.sheet-head h2 { margin: 0; }
.sheet-body { padding: 4px 20px calc(20px + var(--safe-b)); overflow-y: auto; }
.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 200; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 14px; box-shadow: var(--shadow-lg); max-width: 90vw; text-align: center; animation: drop .25s cubic-bezier(.2,.9,.3,1.3); }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } }

/* ------------------------------------------------------------------------------------------------ */
/* Room */
.room { min-height: 100vh; display: flex; flex-direction: column; max-width: 1100px; margin: 0 auto; padding: calc(6px + var(--safe-t)) 10px calc(10px + var(--safe-b)); }
.room-top { display: flex; align-items: center; gap: 8px; padding: 2px 0 8px; }
.room-top .title { flex: 1; min-width: 0; font: 800 17px/1.1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-top .code { font-weight: 900; letter-spacing: .15em; font-size: 13px; color: var(--muted); }
.seats-bar { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.seat { flex: none; display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 13px; position: relative; border: 2px solid transparent; transition: border-color .2s, transform .2s; }
.seat .av { width: 28px; height: 28px; font-size: 16px; }
.seat.turn { border-color: var(--accent); transform: translateY(-1px); }
.seat.turn::after { content: ""; position: absolute; inset: -5px; border-radius: 999px; border: 2px solid var(--accent); opacity: .5; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0; transform: scale(1.06); } }
.seat.offline { opacity: .45; }
.seat .sc { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.seat .me-tag { font-size: 10px; background: var(--ink); color: var(--bg); border-radius: 6px; padding: 0 5px; }
.timer-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 0 2px 8px; }
.timer-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold), var(--accent)); transform-origin: left; }
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.status-line { text-align: center; font-weight: 800; color: var(--ink-2); min-height: 24px; margin: 4px 0 8px; font-size: 15px; }
.status-line.mine { color: var(--accent); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: scale(1.04); } }
.float-btns { position: fixed; right: 12px; bottom: calc(14px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; z-index: 30; }
.react-float { position: fixed; z-index: 60; pointer-events: none; font-size: 38px; animation: floatup 2.2s ease-out forwards; }
@keyframes floatup { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1.2); } 100% { transform: translateY(-220px) scale(1); opacity: 0; } }
.react-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.react-row button { font-size: 28px; border: 0; background: var(--card-2); border-radius: 14px; width: 52px; height: 52px; cursor: pointer; }
.chat-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; padding: 4px 0 10px; }
.chat-msg { display: flex; gap: 8px; align-items: flex-end; }
.chat-msg .bubble { background: var(--card-2); padding: 7px 12px; border-radius: 16px 16px 16px 4px; max-width: 80%; font-weight: 600; }
.chat-msg.me { flex-direction: row-reverse; }
.chat-msg.me .bubble { background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-msg .who { font-size: 11px; font-weight: 800; color: var(--muted); }
.chat-peek { position: fixed; left: 12px; bottom: calc(14px + var(--safe-b)); z-index: 30; max-width: min(70vw, 320px); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.chat-peek div { background: color-mix(in srgb, var(--card) 94%, transparent); box-shadow: var(--shadow); border-radius: 14px; padding: 5px 10px; font-size: 13px; font-weight: 700; animation: drop .2s ease; }

/* Lobby inside a room */
.room-lobby { display: flex; flex-direction: column; gap: 12px; }
.seat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .seat-cards { grid-template-columns: repeat(3, 1fr); } }
.seat-card { background: var(--card); border-radius: var(--r); padding: 14px 10px; text-align: center; box-shadow: var(--shadow); position: relative; }
.seat-card.empty { background: transparent; box-shadow: none; border: 2px dashed var(--line-2); color: var(--muted); display: grid; place-items: center; min-height: 128px; font-weight: 800; }
.seat-card .av { margin: 0 auto 6px; }
.seat-card b { display: block; font-size: 15px; }
.seat-card .state { font-size: 12px; font-weight: 800; }
.seat-card .team { position: absolute; top: 8px; left: 8px; }
.seat-card .kick { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; box-shadow: none; background: transparent; }
.invite-box { display: flex; align-items: center; gap: 10px; background: var(--card-2); border-radius: var(--r); padding: 12px; }
.invite-box .code { font: 900 30px/1 var(--font); letter-spacing: .2em; }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(30, 20, 10, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.overlay .box { background: var(--card); border-radius: 26px; padding: 22px; width: 100%; max-width: 420px; text-align: center; box-shadow: var(--shadow-lg); animation: up .25s ease; }
.countdown { font: 900 110px/1 var(--display); color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.35); animation: pop .9s ease infinite; }
@keyframes pop { 0% { transform: scale(1.5); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { opacity: .9; } }
.wait-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; text-align: left; }
.wait-list .row { padding: 8px 10px; background: var(--card-2); border-radius: 12px; }

/* End screen */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 10px 0 18px; }
.podium .step { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 30%; max-width: 120px; }
.podium .block { width: 100%; border-radius: 14px 14px 6px 6px; display: grid; place-items: center; color: #fff; font: 900 28px/1 var(--display); box-shadow: inset 0 -6px 0 rgba(0,0,0,.12); }
.podium .p1 .block { height: 110px; background: linear-gradient(180deg, #f1c75b, #d9a53a); }
.podium .p2 .block { height: 80px; background: linear-gradient(180deg, #c9ced6, #a9b0ba); }
.podium .p3 .block { height: 60px; background: linear-gradient(180deg, #e0a57a, #c07f52); }
.podium .name { font-weight: 900; font-size: 14px; text-align: center; }
.crown { font-size: 30px; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-6deg); } }
.award { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card-2); border-radius: 14px; margin-bottom: 8px; text-align: left; }
.award .em { font-size: 28px; }
.dare-card { background: linear-gradient(135deg, var(--rose), var(--plum)); color: #fff; border-radius: 20px; padding: 16px; margin: 12px 0; text-align: left; box-shadow: var(--shadow); }
.roast { font-style: italic; color: var(--ink-2); margin: 8px 0; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ------------------------------------------------------------------------------------------------ */
/* Shared game pieces */
.board-wrap { width: 100%; max-width: min(96vw, 620px, calc(100vh - 260px)); margin: 0 auto; aspect-ratio: 1; position: relative; }
.board-wrap.free { aspect-ratio: auto; max-width: 720px; }
.board-wrap svg { width: 100%; height: 100%; display: block; }
.wood { background: linear-gradient(135deg, var(--wood), var(--wood-2)); box-shadow: inset 0 2px 0 rgba(255,255,255,.25), inset 0 -4px 0 rgba(0,0,0,.15), var(--shadow-lg); border-radius: 22px; }
.felt { background: radial-gradient(ellipse at center, var(--felt), var(--felt-2)); box-shadow: inset 0 0 40px rgba(0,0,0,.35), var(--shadow-lg); border-radius: 26px; }
.action-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 10px 0; }
.dice { width: 64px; height: 64px; border-radius: 16px; background: #fffdf8; box-shadow: inset 0 -5px 0 rgba(0,0,0,.08), 0 6px 16px rgba(0,0,0,.18); display: grid; place-items: center; position: relative; }
.dice.rolling { animation: roll .6s cubic-bezier(.3,.7,.4,1); }
@keyframes roll { 0% { transform: rotate(0) scale(.8); } 40% { transform: rotate(200deg) scale(1.15); } 70% { transform: rotate(320deg) scale(.95); } 100% { transform: rotate(360deg) scale(1); } }
.dice svg { width: 80%; height: 80%; }
.pcard { width: var(--cw, 56px); aspect-ratio: 5 / 7; border-radius: 8px; background: #fffdf8; box-shadow: 0 2px 6px rgba(0,0,0,.2); display: flex; flex-direction: column; justify-content: space-between; padding: 4px 5px; font-weight: 900; position: relative; color: #2b2622; flex: none; user-select: none; }
.pcard.red { color: #c63c3c; }
.pcard .r { font-size: calc(var(--cw, 56px) * .3); line-height: 1; }
.pcard .s { font-size: calc(var(--cw, 56px) * .42); align-self: center; line-height: 1; }
.pcard.back { background: repeating-linear-gradient(45deg, #b94b3c 0 6px, #c85b4a 6px 12px); border: 3px solid #fffdf8; }
.hand { display: flex; justify-content: safe center; gap: 0; padding: 18px 8px 4px; overflow-x: auto; min-height: 110px; }
.hand > * { transition: transform .15s ease; cursor: pointer; }

.hand > .sel { transform: translateY(-16px); }
.hand > .dim { filter: grayscale(.4) brightness(.8); }
.hand > .ok { box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(0,0,0,.25); }
.bubble-say { position: absolute; background: var(--card); padding: 6px 10px; border-radius: 12px; font-weight: 800; font-size: 13px; box-shadow: var(--shadow); white-space: nowrap; }
.big-msg { font: 900 26px/1.1 var(--display); text-align: center; margin: 6px 0; }
.q-card { background: var(--card); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); text-align: center; margin-bottom: 12px; }
.q-card .q { font-size: 20px; font-weight: 800; line-height: 1.35; }
.q-level { display: inline-block; font-weight: 900; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
.lv1 { background: rgba(59,140,90,.15); color: var(--ok); } .lv2 { background: rgba(79,143,203,.16); color: var(--sky); }
.lv3 { background: rgba(227,169,59,.2); color: #b07a12; } .lv4 { background: rgba(201,80,63,.16); color: var(--bad); }
.choices { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { border: 0; min-height: 60px; border-radius: 18px; font-weight: 800; font-size: 16px; padding: 10px 14px; cursor: pointer; color: #fff; box-shadow: inset 0 -5px 0 rgba(0,0,0,.15), var(--shadow); text-align: left; display: flex; align-items: center; gap: 10px; transition: transform .1s; }
.choice:active { transform: scale(.97); }
.choice .k { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.25); display: grid; place-items: center; flex: none; }
.choice.c0 { background: #e07a5f; } .choice.c1 { background: #4f8fcb; } .choice.c2 { background: #e3a93b; } .choice.c3 { background: #3d8b7a; }
.choice.picked { outline: 4px solid var(--ink); }
.choice.wrong { opacity: .35; }
.choice.right { outline: 4px solid #3fbf6a; animation: nudge .8s ease 2; }
.answer-row { display: flex; gap: 8px; margin-top: 10px; }
.answer-row input { flex: 1; min-width: 0; min-height: 54px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); padding: 0 16px; font-size: 20px; font-weight: 800; }
.answer-row input:focus { outline: none; border-color: var(--accent); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.report-btn { background: none; border: 0; color: var(--muted); font-weight: 800; font-size: 13px; cursor: pointer; }
.score-list { display: flex; flex-direction: column; gap: 6px; }
.score-list .row { background: var(--card); padding: 8px 12px; border-radius: 14px; box-shadow: var(--shadow); }
.canvas-wrap { position: relative; width: 100%; max-width: min(96vw, 560px, calc(100vh - 300px)); margin: 0 auto; aspect-ratio: 1; background: #fffdf8; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; touch-action: none; }
.canvas-wrap canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.palette { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 8px 0; }
.palette button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--card); box-shadow: var(--shadow); cursor: pointer; }
.palette button.on { outline: 3px solid var(--ink); }
.guess-feed { display: flex; flex-direction: column; gap: 4px; max-height: 120px; overflow-y: auto; font-size: 14px; font-weight: 700; padding: 6px 2px; }
.guess-feed .got { color: var(--ok); }
.word-mask { font: 900 26px/1 var(--font); letter-spacing: .3em; text-align: center; margin: 6px 0; }
.letters { display: flex; justify-content: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.letters button { width: 48px; height: 56px; border-radius: 14px; border: 0; background: #fffdf8; color: #2b2622; font: 900 26px/1 var(--font); box-shadow: inset 0 -5px 0 rgba(0,0,0,.12), var(--shadow); cursor: pointer; text-transform: uppercase; }
.letters button.used { opacity: .3; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.word-chips span { padding: 3px 9px; border-radius: 10px; background: var(--card-2); font-weight: 800; font-size: 14px; }
.word-chips span.new { background: rgba(59,140,90,.18); color: var(--ok); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
