/* Commander Companion — full custom theme (no water.css). */
:root {
  --bg: #0d0b14;
  --bg-2: #14111f;
  --panel: rgba(28, 23, 44, 0.72);
  --panel-solid: #1b1729;
  --ink: #f2ecff;
  --muted: #9b93b8;
  --line: rgba(255, 255, 255, 0.08);
  --gold: #e8c87a;
  --gold-2: #c79a4a;
  --accent: #7c5cff;
  --danger: #e0625f;
  --good: #52b788;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --seat: #7c5cff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(120% 120% at 50% -10%, #1c1633 0%, var(--bg) 60%);
  color: var(--ink);
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
canvas { display: block; }
a { color: var(--gold); }

/* ---------- backdrop art ---------- */
.bg-art { position: fixed; inset: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(33%, 1fr)); opacity: 0; transition: opacity 1s; z-index: 0; }
.bg-art.active { opacity: 0.35; }
.bg-tile { background-size: cover; background-position: center; filter: saturate(1.1); }
.bg-veil { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 120% at 50% -10%, rgba(28,22,51,0.55) 0%, rgba(13,11,20,0.86) 70%); }

/* ---------- screen switching ---------- */
.screen { display: none; position: relative; z-index: 2; height: 100%; }
body[data-screen="home"] .screen[data-for="home"],
body[data-screen="host-setup"] .screen[data-for="host-setup"],
body[data-screen="join"] .screen[data-for="join"],
body[data-screen="table"] .screen[data-for="table"],
body[data-screen="seat"] .screen[data-for="seat"],
body[data-screen="player"] .screen[data-for="player"] { display: block; }

/* ---------- buttons / fields ---------- */
.btn { border: 1px solid var(--line); background: var(--panel-solid); color: var(--ink);
  border-radius: 12px; padding: 14px 18px; font-size: 16px; font-weight: 600; transition: transform .08s, filter .15s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #5a3fd6); border-color: transparent; box-shadow: 0 6px 20px rgba(124,92,255,.4); }
.btn-ghost { background: rgba(255,255,255,0.04); }
.btn-big { width: 100%; padding: 18px; font-size: 18px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.btn-big small { font-weight: 400; opacity: .7; font-size: 12px; }
.btn.small { padding: 9px 12px; font-size: 14px; }
.btn-buy { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2a1e07; border: none; text-decoration: none; text-align: center; }

.field { display: block; margin: 16px 0; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .08em; }
.field input { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #0f0c1a; color: var(--ink); font-size: 17px; }
.code-input { text-transform: uppercase; letter-spacing: .4em; text-align: center; font-size: 28px !important; font-weight: 700; }
.error { color: var(--danger); font-size: 14px; }
.muted, .fine, .sub { color: var(--muted); }
.fine { text-align: center; font-size: 12px; margin-top: 14px; }

/* ---------- home ---------- */
.home-card, .setup-card { max-width: 460px; margin: 0 auto; padding: 28px 22px; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.brand { text-align: center; margin-bottom: 12px; }
.brand-mark { font-size: 44px; color: var(--gold); filter: drop-shadow(0 0 14px rgba(232,200,122,.6)); }
.brand h1 { margin: 6px 0 4px; font-size: 30px; letter-spacing: .02em; font-weight: 800; }
.brand h1 span { color: var(--gold); display: block; font-weight: 600; }
.tagline { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 8px auto 0; max-width: 360px; }
.home-actions { display: grid; gap: 12px; margin-top: 14px; }

/* ---------- setup ---------- */
.setup-card { max-width: 460px; }
.back { background: none; border: none; color: var(--muted); font-size: 15px; align-self: flex-start; padding: 6px 0; margin-bottom: 6px; }
h2 { font-size: 22px; margin: 4px 0 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink); border-radius: 999px; padding: 9px 14px; font-size: 14px; }
.chip.is-active { background: var(--accent); border-color: transparent; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper .step { width: 54px; height: 54px; border-radius: 14px; font-size: 26px; background: var(--panel-solid); border: 1px solid var(--line); color: var(--ink); }
.stepper output { font-size: 30px; font-weight: 800; min-width: 70px; text-align: center; }

/* ---------- table (tablet) ---------- */
.table-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; }
.table-brand { color: var(--gold); font-weight: 700; letter-spacing: .03em; font-size: 18px; }
.join-badge { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); padding: 8px 14px 8px 8px; border-radius: 16px; backdrop-filter: blur(8px); }
.join-qr img { width: 96px; height: 96px; border-radius: 10px; display: block; image-rendering: pixelated; background: #fff; }
.join-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.join-meta { display: flex; flex-direction: column; }
.join-code { font-size: 34px; font-weight: 800; letter-spacing: .12em; color: var(--gold); line-height: 1.1; }
.table-tools { display: flex; gap: 8px; }
.icon-btn { width: 46px; height: 46px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); font-size: 20px; }
.icon-btn.wide { width: auto; padding: 0 13px; gap: 5px; font-size: 14px; font-weight: 600; white-space: nowrap; }

.table-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 14px; padding: 6px 18px 18px; height: calc(100% - 88px); }
.pcard { position: relative; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--seat) 22%, var(--panel-solid)) 0%, var(--panel-solid) 60%);
  display: flex; flex-direction: column; box-shadow: var(--shadow); }
