:root {
  --walnut-dark: #231109;
  --walnut-mid: #4a2413;
  --walnut-warm: #7c4524;
  --satinwood: #e4bc7a;
  --rosewood: #8b3324;
  --felt-light: #1b5946;
  --felt-dark: #0e3328;
  --gold: #ecc882;
  --gold-dim: #b58947;
  --cream: #f7ecd6;
  --panel-bg: rgba(29, 19, 13, 0.94);
  --panel-border: #6d472b;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, #26473a 0%, transparent 45%),
    radial-gradient(circle at 80% 90%, #2c180f 0%, transparent 50%),
    linear-gradient(160deg, #152520 0%, #0d1613 100%);
  color: var(--cream);
  font: 15px/1.45 "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fullscreen & Theater Expansion */
.app-shell:fullscreen,
.app-shell.theater-mode {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow-y: auto;
  background: radial-gradient(circle at center, #1d362d 0%, #0b1411 100%);
}

.app-shell:fullscreen .workspace,
.app-shell.theater-mode .workspace {
  max-width: 1480px;
  width: 100%;
  flex: 1;
  align-items: center;
}

.app-shell:fullscreen .board,
.app-shell.theater-mode .board {
  min-height: 540px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px clamp(14px, 3vw, 32px);
  background: linear-gradient(180deg, #1b110c 0%, #120b08 100%);
  border-bottom: 2px solid #8c5d32;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crest {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #241409;
  background: radial-gradient(circle at 30% 25%, #fae0a8, #b6833e);
  border: 1px solid #fff2cf;
  box-shadow: inset 0 1px 2px #fff, 0 3px 10px rgba(0, 0, 0, 0.5);
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 1.4px;
  font-size: clamp(19px, 3vw, 27px);
  margin: 0;
  color: #f4d69c;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.sub {
  color: #c5b08f;
  font-size: 12px;
  letter-spacing: 0.4px;
}

/* Buttons & Inputs */
button, input, select {
  font: inherit;
}

button {
  border: 1px solid rgba(255, 240, 200, 0.25);
  border-radius: 8px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #e7c27d 0%, #c49249 100%);
  color: #23140b;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 #704922, 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, filter 0.15s ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary {
  background: linear-gradient(180deg, #326451 0%, #1f4537 100%);
  color: #f7eedc;
  border-color: rgba(167, 232, 203, 0.25);
  box-shadow: 0 2px 0 #112920, 0 4px 10px rgba(0, 0, 0, 0.35);
}

button.ghost {
  background: rgba(46, 30, 21, 0.85);
  color: #f0dab4;
  border: 1px solid #754e30;
  box-shadow: none;
}

.tiny-help {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  background: #2f2017;
  color: var(--gold);
  border: 1px solid #8a5e36;
  box-shadow: none;
}

input, select {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid #734f34;
  background: #120c09;
  color: #f9efe0;
}

input {
  width: 100%;
  margin: 4px 0 8px;
}

input:focus, select:focus {
  outline: 2px solid var(--gold);
  border-color: transparent;
}

label {
  font-size: 12px;
  color: #d4bf9e;
  display: block;
}

.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Workspace Layout */
.workspace {
  max-width: 1240px;
  width: 100%;
  margin: 16px auto;
  padding: 0 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 305px;
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 13px;
  padding: 13px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 232, 188, 0.08), 0 10px 26px rgba(0, 0, 0, 0.45);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 16px;
  color: #f1d39b;
  letter-spacing: 0.4px;
}

.action-bar {
  margin-bottom: 12px;
}

.status-banner {
  margin: 10px 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #0f3328 0%, #174637 100%);
  border: 1px solid rgba(236, 200, 130, 0.28);
  color: #f7ead1;
  font-weight: 500;
  min-height: 40px;
  display: flex;
  align-items: center;
}

/* 3D Tumbling Dice Stage */
.dice-tray {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 2px 0;
}

.dice-stage {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 56px;
  padding: 2px 8px;
  perspective: 700px;
}

.die-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
}

.die {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 28% 24%, #ffffff 0%, #f8eed9 52%, #dec79e 100%);
  color: #23140b;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 6px;
  gap: 2px;
  border: 1px solid #c9b084;
  box-shadow:
    inset 0 2px 2px #ffffff,
    inset 0 -3px 4px rgba(133, 102, 61, 0.45),
    0 3px 0 #9b7e53,
    0 7px 12px rgba(0, 0, 0, 0.55);
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
  z-index: 2;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.die.idle,
.die.used-die {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #7d6443;
}

.die.used-die {
  opacity: 0.45;
  transform: scale(0.9);
  background: #d8c6a6;
}

.die-shadow {
  position: absolute;
  bottom: -4px;
  width: 38px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.65) 0%, transparent 72%);
  z-index: 1;
  pointer-events: none;
}

.pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4d3b2f 0%, #140c08 80%);
  align-self: center;
  justify-self: center;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.75);
}

.die.rolling {
  animation: tumbleDieA 0.88s cubic-bezier(0.2, 0.78, 0.25, 1) both;
}

.die-wrap:nth-child(2) .die.rolling {
  animation-name: tumbleDieB;
  animation-delay: 0.05s;
}

.die-wrap.rolling-wrap .die-shadow {
  animation: shadowBounce 0.88s ease-out both;
}

@keyframes tumbleDieA {
  0% {
    transform: translate(-18px, -6px) rotateZ(0deg) rotateX(0deg) rotateY(0deg) scale(0.85);
  }
  20% {
    transform: translate(16px, -26px) rotateZ(145deg) rotateX(160deg) rotateY(90deg) scale(1.18);
  }
  42% {
    transform: translate(-10px, 4px) rotateZ(310deg) rotateX(300deg) rotateY(210deg) scale(0.95);
  }
  65% {
    transform: translate(9px, -13px) rotateZ(500deg) rotateX(430deg) rotateY(300deg) scale(1.08);
  }
  84% {
    transform: translate(-3px, 1px) rotateZ(660deg) rotateX(510deg) rotateY(345deg) scale(0.98);
  }
  100% {
    transform: translate(0, 0) rotateZ(717deg) rotateX(540deg) rotateY(360deg) scale(1);
  }
}

@keyframes tumbleDieB {
  0% {
    transform: translate(18px, -4px) rotateZ(0deg) rotateX(0deg) rotateY(0deg) scale(0.85);
  }
  22% {
    transform: translate(-14px, -28px) rotateZ(-160deg) rotateX(140deg) rotateY(-120deg) scale(1.18);
  }
  45% {
    transform: translate(11px, 5px) rotateZ(-340deg) rotateX(290deg) rotateY(-240deg) scale(0.94);
  }
  68% {
    transform: translate(-8px, -11px) rotateZ(-520deg) rotateX(420deg) rotateY(-310deg) scale(1.07);
  }
  86% {
    transform: translate(3px, 1px) rotateZ(-670deg) rotateX(515deg) rotateY(-350deg) scale(0.98);
  }
  100% {
    transform: translate(0, 0) rotateZ(-716deg) rotateX(540deg) rotateY(-360deg) scale(1);
  }
}

@keyframes shadowBounce {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  22% { transform: scale(0.55); opacity: 0.25; }
  44% { transform: scale(1.08); opacity: 0.75; }
  66% { transform: scale(0.72); opacity: 0.4; }
}

.turn-readout {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.turn-pill {
  padding: 5px 11px;
  border-radius: 999px;
  background: #2b1d14;
  border: 1px solid #7c5433;
  color: #f3d79e;
  font-size: 13px;
  font-weight: 600;
}

/* Heirloom Walnut & Brass Cabinet */
.cabinet-outer {
  position: relative;
  padding: 15px;
  border-radius: 20px;
  background:
    repeating-linear-gradient(
      92deg,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 2px,
      transparent 2px,
      transparent 9px
    ),
    linear-gradient(135deg, #9c6137 0%, #572c17 30%, #36190c 52%, #68361c 78%, #a66a3e 100%);
  border: 6px solid #2b1309;
  box-shadow:
    inset 0 0 0 2px #e7c27d,
    inset 0 0 0 6px #4b2513,
    0 22px 48px rgba(0, 0, 0, 0.72);
}

.brass-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid #f0cf8e;
  pointer-events: none;
  z-index: 4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.brass-corner.tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.brass-corner.tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.brass-corner.bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.brass-corner.br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }

/* Board Grid: Left Field | Center Bar | Right Home Field | Bear-Off Trays */
.board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr) 64px;
  grid-template-rows: minmax(195px, 1fr) minmax(195px, 1fr);
  min-height: 460px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 35% 50%, #1e624d 0%, #113b2f 78%),
    radial-gradient(ellipse at 75% 50%, #1e624d 0%, #113b2f 78%);
  border: 3px solid #e7c27d;
  box-shadow: inset 0 0 28px rgba(4, 18, 14, 0.9);
  overflow: hidden;
}

.half {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  position: relative;
  min-width: 0;
}

.half.top.left { grid-column: 1; grid-row: 1; }
.half.bottom.left { grid-column: 1; grid-row: 2; }
.half.top.right { grid-column: 3; grid-row: 1; }
.half.bottom.right { grid-column: 3; grid-row: 2; }

/* Center Bar & Hinges */
.centerbar {
  grid-column: 2;
  grid-row: 1 / 3;
  position: relative;
  background: linear-gradient(90deg, #2d170d 0%, #7d4c2a 24%, #b37b45 50%, #6e3f21 78%, #29140b 100%);
  border-left: 2px solid #e7c27d;
  border-right: 2px solid #e7c27d;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 2px;
  z-index: 2;
}

.hinge {
  width: 26px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(180deg, #fae2ad 0%, #a57335 100%);
  border: 1px solid #4a2d12;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.bar-emblem {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #f6dca4;
  text-shadow: 0 1px 2px #000;
}

.bar-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 4px 0;
  border-radius: 6px;
  cursor: pointer;
}

.bar-zone.selected {
  outline: 2px solid #ffe08a;
  background: rgba(255, 224, 138, 0.16);
}

.bar-label {
  font-size: 8px;
  letter-spacing: 0.5px;
  color: rgba(246, 220, 164, 0.75);
  font-weight: 700;
}

.barstack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 36px;
}

/* Inlaid Points */
.point {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
  padding: 14px 1px 2px;
  transition: background 0.15s ease;
}

.point.bottom {
  justify-content: flex-end;
  flex-direction: column-reverse;
  padding: 2px 1px 14px;
}

.point::before {
  content: "";
  position: absolute;
  left: 7%;
  width: 86%;
  height: 92%;
  top: 0;
  background: var(--tri);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.point.bottom::before {
  top: auto;
  bottom: 0;
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
}

.point:nth-child(even) {
  --tri: linear-gradient(180deg, #f3cf88 0%, #c8914e 65%, #9f6a32 100%);
}

.point:nth-child(odd) {
  --tri: linear-gradient(180deg, #a63f2e 0%, #76261c 65%, #521711 100%);
}

.point.bottom:nth-child(even) {
  --tri: linear-gradient(0deg, #f3cf88 0%, #c8914e 65%, #9f6a32 100%);
}

.point.bottom:nth-child(odd) {
  --tri: linear-gradient(0deg, #a63f2e 0%, #76261c 65%, #521711 100%);
}

.pt-num {
  position: absolute;
  top: 2px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(247, 234, 209, 0.55);
  pointer-events: none;
  z-index: 1;
}

.point.bottom .pt-num {
  top: auto;
  bottom: 2px;
}

.point.selected::after,
.point.hint::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 3;
}

.point.selected::after {
  border: 2px solid #ffe28a;
  background: rgba(255, 226, 138, 0.14);
}

.point.hint::after {
  border: 2px dashed #6ef2ad;
  background: rgba(110, 242, 173, 0.15);
  animation: pulseHint 1.2s infinite ease-in-out;
}

@keyframes pulseHint {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.45; }
}

/* Lathe-Turned Checkers */
.checkers {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0;
}

.point.bottom .checkers {
  flex-direction: column-reverse;
}

.checker {
  width: min(33px, 4.9vw);
  height: min(33px, 4.9vw);
  max-width: 38px;
  max-height: 38px;
  min-width: 18px;
  min-height: 18px;
  border-radius: 50%;
  margin: -2px 0;
  position: relative;
  transition: transform 0.15s ease;
}

.checker::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  pointer-events: none;
}

.checker.white {
  background: radial-gradient(circle at 32% 26%, #ffffff 0%, #f3e4c3 45%, #c5a874 82%, #7d643d 100%);
  border: 2px solid #6b5231;
  box-shadow:
    inset 0 2px 3px #ffffff,
    inset 0 -2px 4px rgba(92, 70, 41, 0.75),
    0 3px 5px rgba(0, 0, 0, 0.65);
}

.checker.white::after {
  border: 1px solid rgba(139, 108, 63, 0.45);
}

.checker.black {
  background: radial-gradient(circle at 32% 25%, #7c7b75 0%, #363532 36%, #141413 78%, #040404 100%);
  border: 2px solid #090908;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px #000000,
    0 3px 5px rgba(0, 0, 0, 0.75);
}

.checker.black::after {
  border: 1px solid rgba(236, 200, 130, 0.28);
}

.barstack .checker {
  width: 24px;
  height: 24px;
  margin: -3px 0;
}

.count {
  position: absolute;
  z-index: 4;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 12, 8, 0.85);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
}

.point.bottom .count {
  top: auto;
  bottom: 15px;
}

/* Bear-Off Side Trays */
.bear-tray {
  grid-column: 4;
  background: linear-gradient(180deg, #27130a 0%, #3b1e11 50%, #241109 100%);
  border-left: 2px solid #e7c27d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  cursor: pointer;
  position: relative;
}

.bear-tray.top {
  grid-row: 1;
  border-bottom: 1px solid rgba(231, 194, 125, 0.45);
}

.bear-tray.bottom {
  grid-row: 2;
  border-top: 1px solid rgba(231, 194, 125, 0.45);
}

.bear-tray.hint {
  box-shadow: inset 0 0 0 2px #6ef2ad, inset 0 0 18px rgba(110, 242, 173, 0.35);
}

.tray-title {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #e7c27d;
  text-align: center;
}

.tray-slots {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 4px 6px;
}

.tray-chip {
  height: 6px;
  border-radius: 3px;
  width: 100%;
}

.tray-chip.white {
  background: linear-gradient(90deg, #bfa270, #fff7e2, #bfa270);
  border: 1px solid #6b5231;
}

.tray-chip.black {
  background: linear-gradient(90deg, #1b1b19, #5c5b56, #141413);
  border: 1px solid #000;
}

.tray-count {
  font-size: 10px;
  font-weight: 700;
  color: #d7c3a1;
}

/* Sidebar Cards */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 9px;
  background: #2b1d14;
  border: 1px solid transparent;
  margin: 6px 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.player.active {
  border-color: var(--gold);
  background: linear-gradient(90deg, #382519 0%, #281b12 100%);
  box-shadow: 0 0 12px rgba(236, 200, 130, 0.2);
}

.player-id {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pip-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pip-swatch.white {
  background: radial-gradient(circle at 30% 30%, #fff, #cbb07d);
  border: 1px solid #6b5231;
}

.pip-swatch.black {
  background: radial-gradient(circle at 30% 30%, #686862, #111);
  border: 1px solid #000;
}

.player-name {
  font-weight: 700;
  font-size: 14px;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #173d30;
  color: #96e8c2;
  border: 1px solid rgba(150, 232, 194, 0.3);
}

.roomrow {
  display: flex;
  gap: 6px;
}

.roomrow input {
  margin: 4px 0 0;
}

.roomrow button {
  margin-top: 4px;
}

.notice {
  font-size: 12px;
  color: #dec293;
  margin: 8px 0 0;
}

.muted {
  color: #c2ae8f;
  font-size: 13px;
}

.small {
  font-size: 11px;
}

/* Table Chat */
.chat-messages {
  height: 145px;
  overflow-y: auto;
  background: #120c09;
  border: 1px solid #4e3420;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}

.chat-msg {
  padding: 5px 8px;
  border-radius: 7px;
  background: #241811;
  word-break: break-word;
}

.chat-msg.me {
  background: #183d30;
  border-left: 3px solid #6ef2ad;
}

.chat-msg.them {
  background: #2d1e15;
  border-left: 3px solid var(--gold);
}

.chat-msg.system {
  background: transparent;
  color: #a99577;
  font-style: italic;
  padding: 2px 4px;
}

.chat-meta {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
}

.quick-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 7px 0;
}

.chip {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: #2b1d14;
  color: #ebd4ad;
  border: 1px solid #6b472b;
  box-shadow: none;
}

.chip:hover {
  background: #3d291d;
}

.chat-form {
  display: flex;
  gap: 6px;
}

.chat-form input {
  margin: 0;
}

/* Ledger Log */
.log {
  height: 115px;
  overflow-y: auto;
  background: #120c09;
  border: 1px solid #4e3420;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #d6c3a5;
}

.log div {
  margin-bottom: 3px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10000;
}

.modal.show {
  display: flex;
}

.modalbox {
  max-width: 540px;
  width: 100%;
  background: linear-gradient(180deg, #271a11 0%, #1b110b 100%);
  border: 1px solid #b5864c;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
}

.modalbox h2 {
  margin-top: 0;
  font-family: Georgia, serif;
  color: #f3d49b;
}

.modal-body {
  color: #e6d5b8;
  font-size: 14px;
  line-height: 1.55;
}

.modal-body ol, .modal-body ul {
  padding-left: 20px;
}

.modal-body li {
  margin-bottom: 8px;
}

footer {
  text-align: center;
  color: #a89477;
  font-size: 12px;
  padding: 18px 12px;
  margin-top: auto;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 580px) {
  .sidebar {
    grid-template-columns: 1fr;
  }
  .cabinet-outer {
    padding: 7px;
    border-width: 4px;
    border-radius: 14px;
  }
  .board {
    grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 44px;
    grid-template-rows: minmax(150px, 1fr) minmax(150px, 1fr);
    min-height: 350px;
  }
  .checker {
    width: min(23px, 5.1vw);
    height: min(23px, 5.1vw);
    min-width: 14px;
    min-height: 14px;
    border-width: 1px;
  }
  .die-wrap {
    width: 36px;
    height: 36px;
  }
  .die {
    width: 34px;
    height: 34px;
    padding: 4px;
  }
  .pip {
    width: 6px;
    height: 6px;
  }
}
