/* ============ Mahabharata: Kingdoms of Bharat ============ */
/* Cinematic, gold-accented, temple-inspired prototype UI    */

:root {
  --gold-1: #f6d27a;
  --gold-2: #d6a23b;
  --gold-3: #8c6418;
  --saffron: #ff8a3d;
  --crimson: #b22222;
  --royal: #2a3a78;
  --night: #0e1124;
  --night-2: #161a37;
  --marble: #f5ecd8;
  --ink: #1c1410;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --gold-grad: linear-gradient(135deg, #f6d27a 0%, #d6a23b 50%, #8c6418 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--marble);
  background: #000000;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle {
  font-size: 16px;
  width: 36px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.board-mode-toggle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  width: 40px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.board-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.board-3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.board-recenter {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(14, 17, 36, 0.7);
  color: var(--gold-1);
  border: 1px solid rgba(246, 210, 122, 0.4);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform 200ms ease, background 120ms ease;
}
.board-recenter:hover {
  background: rgba(246, 210, 122, 0.18);
  transform: rotate(-90deg);
}
[data-theme="light"] .board-recenter {
  background: rgba(255, 252, 240, 0.85);
  color: #6b4a14;
  border-color: rgba(140, 100, 24, 0.35);
}

.credits {
  position: fixed !important;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100vw - 24px);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: rgba(246, 210, 122, 0.7);
  pointer-events: none;
  z-index: 250;
  text-align: center;
  background: rgba(14, 17, 36, 0.7);
  padding: 5px 14px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  line-height: 1.45;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.credits div { white-space: nowrap; }

/* ===================== Multiplayer ===================== */
.mp-buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.mp-btn {
  flex: 1 1 calc(50% - 5px);
  font-size: 13px;
  padding: 10px 14px;
}

.lobby {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 12px;
  background: #000000;
  z-index: 90;
}
.lobby-card {
  width: min(560px, 100%);
  margin: auto;
  padding: 30px 30px;
  background: rgba(22, 26, 55, 0.8);
  border: 1px solid rgba(246, 210, 122, 0.35);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.lobby-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-1);
  margin-bottom: 4px;
}
.lobby-title {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 2px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lobby-code-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 17, 36, 0.7);
  border: 1px solid rgba(246, 210, 122, 0.25);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 14px 0 18px;
}
.lobby-code-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(245, 236, 216, 0.6);
  margin-right: 8px;
}
.lobby-code {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 6px;
  color: var(--gold-1);
  flex: 1;
  text-align: center;
}
.lobby-copy { font-size: 11px; padding: 6px 12px; }
.lobby-section-title {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-1);
  margin: 14px 0 8px;
  font-weight: 600;
}
.lobby-players {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  max-height: 180px;
  overflow-y: auto;
}
.lobby-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(14, 17, 36, 0.5);
  border: 1px solid rgba(246, 210, 122, 0.15);
  border-left: 3px solid var(--player-color, transparent);
  border-radius: 8px;
}
.lobby-player .lp-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(246, 210, 122, 0.4);
  object-fit: cover;
}
.lobby-player .lp-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--marble);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lobby-player .lp-faction {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-1);
  letter-spacing: 0.3px;
}
.lobby-player .lp-host {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  background: var(--gold-grad);
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
}
.lobby-factions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}
.lobby-faction-pick {
  padding: 12px 14px;
  background: rgba(14, 17, 36, 0.7);
  border: 1px solid rgba(246, 210, 122, 0.3);
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--marble);
  text-align: left;
  transition: all 120ms ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lobby-faction-pick:hover:not(:disabled):not(.taken) {
  background: rgba(246, 210, 122, 0.12);
  border-color: var(--gold-1);
}
.lobby-faction-pick.selected {
  border-color: var(--gold-1);
  background: rgba(246, 210, 122, 0.2);
  box-shadow: 0 0 0 2px rgba(246, 210, 122, 0.3);
}
.lobby-faction-pick.taken { opacity: 0.45; cursor: not-allowed; }
.lobby-faction-pick .lf-swatch {
  width: 16px; height: 16px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 8px currentColor;
}
.lobby-faction-pick .lf-name {
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 15px;
  color: var(--marble);
}
.lobby-faction-pick.selected .lf-name { color: var(--gold-1); }
.lobby-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lobby-status {
  flex: 1;
  font-size: 12px;
  color: rgba(245, 236, 216, 0.7);
}