.pcard::before { content: ''; position: absolute; inset: 0; background-image: var(--art); background-size: cover; background-position: center top; opacity: 0; transition: opacity .6s; }
.pcard.has-art::before { opacity: .22; }
.pcard::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--seat) 55%, transparent); border-radius: var(--radius); pointer-events: none; }
.pcard.is-dead { filter: grayscale(.8) brightness(.6); }
.pcard > * { position: relative; z-index: 1; }
.pcard-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 4px; }
.pname { font-weight: 700; font-size: clamp(15px, 2.2vw, 22px); }
.pbadges .badge { margin-left: 6px; }
.badge.mon { color: var(--gold); }
.badge.live { color: var(--good); font-size: 12px; }
.pcard-life { display: flex; align-items: center; justify-content: space-between; flex: 1; padding: 0 10px; }
.life-num { font-size: clamp(48px, 9vw, 104px); font-weight: 800; line-height: 1; text-shadow: 0 4px 24px rgba(0,0,0,.6); font-variant-numeric: tabular-nums; }
.life-btn { width: clamp(48px, 7vw, 78px); height: clamp(48px, 7vw, 78px); border-radius: 50%; font-size: 30px; font-weight: 700;
  background: rgba(0,0,0,.28); border: 1px solid var(--line); color: var(--ink); }
.life-btn:active { background: color-mix(in srgb, var(--seat) 40%, transparent); }
.stat-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 16px; min-height: 22px; }
.stat { font-size: 13px; background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; }
.stat.lethal { background: var(--danger); color: #fff; }
.pcard-cmdr { padding: 6px 16px 12px; font-size: 13px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- seat pick ---------- */
.seat-list { display: grid; gap: 10px; margin-top: 8px; }
.seat-pick { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; text-align: left;
  border: 1px solid var(--line); background: var(--panel-solid); color: var(--ink); }
.seat-pick .sp-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--seat); box-shadow: 0 0 12px var(--seat); }
.seat-pick .sp-name { font-weight: 700; font-size: 17px; flex: 1; }
.seat-pick .sp-state { font-size: 13px; color: var(--muted); }
.seat-pick.taken { opacity: .45; }

/* ---------- player (phone) ---------- */
.player-root { height: calc(100% - 62px); overflow-y: auto; padding: 14px 14px 20px; }
.player-tabs { position: fixed; bottom: 0; left: 0; right: 0; height: 62px; display: flex; z-index: 5;
  background: var(--panel-solid); border-top: 1px solid var(--line); }
.ptab { flex: 1; background: none; border: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.ptab.is-active { color: var(--gold); box-shadow: inset 0 2px 0 var(--gold); }

.me-wrap { position: relative; border-radius: var(--radius); overflow: hidden; padding: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--seat) 22%, var(--panel-solid)), var(--panel-solid)); }
.me-wrap::before { content: ''; position: absolute; inset: 0; background-image: var(--art); background-size: cover; background-position: center; opacity: 0; }
.me-wrap.has-art::before { opacity: .2; }
.me-wrap > * { position: relative; z-index: 1; }
.me-name { text-align: center; font-weight: 700; font-size: 18px; margin-bottom: 6px; cursor: pointer; }
.me-name .mon { color: var(--gold); }
.me-name-edit { font-size: 13px; opacity: .45; }
.me-life { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 6px; height: 230px; }
.me-zone { border: none; border-radius: 16px; background: rgba(0,0,0,.28); color: var(--ink); font-size: 48px; display: flex; align-items: center; justify-content: center; }
.me-zone.dec:active { background: color-mix(in srgb, var(--danger) 50%, transparent); }
.me-zone.inc:active { background: color-mix(in srgb, var(--good) 50%, transparent); }
.me-life-num { font-size: 96px; font-weight: 800; align-self: center; min-width: 120px; text-align: center; font-variant-numeric: tabular-nums; text-shadow: 0 4px 24px rgba(0,0,0,.6); }
.me-life.dead .me-life-num { color: var(--danger); }
.me-quick { display: flex; gap: 10px; margin: 10px 0; }
.me-quick .q { flex: 1; padding: 12px; border-radius: 12px; background: rgba(0,0,0,.28); border: 1px solid var(--line); color: var(--ink); font-size: 18px; font-weight: 700; }
.dead-tag { text-align: center; margin-top: 10px; color: var(--danger); font-weight: 700; }

