:root {
  --bg: #14112b;
  --bg2: #1e1a3d;
  --card: #262150;
  --card2: #302a63;
  --line: #3d3678;
  --text: #f4f1ff;
  --muted: #a9a3d6;
  --accent: #ffcc33;
  --accent-ink: #2a1f00;
  --good: #3ddc97;
  --bad: #ff5d73;
  --info: #4cc9f0;
  --radius: 18px;
  --c0: #ff5d73;
  --c1: #4cc9f0;
  --c2: #ffb400;
  --c3: #3ddc97;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #3a2f86 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }

#screen {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- generic pieces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.big { font-size: 1.6rem; font-weight: 800; }
.huge { font-size: 3rem; font-weight: 900; }
.spacer { flex: 1; }

.btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--card2); color: var(--text);
  padding: 14px 18px; border-radius: 14px; font-weight: 700; font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .06s ease, filter .15s;
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: transparent; border: 1px solid var(--bad); color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: .9rem; border-radius: 10px; }

.input {
  width: 100%; background: var(--bg2); border: 2px solid var(--line); border-radius: 14px;
  padding: 14px 16px; font-size: 1.1rem; outline: none;
}
.input:focus { border-color: var(--accent); }
.input.code { text-transform: uppercase; letter-spacing: .4em; text-align: center; font-weight: 800; font-size: 1.5rem; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--card2); font-size: .85rem; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 5px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: color-mix(in srgb, var(--pc, #888) 25%, transparent); border: 1px solid color-mix(in srgb, var(--pc, #888) 60%, transparent); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.5rem; letter-spacing: -.02em; }
.logo span { font-size: 2rem; }

/* ---------- home ---------- */
.hero { text-align: center; padding: 24px 0 8px; }
.hero .logo { justify-content: center; font-size: 2.2rem; }
.hero p { margin-top: 8px; color: var(--muted); }
.avatar-btn { width: 64px; height: 64px; flex: none; border-radius: 50%; font-size: 2.2rem; background: var(--bg2); border: 2px solid var(--line); cursor: pointer; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.avatar-grid button { font-size: 1.8rem; padding: 8px; border-radius: 12px; background: var(--bg2); border: 2px solid transparent; cursor: pointer; }
.avatar-grid button.sel { border-color: var(--accent); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; }
.topbar .code { font-weight: 900; letter-spacing: .15em; background: var(--card); border: 1px solid var(--line); padding: 6px 12px; border-radius: 10px; }
.me-btn { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; max-width: 50%; }
.me-btn .av { font-size: 1.4rem; }
.me-btn .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- lobby ---------- */
.qr-card { display: flex; gap: 16px; align-items: center; }
.qr { background: #fff; border-radius: 12px; padding: 6px; width: 132px; height: 132px; flex: none; cursor: zoom-in; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-big { background: #fff; border-radius: 16px; padding: 12px; width: min(80vw, 360px); }
.qr-big svg { display: block; width: 100%; height: auto; }
.room-code { font-size: 2.4rem; font-weight: 900; letter-spacing: .18em; }
.url { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--muted); word-break: break-all; }

.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.player { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: var(--bg2); border-left: 4px solid var(--pc); position: relative; }
.player .av { font-size: 1.6rem; }
.player .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .sc { font-size: .8rem; color: var(--muted); }
.player.off { opacity: .45; }
.player .x { position: absolute; top: 2px; right: 4px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 4px; }
.player.empty { border-left-color: var(--line); color: var(--muted); justify-content: center; font-size: .85rem; border: 1px dashed var(--line); background: transparent; }

.games { display: grid; gap: 10px; }
.game-card { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: transform .06s, border-color .15s; }
.game-card:active { transform: scale(.98); }
.game-card .ic { font-size: 2.4rem; width: 56px; height: 56px; display: grid; place-items: center; background: var(--bg2); border-radius: 14px; flex: none; }
.game-card h3 { font-size: 1.15rem; }
.game-card p { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.game-card:disabled { cursor: default; opacity: .7; }

.settings { display: flex; flex-direction: column; gap: 8px; text-align: left; background: var(--bg2); border-radius: 14px; padding: 12px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; }
.setting > span { flex: 1 1 auto; min-width: 0; }
.setting[hidden] { display: none; }
.setting select { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-weight: 700; min-width: 96px; flex: none; width: auto; max-width: 62%; }

/* ---------- game frame ---------- */
.gamebar { display: flex; align-items: center; gap: 8px; }
.gamebar .title { font-weight: 800; font-size: 1.05rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 900; font-size: 1.2rem; min-width: 2.2ch; text-align: right; }
.timerbar { height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.timerbar > div { height: 100%; background: var(--accent); width: 100%; transition: width .1s linear; }
.timerbar.low > div { background: var(--bad); }
#game { display: flex; flex-direction: column; gap: 14px; flex: 1; }

.prompt { font-size: 1.45rem; font-weight: 800; line-height: 1.25; text-align: center; padding: 8px 0; }
.status { text-align: center; color: var(--muted); font-weight: 600; }
.big-emoji { font-size: 4rem; text-align: center; }
.points { font-size: 2rem; font-weight: 900; text-align: center; color: var(--good); }
.points.zero { color: var(--muted); }
.points.neg { color: var(--bad); }

.choices { display: grid; gap: 10px; }
.choice { border: 0; border-radius: 16px; padding: 18px 14px; font-size: 1.1rem; font-weight: 800; color: #111; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; touch-action: manipulation; }
.choice .shape { font-size: 1.3rem; }
.choice .count { margin-left: auto; font-size: .95rem; opacity: .8; }
.choice:nth-child(1) { background: var(--c0); }
.choice:nth-child(2) { background: var(--c1); }
.choice:nth-child(3) { background: var(--c2); }
.choice:nth-child(4) { background: var(--c3); }
.choices.locked .choice:not(.mine) { opacity: .35; }
.choice.mine { outline: 4px solid #fff; }
.choices.revealed .choice { opacity: .3; }
.choices.revealed .choice.right { opacity: 1; outline: 4px solid #fff; }
.choices.revealed .choice.mine:not(.right) { opacity: .7; text-decoration: line-through; }

.option { width: 100%; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.option.mine { border-color: var(--accent); background: var(--card2); }
.option.truth { border-color: var(--good); background: color-mix(in srgb, var(--good) 18%, var(--card)); }
.option .meta { font-size: .85rem; color: var(--muted); font-weight: 600; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.standings { display: flex; flex-direction: column; gap: 6px; }
.standings .line { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg2); border-radius: 12px; border-left: 4px solid var(--pc); }
.standings .line.me { background: var(--card2); }
.standings .rk { width: 1.6em; font-weight: 900; color: var(--muted); }
.standings .pts { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.standings .delta { font-size: .8rem; font-weight: 700; color: var(--good); min-width: 3.5em; text-align: right; }
.standings .delta.neg { color: var(--bad); }

.spectator { background: var(--card2); border-radius: 12px; padding: 8px 12px; text-align: center; font-size: .9rem; color: var(--muted); }

/* ---------- quick tap ---------- */
.tapzone { flex: 1; min-height: 55dvh; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer; transition: background .05s; padding: 16px; }
.tapzone .t1 { font-size: 3.2rem; font-weight: 900; }
.tapzone .t2 { font-size: 1.1rem; font-weight: 600; opacity: .85; }
.tz-ready { background: var(--card2); }
.tz-wait { background: #7a1730; }
.tz-decoy { background: #1f49d6; }
.tz-go { background: #18b26b; color: #04150c; }
.tz-false { background: #3b0d17; }
.tz-done { background: #0f5136; }

/* ---------- doodle ---------- */
.canvas-wrap { background: #fff; border-radius: 14px; overflow: hidden; touch-action: none; position: relative; }
.canvas-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; flex: none; }
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.size { width: 38px; height: 34px; border-radius: 10px; background: var(--card2); border: 2px solid transparent; display: grid; place-items: center; cursor: pointer; }
.size.sel { border-color: var(--accent); }
.size i { display: block; background: #fff; border-radius: 50%; }
.mask { font-family: ui-monospace, monospace; font-size: 1.6rem; font-weight: 800; letter-spacing: .3em; text-align: center; white-space: pre-wrap; }
.feed { display: flex; flex-direction: column; gap: 4px; max-height: 26dvh; overflow-y: auto; font-size: .95rem; }
.feed .f { padding: 4px 10px; border-radius: 10px; background: var(--bg2); }
.feed .f.ok { background: color-mix(in srgb, var(--good) 25%, var(--bg2)); font-weight: 700; }
.feed .f.close { background: color-mix(in srgb, var(--accent) 25%, var(--bg2)); font-weight: 700; }
.word-choice { font-size: 1.3rem; }

/* ---------- double agent ---------- */
.secret { width: 100%; border: 2px dashed var(--line); background: var(--bg2); border-radius: 14px; padding: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.secret.open { border-style: solid; border-color: var(--accent); }
.secret.open b { font-size: 1.5rem; }
.secret-big { cursor: pointer; text-align: center; font-size: 2.6rem; font-weight: 900; padding: 28px 12px; background: var(--card); border: 2px solid var(--accent); border-radius: 20px; transition: filter .3s; }
.secret-big small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.secret-big.hidden-word { filter: blur(14px); }

/* ---------- most likely ---------- */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.vote-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 16px; background: var(--card); border: 2px solid color-mix(in srgb, var(--pc) 60%, transparent); cursor: pointer; }
.vote-btn span { font-size: 2.2rem; }
.vote-btn b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- tug rush ---------- */
.rope { position: relative; height: 54px; border-radius: 14px; overflow: hidden; display: flex; }
.rope.big { height: 14vh; border-radius: 2vw; }
.rope-zone { flex: 1; }
.rope-zone.red { background: linear-gradient(90deg, #ff4d6d 0 12%, #5c1424 12%); }
.rope-zone.blue { background: linear-gradient(270deg, #3a86ff 0 12%, #0e2a5c 12%); }
.rope-line { position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; background: repeating-linear-gradient(45deg, #c9a46b 0 8px, #8d6e3f 8px 16px); }
.rope-knot { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 2rem; transition: left .1s linear; }
.rope.big .rope-knot { font-size: 9vh; }

/* ---------- echo ---------- */
.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pad { aspect-ratio: 1; border: 0; border-radius: 24px; background: var(--pad); color: #0008; font-size: 2.6rem; opacity: .55; cursor: pointer; touch-action: manipulation; transition: opacity .08s, transform .08s, box-shadow .08s; }
.pad:active { transform: scale(.96); }
.pad.lit { opacity: 1; transform: scale(1.04); box-shadow: 0 0 40px var(--pad); }
.pads.watching .pad { pointer-events: none; }
.pads.tv-pads { width: min(60vh, 100%); margin: 0 auto; }

/* ---------- results ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; padding-top: 12px; }
.podium .col { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.podium .av { font-size: 2.6rem; }
.podium .nm { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .block { width: 100%; border-radius: 12px 12px 0 0; display: grid; place-items: center; font-size: 1.8rem; font-weight: 900; background: var(--card2); }
.podium .p1 .block { height: 120px; background: linear-gradient(#ffd75e, #e0a800); color: #3a2a00; }
.podium .p2 .block { height: 90px; background: linear-gradient(#e3e3f0, #a7a7c2); color: #222; }
.podium .p3 .block { height: 66px; background: linear-gradient(#f0b27a, #b9733b); color: #2b1300; }

/* ---------- overlays ---------- */
#conn-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: var(--bad); color: #fff; text-align: center; font-weight: 700; padding: 6px; }
#toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: #000d; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; max-width: 90vw; text-align: center; }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 22px; padding: 20px; width: min(92vw, 440px); }
dialog::backdrop { background: #000a; }

@keyframes pop { 0% { transform: scale(.6); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
.pop { animation: pop .25s ease-out; }
@keyframes shake { 0%, 100% { transform: translateX(0) } 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.shake { animation: shake .25s ease-in-out 2; }

/* ---------- trivia lock-in board ---------- */
.lockboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.lock { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border-radius: 12px; background: var(--bg2); border: 2px dashed var(--line); opacity: .5; filter: grayscale(1); transition: opacity .2s, filter .2s; }
.lock .av { font-size: 1.5rem; }
.lock .nm { font-size: .8rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lock .st { font-size: .75rem; font-weight: 800; color: var(--muted); }
.lock.on { opacity: 1; filter: none; border: 2px solid var(--pc); background: color-mix(in srgb, var(--pc) 22%, var(--bg2)); }
.lock.on .st { color: var(--text); }
.lock.me:not(.on) { opacity: .8; border-color: var(--bad); animation: shake .4s ease-in-out 1; }
.pressure { display: block; font-size: 1.05rem; color: var(--accent); }
.pressure.me { color: var(--bad); font-size: 1.2rem; animation: shake .3s ease-in-out 3; }
.lock-flash { font-weight: 800; padding: 6px 12px; border-radius: 99px; background: var(--card2); display: inline-block; margin-bottom: 6px; animation: flashout 2.4s ease-out forwards; }
@keyframes flashout { 0% { transform: scale(.6); opacity: 0 } 10% { transform: scale(1.08); opacity: 1 } 20% { transform: scale(1) } 75% { opacity: 1 } 100% { opacity: 0 } }

/* ---------- chess relay ---------- */
.board { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); aspect-ratio: 1; width: min(100%, 62dvh); margin: 0 auto; border-radius: 10px; overflow: hidden; container-type: inline-size; box-shadow: 0 6px 24px #0006; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.sq { position: relative; display: grid; place-items: center; cursor: pointer; aspect-ratio: 1; min-height: 0; overflow: hidden; }
.sq.light { background: #eed9b6; }
.sq.dark { background: #b58863; }
.sq.last::before { content: ''; position: absolute; inset: 0; background: #ffd60a66; }
.sq.sel::before { content: ''; position: absolute; inset: 0; background: #4c9cff99; }
.sq.check { background-image: radial-gradient(circle, #ff2a2a 0%, #ff2a2a88 45%, transparent 75%); }
.sq .by { position: absolute; z-index: 2; left: 50%; bottom: 2%; transform: translateX(-50%); max-width: 96%; overflow: hidden; white-space: nowrap; text-overflow: clip; font-size: 1.75cqw; line-height: 1.25; font-weight: 700; color: #fff; background: #000a; border-bottom: 2px solid var(--pc); border-radius: 3px; padding: 0 2px; pointer-events: none; }
.grade.g-cpu { border-color: #9aa4b2; }
.sq.target::after { content: ''; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: #0005; }
.sq.target.cap::after { width: 86%; height: 86%; background: transparent; border: 5px solid #0005; box-sizing: border-box; }
.pc { position: relative; z-index: 1; font-size: 10.5cqw; line-height: 1; font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', 'DejaVu Sans', sans-serif; }
.pc.w { color: #fff; text-shadow: 0 0 2px #000, 0 0 1px #000, 0 1px 2px #000; }
.pc.b { color: #1d1d1d; text-shadow: 0 0 1px #fff8; }
.sq i { position: absolute; font-style: normal; font-size: 2.4cqw; font-weight: 700; color: #0008; }
.sq i.cf { right: 3%; bottom: 1%; }
.sq i.cr { left: 4%; top: 2%; }
.btn.promo { font-size: 2rem; padding: 6px 12px; background: #eed9b6; }
.evalbar { position: relative; height: 22px; border-radius: 99px; overflow: hidden; background: #222; border: 1px solid var(--line); }
.evalbar > div { height: 100%; background: #f4f1ea; transition: width .4s; }
.evalbar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.movelist { display: flex; flex-direction: column; gap: 4px; }
.mv { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--bg2); font-size: .92rem; }
.mv .no { color: var(--muted); min-width: 2.4em; }
.mv .who { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv .gr { font-weight: 800; white-space: nowrap; }
.grade { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 2px solid var(--line); }
.grade .gi { font-size: 2.2rem; }
.grade .gl { font-weight: 800; }
.grade .gb { color: var(--muted); font-size: .9rem; }
.grade .gp { font-size: 1.6rem; font-weight: 900; color: var(--good); }
.g-best, .g-excellent { border-color: var(--good); }
.g-good { border-color: var(--info); }
.g-inaccuracy { border-color: var(--accent); }
.g-mistake { border-color: #ff9f43; }
.g-blunder { border-color: var(--bad); }
.mv.g-best b, .mv.g-excellent b { color: var(--good); }
.mv.g-mistake b, .mv.g-blunder b { color: var(--bad); }

/* ---------- TV mode (phones as controllers) ---------- */
.look-tv { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 16px; border-radius: 18px; background: var(--card2); border: 2px dashed var(--accent); text-align: center; font-size: 1.15rem; }
.look-tv span { font-size: 2.2rem; }
.choices.tvpads { grid-template-columns: 1fr 1fr; }
.choices.tvpads .choice { min-height: 22dvh; justify-content: center; }
.choices.tvpads .choice .shape { font-size: 3.4rem; }
.choices.tvpads .choice .count { position: absolute; margin: 0; }
.choices.tvpads .choice { position: relative; }
.choices.tvpads .choice .count { bottom: 10px; right: 12px; }
.tz-tv { background: var(--card2); border: 3px dashed var(--line); }
.tz-tv .t1 { font-size: 2.2rem; }

/* ---------- Colony Hex ---------- */
.cx-svg { width: 100%; height: auto; display: block; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.cx-spot { cursor: pointer; }
.cx-pulse { animation: cxpulse 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes cxpulse { 50% { transform: scale(1.45); opacity: .7; } }
.cx-hit { animation: cxhit 1s ease-in-out 3; }
@keyframes cxhit { 50% { filter: brightness(1.5); } }
.cx-hand { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 6px; align-items: stretch; }
.cx-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; background: color-mix(in srgb, var(--rc) 30%, var(--card)); border: 2px solid var(--rc); }
.cx-card span { font-size: 1.3rem; }
.cx-card b { font-size: 1.3rem; font-weight: 900; }
.cx-card.zero { opacity: .45; }
.cx-vp { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 10px; border-radius: 12px; background: var(--card2); font-size: 1.1rem; }
.cx-vp b { font-size: 1.4rem; }
.cx-vp small { color: var(--muted); }
.cx-status { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; text-align: center; font-size: 1.1rem; padding: 6px 0; }
.cx-status.final { font-size: 1.5rem; font-weight: 900; }
.cx-dice { font-size: 2.2rem; line-height: 1; letter-spacing: .05em; }
.cx-sum { font-size: 1.3rem; padding: 2px 10px; border-radius: 99px; background: var(--card2); }
.cx-sum.seven { background: var(--bad); color: #fff; }
.cx-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cx-act { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cx-act b { font-size: 1.05rem; }
.cx-act span { font-size: .95rem; color: var(--muted); }
.cx-act:disabled { opacity: .38; cursor: default; }
.cx-act[data-act="end"] { background: color-mix(in srgb, var(--good) 25%, var(--card2)); }
.cx-roll { font-size: 1.6rem; padding: 26px; }
.cx-offer { display: flex; flex-direction: column; gap: 8px; border-color: var(--accent); }
.cx-row { flex-wrap: wrap; gap: 6px; }
.cx-sel { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px; font: inherit; font-weight: 700; }
.cx-log { display: flex; flex-direction: column; gap: 3px; font-size: .9rem; color: var(--muted); }
.cx-log div:first-child { color: var(--text); }
.cx-costs { display: grid; gap: 4px; font-size: .9rem; padding: 10px 12px; border-radius: 12px; background: var(--bg2); }
.cx-costs div { display: flex; justify-content: space-between; gap: 8px; }