/* ===================== Chat ===================== */
.chat-toggle {
  position: fixed;
  bottom: 60px;
  right: 16px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: var(--ink);
  font-size: 22px;
  border: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
}
.chat-toggle:hover { transform: scale(1.06); }
.chat-unread {
  position: absolute;
  top: -4px; right: -4px;
  background: #d34a4a;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-panel {
  position: fixed;
  bottom: 60px;
  right: 16px;
  width: 320px;
  height: 420px;
  background: rgba(22, 26, 55, 0.98);
  border: 1px solid var(--gold-2);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  z-index: 80;
  backdrop-filter: blur(8px);
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(246, 210, 122, 0.2);
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--gold-1);
}
.chat-head .btn-ghost {
  font-size: 14px;
  padding: 4px 10px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.chat-msg {
  background: rgba(14, 17, 36, 0.6);
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid var(--msg-color, var(--gold-2));
  animation: chatIn 0.2s ease;
}
@keyframes chatIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.own { background: rgba(246, 210, 122, 0.12); }
.chat-msg .cm-author {
  font-size: 11px;
  font-weight: 700;
  color: var(--msg-color, var(--gold-1));
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}
.chat-msg .cm-text {
  color: rgba(245, 236, 216, 0.95);
  word-wrap: break-word;
  line-height: 1.4;
}
.chat-msg.system {
  background: transparent;
  border-left: none;
  text-align: center;
  font-style: italic;
  font-size: 11px;
  color: rgba(245, 236, 216, 0.55);
  padding: 4px 0;
}
.chat-form {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid rgba(246, 210, 122, 0.2);
}
.chat-form input {
  flex: 1;
  background: rgba(14, 17, 36, 0.7);
  color: var(--marble);
  border: 1px solid rgba(246, 210, 122, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.chat-form input:focus { border-color: var(--gold-1); }
.chat-send {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
}

[data-theme="light"] .lobby {
  background: #ffffff;
}
[data-theme="light"] .lobby-card {
  background: rgba(255, 252, 240, 0.95);
  border-color: rgba(140, 100, 24, 0.3);
}
[data-theme="light"] .lobby-eyebrow { color: #8c6418; }
[data-theme="light"] .lobby-code-wrap {
  background: rgba(248, 240, 218, 0.7);
  border-color: rgba(140, 100, 24, 0.25);
}
[data-theme="light"] .lobby-code { color: #6b4a14; }
[data-theme="light"] .lobby-code-label { color: rgba(50, 35, 15, 0.65); }
[data-theme="light"] .lobby-section-title { color: #8c6418; }
[data-theme="light"] .lobby-player {
  background: rgba(248, 240, 218, 0.85);
  border-color: rgba(140, 100, 24, 0.25);
}
[data-theme="light"] .lobby-player .lp-name { color: #1a1410; }
[data-theme="light"] .lobby-player .lp-faction { color: #8c6418; }
[data-theme="light"] .lobby-player .lp-host {
  background: linear-gradient(135deg, #d6a23b, #8c6418);
  color: #fff8e0;
}
[data-theme="light"] .lobby-faction-pick {
  background: rgba(255, 252, 240, 0.85);
  border-color: rgba(140, 100, 24, 0.3);
  color: #1a1410;
}
[data-theme="light"] .lobby-faction-pick:hover:not(:disabled):not(.taken) {
  background: rgba(214, 162, 59, 0.15);
  border-color: var(--gold-2);
}
[data-theme="light"] .lobby-faction-pick.selected {
  background: rgba(214, 162, 59, 0.2);
  border-color: var(--gold-2);
  box-shadow: 0 0 0 2px rgba(140, 100, 24, 0.3);
}
[data-theme="light"] .lobby-faction-pick .lf-name { color: #1a1410; }
[data-theme="light"] .lobby-faction-pick.selected .lf-name { color: #6b4a14; }
[data-theme="light"] .lobby-status { color: rgba(50, 35, 15, 0.85); }
[data-theme="light"] .chat-panel { background: #fffaee; border-color: var(--gold-2); }
[data-theme="light"] .chat-head { color: #8c6418; border-bottom-color: rgba(140, 100, 24, 0.2); }
[data-theme="light"] .chat-msg {
  background: rgba(248, 240, 218, 0.85);
  border-left-color: var(--msg-color, #8c6418);
}
[data-theme="light"] .chat-msg.own { background: rgba(214, 162, 59, 0.22); }
[data-theme="light"] .chat-msg .cm-text { color: #1a1410; }
[data-theme="light"] .chat-msg .cm-author { color: var(--msg-color, #6b4a14); }
[data-theme="light"] .chat-msg.system {
  background: transparent;
  color: rgba(50, 35, 15, 0.65);
}
[data-theme="light"] .chat-form { border-top-color: rgba(140, 100, 24, 0.2); }
[data-theme="light"] .chat-form input {
  background: #fff;
  color: #2a2218;
  border-color: rgba(140, 100, 24, 0.3);
}
[data-theme="light"] .chat-toggle {
  background: var(--gold-grad);
  color: #fff8e0;
}

/* Buttons in light theme */
[data-theme="light"] .btn-secondary {
  background: rgba(255, 252, 240, 0.95);
  color: #6b4a14;
  border-color: rgba(140, 100, 24, 0.4);
}
[data-theme="light"] .btn-secondary:hover {
  background: rgba(214, 162, 59, 0.18);
  color: #4a3208;
}
[data-theme="light"] .mp-btn { color: #6b4a14; }
[data-theme="light"] .lobby-copy { color: #6b4a14; border-color: rgba(140, 100, 24, 0.35); }

/* Splash hint + tagline contrast */
[data-theme="light"] .hint { color: rgba(50, 35, 15, 0.7); }
[data-theme="light"] .auth-hint { color: rgba(50, 35, 15, 0.7); }
[data-theme="light"] .credits {
  color: #6b4a14;
  background: rgba(255, 250, 235, 0.85);
  border: 1px solid rgba(140, 100, 24, 0.15);
}

@media (max-width: 600px) {
  .lobby-card { padding: 20px 16px; }
  .lobby-title { font-size: 20px; }
  .lobby-code { font-size: 22px; letter-spacing: 4px; }
  .lobby-factions { grid-template-columns: 1fr 1fr; }
  .chat-panel { width: calc(100vw - 16px); right: 8px; bottom: 80px; height: 60vh; }
  .chat-toggle { bottom: 12px; right: 12px; }
  .mp-btn { flex: 1 1 100%; }
}
[data-theme="light"] .credits {
  color: #8c6418;
  background: rgba(255, 250, 235, 0.7);
}
@media (max-width: 600px) {
  .credits {
    font-size: 10px;
    bottom: 4px;
    padding: 3px 10px;
  }
}

/* ===================== Light theme ===================== */
[data-theme="light"] {
  --marble: #2a2218;
  --night: #f6efde;
  --night-2: #fbf6e6;
  --ink: #1a1410;
  --shadow: 0 6px 22px rgba(80, 50, 10, 0.18);
}
[data-theme="light"] body {
  color: #1a1410;
  background: #ffffff;
}
[data-theme="light"] .topbar {
  background: linear-gradient(180deg, rgba(255, 250, 235, 0.95), rgba(248, 240, 218, 0.85));
  border-bottom: 1px solid rgba(140, 100, 24, 0.25);
}
[data-theme="light"] .brand-text { color: #6b4a14; }
[data-theme="light"] .brand-mark {
  filter: drop-shadow(0 1px 3px rgba(140, 100, 24, 0.3));
}
[data-theme="light"] #phase-name { color: #6b4a14; }
[data-theme="light"] .phase-label { color: rgba(60, 40, 20, 0.55); }
[data-theme="light"] .btn-ghost {
  color: rgba(60, 40, 20, 0.75);
  border-color: rgba(140, 100, 24, 0.3);
}
[data-theme="light"] .btn-ghost:hover { color: #6b4a14; border-color: var(--gold-2); }

[data-theme="light"] .panel {
  background: rgba(255, 252, 240, 0.95);
  border: 1px solid rgba(140, 100, 24, 0.2);
  box-shadow: 0 2px 14px rgba(80, 50, 10, 0.08);
}
[data-theme="light"] .panel-title { color: #8c6418; border-bottom-color: rgba(140, 100, 24, 0.18); }
[data-theme="light"] .player-card {
  background: rgba(255, 252, 240, 0.95);
  border: 1px solid rgba(140, 100, 24, 0.2);
}
[data-theme="light"] .player-card.active {
  background: rgba(255, 245, 215, 1);
  box-shadow: 0 4px 18px rgba(214, 162, 59, 0.3);
}
[data-theme="light"] .pc-faction { color: rgba(60, 40, 20, 0.55); }
[data-theme="light"] .pc-res { background: rgba(248, 240, 218, 0.7); border-color: rgba(140, 100, 24, 0.1); }
[data-theme="light"] .pc-res .res-count { color: #8c6418; }
[data-theme="light"] .pc-dharma { color: rgba(60, 40, 20, 0.6); }
[data-theme="light"] .pc-dharma .dharma-val { color: #8c6418; }

[data-theme="light"] .board-wrap {
  background: rgba(255, 252, 240, 0.6);
  border: 1px solid rgba(140, 100, 24, 0.2);
  box-shadow: 0 4px 22px rgba(80, 50, 10, 0.1), inset 0 0 40px rgba(80, 50, 10, 0.06);
}

[data-theme="light"] .log { color: rgba(50, 35, 15, 0.85); }
[data-theme="light"] .log-line { border-bottom-color: rgba(140, 100, 24, 0.08); }
[data-theme="light"] .log-line.event { color: #8c6418; }
[data-theme="light"] .log-line.gain { color: #2f7a3e; }
[data-theme="light"] .log-line.warn { color: #b96b1e; }
[data-theme="light"] .log-line.bad { color: #b22e2e; }

[data-theme="light"] .btn-build {
  background: rgba(255, 252, 240, 0.9);
  border: 1px solid rgba(140, 100, 24, 0.25);
  color: #2a2218;
}
[data-theme="light"] .btn-build:hover:not(:disabled) {
  background: rgba(255, 240, 200, 0.9);
  border-color: var(--gold-2);
}
[data-theme="light"] .btn-build.active {
  background: rgba(255, 235, 180, 1);
  border-color: var(--gold-2);
  box-shadow: 0 0 0 2px rgba(214, 162, 59, 0.4);
}
[data-theme="light"] .btn-build::after { color: #8c6418; }
[data-theme="light"] .die {
  background: linear-gradient(145deg, #ffffff, #ecdfb6);
  color: #1a0f0f;
}
[data-theme="light"] .dice-total { color: #6b4a14; }

[data-theme="light"] .modal {
  background: rgba(50, 38, 18, 0.55);
}
[data-theme="light"] .modal-card {
  background: #fffaee;
  border: 1px solid var(--gold-2);
  color: #2a2218;
}
[data-theme="light"] .modal-card h3 { color: #8c6418; }
[data-theme="light"] .modal-card #modal-body { color: #2a2218; }
[data-theme="light"] .modal-card #modal-body code {
  background: rgba(140, 100, 24, 0.12);
  color: #6b4a14;
}
[data-theme="light"] .rules-section {
  background: rgba(248, 240, 218, 0.6);
  border-color: rgba(140, 100, 24, 0.2);
}
[data-theme="light"] .rules-head { color: #8c6418; }
[data-theme="light"] .rules-body { color: rgba(50, 35, 15, 0.9); }
[data-theme="light"] .rules-table td { border-top-color: rgba(140, 100, 24, 0.15); }
[data-theme="light"] .rules-table td:nth-child(2) { color: #8c6418; }
[data-theme="light"] .rules-table td:nth-child(3) { color: rgba(50, 35, 15, 0.7); }

[data-theme="light"] .splash {
  background: #ffffff;
}
[data-theme="light"] .splash-inner {
  background: rgba(255, 252, 240, 0.95);
  border: 1px solid rgba(140, 100, 24, 0.3);
  box-shadow: 0 8px 30px rgba(80, 50, 10, 0.18);
}
[data-theme="light"] .tagline { color: rgba(50, 35, 15, 0.7); }
[data-theme="light"] .subtitle { color: #6b4a14; opacity: 1; }
[data-theme="light"] .setup-grid select {
  background: #fffdf3;
  color: #2a2218;
  border-color: rgba(140, 100, 24, 0.4);
}
[data-theme="light"] .faction-pick {
  background: rgba(255, 252, 240, 0.9);
  border-color: rgba(140, 100, 24, 0.25);
}
[data-theme="light"] .faction-pick .fp-desc { color: rgba(50, 35, 15, 0.7); }
[data-theme="light"] .auth-signed-in {
  background: rgba(255, 252, 240, 0.9);
  border-color: rgba(140, 100, 24, 0.3);
}
[data-theme="light"] .auth-greeting { color: rgba(50, 35, 15, 0.6); }
[data-theme="light"] .auth-name { color: #8c6418; }
[data-theme="light"] .auth-divider span {
  background: rgba(255, 252, 240, 0.95);
  color: rgba(50, 35, 15, 0.55);
}
[data-theme="light"] .auth-signout {
  border-color: rgba(140, 100, 24, 0.3);
  color: rgba(50, 35, 15, 0.7);
}
[data-theme="light"] .auth-signout:hover { border-color: var(--gold-2); color: #6b4a14; }
[data-theme="light"] .floating-tip {
  background: rgba(255, 252, 240, 0.98);
  color: #2a2218;
}

.display-font {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
}

button {
  font-family: inherit;
  cursor: pointer;
  outline: none;
  border: none;
}

.hidden { display: none !important; }

/* ===================== Splash ===================== */
.splash {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 12px;
  background: #000000;
  z-index: 100;
}
.splash-inner {
  width: min(560px, 100%);
  padding: 36px 32px;
  margin: auto;
  position: relative;
  text-align: center;
  background: rgba(22, 26, 55, 0.7);
  border: 1px solid rgba(246, 210, 122, 0.35);
  border-radius: 14px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(246, 210, 122, 0.08);
  backdrop-filter: blur(8px);
}
.splash-theme-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(14, 17, 36, 0.6);
  color: var(--gold-1);
  border: 1px solid rgba(246, 210, 122, 0.3);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 120ms ease;
}
.splash-theme-toggle:hover {
  background: rgba(246, 210, 122, 0.15);
  border-color: var(--gold-1);
  transform: rotate(15deg);
}
[data-theme="light"] .splash-theme-toggle {
  background: rgba(255, 252, 240, 0.8);
  color: #8c6418;
  border-color: rgba(140, 100, 24, 0.3);
}
.splash-mark {
  font-family: 'Tiro Devanagari Sanskrit', serif;
  font-size: 56px;
  line-height: 1;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(214, 162, 59, 0.4));
}
.title {
  margin: 6px 0 0;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 42px;
  letter-spacing: 4px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle {
  margin: 4px 0 18px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--marble);
  opacity: 0.85;
  font-size: 14px;
}
.tagline {
  margin: 0 0 22px;
  color: rgba(245, 236, 216, 0.75);
  font-size: 14px;
}

/* ===================== Auth ===================== */
.auth-section {
  margin: 8px 0 16px;
}
.g-signin-btn {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  min-height: 40px;
}
.g-signin-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
.g-signin-pseudo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.25px;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}
.g-signin-pseudo:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.auth-hint {
  font-size: 11px;
  color: rgba(245, 236, 216, 0.55);
  font-style: italic;
}
.auth-divider {
  position: relative;
  text-align: center;
  margin: 8px 0;
}
.auth-divider::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: rgba(246, 210, 122, 0.2);
}
.auth-divider span {
  position: relative;
  background: rgba(22, 26, 55, 0.7);
  padding: 0 12px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(245, 236, 216, 0.5);
}
.auth-signed-in {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(14, 17, 36, 0.6);
  border: 1px solid rgba(246, 210, 122, 0.3);
  border-radius: 10px;
  margin-bottom: 12px;
  text-align: left;
}
.auth-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold-2);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
}
.auth-user { flex: 1; min-width: 0; }
.auth-greeting {
  font-size: 11px;
  color: rgba(245, 236, 216, 0.6);
  letter-spacing: 0.5px;
}
.auth-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-signout {
  background: transparent;
  border: 1px solid rgba(246, 210, 122, 0.3);
  color: rgba(245, 236, 216, 0.7);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 120ms ease;
}
.auth-signout:hover {
  border-color: var(--gold-1);
  color: var(--gold-1);
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 12px 0 18px;
}
.setup-grid label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; letter-spacing: 0.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gold-1);
  text-align: left;
}
.setup-grid select {
  background: rgba(14, 17, 36, 0.9);
  color: var(--marble);
  border: 1px solid rgba(246, 210, 122, 0.4);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
}
.setup-factions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.faction-pick {
  background: rgba(14, 17, 36, 0.6);
  border: 1px solid rgba(246, 210, 122, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  font-size: 12px;
}
.faction-pick .fp-name {
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 13px;
  color: var(--gold-1);
}
.faction-pick .fp-desc {
  color: rgba(245, 236, 216, 0.7);
  font-size: 12px;
}
.faction-swatch {
  width: 16px; height: 16px;
  border-radius: 50%;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 8px currentColor;
}

.hint {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: 0;
  opacity: 0.6;
}

/* ===================== Buttons ===================== */
.btn-primary, .btn-secondary, .btn-ghost, .btn-build {
  font-family: inherit;
  letter-spacing: 0.5px;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary {
  background: var(--gold-grad);
  color: var(--ink);
  font-weight: 700;
  padding: 10px 22px;
  box-shadow: 0 4px 16px rgba(214, 162, 59, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary.full, .btn-secondary.full, .btn-ghost.full { width: 100%; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-1);
  border: 1px solid rgba(246, 210, 122, 0.4);
  padding: 9px 18px;
}
.btn-secondary:hover { background: rgba(246, 210, 122, 0.15); }

.btn-ghost {
  background: transparent;
  color: rgba(245, 236, 216, 0.75);
  padding: 8px 14px;
  border: 1px solid rgba(245, 236, 216, 0.2);
}
.btn-ghost:hover { color: var(--gold-1); border-color: var(--gold-2); }

.btn-build {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  background: rgba(14, 17, 36, 0.85);
  color: var(--marble);
  padding: 10px 8px;
  border: 1px solid rgba(246, 210, 122, 0.25);
  text-align: center;
}
.btn-build:hover:not(:disabled) {
  border-color: var(--gold-1);
  background: rgba(246, 210, 122, 0.1);
}
.btn-build:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-build.active {
  border-color: var(--gold-1);
  background: rgba(246, 210, 122, 0.18);
  box-shadow: 0 0 0 2px rgba(246, 210, 122, 0.4);
}
.btn-build .b-icon { font-size: 22px; line-height: 1; }
.btn-build .b-label { font-size: 12px; letter-spacing: 0.2px; font-weight: 600; line-height: 1.2; }
.btn-build::after {
  content: attr(data-cost);
  font-size: 10px;
  letter-spacing: 0;
  color: rgba(246, 210, 122, 0.75);
  line-height: 1.1;
}

/* ===================== Game Layout ===================== */
.game {
  display: flex; flex-direction: column;
  height: 100vh;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(22, 26, 55, 0.95), rgba(22, 26, 55, 0.7));
  border-bottom: 1px solid rgba(246, 210, 122, 0.25);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; letter-spacing: 1px;
}
.brand-mark {
  font-family: 'Tiro Devanagari Sanskrit', serif;
  font-size: 22px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-text {
  color: var(--gold-1);
  font-weight: 700;
  font-family: 'Cinzel', serif;
  letter-spacing: 2px;
}
.phase-indicator {
  display: flex; gap: 10px; align-items: baseline;
}
.phase-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(245, 236, 216, 0.55);
  text-transform: uppercase;
}
#phase-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--gold-1);
}
.topbar-actions { display: flex; gap: 8px; }

.stage {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 16px;
  padding: 16px;
  flex: 1; min-height: 0;
}

.side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.side.left { overflow-y: auto; }
.side.right { overflow-y: auto; }

.board-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(246, 210, 122, 0.06) 0%, transparent 70%),
    rgba(14, 17, 36, 0.6);
  border: 1px solid rgba(246, 210, 122, 0.2);
  border-radius: 10px;
  box-shadow: var(--shadow), inset 0 0 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
#board {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.floating-tip {
  position: absolute;
  background: rgba(14, 17, 36, 0.95);
  border: 1px solid var(--gold-2);
  color: var(--marble);
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 1px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

/* ===================== Players Panel ===================== */
.players-panel {
  display: flex; flex-direction: column; gap: 10px;
}
.player-card {
  background: rgba(22, 26, 55, 0.85);
  border: 1px solid rgba(246, 210, 122, 0.2);
  border-left: 4px solid var(--player-color, #888);
  border-radius: 8px;
  padding: 10px 12px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.player-card.active {
  border-color: var(--gold-1);
  box-shadow: 0 0 24px rgba(246, 210, 122, 0.35), inset 0 0 0 1px rgba(246, 210, 122, 0.4);
  transform: translateX(2px);
}
.pc-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.pc-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  color: var(--player-color);
}
.pc-faction {
  font-size: 11px;
  letter-spacing: 0;
  color: rgba(245, 236, 216, 0.6);
}
.pc-vp {
  background: var(--gold-grad);
  color: var(--ink);
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.pc-resources {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.pc-res {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 5px 2px;
  text-align: center;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.pc-res .res-icon { display: block; font-size: 16px; margin-bottom: 2px; }
.pc-res .res-count { color: var(--gold-1); font-weight: 700; font-size: 13px; }
.pc-dharma {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0;
  color: rgba(245, 236, 216, 0.7);
  display: flex; justify-content: space-between;
}
.pc-dharma .dharma-val { color: var(--gold-1); font-weight: 700; }

/* ===================== Right Panels ===================== */
.panel {
  background: rgba(22, 26, 55, 0.85);
  border: 1px solid rgba(246, 210, 122, 0.2);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.panel-title {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-1);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(246, 210, 122, 0.2);
}
.current-player {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  letter-spacing: 1.5px;
  color: var(--player-color, var(--gold-1));
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.dice-row {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  margin: 8px 0 12px;
}
.die {
  width: 48px; height: 48px;
  background: linear-gradient(145deg, #faf3df, #c8b984);
  color: #1a0f0f;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  font-family: 'Cinzel', serif;
}
.die.rolling {
  animation: roll 0.6s ease-in-out;
}
@keyframes roll {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}
.dice-total {
  font-size: 22px;
  color: var(--gold-1);
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin: 10px 0;
}

/* ===================== Log ===================== */
.log {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  color: rgba(245, 236, 216, 0.9);
  max-height: 240px;
  min-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
  line-height: 1.55;
}
.log-line {
  padding: 4px 0;
  border-bottom: 1px solid rgba(246, 210, 122, 0.08);
  animation: fadeIn 0.4s ease;
}
.log-line.event { color: var(--gold-1); }
.log-line.gain  { color: #98e4a4; }
.log-line.warn  { color: #f4a64f; }
.log-line.bad   { color: #ef6f6f; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.log::-webkit-scrollbar { width: 6px; }
.log::-webkit-scrollbar-thumb { background: rgba(246, 210, 122, 0.3); border-radius: 3px; }
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: rgba(246, 210, 122, 0.2); border-radius: 3px; }

/* ===================== Modal ===================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(5, 6, 13, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  backdrop-filter: blur(4px);
}
.modal-card {
  width: min(520px, 92vw);
  background: rgba(22, 26, 55, 0.98);
  border: 1px solid var(--gold-2);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.modal-card h3 {
  margin: 0 0 14px;
  font-family: 'Cinzel', serif;
  letter-spacing: 1.5px;
  color: var(--gold-1);
  font-size: 20px;
  text-align: center;
}
.modal-card #modal-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--marble);
  margin-bottom: 18px;
  max-height: 65vh;
  overflow-y: auto;
}
.rules-section {
  background: rgba(14, 17, 36, 0.5);
  border: 1px solid rgba(246, 210, 122, 0.15);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.rules-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
  color: var(--gold-1);
  font-size: 14px;
}
.rules-head strong { font-weight: 600; letter-spacing: 0.3px; }
.rules-emoji { font-size: 18px; }
.rules-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(245, 236, 216, 0.9);
}
.rules-body ol {
  margin: 6px 0 4px 18px;
  padding: 0;
}
.rules-body ol li { margin-bottom: 4px; }
.resource-key {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  margin-bottom: 8px;
  font-size: 13px;
}
.resource-key .rk-icon { font-size: 15px; margin-right: 3px; }
.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rules-table td {
  padding: 5px 6px;
  border-top: 1px solid rgba(246, 210, 122, 0.1);
  vertical-align: top;
}
.rules-table tr:first-child td { border-top: 0; }
.rules-table td:nth-child(2) {
  color: var(--gold-1);
  white-space: nowrap;
  font-weight: 500;
}
.rules-table td:nth-child(3) {
  color: rgba(245, 236, 216, 0.7);
  font-size: 12px;
}
.rules-subtitle {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold-1);
  margin: 12px 0 6px;
  font-weight: 600;
}
.rules-subtitle:first-child { margin-top: 4px; }
.rules-table.compare th {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(245, 236, 216, 0.55);
  font-weight: 600;
  padding: 5px 6px;
  text-align: left;
}
.rules-table.compare td {
  border-top: 1px solid rgba(246, 210, 122, 0.1);
  padding: 6px;
}
.rules-table.compare td:first-child {
  color: rgba(245, 236, 216, 0.65);
  width: 22%;
}
.rules-table.compare td:nth-child(2) {
  color: var(--gold-1);
  font-weight: 600;
  width: 38%;
  white-space: normal;
}
.rules-table.compare td:nth-child(3) {
  color: rgba(245, 236, 216, 0.75);
  font-size: 12px;
}
[data-theme="light"] .rules-subtitle { color: #8c6418; }
[data-theme="light"] .rules-table.compare th { color: rgba(50, 35, 15, 0.6); }
[data-theme="light"] .rules-table.compare td:first-child { color: rgba(50, 35, 15, 0.7); }
[data-theme="light"] .rules-table.compare td:nth-child(2) { color: #6b4a14; }
[data-theme="light"] .rules-table.compare td:nth-child(3) { color: rgba(50, 35, 15, 0.75); }
.modal-card #modal-body p { margin: 6px 0; }
.modal-card #modal-body ul { margin: 6px 0 6px 18px; padding: 0; }
.modal-card #modal-body code {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--gold-1);
  font-size: 12px;
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ===================== Responsive ===================== */
@media (max-width: 1100px) {
  .stage { grid-template-columns: 240px 1fr 280px; }
}
@media (max-width: 900px) {
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .side { max-height: 200px; flex-direction: row; flex-wrap: wrap; }
  .side.left .player-card { flex: 1 1 45%; }
}

@media (max-width: 600px) {
  html, body { overflow: visible; height: auto; min-height: 100%; font-size: 15px; }
  .game { height: auto; min-height: 100vh; }

  /* Splash compaction */
  .splash { padding: 16px 8px; align-items: flex-start; }
  .splash-inner { padding: 26px 20px; border-radius: 12px; }
  .splash-mark { font-size: 44px; }
  .title { font-size: 32px; letter-spacing: 2px; margin-top: 4px; }
  .subtitle { font-size: 13px; letter-spacing: 3px; margin-bottom: 14px; }
  .tagline { font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
  .auth-section { margin: 8px 0 14px; }
  .auth-divider { margin: 8px 0; }
  .auth-divider span { font-size: 12px; }
  .auth-name { font-size: 15px; }
  .auth-greeting { font-size: 12px; }
  .setup-grid { gap: 10px; margin: 10px 0 14px; }
  .setup-grid label { font-size: 13px; }
  .setup-grid select { padding: 9px 10px; font-size: 14px; }
  .setup-factions { grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; }
  .faction-pick { padding: 10px 12px; }
  .faction-pick .fp-name { font-size: 14px; }
  .faction-pick .fp-desc { font-size: 13px; }
  .btn-primary { padding: 13px 22px; font-size: 15px; width: 100%; }
  .hint { margin-top: 14px; font-size: 12px; }

  /* In-game layout — stack vertically with full width */
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .brand { font-size: 14px; gap: 6px; }
  .brand-text { letter-spacing: 1px; font-size: 14px; }
  .phase-indicator { display: none; }
  .topbar-actions { gap: 6px; }
  .btn-ghost { padding: 7px 12px; font-size: 13px; }
  .theme-toggle { font-size: 16px; width: 36px; height: 32px; }

  .stage {
    padding: 0;
    gap: 8px;
    grid-template-rows: auto auto auto;
    grid-template-areas: "left" "board" "right";
  }
  .side.left { grid-area: left; padding: 0 6px; }
  .board-wrap {
    grid-area: board;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .side.right { padding: 0 6px; }
  .side.right { grid-area: right; }
  .side { max-height: none; }
  /* Compact 4-up player cards in a row */
  .side.left { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .side.left .player-card {
    flex: 1 0 auto;
    min-width: 145px;
    max-width: 200px;
    padding: 8px 10px;
  }
  .pc-name { font-size: 14px; }
  .pc-faction { font-size: 11px; }
  .pc-vp { font-size: 12px; padding: 2px 8px; }
  .pc-header { margin-bottom: 6px; }
  .pc-resources { grid-template-columns: repeat(5, 1fr); gap: 3px; }
  .pc-res { padding: 3px 1px; font-size: 12px; }
  .pc-res .res-icon { font-size: 14px; margin-bottom: 1px; }
  .pc-res .res-count { font-size: 13px; }
  .pc-dharma { font-size: 11px; margin-top: 5px; }

  .side.right { flex-direction: column; gap: 8px; }
  .panel { padding: 10px 12px; }
  .panel-title { font-size: 12px; letter-spacing: 1.5px; margin-bottom: 8px; }
  .current-player { font-size: 20px; margin-bottom: 8px; }
  .dice-row { margin: 4px 0 8px; }
  .actions { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; margin: 8px 0; }
  .btn-build { padding: 8px 4px; }
  .btn-build .b-icon { font-size: 22px; }
  .btn-build .b-label { font-size: 12px; }
  .btn-build::after { font-size: 10px; }
  .btn-primary, .btn-secondary { padding: 11px 18px; font-size: 14px; }
  .die { width: 42px; height: 42px; font-size: 20px; }
  .dice-total { font-size: 20px; }
  .log { max-height: 120px; min-height: 70px; font-size: 13px; line-height: 1.45; }

  /* Modals */
  .modal-card { padding: 22px 18px; }
  .modal-card h3 { font-size: 19px; letter-spacing: 1px; }
  .modal-card #modal-body { font-size: 14px; line-height: 1.55; }
  .rules-head { font-size: 15px; }
  .rules-body { font-size: 14px; }
  .rules-table { font-size: 13.5px; }
  .resource-key { font-size: 14px; gap: 8px 16px; }
}