.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 2px 8px; }
.cmd-panel { margin-top: 8px; }
.cmd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cmd-cell { position: relative; border-radius: 12px; padding: 10px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--seat) 18%, var(--panel-solid)); display: flex; flex-direction: column; gap: 6px; }
.cmd-cell.lethal { background: var(--danger); }
.cmd-from { font-size: 13px; opacity: .85; }
.cmd-val { font-size: 26px; font-weight: 800; }
.cmd-ctrls { display: flex; gap: 6px; }
.cmd-mini { flex: 1; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--ink); font-size: 20px; padding: 6px 0; }

/* table tab */
.ptable .trow { display: grid; grid-template-columns: 14px 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); margin-bottom: 8px; }
.trow.me { box-shadow: inset 0 0 0 2px var(--seat); }
.trow.dead { opacity: .5; }
.trow-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--seat); }
.trow-name { font-size: 15px; font-weight: 600; }
.trow-name small { color: var(--gold); font-weight: 400; }
.trow-life { font-size: 24px; font-weight: 800; }
.trow-stats { font-size: 13px; color: var(--muted); }

/* more tab */
.cblock { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid var(--line); margin-bottom: 8px; }
.cblock.lethal { border-color: var(--danger); }
.cblock.small { background: rgba(255,255,255,.03); }
.cb-label { font-weight: 600; }
.cb-ctrls { display: flex; align-items: center; gap: 12px; }
.cb-btn { width: 42px; height: 42px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid var(--line); color: var(--ink); font-size: 22px; }
.cb-val { font-size: 22px; font-weight: 800; min-width: 32px; text-align: center; }
.more-block { margin-top: 6px; }
.more-actions { display: grid; gap: 8px; margin-top: 16px; }

/* ---------- modal / toast ---------- */
[hidden] { display: none !important; }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 20px; box-shadow: var(--shadow); }
@media (min-width: 600px) { .modal { align-items: center; } .modal-card { border-radius: 20px; } }
.modal-card h3 { margin: 0 0 12px; }
.modal-row { display: flex; gap: 10px; margin-top: 14px; }
.modal-row .btn { flex: 1; }
.search-input { width: 100%; padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: #0f0c1a; color: var(--ink); font-size: 16px; margin-bottom: 10px; }
.search-results { display: grid; gap: 6px; margin-bottom: 12px; }
.search-row { text-align: left; padding: 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--ink); }
.or-sep { text-align: center; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 12px 0; }
.scan-stage { position: relative; width: 100%; aspect-ratio: 3/4; max-height: 50vh; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 10px; }
.scan-stage video { width: 100%; height: 100%; object-fit: cover; }
.scan-guide { position: absolute; inset: 12% 8%; border: 2px dashed rgba(255,255,255,.6); border-radius: 12px; pointer-events: none; }
.scan-status { text-align: center; }
.card-detail { text-align: center; }
.card-img { max-width: 240px; width: 70%; border-radius: 12px; margin-bottom: 12px; }
.store-links { display: grid; gap: 8px; margin: 10px 0; }
.dice-out { text-align: center; font-size: 30px; font-weight: 800; padding: 14px; }
.dice-row { display: flex; gap: 8px; }
.dice-row .btn { flex: 1; }
.log-list { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; margin-bottom: 12px; }
.log-line { font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.log-line time { color: var(--muted); font-size: 12px; margin-right: 8px; }

.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: #000; color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); }

/* =====================================================================
   Cooler tablet table view + commander UI (overrides above)
   ===================================================================== */
.bg-art.active { opacity: .5; }
.bg-tile { animation: bgdrift 44s ease-in-out infinite alternate; }
@keyframes bgdrift { from { transform: scale(1.05); } to { transform: scale(1.2); } }

.table-top { padding: 16px 26px; }
.table-brand { font-size: 21px; text-shadow: 0 0 20px rgba(232,200,122,.45); }
.join-badge { background: linear-gradient(135deg, rgba(42,34,68,.92), rgba(18,14,30,.92)); box-shadow: 0 10px 30px rgba(0,0,0,.55); border-color: rgba(232,200,122,.25); }
.join-code { text-shadow: 0 0 18px rgba(232,200,122,.55); }
.icon-btn { transition: transform .1s, background .15s; }
.icon-btn:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--accent) 30%, var(--panel)); }

.table-grid { gap: 18px; padding: 4px 26px 26px; }

.pcard { border: none; border-radius: 22px; cursor: pointer; transform: rotate(var(--rot, 0deg));
  box-shadow: 0 18px 52px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.05);
  transition: transform .25s ease, box-shadow .2s; }
.pcard:hover { transform: translateY(-3px) rotate(var(--rot, 0deg)); box-shadow: 0 26px 60px rgba(0,0,0,.7); }

/* face-out seat layouts (tablet); around grid template is set inline per count */
.layout-around .around-card { aspect-ratio: 1; height: 100%; width: auto; max-width: 100%; margin: auto; }

/* drag-to-swap (tablet) */
.pcard.dragging { opacity: .92; transition: none; cursor: grabbing; box-shadow: 0 30px 72px rgba(0,0,0,.8); }
.pcard.drop-target::after { box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 70px rgba(232,200,122,.3) !important; }

