:root {
  --bg1: #1e1b4b;
  --bg2: #4c1d95;
  --ink: #1f1235;
  --paper: #fff8ec;
  --paper-2: #fdecd2;
  --muted: #6b5a7a;
  --gold: #fbbf24;
  --good: #16a34a;
  --bad: #dc2626;
  --warn: #ea580c;
  --radius: 18px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: #fff;
  background: radial-gradient(120% 80% at 50% 0%, var(--bg2), var(--bg1) 70%) fixed, var(--bg1);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; touch-action: manipulation; }
[hidden] { display: none !important; }

/* ---------- screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}
.screen.active { display: flex; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- buttons ---------- */
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease, opacity .15s;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-big { padding: 16px 26px; font-size: 20px; }
.btn-wide { width: 100%; margin-top: 10px; }
.btn-primary { background: var(--gold); color: #3b1d00; }
.btn-secondary { background: #fff; color: var(--ink); }
.btn-ghost { background: transparent; box-shadow: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn {
  width: 44px; height: 44px;
  border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  font-size: 22px; line-height: 1;
  cursor: pointer;
}
.icon-btn:active { background: rgba(255, 255, 255, .25); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- title ---------- */
.title-wrap {
  margin: auto;
  padding: 24px 16px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.logo {
  width: 120px; height: 120px;
  border-radius: 32px;
  background: linear-gradient(145deg, #f43f5e, #e11d48);
  display: grid; place-items: center;
  box-shadow: 0 10px 0 #9f1239, 0 20px 40px rgba(0, 0, 0, .35);
  animation: bob 3s ease-in-out infinite;
}
.logo-die { font-size: 64px; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.game-title {
  margin: 28px 0 6px;
  font-size: clamp(36px, 11vw, 52px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -1px;
  text-shadow: 0 4px 0 #2e1065;
}
.game-title span {
  display: block;
  margin-top: 8px;
  font-size: .5em;
  color: var(--gold);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.title-cast { font-size: 34px; margin: 10px 0 26px; letter-spacing: 6px; }
.title-buttons { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.install-hint {
  margin-top: 26px;
  font-size: 14px;
  opacity: .85;
  background: rgba(255, 255, 255, .1);
  padding: 10px 14px;
  border-radius: 12px;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 4px;
}
.topbar h2 { flex: 1; margin: 0; text-align: center; font-size: 18px; font-weight: 800; }
.topbar-spacer { width: 44px; }

/* ---------- setup ---------- */
.setup-body { flex: 1; overflow-y: auto; padding: 8px 16px 16px; -webkit-overflow-scrolling: touch; }
.setup-label { margin: 14px 0 10px; font-size: 16px; font-weight: 800; opacity: .9; }
.setup-label.prompt { color: var(--gold); font-size: 18px; margin-top: 22px; }
.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: rgba(255, 255, 255, .1); padding: 6px; border-radius: 16px;
}
.seg {
  border: 0; border-radius: 12px; padding: 12px 0;
  background: transparent; font-size: 20px; font-weight: 900; cursor: pointer;
}
.seg[aria-pressed="true"] { background: #fff; color: var(--ink); }
.char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.char-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
  padding: 14px 10px 12px;
  border-radius: var(--radius);
  border: 3px solid transparent;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .25);
  transition: transform .12s ease, opacity .2s, border-color .2s;
}
.char-card:active { transform: scale(.97); }
.char-card.picked { border-color: var(--c); background: #fff; transform: translateY(-2px); box-shadow: 0 7px 0 var(--c); }
.char-card.dim { opacity: .45; }
.char-emoji {
  font-size: 40px;
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2);
}
.char-name { font-weight: 900; font-size: 19px; margin-top: 4px; }
.char-tag { font-size: 12px; color: var(--muted); font-weight: 700; }
.char-line { font-size: 11.5px; line-height: 1.3; margin-top: 2px; font-weight: 600; }
.char-line.good { color: #15803d; }
.char-line.bad { color: #b91c1c; }
.char-seat {
  position: absolute; top: 8px; right: 8px;
  min-width: 30px; padding: 3px 6px;
  border-radius: 999px;
  background: var(--c); color: #fff;
  font-weight: 900; font-size: 13px;
}
.char-seat:empty { display: none; }
.setup-footer { padding: 10px 16px 14px; }
.setup-footer .btn { width: 100%; }

/* ---------- game ---------- */
.player-strip {
  display: flex; gap: 6px;
  padding: 4px 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.player-strip::-webkit-scrollbar { display: none; }
.chip {
  position: relative;
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 4px 4px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
}
.chip.current { background: #fff; color: var(--ink); border-color: var(--c); box-shadow: 0 3px 0 var(--c); }
.chip-av { position: relative; display: block; }
.chip-pos {
  position: absolute; right: -10px; bottom: -3px;
  min-width: 20px; padding: 1px 4px;
  border-radius: 999px;
  background: #1f1235; color: #fff;
  border: 2px solid #fff;
  font-size: 10px; font-weight: 900; line-height: 1.2;
  text-align: center;
}
.chip-name { max-width: 100%; font-weight: 800; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-skip { position: absolute; top: -6px; right: -4px; font-size: 16px; }

.avatar {
  flex: none;
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: var(--c);
  font-size: 22px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2);
  vertical-align: middle;
}
.avatar.sm { width: 30px; height: 30px; font-size: 17px; }
.avatar.xl { width: 96px; height: 96px; font-size: 56px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2), 0 0 0 6px #fff; }

.board-wrap {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  padding: 6px 16px;
}
.board {
  position: relative;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 0 0 5px #7c2d12, 0 0 0 9px #fbbf24, 0 14px 30px rgba(0, 0, 0, .45);
}
.board-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.board-path polyline {
  fill: none;
  stroke: #e7c9a0;
  stroke-width: calc(var(--t, 56px) * .5);
  stroke-linejoin: round;
  stroke-linecap: round;
}
.tile {
  position: absolute;
  width: var(--t); height: var(--t);
  padding: calc(var(--t) * .07);
}
.tile::before {
  content: "";
  position: absolute;
  inset: calc(var(--t) * .07);
  border-radius: calc(var(--t) * .2);
  background: var(--tile-bg, #fff);
  box-shadow: inset 0 calc(var(--t) * -.06) 0 rgba(0, 0, 0, .18), 0 1px 2px rgba(0, 0, 0, .2);
}
.tile > * { position: relative; }
.tile-num {
  position: absolute;
  top: calc(var(--t) * .1); left: calc(var(--t) * .14);
  font-size: calc(var(--t) * .17);
  font-weight: 800;
  color: var(--tile-num, rgba(31, 18, 53, .45));
}
.tile-emoji {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: calc(var(--t) * .42);
  padding-top: calc(var(--t) * .04);
}
.tile-label {
  position: absolute;
  left: 0; right: 0; bottom: calc(var(--t) * .1);
  text-align: center;
  font-size: calc(var(--t) * .15);
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
}
.tile-start, .tile-finish { --tile-num: transparent; }
.tile-start .tile-emoji, .tile-finish .tile-emoji { padding-bottom: calc(var(--t) * .16); font-size: calc(var(--t) * .36); }
.tile-blank { --tile-bg: #ffffff; }
.tile-start { --tile-bg: #16a34a; }
.tile-finish { --tile-bg: linear-gradient(145deg, #fbbf24, #f59e0b); }
.tile-card { --tile-bg: #818cf8; --tile-num: rgba(255, 255, 255, .8); }
.tile-villain { --tile-bg: #3b0764; --tile-num: rgba(255, 255, 255, .7); }
.tile-cfa { --tile-bg: #ef4444; --tile-num: rgba(255, 255, 255, .8); }
.tile-kitchen { --tile-bg: #14b8a6; --tile-num: rgba(255, 255, 255, .8); }

.token {
  position: absolute; left: 0; top: 0;
  width: calc(var(--t) * .62); height: calc(var(--t) * .62);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid #fff;
  font-size: calc(var(--t) * .34);
  box-shadow: 0 4px 6px rgba(0, 0, 0, .4);
  transition: transform .2s cubic-bezier(.3, 1.4, .6, 1), width .2s, height .2s;
  z-index: 2;
  pointer-events: none;
}
.token.small { width: calc(var(--t) * .46); height: calc(var(--t) * .46); font-size: calc(var(--t) * .25); border-width: 2px; }
.token.active { z-index: 3; animation: pulse 1.4s ease-in-out infinite; }
.token.hopping { animation: none; z-index: 4; }
.token.no-anim { transition: none; }
@keyframes pulse {
  50% { box-shadow: 0 4px 6px rgba(0, 0, 0, .4), 0 0 0 6px color-mix(in srgb, var(--c) 45%, transparent); }
}

.panel {
  margin: 10px 16px 6px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .1);
  display: flex; flex-direction: column; gap: 10px;
}
.turn-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.turn-badge { display: flex; align-items: center; gap: 10px; min-width: 0; }
.turn-emoji {
  flex: none;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 28px;
  border-radius: 50%;
  background: var(--c, #888);
  box-shadow: 0 0 0 3px #fff;
}
.turn-text { display: flex; flex-direction: column; min-width: 0; }
.turn-text > span { font-size: 20px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turn-text small { font-size: 13px; opacity: .75; font-weight: 700; }
.die {
  flex: none;
  width: 54px; height: 54px;
  padding: 7px;
  border-radius: 13px;
  background: #fff;
  box-shadow: inset 0 -4px 0 #d6d3d1, 0 4px 8px rgba(0, 0, 0, .3);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  place-items: center;
}
.die span { width: 9px; height: 9px; border-radius: 50%; background: transparent; }
.die span.on { background: var(--ink); }
.die.rolling { animation: shake .12s linear infinite; }
.die.landed { animation: land .35s ease; }
@keyframes shake { 25% { transform: rotate(14deg) translateY(-3px); } 75% { transform: rotate(-14deg) translateY(2px); } }
@keyframes land { 40% { transform: scale(1.25); } }
.btn-roll {
  background: var(--c, var(--gold));
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .35);
}
.last-log {
  margin: 0;
  min-height: 2.6em;
  font-size: 13px;
  line-height: 1.3;
  opacity: .85;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- modals ---------- */
.overlay {
  position: fixed; inset: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px);
  background: rgba(15, 5, 35, .65);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fade-in .18s ease;
}
.overlay.closing { animation: fade-out .18s ease forwards; pointer-events: none; }
@keyframes fade-out { to { opacity: 0; } }
.sheet {
  width: 100%; max-width: 400px;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  color: var(--ink);
  border-radius: 26px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  animation: pop-in .28s cubic-bezier(.3, 1.5, .6, 1);
  -webkit-user-select: text;
  user-select: text;
}
@keyframes pop-in { from { transform: scale(.85) translateY(20px); opacity: 0; } }
.sheet h2 { margin: 4px 0 10px; font-size: 24px; font-weight: 900; }
.sheet h3 { margin: 18px 0 8px; }
.sheet p { line-height: 1.4; }
.sheet .btn-ghost { color: var(--ink); }
.sheet-card { background: transparent; box-shadow: none; padding: 0; overflow: visible; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.tag.good { background: var(--good); }
.tag.bad { background: var(--bad); }
.tag.warn { background: var(--warn); }

.effect {
  display: block;
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 17px;
  text-align: center;
  color: #fff;
}
.effect.good { background: var(--good); }
.effect.bad { background: var(--bad); }
.effect.warn { background: var(--warn); }
.effect.neutral { background: #a8a29e; }

/* how to play */
.rules { padding-left: 20px; margin: 0; }
.rules li { margin-bottom: 8px; line-height: 1.4; }
.legend { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 14px; font-weight: 700; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend-tile {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--tile-bg);
  font-size: 17px;
}
.howto-chars { display: grid; gap: 10px; }
.char-summary {
  border-left: 5px solid var(--c);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
}
.char-summary-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.char-summary-head strong { font-size: 18px; }
.char-summary-head small { color: var(--muted); font-weight: 700; }
.char-summary p { margin: 6px 0 0; font-size: 14px; }

/* tile modal */
.tile-modal { text-align: center; }
.tm-emoji {
  width: 90px; height: 90px; margin: 0 auto 6px;
  display: grid; place-items: center;
  font-size: 52px; border-radius: 24px;
}
.tm-cfa .tm-emoji { background: #ef4444; }
.tm-kitchen .tm-emoji { background: #14b8a6; }

/* strength/weakness flip card */
.card-modal { display: flex; flex-direction: column; align-items: stretch; }
.card-for { margin: 0 0 12px; color: #fff; font-weight: 800; font-size: 17px; text-align: center; }
.flip-card {
  position: relative;
  height: min(440px, 62vh);
  border: 0; padding: 0;
  background: transparent;
  perspective: 1200px;
  cursor: pointer;
}
.flip-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4, 1.3, .5, 1);
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.flip-back {
  background: repeating-linear-gradient(45deg, #6366f1 0 16px, #4f46e5 16px 32px);
  color: #fff;
  border: 6px solid #fff;
}
.fb-emoji { font-size: 84px; }
.fb-title { font-size: 26px; font-weight: 900; margin-top: 10px; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.fb-tap { margin-top: 14px; font-weight: 800; background: rgba(0, 0, 0, .25); padding: 6px 14px; border-radius: 999px; animation: bob 1.6s ease-in-out infinite; }
.flip-front { background: var(--paper); color: var(--ink); transform: rotateY(180deg); border: 6px solid #818cf8; }
.ff-emoji { font-size: 72px; }
.ff-title { font-size: 25px; font-weight: 900; margin-top: 6px; }
.ff-flavor { font-size: 15px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.ff-text { font-size: 16px; font-weight: 700; margin-top: 6px; line-height: 1.35; }
.flip-front .effect { width: 100%; }

/* villain */
.sheet-villain { padding-top: 16px; border-top: 8px solid var(--v, #7c3aed); }
.villain-modal { --v: #7c3aed; }
.villain-head { display: flex; align-items: center; gap: 12px; }
.villain-emoji {
  width: 60px; height: 60px; flex: none;
  display: grid; place-items: center;
  border-radius: 18px;
  background: var(--v);
  font-size: 34px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25);
}
.villain-head small { display: block; font-size: 11px; font-weight: 900; letter-spacing: 2px; color: var(--v); }
.villain-head strong { font-size: 22px; font-weight: 900; }
.villain-modal h2 { margin-top: 14px; }
.scenario { font-size: 17px; font-weight: 600; }
.stakes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.choose { font-weight: 800; margin-bottom: 8px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 3px solid #e7d7c1;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 4px 0 #e7d7c1;
  transition: transform .08s, background .2s, border-color .2s;
}
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #e7d7c1; }
.choice:disabled { cursor: default; opacity: .6; }
.choice.right { border-color: var(--good); background: #dcfce7; opacity: 1; box-shadow: 0 4px 0 var(--good); }
.choice.right::after { content: " ✅"; }
.choice.wrong { border-color: var(--bad); background: #fee2e2; opacity: 1; box-shadow: 0 4px 0 var(--bad); }
.choice.wrong::after { content: " ❌"; }
.villain-result { margin-top: 14px; animation: pop-in .25s ease; }
.villain-result p { margin: 4px 0; }
.res-good { color: var(--good); font-size: 20px; }
.res-bad { color: var(--bad); font-size: 20px; }

/* menu */
.menu { text-align: center; }

/* win */
.win-modal { text-align: center; }
.win-trophy { font-size: 64px; animation: bob 1.8s ease-in-out infinite; }
.win-modal h2 { font-size: 30px; margin-top: 14px; }
.win-sub { color: var(--muted); margin-top: 0; font-weight: 700; }
.standings { text-align: left; padding: 0; list-style: none; counter-reset: s; }
.standings li {
  counter-increment: s;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  background: #fff;
  border-radius: 12px;
  font-weight: 800;
}
.standings li::before { content: counter(s) "."; width: 22px; color: var(--muted); }
.standings li small { margin-left: auto; color: var(--muted); }

/* toasts */
#toast-root {
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--safe-t) + 60px);
  z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  animation: toast-in .3s cubic-bezier(.3, 1.5, .6, 1);
  transition: opacity .35s, transform .35s;
  text-align: center;
}
.toast.good { border: 3px solid var(--good); }
.toast.warn { border: 3px solid var(--warn); }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toast-in { from { transform: translateY(-20px) scale(.9); opacity: 0; } }

/* confetti */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
#confetti i {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: 10px; height: 16px;
  background: var(--c);
  border-radius: 3px;
  animation: fall var(--d) ease-in var(--delay) forwards;
}
@keyframes fall {
  to { transform: translate(var(--drift), 110vh) rotate(var(--r)); }
}

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

/* short phones (iPhone SE) */
@media (max-height: 700px) {
  .panel { padding: 8px; gap: 6px; margin-top: 6px; }
  .btn-big { padding: 12px 22px; font-size: 18px; }
  .turn-emoji { width: 40px; height: 40px; font-size: 22px; }
  .die { width: 46px; height: 46px; padding: 6px; }
  .die span { width: 7px; height: 7px; }
  .last-log { min-height: 0; -webkit-line-clamp: 1; }
}

/* landscape tablets / desktop: board beside the panel */
@media (min-width: 820px) and (min-aspect-ratio: 1/1) {
  #screen-game {
    display: none;
    grid-template-columns: 1fr 360px;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "top top" "board strip" "board panel";
  }
  #screen-game.active { display: grid; }
  #screen-game .topbar { grid-area: top; }
  #screen-game .player-strip { grid-area: strip; overflow: visible; }
  #screen-game .board-wrap { grid-area: board; padding: 16px; }
  #screen-game .panel { grid-area: panel; align-self: start; }
}
