:root {
  --bg: #f4ead9;
  --paper: rgba(255, 250, 241, .86);
  --paper-strong: #fff8eb;
  --ink: #1e1711;
  --muted: #786759;
  --line: rgba(83, 55, 30, .18);
  --gold: #c99b55;
  --gold-2: #f3d8a0;
  --dark: #231710;
  --sand: #d8b879;
  --teal: #1daaa1;
  --red: #9b3429;
  --shadow: 0 26px 90px rgba(35, 23, 16, .17);
  --radius: 28px;
  --cell: 12.2%;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(224, 192, 140, .18), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(193, 160, 116, .10), transparent 24%),
    linear-gradient(180deg, #f8f2e7 0%, #f4ecdf 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: none;
  opacity: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.05) 36%, rgba(80,45,12,.08));
  pointer-events: none;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.page-shell {
  width: min(1440px, calc(100% - 30px));
  margin: 0 auto;
  padding: 16px 0 42px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  margin-bottom: 28px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 249, 239, .74);
  box-shadow: 0 12px 40px rgba(35, 23, 16, .08);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}
.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  transform: rotate(22.5deg);
  border-radius: 3px;
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,.18), transparent);
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid var(--gold);
}
.brand-mark::after {
  inset: 18px;
  border-radius: 50%;
  background: var(--gold);
  opacity: .35;
}
.brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  letter-spacing: .16em;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  margin-top: -2px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.top-actions a,
.ghost-button,
.small-button,
.tab {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.34);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 13px;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.top-actions a:hover,
.ghost-button:hover,
.small-button:hover,
.tab:hover { transform: translateY(-1px); background: rgba(255,255,255,.58); }
.small-button { padding: 7px 11px; font-size: .88rem; }
.small-button.danger { color: var(--red); }

.landing {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(360px, .7fr);
  gap: clamp(22px, 5vw, 70px);
  align-items: center;
  min-height: calc(100svh - 145px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 800;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.04;
}
h1 {
  max-width: 780px;
  margin: 0 0 18px;
  font-size: clamp(3rem, 8vw, 7.6rem);
  letter-spacing: -.075em;
}
h2 { margin: 0; font-size: clamp(1.55rem, 2vw, 2.5rem); }
.lead {
  max-width: 760px;
  margin: 0 0 26px;
  font-size: clamp(1.06rem, 1.5vw, 1.3rem);
  color: #3e3328;
}
.hero-media {
  position: relative;
  border-radius: 36px;
  padding: 14px;
  background: rgba(255, 248, 235, .68);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-media::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 45deg, transparent, rgba(221, 168, 86, .22), transparent, rgba(0,0,0,.10), transparent);
  animation: slowSpin 28s linear infinite;
}
.hero-media img {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 24px;
  background: var(--paper-strong);
}
.media-caption {
  position: relative;
  padding: 12px 6px 2px;
  color: var(--muted);
  font-size: .95rem;
}
@keyframes slowSpin { to { transform: rotate(1turn); } }

.lobby-card,
.glass-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.lobby-card {
  max-width: 520px;
  padding: 14px;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.tab {
  border-radius: 18px;
  padding: 12px 14px;
  font-weight: 760;
}
.tab.active {
  background: var(--dark);
  color: #fff8ea;
  border-color: var(--dark);
}
.lobby-form {
  display: grid;
  gap: 12px;
}
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 650;
}
input, select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  outline: none;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,155,85,.18); }
.primary-button {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  padding: 13px 16px;
  background: linear-gradient(135deg, var(--dark), #5b351e);
  color: #fff8ea;
  font-weight: 820;
  box-shadow: 0 14px 34px rgba(35, 23, 16, .22);
}
.primary-button:hover { transform: translateY(-1px); }

.game { display: grid; gap: 18px; }
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
}
.room-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#roomCode { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: .08em; font-family: Georgia, "Times New Roman", serif; }
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(29, 170, 161, .11);
  color: #096d66;
  font-weight: 750;
  white-space: nowrap;
}
.connection-status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10a48f;
  box-shadow: 0 0 0 4px rgba(16,164,143,.14);
}
.connection-status.offline { background: rgba(155, 52, 41, .12); color: var(--red); }
.connection-status.offline::before { background: var(--red); box-shadow: 0 0 0 4px rgba(155,52,41,.12); }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  gap: 18px;
  align-items: start;
}
.board-panel { padding: clamp(14px, 2.2vw, 24px); }
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.turn-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,.38);
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.board {
  position: relative;
  width: min(86svh, 100%);
  max-width: 860px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 34px;
  overflow: hidden;
  touch-action: manipulation;
  isolation: isolate;
}
.board::before {
  content: "";
  position: absolute;
  inset: 1.5%;
  clip-path: polygon(28% 3%,72% 3%,97% 28%,97% 72%,72% 97%,28% 97%,3% 72%,3% 28%);
  background:
    linear-gradient(135deg, rgba(255,255,255,.11), rgba(0,0,0,.16)),
    url('../img/board-print-2.jpg') center / cover;
  border: 1px solid rgba(255,255,255,.34);
  filter: saturate(.82) contrast(1.04);
  z-index: 0;
}
.board::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 24px;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.slot {
  --size: var(--cell);
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: var(--size);
  height: var(--size);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 242, 207, .62);
  border-radius: 10px;
  color: var(--ink);
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.07), 0 8px 20px rgba(31, 19, 11, .16);
  transition: transform .16s ease, box-shadow .16s ease, outline-color .16s ease, filter .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.slot.light { background: linear-gradient(145deg, rgba(246, 211, 150, .92), rgba(255, 242, 198, .9)); }