/* phone: move-my-spot control */
.spot-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 2px 0 8px; }
.spot-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.spot-btn { width: 40px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: #fff; font-size: 15px; }
.spot-btn:active { background: color-mix(in srgb, var(--seat) 40%, transparent); }
.pcard::before { opacity: 0; background-position: center 18%; filter: saturate(1.18) contrast(1.03);
  transition: opacity .8s ease, transform 9s ease; }
.pcard.has-art::before { opacity: .6; }
.pcard.has-art:hover::before { transform: scale(1.07); }
.pcard::after { border-radius: 22px;
  background: linear-gradient(180deg, rgba(8,6,14,.35) 0%, rgba(8,6,14,.02) 32%, rgba(8,6,14,.5) 74%, rgba(8,6,14,.88) 100%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--seat) 60%, transparent), inset 0 0 70px color-mix(in srgb, var(--seat) 22%, transparent); }
.pcard > * { position: relative; z-index: 2; }

.pname { font-size: clamp(16px, 2.3vw, 26px); font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.85); }
.badge.live { width: 10px; height: 10px; padding: 0; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); display: inline-block; vertical-align: middle; }
.badge.mon { font-size: 22px; filter: drop-shadow(0 0 8px rgba(232,200,122,.85)); }

.life-num { font-size: clamp(58px, 11vw, 134px); font-weight: 900; letter-spacing: -.02em;
  text-shadow: 0 0 34px color-mix(in srgb, var(--seat) 55%, transparent), 0 6px 26px rgba(0,0,0,.75); }
.life-btn { background: rgba(0,0,0,.34); backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.life-btn:hover { background: color-mix(in srgb, var(--seat) 45%, rgba(0,0,0,.4)); }

.stat-row { padding: 4px 16px; }
.stat { background: rgba(0,0,0,.42); backdrop-filter: blur(3px); }

.pcard-cmdr { display: flex; align-items: center; gap: 8px; padding: 10px 16px 15px; font-size: clamp(12px, 1.35vw, 16px); color: #f4ecdf; white-space: nowrap; }
.pcard-cmdr .cmdr-ic { color: var(--gold); flex: none; }
.pcard-cmdr .cmdr-names { flex: 1; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 8px rgba(0,0,0,.85); }
.pcard-cmdr .cmdr-names.empty { color: rgba(255,255,255,.5); font-style: italic; }
.pcard-cmdr .cmdr-tap { flex: none; font-size: 12px; color: var(--gold); opacity: .85; }

.pcard.is-low::after { animation: lowpulse 1.7s ease-in-out infinite; }
@keyframes lowpulse {
  0%, 100% { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--seat) 60%, transparent), inset 0 0 70px color-mix(in srgb, var(--seat) 22%, transparent); }
  50% { box-shadow: inset 0 0 0 3px var(--danger), inset 0 0 80px rgba(224,98,95,.42); }
}

.dead-overlay { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(8,6,14,.66); border-radius: 22px; }
.dead-overlay .skull { font-size: clamp(40px, 7vw, 80px); filter: drop-shadow(0 0 14px rgba(224,98,95,.6)); }
.dead-overlay b { letter-spacing: .22em; text-transform: uppercase; color: #e9c0bf; font-size: clamp(12px, 1.5vw, 18px); }
.pcard.is-dead::before { filter: grayscale(1) brightness(.5); }

/* ---- commander strip (phone Me view) ---- */
.cmdr-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.btn-cmdr-set { width: 100%; background: linear-gradient(135deg, rgba(232,200,122,.2), rgba(232,200,122,.06));
  border: 1px dashed rgba(232,200,122,.55); color: var(--gold); padding: 13px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.cmdr-chip { flex: 1 1 100%; display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; color: #fff; background: var(--panel-solid); text-align: left; }
.cmdr-chip::before { content: ''; position: absolute; inset: 0; background-image: var(--art); background-size: cover; background-position: center 22%; opacity: 0; }
.cmdr-chip.has-art::before { opacity: .3; }
.cmdr-chip > * { position: relative; z-index: 1; }
.cmdr-chip-name { flex: 1; font-weight: 700; }
.cmdr-chip-go { color: var(--gold); font-size: 20px; }
.cmdr-add { flex: 1 1 100%; background: rgba(255,255,255,.04); border: 1px dashed var(--line); color: var(--muted); border-radius: 12px; padding: 11px; font-size: 14px; }

/* ---- recents in the picker ---- */
.recent-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 4px; }
.recent-chip { flex: 0 0 auto; width: 104px; height: 66px; border-radius: 10px; border: 1px solid var(--line); position: relative; overflow: hidden;
  background: #0f0c1a; background-size: cover; background-position: center 25%; color: #fff; padding: 0; }
.recent-chip .recent-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 6px; font-size: 10px; line-height: 1.15; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.88)); }

/* ---- card detail: type line + oracle text ---- */
.card-type { color: var(--muted); font-size: 13px; margin: -4px 0 10px; }
.card-oracle { text-align: left; font-size: 14px; line-height: 1.5; background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.ptable .trow { cursor: pointer; }
.ptable .trow:active { background: color-mix(in srgb, var(--seat) 18%, var(--panel-solid)); }

/* =====================================================================
   Polish pass: flashes, seat admin, format badge, refined phone zones
   ===================================================================== */
.life-num.flash-down, .me-life-num.flash-down { animation: flashdown .6s ease; }
.life-num.flash-up, .me-life-num.flash-up { animation: flashup .6s ease; }
@keyframes flashdown { 0% { color: #ff7b78; transform: scale(1.13); } 100% { color: inherit; transform: scale(1); } }
@keyframes flashup { 0% { color: #74e0a3; transform: scale(1.13); } 100% { color: inherit; transform: scale(1); } }

.table-brand { display: flex; flex-direction: column; line-height: 1.15; }
.tb-logo { color: var(--gold); font-weight: 700; font-size: 21px; text-shadow: 0 0 20px rgba(232,200,122,.45); }
.table-format { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }

.pcard-admin { position: absolute; top: 10px; right: 12px; z-index: 4; width: 34px; height: 30px; border-radius: 9px;
  background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.14); color: #fff; font-size: 18px; line-height: 1;
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }
.pcard-admin:hover { background: color-mix(in srgb, var(--seat) 45%, rgba(0,0,0,.4)); }
.pcard-head { padding-right: 56px; }

.admin-actions { display: grid; gap: 8px; margin: 6px 0 12px; }
.admin-actions .btn { width: 100%; }
.btn.danger { color: #ff8784; border-color: rgba(224,98,95,.5); }

.cmd-sub { font-size: 11px; color: rgba(255,255,255,.72); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.me-life { gap: 8px; }
.me-zone { background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,.07), rgba(0,0,0,.34)); border: 1px solid rgba(255,255,255,.08);
  transition: background .12s, transform .08s; }
.me-zone span { opacity: .5; font-weight: 300; }
.me-zone.dec:active { transform: scale(.97); background: radial-gradient(120% 120% at 50% 0%, rgba(224,98,95,.5), rgba(0,0,0,.3)); }
.me-zone.inc:active { transform: scale(.97); background: radial-gradient(120% 120% at 50% 0%, rgba(82,183,136,.5), rgba(0,0,0,.3)); }

.screen { animation: fadein .32s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Turns, timers & storm
   ===================================================================== */
/* let the grid fill whatever space the header + turn bar leave */
body[data-screen="table"] .screen[data-for="table"] { display: flex; flex-direction: column; }
.table-grid { height: auto; flex: 1 1 auto; min-height: 0; }

.turn-bar { display: flex; align-items: center; gap: 14px; padding: 6px 26px 12px; }
.tb-turn { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 16px; backdrop-filter: blur(6px); }
.tb-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.tb-holder { font-weight: 800; font-size: 18px; color: #fff; }
.tb-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; color: var(--gold); min-width: 64px; text-align: right; }
.tb-storm { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px; }
.tb-storm-val { font-weight: 700; color: #cdb9ff; white-space: nowrap; }
.tb-s-btn { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: #fff; font-size: 20px; }
.tb-pass { margin-left: auto; background: linear-gradient(135deg, var(--accent), #5a3fd6); border: none; color: #fff; font-weight: 700; padding: 11px 22px; border-radius: 12px; font-size: 16px; box-shadow: 0 6px 20px rgba(124,92,255,.4); }
.tb-pass:active { transform: scale(.97); }

.pcard.is-turn { animation: turnglow 2.6s ease-in-out infinite; }
@keyframes turnglow {
  0%, 100% { box-shadow: 0 0 0 3px var(--gold), 0 18px 52px rgba(0,0,0,.6), 0 0 38px rgba(232,200,122,.35); }
  50% { box-shadow: 0 0 0 3px var(--gold), 0 18px 52px rgba(0,0,0,.6), 0 0 72px rgba(232,200,122,.6); }
}
.pcard-turn { display: flex; align-items: center; gap: 10px; padding: 0 16px 8px; font-size: 13px; color: #e8dcc4; }
.turn-flag { font-weight: 800; color: var(--gold); letter-spacing: .08em; }
.turn-now { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--gold); }
.turn-tot { margin-left: auto; color: rgba(255,255,255,.6); font-size: 12px; }
.turn-tot b { color: #fff; font-variant-numeric: tabular-nums; }

.turn-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; margin: 6px 0 10px;
  background: var(--panel-solid); border: 1px solid var(--line); }
.turn-banner.mine { background: linear-gradient(135deg, rgba(232,200,122,.18), rgba(232,200,122,.05)); border-color: rgba(232,200,122,.5); }
.tbn-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.turn-banner.mine .tbn-dot { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.tbn-who { font-weight: 700; }
.tbn-time { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 700; }
.tbn-btn { margin-left: auto; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: #fff; font-weight: 700; }
.turn-banner.mine .tbn-btn { background: linear-gradient(135deg, var(--accent), #5a3fd6); border: none; }

.storm-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); margin: 10px 0; }
.storm-label { flex: 1; font-weight: 600; color: #cdb9ff; }
.storm-btn { width: 42px; height: 42px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid var(--line); color: #fff; font-size: 22px; }
.storm-val { font-size: 22px; font-weight: 800; min-width: 28px; text-align: center; }

/* =====================================================================
   M2-M5: turn banner (rebuilt), toggles, settings, stats, winner, conn
   ===================================================================== */
.turn-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.turn-banner .tbn-head { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.turn-banner .tbn-who { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbn-times { display: flex; gap: 14px; }
.tbn-stat { display: flex; flex-direction: column; align-items: center; min-width: 48px; }
.tbn-stat b { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--gold); font-size: 17px; line-height: 1.1; }
.tbn-stat b.over { color: var(--danger); }
.tbn-stat small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.tbn-btn { flex: 0 0 auto; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: #fff; font-weight: 700; }
.turn-banner.mine .tbn-btn { background: linear-gradient(135deg, var(--accent), #5a3fd6); border: none; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); margin: 10px 0; cursor: pointer; }
.toggle-row input[type=checkbox] { width: 46px; height: 26px; appearance: none; -webkit-appearance: none; background: rgba(255,255,255,.14); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.toggle-row input[type=checkbox]:checked { background: var(--accent); }
.toggle-row input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle-row input[type=checkbox]:checked::after { transform: translateX(20px); }

.tb-ctrls { display: flex; gap: 6px; }
.tb-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); color: #fff; font-size: 17px; }
.tb-ico.active { background: color-mix(in srgb, var(--accent) 40%, var(--panel)); }
.tb-limit { color: var(--muted); font-size: 14px; }
.tb-timer.over { color: var(--danger); animation: overpulse 1s ease-in-out infinite; }
#turn-bar.over .tb-turn { border-color: var(--danger); box-shadow: 0 0 18px rgba(224,98,95,.4); }
@keyframes overpulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.pcard.is-turn.over { animation: turnover 1s ease-in-out infinite; }
@keyframes turnover {
  0%, 100% { box-shadow: 0 0 0 3px var(--danger), 0 18px 52px rgba(0,0,0,.6), 0 0 46px rgba(224,98,95,.5); }
  50% { box-shadow: 0 0 0 3px var(--danger), 0 18px 52px rgba(0,0,0,.6), 0 0 82px rgba(224,98,95,.85); }
}
.turn-now.over { color: var(--danger); }
.badge.init { color: #7fd1ff; filter: drop-shadow(0 0 6px rgba(127,209,255,.7)); }

body.is-night .bg-veil { background: radial-gradient(120% 120% at 50% -10%, rgba(22,30,64,.6) 0%, rgba(6,8,20,.9) 70%); }

.settings-list { display: grid; gap: 8px; margin-bottom: 12px; }
.stats-table { display: grid; gap: 8px; margin-bottom: 12px; }
.stats-row { display: grid; grid-template-columns: 14px 1fr auto auto auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); }
.stats-row.dead { opacity: .55; }
.st-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--seat); }
.st-name { font-weight: 700; }
.st-col { text-align: center; display: flex; flex-direction: column; min-width: 50px; }
.st-col b { font-size: 16px; font-variant-numeric: tabular-nums; }
.st-col small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 560px) { .stats-row { grid-template-columns: 12px 1fr auto auto; } .st-col.opt { display: none; } }

.winner-modal { text-align: center; }
.winner-crown { font-size: 64px; filter: drop-shadow(0 0 20px rgba(232,200,122,.7)); animation: pop .5s ease; }
.winner-modal h2 { font-size: 28px; margin: 6px 0 14px; color: var(--gold); }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.conn { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 70; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.conn.reconnecting { background: #3a2f12; color: var(--gold); border: 1px solid rgba(232,200,122,.4); }
.conn.lost { background: #3a1414; color: #ff9a98; border: 1px solid rgba(224,98,95,.5); }

/* Phone player view in landscape: tabs move to a narrow side rail (freeing the
   full height), the life counter stays on the left, the rest scrolls on the right. */
@media (orientation: landscape) and (max-height: 560px) {
  .player-tabs { flex-direction: column; width: 60px; height: 100%; top: 0; right: 0; left: auto; bottom: auto;
    border-top: none; border-left: 1px solid var(--line); }
  .ptab { box-shadow: none; font-size: 12px; padding: 0 2px; }
  .ptab.is-active { box-shadow: inset 2px 0 0 var(--gold); }
  .player-root { height: 100%; width: calc(100% - 60px); overflow: hidden; padding: 8px 10px; }
  .me-wrap { height: 100%; display: flex; flex-direction: column; padding: 10px; }
  .me-top { flex: none; }
  .me-name { font-size: 15px; margin-bottom: 2px; }
  .spot-row { margin: 0 0 4px; gap: 10px; }
  .turn-banner { margin: 0; padding: 7px 10px; }
  .me-grid { flex: 1; min-height: 0; display: flex; gap: 10px; margin-top: 8px; }
  .me-life-col { flex: 1.1; display: flex; flex-direction: column; min-width: 0; }
  .me-life { flex: 1; height: auto; min-height: 0; }
  .me-life-num { font-size: clamp(46px, 13vh, 80px); }
  .me-quick { margin: 8px 0 0; }
  .me-extra { flex: 1; min-width: 0; overflow-y: auto; padding-right: 2px; }
  .me-extra .panel-title { margin-top: 8px; }
  .cmdr-strip { margin: 0 0 8px; }
}

/* layout picker */
.layout-list { display: grid; gap: 8px; margin: 10px 0 12px; }
.layout-opt { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-solid); color: var(--ink); display: flex; flex-direction: column; gap: 3px; }
.layout-opt.is-active { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.lo-label { font-weight: 700; font-size: 15px; }
.lo-desc { font-size: 12px; color: var(--muted); }

/* active games pill + browser */
.games-pill { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 40; cursor: pointer;
  display: flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.games-pill b { color: var(--gold); }
.games-pill:active { transform: translateX(-50%) scale(.96); }
.gp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.games-list { display: grid; gap: 8px; margin-bottom: 12px; max-height: 55vh; overflow-y: auto; }
.game-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); }
.gr-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.gr-code { font-weight: 800; font-size: 18px; letter-spacing: .12em; color: var(--gold); }
.gr-meta { font-size: 12px; color: var(--muted); }
.gr-join { padding: 9px 16px; flex: none; }
.gr-copy { padding: 9px 12px; flex: none; }

/* admin dashboard */
.link-btn { background: none; border: none; color: var(--gold); font-size: 13px; text-decoration: underline; padding: 8px; margin-top: 4px; opacity: .85; cursor: pointer; }
.admin-dash .panel-title { margin-top: 14px; }
.match-list { display: grid; gap: 6px; max-height: 44vh; overflow-y: auto; margin-bottom: 12px; }
.match-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--panel-solid); border: 1px solid var(--line); font-size: 13px; }
.match-row.live { border-color: rgba(82,183,136,.5); }
.mr-code { font-weight: 800; color: var(--gold); letter-spacing: .08em; }
.mr-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-when { color: var(--muted); font-size: 11px; white-space: nowrap; }

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

/* =====================================================================
   M6: share badge, featured card, affiliate summary
   ===================================================================== */
.join-badge { cursor: pointer; font: inherit; color: inherit; text-align: left; transition: transform .1s; }
.join-badge:active { transform: scale(.98); }

.featured { position: absolute; bottom: 16px; right: 24px; z-index: 6; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  gap: 0 10px; align-items: center; padding: 7px 14px 7px 7px; border-radius: 14px; max-width: 240px;
  background: rgba(18,14,30,.82); border: 1px solid var(--line); backdrop-filter: blur(8px); color: #fff; box-shadow: var(--shadow); cursor: pointer; }
.featured img { grid-row: 1 / 3; width: 56px; height: 42px; object-fit: cover; border-radius: 8px; }
.featured .feat-label { font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; align-self: end; }
.featured .feat-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: start; }

.aff-summary { margin-top: 6px; }
.aff-line { color: var(--muted); font-size: 13px; }

.combo-box { margin-bottom: 12px; text-align: left; }
.combo-row { display: block; text-align: left; text-decoration: none; color: var(--ink); padding: 9px 12px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); margin-bottom: 6px; }
.combo-row:active { background: rgba(255,255,255,.08); }
.combo-with { display: block; font-weight: 600; font-size: 14px; }
.combo-prod { display: block; color: var(--gold); font-size: 12px; margin-top: 2px; }
.combo-loading { font-size: 13px; }
.combo-row.ready { border-color: rgba(232,200,122,.6); background: rgba(232,200,122,.12); }
.combo-row.ready .combo-with { color: var(--gold); }
.small { font-size: 12px; }

/* battlefield / board tab */
.board-add, .bf-add-me { width: 100%; }
.bf-add-me { margin-top: 10px; }
.board-sec { margin: 14px 0; }
.board-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.board-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--seat); flex: none; }
.board-name { font-weight: 700; flex: 1; }
.board-count { font-size: 12px; color: var(--muted); background: rgba(255,255,255,.06); border-radius: 999px; padding: 2px 9px; }
.board-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.board-empty { grid-column: 1 / -1; }
.bf-thumb { position: relative; aspect-ratio: 1.3; border-radius: 10px; border: 1px solid var(--line); overflow: hidden;
  background-size: cover; background-position: center 18%; background-color: #0f0c1a; color: #fff; padding: 0; }
.bf-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: 10px; line-height: 1.15; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.9)); }
.bf-mine { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.bf-mine .panel-title { width: 100%; }
.bf-chip { display: flex; align-items: center; gap: 6px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 12px; font-size: 13px; }
.bf-x { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.08); border: none; color: #fff; font-size: 12px; flex: none; }

.btn-install { width: 100%; margin-top: 10px; }

/* =====================================================================
   Responsive: the table (host) view shrunk for phones / narrow screens
   ===================================================================== */
@media (max-width: 820px) {
  .table-top { flex-wrap: wrap; padding: 8px 12px; gap: 8px; align-items: center; }
  .table-brand { flex: 1 1 auto; }
  .tb-logo { font-size: 15px; }
  .table-format { font-size: 9px; margin-top: 1px; }
  .join-badge { padding: 4px 10px 4px 4px; gap: 7px; }
  .join-qr img { width: 48px; height: 48px; }
  .join-label { display: none; }
  .join-code { font-size: 21px; }
  .table-tools { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 6px; padding-bottom: 2px; }
  .table-tools::-webkit-scrollbar { display: none; }
  .icon-btn { width: 38px; height: 38px; font-size: 17px; flex: none; }

  .turn-bar { padding: 4px 12px 8px; gap: 8px; flex-wrap: wrap; }
  .tb-turn { padding: 6px 12px; gap: 10px; flex: 1 1 auto; }
  .tb-holder { font-size: 16px; }
  .tb-timer { font-size: 17px; min-width: 52px; }
  .tb-pass { margin-left: auto; padding: 9px 16px; font-size: 15px; }

  .table-grid { padding: 4px 12px 12px; gap: 10px; }
  .pcard-head { padding: 9px 13px 3px; }
  .pname { font-size: 16px; }
  .life-num { font-size: clamp(44px, 16vw, 88px); }
  .life-btn { width: 46px; height: 46px; font-size: 24px; }
  .pcard-cmdr { padding: 0 13px 8px; font-size: 11px; }
  .pcard-turn { padding: 0 13px 6px; font-size: 11px; }
  .featured { bottom: 10px; right: 12px; max-width: 180px; }
}
.dice-hint { text-align: center; font-size: 12px; margin-top: 10px; }

/* =====================================================================
   3D dice rolling onto a seat (tablet)
   ===================================================================== */
.dice-layer { position: absolute; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.dice-roll { position: absolute; transform: translate(-50%, -50%); perspective: 720px; transition: left .35s ease; }
.dice-roll.out { opacity: 0; transition: left .35s ease, opacity .5s ease; }
.dice-shadow { position: absolute; left: 50%; top: 44px; width: 74px; height: 18px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); opacity: 0; animation: diceShadow 1.05s ease forwards; }
@keyframes diceShadow { 0% { opacity: 0; transform: translateX(-50%) scale(.4); } 60% { opacity: .6; transform: translateX(-50%) scale(1); } 100% { opacity: .5; } }
.dice-drop { animation: diceDrop 1.05s cubic-bezier(.3,.7,.4,1.1) forwards; transform-style: preserve-3d; }
@keyframes diceDrop {
  0% { transform: translateY(-280px) scale(.5); opacity: 0; }
  55% { transform: translateY(8px) scale(1.07); opacity: 1; }
  72% { transform: translateY(-12px) scale(.97); }
  86% { transform: translateY(4px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}
.die { width: 64px; height: 64px; position: relative; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.25,.7,.3,1); }
.die6 .face { position: absolute; width: 64px; height: 64px; border-radius: 12px;
  background: linear-gradient(140deg, #fcf7ea, #e3d8bb); box-shadow: inset 0 0 0 2px rgba(120,90,40,.18), inset 0 -6px 12px rgba(120,90,40,.16); }
.die6 .f1 { transform: translateZ(32px); }
.die6 .f6 { transform: rotateY(180deg) translateZ(32px); }
.die6 .f3 { transform: rotateY(90deg) translateZ(32px); }
.die6 .f4 { transform: rotateY(-90deg) translateZ(32px); }
.die6 .f5 { transform: rotateX(90deg) translateZ(32px); }
.die6 .f2 { transform: rotateX(-90deg) translateZ(32px); }
.pips { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 9px; }
.pip { display: block; }
.pip.on { width: 11px; height: 11px; border-radius: 50%; align-self: center; justify-self: center;
  background: radial-gradient(circle at 35% 30%, #5a4327, #261a0a); box-shadow: inset 0 -1px 1px rgba(0,0,0,.4); }
.numface { display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 28px; color: #2a1d0c; }
.coin .coinface { position: absolute; width: 64px; height: 64px; border-radius: 50%; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 30px; color: #5a3f0a;
  background: linear-gradient(140deg, #ffe9a8, #c79a3f); box-shadow: inset 0 0 0 3px rgba(120,80,20,.3); }
.coin .coinface.tails { transform: rotateX(180deg); }
.dice-result { position: absolute; left: 50%; top: -46px; transform: translateX(-50%); font-size: 30px; font-weight: 900; color: var(--gold);
  text-shadow: 0 2px 12px rgba(0,0,0,.8); white-space: nowrap; animation: diceResult .4s ease forwards; }
@keyframes diceResult { from { opacity: 0; transform: translate(-50%, 10px) scale(.6); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