.slot.dark { background: linear-gradient(145deg, rgba(74, 42, 22, .92), rgba(26, 17, 11, .94)); color: #fff2d9; }
.slot.center {
  background: linear-gradient(145deg, rgba(177, 136, 74, .92), rgba(76, 59, 38, .92));
  color: #fff6df;
  border-radius: 8px;
}
.slot.idea {
  --size: 11.5%;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 36%, #ffedd1, #d49a58 48%, #6f3e1c 70%);
  border: 2px solid rgba(255,235,193,.68);
}
.slot.idea.empty {
  background: radial-gradient(circle at 42% 36%, rgba(255,246,220,.48), rgba(166,114,56,.42) 52%, rgba(60,36,18,.52) 73%);
}
.slot.selectable { outline: 3px solid rgba(29,170,161,.72); outline-offset: 3px; }
.slot.selected { outline: 4px solid var(--teal); outline-offset: 4px; transform: translate(-50%, -50%) scale(1.04); }
.slot.suggested { box-shadow: 0 0 0 5px rgba(29,170,161,.18), inset 0 0 0 1px rgba(0,0,0,.07), 0 8px 20px rgba(31, 19, 11, .16); }
.slot:disabled { cursor: default; }
.slot:not(:disabled):hover { transform: translate(-50%, -50%) scale(1.035); filter: brightness(1.05); }

.piece {
  width: 72%;
  height: 72%;
  border-radius: 50% 50% 42% 42%;
  display: grid;
  place-items: center;
  color: #fff9e6;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  font-size: clamp(16px, 3.2vw, 32px);
  line-height: 1;
  box-shadow: 0 9px 18px rgba(0,0,0,.28), inset 0 1px 5px rgba(255,255,255,.45);
  position: relative;
  z-index: 4;
}
.piece.white,
.piece.black {
  background: transparent;
}
.piece.bastet::after,
.piece.anubis::after {
  content: attr(data-glyph);
  transform: translateY(-1px);
}
.piece.dead { opacity: .4; filter: grayscale(1); }
.pyramid {
  width: 68%;
  height: 68%;
  clip-path: polygon(50% 4%, 94% 90%, 6% 90%);
  background: linear-gradient(145deg, #58e6d8, #159890 56%, #096962);
  box-shadow: 0 8px 15px rgba(0,0,0,.24), inset -12px -14px 20px rgba(0,0,0,.18), inset 10px 8px 16px rgba(255,255,255,.35);
  z-index: 3;
}
.pebble,
.work {
  width: 42%;
  height: 42%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 27%, #fff, #d9d3c5 48%, #877f71 100%);
  box-shadow: 0 6px 10px rgba(0,0,0,.24), inset 0 1px 4px rgba(255,255,255,.75);
  z-index: 3;
}
.work { background: radial-gradient(circle at 32% 27%, #fff4db, #c09c68 50%, #6a4a24); }
.slot .stack {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.slot .label {
  position: absolute;
  bottom: -1.35rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .68rem;
  letter-spacing: .08em;
  color: rgba(255, 248, 232, .92);
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.board-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: .9rem;
}
.board-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-piece,
.legend-pyramid,
.legend-pebble {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.5);
}
.legend-piece.white { background: radial-gradient(circle at 34% 28%, #ffffff, #eee9df 58%, #c7beb0 100%); }
.legend-piece.black { background: radial-gradient(circle at 34% 28%, #4a4a4a, #121212 60%, #000000 100%); }
.legend-pyramid { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: var(--teal); }
.legend-pebble { background: radial-gradient(circle at 30% 25%, #fffdf5, #dfd8ca 52%, #b4aa99 100%); }

.side-panel { display: grid; gap: 18px; }
.status-card,
.action-card,
.rules-mini,
.log-card { padding: 18px; }
.players { display: grid; gap: 10px; }
.player-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.32);
  border: 1px solid var(--line);
}
.player-card.active { box-shadow: 0 0 0 3px rgba(201,155,85,.18); border-color: rgba(201,155,85,.5); }
.player-token {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.player-token.white { background: radial-gradient(circle at 34% 28%, #ffffff, #eee9df 58%, #c7beb0 100%); }
.player-token.black { background: radial-gradient(circle at 34% 28%, #4a4a4a, #121212 60%, #000000 100%); }
.player-main strong { display: block; }
.player-main small { display: block; color: var(--muted); }
.player-stats { text-align: right; font-size: .86rem; color: var(--muted); }
.player-stats strong { color: var(--ink); font-size: 1.04rem; }
.meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.meters div {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.28);
  border: 1px solid var(--line);
}
.meters span { display: block; color: var(--muted); font-size: .84rem; }
.meters strong { display: block; font-size: 1.7rem; line-height: 1; font-family: Georgia, "Times New Roman", serif; }

.hint {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.3);
  color: var(--muted);
  margin-bottom: 12px;
}
.mode-bar {
  min-height: 0;
  margin-bottom: 10px;
}
.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(29,170,161,.12);
  color: #08766e;
  font-weight: 780;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255,255,255,.42);
  color: var(--ink);
  font-weight: 760;
}
.actions button.primary {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--dark), #5b351e);
  color: #fff8ea;
  border-color: transparent;
}
.actions button.warn { color: var(--red); }
.actions button.active { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,170,161,.14); }
.actions button:disabled { opacity: .48; cursor: not-allowed; }
.actions button:not(:disabled):hover { transform: translateY(-1px); background: rgba(255,255,255,.66); }

.rules-mini details { color: var(--muted); }
.rules-mini summary { cursor: pointer; color: var(--ink); font-weight: 820; }
.rules-mini p { margin: 10px 0 0; font-size: .92rem; }

.log-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.log {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}
.log li {
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.28);
  color: var(--muted);
  font-size: .9rem;
}
.log time { display: block; color: var(--gold); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translate(-50%, 130%);
  z-index: 30;
  max-width: min(560px, calc(100% - 28px));
  border-radius: 18px;
  padding: 12px 16px;
  background: var(--dark);
  color: #fff8ea;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform .24s ease, opacity .24s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 1fr; }
  .board { width: min(92svh, 100%); }
  .side-panel { grid-template-columns: 1fr 1fr; }
  .action-card, .log-card { grid-column: span 1; }
}

@media (max-width: 860px) {
  .page-shell { width: min(100% - 18px, 1440px); padding-top: 8px; }
  .topbar { position: static; border-radius: 26px; align-items: flex-start; flex-direction: column; }
  .top-actions { justify-content: flex-start; }
  .landing { grid-template-columns: 1fr; min-height: auto; }
  .desktop-only { display: none; }
  .mobile-only { display: block; margin: 18px 0; }
  h1 { font-size: clamp(2.65rem, 14vw, 4.6rem); }
  .side-panel { grid-template-columns: 1fr; }
  .board { filter: saturate(1.1) contrast(1.14) brightness(1.03); }
  .game-header { align-items: flex-start; flex-direction: column; }
  .board-toolbar { align-items: flex-start; flex-direction: column; }
  .turn-pill { text-align: left; }
  .actions { grid-template-columns: 1fr; }
  .brand small { display: none; }
}

@media (max-width: 520px) {
  :root { --cell: 13.2%; }
  .top-actions a, .ghost-button { font-size: .86rem; padding: 8px 10px; }
  .brand strong { font-size: 1rem; }
  .brand-mark { width: 40px; height: 40px; }
  .board-panel, .status-card, .action-card, .rules-mini, .log-card { padding: 13px; }
  .board { border-radius: 22px; }
  .slot { border-radius: 7px; }
  .slot.idea { --size: 12.4%; }
  .slot .label { display: none; }
  .piece { font-size: 18px; }
}

/* Static WebRTC edition */
.landing {
  align-items: start;
  padding-top: 10px;
}
.hero-copy { min-width: 0; }
.lobby-card.wide { max-width: 100%; }
.mode-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 16px;
}
.choice-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,255,255,.42);
  text-align: left;
  color: var(--ink);
  box-shadow: 0 10px 32px rgba(35, 23, 16, .08);
}
.choice-card strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  margin-bottom: 5px;
}
.choice-card span { color: var(--muted); font-size: .94rem; }
.choice-card.active,
.choice-card:hover {
  background: rgba(255,255,255,.66);
  border-color: rgba(143,95,47,.45);
  transform: translateY(-1px);
}
.connection-forms { display: grid; gap: 16px; }
.connection-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.38);
  padding: 16px;
}
.connection-card h3 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 190px);
  gap: 12px;
}
.code-box {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255,255,255,.68);
  font: 500 .9rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
}
.code-box.small { min-height: 72px; }
.step-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.mini-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: .92rem;
}
.warning-note {
  margin: 12px 0 0;
  border: 1px solid rgba(155,52,41,.26);
  border-radius: 18px;
  padding: 12px;
  color: var(--red);
  background: rgba(255,255,255,.44);
}
.status-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: .95rem;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 5px rgba(120,103,89,.12);
}
.status-dot.live { background: #2f8f55; box-shadow: 0 0 0 5px rgba(47,143,85,.14); }
.status-dot.warn { background: var(--red); box-shadow: 0 0 0 5px rgba(155,52,41,.14); }
.session-note {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: .94rem;
}
.secondary-button,
.copy-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.42);
  color: var(--ink);
  border-radius: 999px;
  padding: 11px 15px;
}
.secondary-button:hover,
.copy-button:hover { background: rgba(255,255,255,.72); }
.copy-button { padding: 8px 12px; font-size: .9rem; }
.primary-button.full { width: 100%; }
.action-card .actions .subtle { opacity: .75; }
.turn-pill.ai { border-color: rgba(29,170,161,.35); }
.player-card.ai .player-main small::after { content: " · ήπια εφαρμογή"; }
.board::after {
  content: "";
  position: absolute;
  inset: 5%;
  border: 1px solid rgba(255,255,255,.14);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  pointer-events: none;
}
.slot.suggested::before,
.slot.selectable::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(29,170,161,.55);
  border-radius: inherit;
  animation: pulse-choice 1.4s ease-in-out infinite;
}
@keyframes pulse-choice {
  0%, 100% { opacity: .35; transform: scale(.98); }
  50% { opacity: .9; transform: scale(1.02); }
}
@media (max-width: 920px) {
  .mode-choice { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .code-box { min-height: 130px; }
  .connection-card { padding: 13px; }
  .choice-card { padding: 15px; }
}

/* Refinements requested for the static peer-to-peer edition */
h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  letter-spacing: -.045em;
  margin-bottom: 12px;
}
.lead {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.65vw, 1.34rem);
  line-height: 1.35;
}
.landing { align-items: center; }
.choice-card span, .mini-note, .media-caption { line-height: 1.45; }

.board {
  width: min(86svh, 100%);
  max-width: 900px;
  border-radius: 0;
  overflow: visible;
  background: url('../img/board-print-2.jpg') center / 100% 100% no-repeat;
  filter: saturate(1) contrast(1.06);
}
.board::before,
.board::after { display: none; }
.slot {
  --size: 12.35%;
  border: 0;
  border-radius: 2px;
  background: transparent !important;
  box-shadow: none;
  outline: 0;
}
.slot.light,
.slot.dark,
.slot.center,
.slot.idea,
.slot.idea.empty { background: transparent !important; color: var(--ink); }
.slot.center { --size: 12.35%; border-radius: 2px; }
.slot.idea { --size: 12.15%; border-radius: 50%; }
.slot.selectable,
.slot.selected,
.slot.suggested {
  outline: 0;
  box-shadow: inset 0 0 0 3px rgba(0, 157, 146, .94), 0 0 18px rgba(0, 157, 146, .35);
}
.slot.selected { transform: translate(-50%, -50%) scale(1.015); }
.slot.suggested { box-shadow: inset 0 0 0 4px rgba(0, 157, 146, .82), 0 0 20px rgba(0, 157, 146, .42); }
.slot.selectable::before,
.slot.suggested::before { display: none; }
.slot:not(:disabled):hover { transform: translate(-50%, -50%) scale(1.01); }
.slot.idea.selectable,
.slot.idea.selected,
.slot.idea.suggested {
  box-shadow: inset 0 0 0 3px rgba(0, 157, 146, .92), 0 0 22px rgba(0, 157, 146, .42);
}
.slot.last-ai {
  box-shadow: inset 0 0 0 5px rgba(255, 232, 142, .95), 0 0 26px rgba(255, 201, 82, .65) !important;
  animation: last-move-pulse 1.1s ease-in-out infinite;
}
@keyframes last-move-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.32); }
}

.piece {
  width: 74%;
  height: 80%;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
  display: grid;
  place-items: center;
}
.piece img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgba(0,0,0,.36));
}
.pyramid {
  width: 78%;
  height: 78%;
  clip-path: none;
  background: url('../img/ui/pyramid-symbol.png') center / contain no-repeat;
  box-shadow: none;
}
.pebble,
.work {
  width: 44%;
  height: 44%;
  background: radial-gradient(circle at 32% 27%, #fff, #d9d3c5 48%, #877f71 100%);
  box-shadow: 0 6px 10px rgba(0,0,0,.24), inset 0 1px 4px rgba(255,255,255,.75);
}
.work { background: radial-gradient(circle at 32% 27%, #fff4db, #c09c68 50%, #6a4a24); }
.slot .label { display: none !important; }

.slot.tomb-target::after {
  content: "";
  position: absolute;
  inset: 10%;
  background:
    linear-gradient(45deg, transparent calc(50% - 2px), rgba(255,255,255,.95) calc(50% - 2px), rgba(255,255,255,.95) calc(50% + 2px), transparent calc(50% + 2px)),
    linear-gradient(-45deg, transparent calc(50% - 2px), rgba(255,255,255,.95) calc(50% - 2px), rgba(255,255,255,.95) calc(50% + 2px), transparent calc(50% + 2px)),
    rgba(0,0,0,.42);
  border: 2px solid rgba(255,255,255,.72);
  box-shadow: 0 6px 14px rgba(0,0,0,.24);
  pointer-events: none;
  z-index: 1;
}
.slot.tomb-target:has(.pyramid)::after,
.slot.tomb-target:has(.work)::after,
.slot.tomb-target:has(.piece)::after { opacity: .28; }
.slot.buried-tomb {
  box-shadow: inset 0 0 0 5px rgba(184, 28, 20, .92), 0 0 20px rgba(184, 28, 20, .35) !important;
}

.player-card {
  grid-template-columns: auto auto 1fr auto;
}
.player-card.ai .player-main small::after { content: ""; }

.dice-dock {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: grid;
  gap: 8px;
  place-items: center;
  width: 132px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 248, 235, .84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.dice-dock.dragging {
  cursor: grabbing;
}
.dice-title {
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--gold);
  font-size: .7rem;
  font-weight: 900;
}
.die-face {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,.52);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 14px 28px rgba(0,0,0,.20);
}
.die-face img {
  width: 78px;
  height: 76px;
  object-fit: contain;
  image-rendering: auto;
}
.dice-caption {
  min-height: 2.7em;
  max-width: 112px;
  text-align: center;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.dice-dock.rolling .die-face {
  animation: die-tumble .42s linear infinite;
}
.dice-dock.rolling .dice-caption { color: var(--ink); font-weight: 800; }
@keyframes die-tumble {
  0% { transform: rotate(0deg) scale(1); }
  30% { transform: rotate(42deg) scale(1.08); }
  60% { transform: rotate(110deg) scale(.98); }
  100% { transform: rotate(180deg) scale(1); }
}

@media (min-width: 1180px) {
  .page-shell { padding-left: 114px; }
}
@media (max-width: 860px) {
  .dice-dock {
    left: max(8px, env(safe-area-inset-left));
    top: 42%;
    width: 78px;
    padding: 7px 5px;
    border-radius: 18px;
    transform: translateY(-50%);
  }
  .die-face { width: 54px; height: 54px; border-radius: 12px; }
  .die-face img { width: 48px; height: 48px; }
  .dice-caption { max-width: 66px; font-size: .62rem; }
  .dice-title { font-size: .58rem; }
  h1 { font-size: clamp(2rem, 10vw, 3.6rem); }
}
@media (max-width: 520px) {
  :root { --cell: 12.35%; }
  .slot { --size: 12.35%; }
  .slot.idea { --size: 12.15%; }
  .piece { width: 82%; height: 86%; }
  .board { filter: saturate(1.12) contrast(1.18) brightness(1.04); }
}
.piece.black img {
  filter: drop-shadow(0 0 2px rgba(255,255,255,.85)) drop-shadow(0 8px 8px rgba(0,0,0,.42));
}

/* --- v3 visual refinements: English UI, board logo, earth-tone highlights, corrected pieces/pyramid/hourglass --- */
.brand-mark {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 0;
  transform: none;
  clip-path: polygon(28% 2%,72% 2%,98% 28%,98% 72%,72% 98%,28% 98%,2% 72%,2% 28%);
  background:
    linear-gradient(135deg, rgba(255,255,255,.16), rgba(0,0,0,.15)),
    url('../img/board-print-2.jpg') center / 145% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,245,220,.65), 0 8px 18px rgba(35,23,16,.18);
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.brand-mark::before {
  inset: 8px;
  clip-path: polygon(28% 2%,72% 2%,98% 28%,98% 72%,72% 98%,28% 98%,2% 72%,2% 28%);
  border: 1px solid rgba(255,240,205,.75);
}
.brand-mark::after {
  inset: 17px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255,240,205,.8);
  opacity: .75;
}

h1 {
  max-width: 920px;
  font-size: clamp(2rem, 4.45vw, 4.15rem);
  line-height: 1.04;
}
.lead {
  max-width: 860px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(1.02rem, 1.34vw, 1.18rem);
  line-height: 1.55;
}

button {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
}
.actions button,
.actions button:focus,
.actions button:active,
.actions button:focus-visible {
  color: var(--ink);
  outline: none;
}
.actions button {
  background: rgba(255,255,255,.44);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.actions button:hover:not(:disabled) { background: rgba(255,255,255,.68); }
.actions button.active,
.actions button.active:active,
.actions button.active:focus-visible {
  background: rgba(232, 244, 241, .98);
  color: #0a746b;
  border-color: rgba(10,116,107,.34);
  box-shadow: 0 0 0 3px rgba(29,170,161,.16), inset 0 0 0 1px rgba(255,255,255,.28);
}
.actions button.primary,
.actions button.primary:focus,
.actions button.primary:active,
.actions button.primary:focus-visible {
  background: linear-gradient(135deg, var(--dark), #6f4222);
  color: #fff8ea;
}
.actions button.warn,
.actions button.warn:focus,
.actions button.warn:active,
.actions button.warn:focus-visible { color: var(--red); }
.actions button.primary.warn,
.actions button.primary.warn:focus,
.actions button.primary.warn:active,
.actions button.primary.warn:focus-visible { color: #fff4ea; }

.board {
  background: url('../img/board-print-2.jpg') center / 100% 100% no-repeat;
}
.slot.space::before,
.slot.center::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 4px;
  background:
    radial-gradient(circle at 28% 24%, rgba(255,236,196,.22), transparent 48%),
    linear-gradient(135deg, rgba(255,244,220,.13), rgba(64,41,20,.18));
  box-shadow:
    inset 0 1px 0 rgba(255,245,220,.28),
    inset 0 -1px 0 rgba(38,24,12,.22),
    0 4px 10px rgba(35,23,16,.12);
  opacity: .72;
  pointer-events: none;
}
.slot.center::before {
  inset: 5%;
  background:
    radial-gradient(circle at 28% 24%, rgba(255,236,196,.24), transparent 44%),
    linear-gradient(135deg, rgba(255,244,220,.18), rgba(58,41,22,.24));
}
.slot.idea::before,
.slot.idea::after { display: none !important; }
.slot.idea {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.slot.idea.selectable,
.slot.idea.selected,
.slot.idea.suggested {
  box-shadow: 0 0 0 3px rgba(0, 157, 146, .88), 0 0 16px rgba(0,157,146,.22) !important;
}
.slot.selected { transform: translate(-50%, -50%) scale(1.01); }

.piece {
  width: 86%;
  height: 90%;
}
.piece.bastet {
  width: 86%;
  height: 90%;
}
.piece.anubis {
  width: 94%;
  height: 98%;
}
.piece img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.34));
}
.piece.white img {
  filter: drop-shadow(0 0 2px rgba(0,0,0,.22)) drop-shadow(0 6px 8px rgba(0,0,0,.28));
}
.piece.black img {
  filter: drop-shadow(0 0 1px rgba(255,255,255,.42)) drop-shadow(0 7px 9px rgba(0,0,0,.42));
}

.pyramid {
  width: 86%;
  height: 86%;
  background: url('../img/ui/pyramid-symbol.png') center / contain no-repeat;
}
.legend-pyramid {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  background: url('../img/ui/pyramid-symbol.png') center / contain no-repeat;
  box-shadow: none;
}

.pebble,
.work {
  width: 56%;
  height: 56%;
  box-shadow: 0 5px 8px rgba(0,0,0,.22), inset 0 1px 4px rgba(255,255,255,.72);
}
.slot.idea .pebble,
.slot.idea .work {
  width: 68%;
  height: 68%;
}
.pebble { background: radial-gradient(circle at 30% 28%, #fff, #d9d3c5 45%, #7d7467 96%); }
.work { background: radial-gradient(circle at 30% 28%, #fff1d6, #c29a68 46%, #6b4a27 96%); }
.legend-pebble {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #fff, #d9d3c5 45%, #7d7467 96%);
}

.legend-piece,
.player-token {
  border: 1px solid rgba(48,34,21,.18);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.5), 0 2px 5px rgba(0,0,0,.12);
}
.legend-piece.white,
.player-token.white {
  background: radial-gradient(circle at 34% 28%, #ffffff, #d9d9d9 60%, #aeaeae 100%);
}
.legend-piece.black,
.player-token.black {
  background: radial-gradient(circle at 34% 28%, #414141, #111111 60%, #000000 100%);
}
.player-card {
  grid-template-columns: auto auto 1fr auto;
  gap: 12px;
}
.player-token {
  width: 38px;
  height: 38px;
}
.player-main strong { font-size: 1.05rem; }
.player-main small { font-size: .96rem; }

@media (max-width: 860px) {
  .player-main strong { font-size: 1rem; }
}

/* --- v4 polish: refined logo, landing, dice dock, hourglass, buttons --- */

.brand {
  gap: 12px;
}
.brand-mark {
  width: 54px !important;
  height: 54px !important;
  clip-path: none !important;
  border-radius: 0 !important;
  background: url('../img/ui/board-logo.png') center / contain no-repeat !important;
  box-shadow: none !important;
}
.brand-mark::before,
.brand-mark::after { display: none !important; }
.brand strong {
  font-size: clamp(1.15rem, 1.55vw, 1.65rem);
  letter-spacing: .16em;
}
.brand small {
  display: block;
  margin-top: 2px;
  font-size: clamp(.74rem, .9vw, .86rem);
  line-height: 1.15;
}

h1 {
  max-width: 760px;
  font-size: clamp(1.35rem, 2.35vw, 2.2rem);
  line-height: 1.15;
}
.lead {
  max-width: 840px;
  font-size: clamp(.98rem, 1.04vw, 1.06rem);
}

.actions button.primary,
.actions button.primary:focus,
.actions button.primary:active,
.actions button.primary:focus-visible,
.actions button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4a2715, #8b5328) !important;
  color: #fff8ea !important;
  border-color: rgba(86, 49, 24, .7) !important;
}
.actions button.primary:disabled,
.actions button.primary:disabled:hover {
  background: linear-gradient(135deg, #ece8e2, #f7f3ee) !important;
  color: #e7d5b3 !important;
  border-color: rgba(197, 181, 156, .55) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}

.board-legend .legend-pyramid {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: url('../img/ui/pyramid-symbol.png') center / contain no-repeat;
}

@media (max-width: 860px) {
  .brand-mark { width: 46px !important; height: 46px !important; }
  .brand strong { letter-spacing: .12em; }
  .brand small { font-size: .72rem; }
}

/* -------------------------------------------------------------------------
   Turn indicator: rotating GENESIS board logo
   Replaces the old hourglass completely.
   Image required at: assets/img/ui/board-logo.png
   ------------------------------------------------------------------------- */

.player-card {
  grid-template-columns: 44px auto 1fr auto;
}

/* This fixed holder never rotates, so the status row does not jump. */
.hourglass {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  flex: 0 0 44px !important;

  position: relative !important;
  display: block !important;
  place-items: initial !important;

  margin: 0 !important;
  padding: 0 !important;

  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: none !important;

  opacity: .36;
  overflow: visible !important;

  transform: none !important;
  animation: none !important;
}

/* Remove every old hourglass/sand child element from the display. */
.hourglass > *,
.hourglass i,
.hourglass span,
.hourglass .hg-rail,
.hourglass .hg-post,
.hourglass .hg-bulb,
.hourglass .hg-sand,
.hourglass .hg-stream {
  display: none !important;
  opacity: 0 !important;
  animation: none !important;
}

/* Reset old pseudo-element drawings. */
.hourglass::after {
  content: none !important;
  display: none !important;
}

/* The logo itself. Only this pseudo-element rotates when the player is active. */
.hourglass::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;

  width: 44px !important;
  height: 44px !important;
  display: block !important;

  background-image: url("../img/ui/board-logo.png") !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: contain !important;

  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: 50% 50% !important;

  opacity: .55;
  filter: grayscale(.1) saturate(.9);
  animation: none !important;
}

/* Current player: show and rotate the board logo. */
.hourglass.active {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.hourglass.active::before {
  opacity: 1;
  filter: none;
  animation: genesis-turn-logo-spin 2.4s linear infinite !important;
  will-change: transform;
}

/* Keeps the center fixed while rotating, so there is no wobble/jump. */
@keyframes genesis-turn-logo-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hourglass.active::before {
    animation: none !important;
  }
}

/* -------------------------------------------------------------------------
   Strong full-size gold center square.
   ------------------------------------------------------------------------- */

.slot.center::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;

  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;

  border-radius: 2px !important;
  border: 1px solid rgba(111, 75, 19, .55) !important;

  background:
    linear-gradient(135deg,
      #fff1a8 0%,
      #f5c64f 26%,
      #d59625 54%,
      #9b6617 100%
    ) !important;

  box-shadow:
    inset 0 2px 0 rgba(255, 251, 221, .72),
    inset 0 -3px 7px rgba(99, 62, 12, .32),
    0 4px 10px rgba(80, 50, 12, .28) !important;
}

.slot.center::after {
  content: none !important;
  display: none !important;
}

/* Pieces remain above the metal plate */
.slot.center .stack,
.slot.center .piece,
.slot.center .pyramid,
.slot.center .pebble,
.slot.center .work {
  position: relative;
  z-index: 4;
}

/* Piece image sizing and baseline alignment. */
.piece.bastet {
  width: 86% !important;
  height: 90% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

.piece.anubis {
  width: 98% !important;
  height: 104% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

.slot.center .piece.anubis,
.slot.center .piece.bastet {
  max-width: 100%;
  max-height: 100%;
}

.piece.bastet img,
.piece.anubis img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform-origin: center center !important;
}

.piece.bastet img {
  transform: translateY(0) !important;
}

.piece.anubis img {
  transform: translateY(0) scale(1.08) !important;
}

@media (max-width: 700px) {
  .piece.bastet img {
    transform: translateY(0) !important;
  }

  .piece.anubis img {
    transform: translateY(0) scale(1.06) !important;
  }
}

/* Fix the legend pyramid: square image, not a triangle/clip. */
.board-legend .legend-pyramid,
.legend-pyramid {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  border-radius: 3px !important;
  clip-path: none !important;
  background: url("../img/ui/pyramid-symbol.png") center / contain no-repeat !important;
  box-shadow: none !important;
}


/* --- v4 restore corrected title/header position under the board --- */
/* Do NOT force .game globally; keep the landing page hidden/visible logic intact. */
.game.hidden {
  display: none !important;
}

/* Desktop: board stays left, panels stay right, title/header goes below the board. */
@media (min-width: 1101px) {
  .game:not(.hidden) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 410px) !important;
    grid-template-rows: auto auto !important;
    gap: 18px !important;
    align-items: start !important;
  }

  .game:not(.hidden) .game-layout {
    display: contents !important;
  }

  .game:not(.hidden) .board-panel {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .game:not(.hidden) .side-panel {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
  }

  .game:not(.hidden) .game-header {
    grid-column: 1 !important;
    grid-row: 2 !important;

    width: min(86svh, 100%, 900px) !important;
    max-width: 900px !important;
    justify-self: center !important;

    margin-top: 0 !important;
    padding: 14px 18px !important;
    border-radius: 26px !important;

    text-align: left !important;
  }

  .game:not(.hidden) .game-header > div:first-child {
    text-align: left !important;
  }

  .game:not(.hidden) .game-header h2,
  .game:not(.hidden) #roomCode {
    font-size: clamp(1.45rem, 3vw, 2.35rem) !important;
  }

  .game:not(.hidden) .game-header .eyebrow {
    margin-bottom: 4px !important;
  }

  .game:not(.hidden) .room-row {
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  .game:not(.hidden) .session-note {
    font-size: .9rem !important;
  }
}

/* Tablet/mobile: title/header stays after the board, never above it. */
@media (max-width: 1100px) {
  .game:not(.hidden) {
    display: grid !important;
    gap: 18px !important;
  }

  .game:not(.hidden) .game-layout {
    order: 1 !important;
  }

  .game:not(.hidden) .game-header {
    order: 2 !important;
    width: min(100%, 900px) !important;
    justify-self: center !important;
    margin-top: 12px !important;
    border-radius: 22px !important;
    text-align: left !important;
  }

  .game:not(.hidden) .room-row {
    justify-content: flex-start !important;
  }
}
/* --- final clean safety: dice visibility --- */
/* Dice is part of the game screen only. It stays hidden on the landing/lobby page. */
#diceDock.hidden,
body:not(.game-view) #diceDock.dice-dock {
  display: none !important;
}

body.game-view #diceDock.dice-dock:not(.hidden) {
  display: grid !important;
}

/* --- beta footer / credits --- */
.app-footer {
  width: min(100%, 900px);
  margin: 18px auto 0;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  opacity: .86;
}

.app-footer-separator {
  color: var(--gold);
}

.app-footer a {
  color: var(--dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(74, 39, 21, .32);
}

.app-footer a:hover {
  color: #7a4a22;
  border-bottom-color: currentColor;
}

.update-button {
  border: 1px solid rgba(29, 170, 161, .32);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(232, 244, 241, .94);
  color: #08766e;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(29, 170, 161, .12);
}

.update-button:hover {
  transform: translateY(-1px);
  background: #f5fffc;
}

@media (max-width: 520px) {
  .app-footer {
    margin-top: 14px;
    font-size: .68rem;
    line-height: 1.35;
    gap: 6px;
  }
}
