:root {
  --bg-dark: #110d0a;
  --bg-panel: #1c1510;
  --bg-card: #271e16;
  --border-gold: #8c6a30;
  --gold-bright: #f5c84c;
  --gold-soft: #e6cf8b;
  --text-light: #f7eed7;
  --text-muted: #b5a382;
  --emerald: #17c964;
  --ruby: #ef1733;
  --lapis: #1f75d2;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* =========================================================================
   TOP NAVIGATION BAR
   ========================================================================= */
.top-navbar {
  min-height: 58px;
  background: linear-gradient(180deg, #261c12 0%, #16100b 100%);
  border-bottom: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 30;
}

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

.brand-emblem {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.brand-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.status-pills-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.part-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-gold);
  background: rgba(245, 200, 76, 0.14);
  color: var(--gold-bright);
}

.part-pill.part-two {
  background: rgba(239, 23, 51, 0.22);
  border-color: #ff5c70;
  color: #ffa8b3;
}

.jewel-status-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(23, 201, 100, 0.14);
  border: 1px solid rgba(23, 201, 100, 0.45);
  color: #8affbd;
}

.room-badge-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(31, 117, 210, 0.25);
  border: 1px solid #59a9ff;
  color: #9ed0ff;
}

.nav-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-switcher {
  display: flex;
  background: #100c08;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  overflow: hidden;
}

.view-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-btn:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.06);
}

.view-btn.active {
  background: var(--gold-bright);
  color: #140e08;
}

.nav-btn {
  background: var(--bg-card);
  color: var(--gold-soft);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-btn:hover {
  background: #382b1e;
  color: #fff;
  border-color: var(--gold-bright);
}

/* =========================================================================
   MAIN WORKSPACE LAYOUT (3D / 2D STAGE + RIGHT SIDEBAR)
   ========================================================================= */
.workspace-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.stage-area {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: #120e0a;
}

.stage-area[data-view-mode='split'] {
  grid-template-columns: 1.35fr 1fr;
}

.stage-area[data-view-mode='3d'] {
  grid-template-columns: 1fr;
}

.stage-area[data-view-mode='3d'] .pane-2d {
  display: none;
}

.stage-area[data-view-mode='2d'] {
  grid-template-columns: 1fr;
}

.stage-area[data-view-mode='2d'] .pane-3d {
  display: none;
}

.pane-3d,
.pane-2d {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.pane-3d {
  border-right: 1px solid rgba(140, 106, 48, 0.4);
}

.viewport-canvas {
  position: relative;
  width: 100%;
  height: 100%;
}

.pane-floating-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
  flex-wrap: wrap;
  pointer-events: none;
}

.cam-pill-btn {
  pointer-events: auto;
  background: rgba(22, 16, 11, 0.88);
  backdrop-filter: blur(6px);
  color: var(--gold-soft);
  border: 1px solid rgba(140, 106, 48, 0.8);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.cam-pill-btn:hover {
  background: var(--gold-bright);
  color: #140e08;
}

.cam-pill-btn.active,
.bg-mode-btn.active {
  background: var(--gold-bright);
  color: #140e08;
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(245, 200, 76, 0.55);
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(245, 200, 76, 0.45);
  align-self: center;
  margin: 0 2px;
}

.pane-label-tag {
  position: absolute;
  bottom: 10px;
  left: 12px;
  background: rgba(18, 13, 8, 0.82);
  border: 1px solid rgba(140, 106, 48, 0.55);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  pointer-events: none;
  z-index: 10;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: #120d09;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 8;
  color: var(--gold-bright);
  font-weight: 700;
}

.loading-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
}

.loading-overlay-badge {
  position: absolute;
  bottom: 48px;
  background: rgba(18, 13, 8, 0.92);
  border: 1px solid var(--gold-bright);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--gold-bright);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
  text-align: center;
  max-width: 92%;
}

.fallback3d-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #120d09;
  overflow: hidden;
}

.fallback3d-bg-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fallback3d-tilt-plane {
  display: none;
}

/* =========================================================================
   2D ORTHOGRAPHIC BOARD VIEWPORT
   ========================================================================= */
.board2d-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 12px 34px 12px;
  background: radial-gradient(circle at center, #241b12 0%, #120d09 100%);
}

.board2d-stage {
  position: relative;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  aspect-ratio: 469 / 652;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85), 0 0 0 2px var(--border-gold);
  border-radius: 8px;
  overflow: hidden;
}

.board2d-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
}

.board2d-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.space-hit-rect {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1.5;
  transition: all 0.15s ease;
}

.space-cell:hover .space-hit-rect {
  fill: rgba(255, 255, 255, 0.16);
  stroke: rgba(255, 215, 0, 0.7);
}

.stairs-dot-indicator {
  fill: rgba(255, 200, 59, 0.45);
  stroke: #3d2808;
  stroke-width: 1;
  pointer-events: none;
}

.space-cell.highlight-move-cw .space-hit-rect {
  fill: rgba(46, 230, 117, 0.42);
  stroke: #2ee675;
  stroke-width: 3;
  cursor: pointer;
  animation: pulseCell 1.1s infinite alternate;
}

.space-cell.highlight-move-ccw .space-hit-rect {
  fill: rgba(56, 168, 255, 0.42);
  stroke: #38a8ff;
  stroke-width: 3;
  cursor: pointer;
  animation: pulseCell 1.1s infinite alternate;
}

.space-cell.highlight-step-up .space-hit-rect {
  fill: rgba(255, 200, 59, 0.45);
  stroke: #ffc83b;
  stroke-width: 3;
  cursor: pointer;
  animation: pulseCell 1.1s infinite alternate;
}

.space-cell.highlight-step-down .space-hit-rect {
  fill: rgba(255, 123, 46, 0.45);
  stroke: #ff7b2e;
  stroke-width: 3;
  cursor: pointer;
  animation: pulseCell 1.1s infinite alternate;
}

.space-cell.highlight-great-jewel .space-hit-rect {
  fill: rgba(239, 23, 51, 0.36);
  stroke: #ffd700;
  stroke-width: 2.5;
  animation: pulseCell 1.2s infinite alternate;
}

.cobra-curse-halo-2d {
  animation: pulseCobra2D 0.85s infinite alternate;
}

@keyframes pulseCobra2D {
  from {
    opacity: 0.45;
    stroke-width: 2px;
  }
  to {
    opacity: 1;
    stroke-width: 4.5px;
  }
}

@keyframes pulseCell {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

.board2d-tooltip {
  position: absolute;
  background: rgba(17, 12, 8, 0.94);
  border: 1px solid var(--gold-bright);
  color: var(--text-light);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
  z-index: 25;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
}

/* =========================================================================
   FLOATING MUMMY VOICE BANNER, BIG EVENT POP-UP & PART II RECORD FLIP TOAST
   ========================================================================= */
.big-event-popup {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, 92%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
  pointer-events: none;
}

.big-event-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 22px;
  border-radius: 14px;
  text-align: left;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.9);
  animation: bigEventPopIn 0.32s cubic-bezier(0.18, 1.25, 0.4, 1);
}

@keyframes bigEventPopIn {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.86);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.big-event-card.theme-emerald {
  background: linear-gradient(135deg, rgba(8, 56, 26, 0.96), rgba(4, 28, 14, 0.98));
  border: 2.5px solid #2ee675;
  box-shadow: 0 0 32px rgba(46, 230, 117, 0.55), 0 14px 36px rgba(0, 0, 0, 0.9);
}

.big-event-card.theme-curse {
  background: linear-gradient(135deg, rgba(92, 8, 20, 0.96), rgba(42, 4, 10, 0.98));
  border: 2.5px solid #ff334b;
  box-shadow: 0 0 36px rgba(255, 42, 75, 0.7), 0 14px 36px rgba(0, 0, 0, 0.9);
}

.big-event-card.theme-gold {
  background: linear-gradient(135deg, rgba(68, 46, 8, 0.96), rgba(32, 20, 4, 0.98));
  border: 2.5px solid var(--gold-bright);
  box-shadow: 0 0 34px rgba(245, 200, 76, 0.65), 0 14px 36px rgba(0, 0, 0, 0.9);
}

.big-event-icon {
  font-size: 34px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.big-event-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.big-event-title {
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  line-height: 1.15;
}

.big-event-card.theme-emerald .big-event-title {
  color: #a8ffd0;
}

.big-event-card.theme-curse .big-event-title {
  color: #ffccd4;
}

.big-event-card.theme-gold .big-event-title {
  color: #ffe885;
}

.big-event-sub {
  font-size: 13px;
  font-weight: 700;
  color: #f0e4d0;
  opacity: 0.95;
}

.mummy-voice-banner {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 92%);
  background: linear-gradient(135deg, rgba(20, 38, 24, 0.96), rgba(14, 18, 14, 0.98));
  border: 2px solid #38ff7a;
  border-radius: 14px;
  padding: 14px 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 24px rgba(56, 255, 122, 0.35);
  z-index: 25;
  text-align: center;
}

.mummy-voice-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38ff7a;
  margin-bottom: 6px;
}

.mummy-voice-quote {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  font-style: italic;
}

.part2-flip-toast {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: min(580px, 90%);
  background: linear-gradient(135deg, #4a0b13, #210609);
  border: 2px solid var(--gold-bright);
  border-radius: 14px;
  padding: 16px 22px;
  text-align: center;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.9);
  z-index: 28;
}

.part2-flip-toast h3 {
  color: var(--gold-bright);
  font-size: 16px;
  margin-bottom: 6px;
}

.part2-flip-toast p {
  font-size: 13px;
  color: #ffd6dc;
  line-height: 1.4;
}

/* =========================================================================
   RIGHT SIDEBAR (TURN ACTION DECK + 4 PLAYER TEMPLES + TOMB LOG)
   ========================================================================= */
.sidebar-panel {
  background: var(--bg-panel);
  border-left: 2px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.mobile-sidebar-tabs {
  display: none;
}

.turn-action-deck {
  padding: 12px 14px;
  background: linear-gradient(180deg, #2b2016 0%, #1f1710 100%);
  border-bottom: 1px solid var(--border-gold);
  flex-shrink: 0;
}

.turn-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 10px;
  margin-bottom: 10px;
  gap: 8px;
}

.turn-who-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.turn-explorer-avatar {
  width: 38px;
  height: 46px;
  border-radius: 6px;
  border: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.turn-explorer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.turn-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.turn-color-chip {
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.turn-who strong {
  font-size: 14.5px;
  color: var(--gold-bright);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.turn-die-badge {
  background: #120d09;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.btn-primary-action {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-primary-action:hover {
  transform: translateY(-1px);
}

.pulse-gold {
  background: linear-gradient(135deg, #ffd859 0%, #dca01d 100%);
  color: #171008;
  box-shadow: 0 4px 16px rgba(245, 200, 76, 0.4);
}

.pulse-emerald {
  background: linear-gradient(135deg, #38ff7a 0%, #0ea847 100%);
  color: #071c0e;
  box-shadow: 0 4px 18px rgba(56, 255, 122, 0.45);
}

.rolled-banner,
.choice-prompt-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-soft);
  margin-bottom: 8px;
}

.action-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.btn-move-dir,
.btn-choice-opt,
.btn-step-opt {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  border: 1px solid transparent;
  transition: all 0.14s ease;
}

.btn-move-dir.cw {
  background: rgba(46, 230, 117, 0.18);
  border-color: #2ee675;
  color: #a6ffca;
}

.btn-move-dir.cw:hover {
  background: #2ee675;
  color: #092112;
}

.btn-move-dir.ccw {
  background: rgba(56, 168, 255, 0.18);
  border-color: #38a8ff;
  color: #b3deff;
}

.btn-move-dir.ccw:hover {
  background: #38a8ff;
  color: #071929;
}

.btn-choice-opt,
.btn-step-opt {
  background: #2c2218;
  border-color: var(--border-gold);
  color: var(--gold-bright);
}

.btn-choice-opt:hover,
.btn-step-opt:hover {
  background: var(--gold-bright);
  color: #140e08;
}

.btn-secondary-action {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: #1b140e;
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary-action:hover {
  color: #fff;
  border-color: var(--gold-soft);
}

.waiting-turn-notice,
.mummy-speaking-status {
  font-size: 13px;
  color: var(--gold-soft);
  padding: 6px 0;
}

/* =========================================================================
   PLAYER TEMPLE & EXPLORER CHARACTER CARDS
   ========================================================================= */
.sidebar-section-header {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: #15100c;
  border-bottom: 1px solid rgba(140, 106, 48, 0.3);
  flex-shrink: 0;
}

.players-sidebar-list {
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex-shrink: 0;
}

.temple-player-card {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid rgba(140, 106, 48, 0.5);
  border-left: 7px solid var(--player-color);
  border-radius: 10px;
  padding: 8px 10px;
  transition: all 0.2s ease;
}

/* ENTIRE CARD LIGHTS UP IN BRIGHT GOLDEN-YELLOW ON ACTIVE TURN */
.temple-player-card.active-turn {
  background: linear-gradient(135deg, #fff19e 0%, #ffd53d 55%, #f5b418 100%) !important;
  color: #1a1004 !important;
  border: 2px solid #ffffff !important;
  border-left: 8px solid var(--player-color) !important;
  box-shadow: 0 0 24px rgba(255, 215, 56, 0.8), 0 4px 14px rgba(0, 0, 0, 0.65);
  transform: scale(1.01);
}

.active-turn-ribbon {
  background: #1a1004;
  color: #ffe252;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 6px;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.temple-card-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Dual Visuals: Larger Character Figure + Temple Box */
.temple-card-visuals {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.explorer-figure-box {
  position: relative;
  width: 52px;
  height: 66px;
  border-radius: 7px;
  border: 2px solid var(--player-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.5);
}

.explorer-figure-thumb {
  width: 46px;
  height: 50px;
  object-fit: contain;
  margin-top: 1px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.explorer-pawn-tag {
  width: 100%;
  font-size: 8.5px;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  padding: 1.5px 0;
  margin-top: auto;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.temple-deity-thumb {
  width: 46px;
  height: 66px;
  object-fit: cover;
  border-radius: 7px;
  border: 1.5px solid var(--border-gold);
  flex-shrink: 0;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.5);
}

.temple-player-info {
  flex: 1;
  min-width: 0;
}

.temple-player-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.pawn-color-pill {
  font-size: 9.5px;
  font-weight: 900;
  color: #ffffff;
  padding: 1.5px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.player-badge-role {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.temple-player-title-strong {
  font-size: 13.5px;
  font-weight: 900;
  color: var(--text-light);
  line-height: 1.15;
}

.temple-deity-sub {
  font-size: 11px;
  color: var(--player-accent);
  font-weight: 700;
}

.temple-space-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* High-contrast dark text inside the lit-up yellow active-turn card */
.temple-player-card.active-turn .temple-player-title-strong {
  color: #140c02 !important;
}

.temple-player-card.active-turn .temple-deity-sub {
  color: #3d2405 !important;
}

.temple-player-card.active-turn .temple-space-sub,
.temple-player-card.active-turn .player-badge-role {
  color: #2e1c06 !important;
  font-weight: 700;
}

.temple-score-box {
  background: #140f0a;
  border: 1.5px solid var(--border-gold);
  border-radius: 8px;
  padding: 5px 9px;
  text-align: center;
  min-width: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.temple-player-card.active-turn .temple-score-box {
  background: #1a1004;
  border-color: #1a1004;
}

.score-num {
  font-size: 17px;
  font-weight: 900;
  color: var(--gold-bright);
  line-height: 1.05;
}

.score-gem-icon {
  width: 20px;
  height: 15px;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0, 212, 85, 0.45));
}

.temple-inventory-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.inv-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.inv-pill.emerald {
  background: rgba(23, 201, 100, 0.18);
  color: #7dffb3;
  border: 1px solid rgba(23, 201, 100, 0.45);
}

.temple-player-card.active-turn .inv-pill.emerald {
  background: #0b4a25;
  color: #9effc5;
  border-color: #062e16;
}

.inv-pill.gold {
  background: rgba(245, 200, 76, 0.25);
  color: #ffe27a;
  border: 1px solid var(--gold-bright);
}

.temple-player-card.active-turn .inv-pill.gold {
  background: #422a03;
  color: #ffe266;
  border-color: #1f1300;
}

.inv-pill.ruby-curse {
  background: #b80d24;
  color: #ffffff;
  border: 1px solid #ff6b7d;
  box-shadow: 0 0 10px rgba(239, 23, 51, 0.6);
}

/* =========================================================================
   TOMB EVENT LOG
   ========================================================================= */
.tomb-event-log {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  background: #120d09;
  min-height: 80px;
}

.log-entry {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #6e5529;
  line-height: 1.38;
}

.log-entry.log-mummy {
  border-left-color: #38ff7a;
  background: rgba(56, 255, 122, 0.08);
  color: #b8ffd0;
}

.log-entry.log-jewel {
  border-left-color: #17c964;
  color: #9effc4;
}

.log-entry.log-highlight {
  border-left-color: var(--gold-bright);
  background: rgba(245, 200, 76, 0.12);
  color: var(--gold-bright);
  font-weight: 600;
}

.log-entry.log-warning {
  border-left-color: #ef1733;
  background: rgba(239, 23, 51, 0.12);
  color: #ffb3bd;
}

/* =========================================================================
   INTRO LANDING CARD (1971 HERO ARTWORK + SINGLE PLAYER / MULTIPLAYER)
   ========================================================================= */
.intro-landing-card {
  background: linear-gradient(180deg, #1d140c 0%, #110b06 100%);
  border: 2.5px solid var(--gold-bright);
  border-radius: 18px;
  width: min(760px, 95vw);
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 55px rgba(245, 200, 76, 0.25), 0 28px 72px rgba(0, 0, 0, 0.95);
  animation: introCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes introCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.intro-hero-artwork-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 400px;
  overflow: hidden;
  background: #0d0804;
  border-bottom: 2px solid var(--border-gold);
}

.intro-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
  transform: scale(1.01);
}

.intro-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 6, 3, 0.15) 0%,
    rgba(10, 6, 3, 0.25) 48%,
    rgba(15, 10, 5, 0.96) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: 18px 22px 16px;
}

.intro-vintage-pill {
  background: rgba(18, 12, 6, 0.85);
  border: 1px solid var(--gold-bright);
  color: var(--gold-bright);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.14em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.intro-main-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffe484;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.95),
    0 0 22px rgba(56, 255, 122, 0.45),
    0 0 36px rgba(245, 200, 76, 0.45);
  line-height: 1.1;
  margin-bottom: 6px;
}

.intro-subtitle {
  font-size: 13px;
  color: #eadcc3;
  max-width: 580px;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

.intro-choice-section {
  padding: 18px 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 0%, #2a1d11 0%, #140e08 100%);
}

.intro-choice-heading {
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--gold-soft);
  text-transform: uppercase;
}

.intro-mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.intro-mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 2px solid var(--border-gold);
  background: linear-gradient(145deg, #2b1f14 0%, #1a120b 100%);
  color: var(--text-light);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
}

.intro-mode-card.single-player:hover {
  transform: translateY(-2px);
  border-color: #38ff7a;
  background: linear-gradient(145deg, #1b3322 0%, #122117 100%);
  box-shadow: 0 0 24px rgba(56, 255, 122, 0.35), 0 10px 26px rgba(0, 0, 0, 0.75);
}

.intro-mode-card.multi-player:hover {
  transform: translateY(-2px);
  border-color: var(--gold-bright);
  background: linear-gradient(145deg, #3b2a14 0%, #24180b 100%);
  box-shadow: 0 0 24px rgba(245, 200, 76, 0.4), 0 10px 26px rgba(0, 0, 0, 0.75);
}

.intro-mode-icon {
  font-size: 32px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.intro-mode-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.intro-mode-title {
  font-size: 16.5px;
  font-weight: 900;
  color: var(--gold-bright);
  letter-spacing: 0.03em;
}

.intro-mode-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.intro-mode-arrow {
  font-size: 18px;
  font-weight: 900;
  color: var(--gold-bright);
  flex-shrink: 0;
}

.intro-footer-links {
  margin-top: 2px;
}

.intro-link-btn {
  background: transparent;
  border: 1px solid rgba(212, 168, 83, 0.4);
  color: var(--gold-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.intro-link-btn:hover {
  border-color: var(--gold-bright);
  color: #ffffff;
  background: rgba(245, 200, 76, 0.12);
}

/* =========================================================================
   MODALS (LOBBY / MULTIPLAYER, 1971 RULEBOOK & SOUNDBOARD, GAME OVER)
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 4, 0.82);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.modal-card {
  background: linear-gradient(180deg, #261c14 0%, #17110c 100%);
  border: 2px solid var(--gold-bright);
  border-radius: 16px;
  width: min(880px, 96vw);
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.92);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.guest-invite-step-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.modal-header {
  padding: 14px 20px;
  background: #140f0a;
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-header h2 {
  font-size: 17px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}

.btn-close-modal {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.btn-close-modal:hover {
  color: #fff;
  border-color: var(--gold-bright);
}

.modal-body {
  padding: 18px 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mp-wizard-card {
  width: min(820px, 96vw);
}

.mp-wizard-step {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mp-step-field {
  background: #1d150e;
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-step-label {
  font-size: 13px;
  font-weight: 900;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mp-name-big-input {
  background: #100b07;
  border: 2px solid var(--border-gold);
  color: #ffffff;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
  max-width: 420px;
}

.mp-name-big-input:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(245, 200, 76, 0.35);
}

.mp-char-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.mp-char-pick-card {
  background: #17100b;
  border: 2px solid rgba(140, 106, 48, 0.5);
  border-top: 5px solid var(--char-color);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.15s ease;
}

.mp-char-pick-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-bright);
}

.mp-char-pick-card.selected {
  background: linear-gradient(135deg, #fff19e 0%, #ffd53d 55%, #f5b418 100%);
  color: #1a1004;
  border-color: #ffffff;
  border-top: 5px solid var(--char-color);
  box-shadow: 0 0 22px rgba(255, 215, 56, 0.7);
  transform: scale(1.02);
}

.mp-char-visuals {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mp-char-fig {
  width: 40px;
  height: 54px;
  object-fit: contain;
}

.mp-char-temple {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid var(--border-gold);
}

.mp-char-name {
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.mp-char-deity {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
  text-align: center;
}

.mp-char-pick-card.selected .mp-char-deity {
  color: #3d2405;
}

.mp-char-badge {
  font-size: 10px;
  font-weight: 900;
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.mp-char-pick-card.taken-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.45);
  transform: none !important;
}

/* Guest Pyramid Cave Waiting Screen (#guest-invite-step-waiting) */
.guest-cave-hero-wrap {
  aspect-ratio: 16 / 8.5;
  max-height: 245px;
  border-bottom: 2px solid var(--gold-bright);
}

.guest-cave-overlay {
  padding: 16px 20px 14px;
}

.guest-cave-title {
  margin: 6px 0 3px;
  font-size: 24px;
  font-weight: 900;
  color: #ffe885;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}

.guest-cave-sub {
  margin: 0;
  font-size: 13px;
  color: #f2e5cb;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
}

.guest-waiting-count-badge {
  display: inline-block;
  align-self: center;
  background: linear-gradient(180deg, #ffe252 0%, #dfa01c 100%);
  color: #1a1004;
  font-size: 14px;
  font-weight: 900;
  padding: 5px 16px;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 3px 12px rgba(245, 200, 76, 0.45);
  margin-bottom: 4px;
}

.guest-waiting-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.guest-roster-card {
  background: #140f0a;
  border: 1.5px solid rgba(140, 106, 48, 0.55);
  border-left: 5px solid var(--roster-color, #f5c84c);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.guest-roster-card.roster-is-me {
  background: linear-gradient(135deg, rgba(245, 200, 76, 0.2), rgba(28, 19, 10, 0.95));
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(245, 200, 76, 0.28);
}

.guest-roster-card.roster-is-waiting {
  border-style: dashed;
  opacity: 0.78;
}

.guest-roster-fig {
  width: 30px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.guest-roster-info {
  flex: 1;
  min-width: 0;
}

.guest-roster-name {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guest-roster-sub {
  font-size: 10.5px;
  font-weight: 700;
}

.guest-roster-pill {
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.guest-roster-pill.pill-me {
  background: #2ee675;
  color: #05210e;
}

.guest-roster-pill.pill-joined {
  background: rgba(46, 230, 117, 0.22);
  color: #7dffb3;
  border: 1px solid #2ee675;
}

.guest-roster-pill.pill-waiting {
  background: rgba(245, 200, 76, 0.16);
  color: #ffe266;
  border: 1px dashed var(--gold-bright);
}

.guest-roster-pill.pill-bot {
  background: rgba(99, 179, 255, 0.18);
  color: #99ceff;
  border: 1px solid #63b3ff;
}

@media (max-width: 600px) {
  .guest-waiting-roster-grid {
    grid-template-columns: 1fr;
  }
  .guest-cave-title {
    font-size: 19px;
  }
}

.mp-count-pills-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mp-count-pill {
  background: #120d09;
  border: 2px solid var(--border-gold);
  color: var(--text-light);
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.mp-count-pill.active {
  background: var(--gold-bright);
  color: #140e08;
  border-color: #ffffff;
  box-shadow: 0 0 14px rgba(245, 200, 76, 0.5);
}

.mp-ai-fill-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 2px;
}

.mp-step1-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.btn-single-advanced-tab {
  background: rgba(24, 17, 10, 0.85);
  border: 1.5px solid rgba(245, 200, 76, 0.35);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-single-advanced-tab:hover,
.btn-single-advanced-tab.open {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: rgba(44, 32, 16, 0.92);
}

#single-advanced-summary {
  font-weight: 600;
  font-size: 11.5px;
  opacity: 0.85;
}

.single-advanced-panel {
  border-top: 1px solid rgba(245, 200, 76, 0.25);
  padding-top: 12px;
  margin-top: 4px;
}

/* SINGLE PLAYER BOT PICKER & HONEST BOT TRAIT TOGGLES (RIGHT/LEFT-HANDED, EVEN/ODD B-DAY) */
.single-bot-sublabel {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.single-bot-sublabel strong {
  color: var(--gold-bright);
}

.single-bot-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.single-bot-card {
  background: #140f0a;
  border: 2px solid rgba(140, 106, 48, 0.35);
  border-top: 4px solid var(--bot-color);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.single-bot-card.bot-active {
  background: linear-gradient(180deg, rgba(44, 32, 18, 0.96) 0%, rgba(22, 16, 10, 0.98) 100%);
  border-color: var(--bot-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

.single-bot-card.bot-off {
  opacity: 0.62;
  filter: grayscale(40%);
}

.single-bot-toggle-head {
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  width: 100%;
  transition: all 0.15s ease;
}

.single-bot-toggle-head:hover {
  border-color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.06);
}

.single-bot-visuals {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 54px;
}

.single-bot-fig {
  width: 38px;
  height: 50px;
  object-fit: contain;
  transform: rotate(10deg);
}

.single-bot-temple {
  width: 34px;
  height: 50px;
  object-fit: contain;
}

.single-bot-name {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-light);
}

.single-bot-deity {
  font-size: 10.5px;
  color: var(--text-muted);
}

.single-bot-status-pill {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  margin-top: 2px;
  width: 100%;
}

.single-bot-traits-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 4px;
  border-top: 1px solid rgba(245, 200, 76, 0.18);
}

.single-bot-traits-box.traits-disabled {
  pointer-events: none;
  opacity: 0.4;
}

.bot-trait-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bot-trait-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.bot-trait-Switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.btn-bot-trait {
  background: #120d09;
  border: 1.5px solid rgba(140, 106, 48, 0.45);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 5px 4px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-bot-trait:hover:not(:disabled) {
  border-color: var(--gold-bright);
  color: var(--text-light);
}

.btn-bot-trait.active {
  background: linear-gradient(180deg, #ffe252 0%, #dfa01c 100%);
  color: #1a1005;
  border-color: #ffffff;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(245, 200, 76, 0.35);
}

.lobby-bot-traits-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-lobby-trait {
  background: #140f0a;
  border: 1.5px solid var(--border-gold);
  color: #ffe266;
  border-radius: 7px;
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-lobby-trait:hover {
  background: rgba(245, 200, 76, 0.18);
  border-color: #ffffff;
}

/* STEP 2: INVITE LINK & WAITING ROOM */
.mp-invite-hero-box {
  background: linear-gradient(135deg, rgba(16, 56, 32, 0.9), rgba(10, 32, 18, 0.95));
  border: 2px solid #2ee675;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 0 24px rgba(46, 230, 117, 0.25);
}

.mp-invite-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mp-invite-kicker {
  font-size: 13px;
  font-weight: 900;
  color: #7dffb3;
  letter-spacing: 0.05em;
}

.mp-invite-sub {
  font-size: 12px;
  color: #d6f5e3;
  margin-top: 2px;
}

.mp-room-pill {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #7dffb3;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #ffffff;
}

.mp-invite-input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.mp-invite-url-input {
  flex: 1;
  min-width: 200px;
  font-family: monospace;
  font-size: 12.5px;
}

.btn-copy-invite-big {
  background: linear-gradient(180deg, #2ee675 0%, #17b855 100%);
  color: #06210f;
  border: 1.5px solid #b8ffd3;
  border-radius: 9px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(46, 230, 117, 0.4);
}

.btn-copy-invite-big:hover {
  filter: brightness(1.08);
}

.btn-sms-invite-big {
  background: linear-gradient(180deg, #38a8ff 0%, #1675d6 100%);
  color: #ffffff;
  border: 1.5px solid #b8e2ff;
  border-radius: 9px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(56, 168, 255, 0.4);
}

.btn-sms-invite-big:hover {
  filter: brightness(1.08);
}

.mp-play-current-box {
  background: linear-gradient(135deg, rgba(48, 34, 14, 0.95), rgba(28, 19, 8, 0.98));
  border: 1.5px solid var(--gold-bright);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-play-current-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
  color: var(--text-light);
}

.mp-play-current-info strong {
  color: var(--gold-bright);
  font-size: 13px;
}

.mp-play-current-info span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.mp-play-current-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-play-current-opt {
  background: linear-gradient(180deg, #3b2a14 0%, #24180b 100%);
  border: 1.5px solid var(--gold-bright);
  color: #ffe266;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
}

.btn-play-current-opt span {
  font-size: 10.5px;
  font-weight: 700;
  color: #d6c5a8;
}

.btn-play-current-opt:hover {
  background: var(--gold-bright);
  color: #140e08;
}

.btn-play-current-opt:hover span {
  color: #2e1d04;
}

.mp-guest-welcome-box {
  background: #1d150e;
  border: 1.5px solid var(--gold-bright);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-guest-name-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.mp-waiting-status-box {
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-waiting-status-box.waiting {
  background: rgba(245, 200, 76, 0.14);
  border: 2px dashed var(--gold-bright);
}

.mp-waiting-status-box.ready {
  background: rgba(46, 230, 117, 0.18);
  border: 2px solid #2ee675;
}

.mp-waiting-headline {
  font-size: 15px;
  font-weight: 900;
  color: var(--gold-bright);
}

.mp-waiting-status-box.ready .mp-waiting-headline {
  color: #7dffb3;
}

.mp-waiting-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.mp-input {
  background: #110c08;
  border: 1px solid var(--border-gold);
  color: var(--text-light);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.lobby-seats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}

.lobby-seat-card {
  background: #1f1710;
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-seat-card.seat-is-me {
  background: linear-gradient(180deg, #2e2212 0%, #1d150b 100%);
  box-shadow: 0 0 18px rgba(245, 200, 76, 0.35);
}

.lobby-seat-card.seat-is-waiting {
  border-style: dashed;
}

.seat-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 8px;
}

.seat-dual-thumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.seat-portrait {
  width: 34px;
  height: 48px;
  object-fit: contain;
}

.seat-temple-thumb {
  width: 30px;
  height: 48px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border-gold);
}

.seat-header-info {
  flex: 1;
  min-width: 0;
}

.seat-color-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 900;
  color: #ffffff;
  padding: 1.5px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.seat-deity-title {
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 3px;
}

.seat-live-status {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 6px;
  text-align: center;
}

.seat-live-status.status-me {
  background: rgba(245, 200, 76, 0.22);
  color: #ffe266;
  border: 1px solid var(--gold-bright);
}

.seat-live-status.status-joined {
  background: rgba(46, 230, 117, 0.2);
  color: #85ffba;
  border: 1px solid #2ee675;
}

.seat-live-status.status-waiting {
  background: rgba(255, 180, 40, 0.14);
  color: #ffd480;
  border: 1px dashed #ffb428;
}

.seat-live-status.status-ai {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.seat-live-status.status-empty {
  background: rgba(0, 0, 0, 0.35);
  color: #7a6a58;
}

.seat-name-input,
.seat-control-select {
  width: 100%;
  background: #120d09;
  border: 1px solid var(--border-gold);
  color: var(--text-light);
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 11.5px;
}

.btn-claim-seat {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--gold-bright);
  background: transparent;
  color: var(--gold-bright);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.btn-claim-seat:hover:not(:disabled) {
  background: rgba(245, 200, 76, 0.18);
}

.btn-claim-seat.claimed {
  background: var(--gold-bright);
  color: #140e08;
  cursor: default;
}

.mp-step2-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.guest-waiting-host-notice {
  background: rgba(245, 200, 76, 0.15);
  border: 1.5px solid var(--gold-bright);
  color: #ffe266;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  flex: 1;
}

/* TOP NAVBAR INVITE BUTTONS & MAIN SCREEN WAITING BANNER */
.nav-invite-btn {
  background: linear-gradient(180deg, #1f6b3b 0%, #124224 100%) !important;
  border-color: #2ee675 !important;
  color: #b8ffd3 !important;
  font-weight: 800 !important;
}

.nav-sms-btn {
  background: linear-gradient(180deg, #1b528c 0%, #103257 100%) !important;
  border-color: #38a8ff !important;
  color: #cce8ff !important;
  font-weight: 800 !important;
}

.mp-main-waiting-banner {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 13, 8, 0.95);
  border: 1.5px solid var(--gold-bright);
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #ffe266;
  z-index: 22;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
  max-width: 96%;
}

.mp-main-banner-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mp-main-copy-btn {
  background: #2ee675;
  color: #06210f;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.mp-main-sms-btn {
  background: #38a8ff;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.mp-main-playnow-btn {
  background: var(--gold-bright);
  color: #140e08;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.rules-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.rules-box {
  background: #1c150f;
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 14px;
  font-size: 12.5px;
  line-height: 1.5;
}

.rules-box h3 {
  color: var(--gold-bright);
  margin-bottom: 8px;
  font-size: 14px;
}

.rules-box ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.soundboard-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.soundboard-track-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #140f0a;
  border: 1px solid rgba(140, 106, 48, 0.35);
  border-radius: 8px;
  padding: 7px 9px;
}

.btn-play-sample {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 4px 7px;
  cursor: pointer;
}

.track-title {
  font-size: 12px;
  color: var(--gold-soft);
}

.track-quote {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* =========================================================================
   GRAND FINALE GAME OVER MODAL (VICTORY CELEBRATION & LOSERS FATE)
   ========================================================================= */
.gameover-particles-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 101;
}

.gameover-particle {
  position: absolute;
  top: -48px;
  animation: particleFall linear infinite;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.75));
}

@keyframes particleFall {
  0% {
    transform: translateY(-40px) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    transform: translateY(104vh) rotate(360deg);
    opacity: 0;
  }
}

.gameover-card {
  position: relative;
  z-index: 102;
  width: min(740px, 95vw);
}

.gameover-card.is-victory {
  border-color: #ffe252;
  box-shadow: 0 0 60px rgba(255, 215, 56, 0.45), 0 28px 72px rgba(0, 0, 0, 0.95);
}

.gameover-card.is-defeat {
  border-color: #ff334b;
  box-shadow: 0 0 60px rgba(255, 42, 75, 0.45), 0 28px 72px rgba(0, 0, 0, 0.95);
}

.gameover-scores-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gameover-outcome-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
}

.gameover-outcome-banner.outcome-victory {
  background: linear-gradient(135deg, rgba(68, 48, 6, 0.92), rgba(28, 44, 16, 0.92));
  border: 2px solid #ffe252;
  box-shadow: 0 0 24px rgba(255, 226, 82, 0.3);
}

.gameover-outcome-banner.outcome-defeat {
  background: linear-gradient(135deg, rgba(78, 8, 18, 0.92), rgba(32, 6, 12, 0.95));
  border: 2px solid #ff425b;
  box-shadow: 0 0 24px rgba(255, 66, 91, 0.35);
}

.outcome-badge-icon {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
  animation: crownBob 1.5s ease-in-out infinite alternate;
}

.outcome-kicker {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}

.outcome-defeat .outcome-kicker {
  color: #ff99a8;
}

.outcome-headline {
  font-size: 19px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.2;
}

.outcome-sub {
  font-size: 12.5px;
  color: #eadcc4;
}

.gameover-winner-showcase {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff19e 0%, #ffd53d 55%, #f5b418 100%);
  color: #1a1004;
  border: 2.5px solid #ffffff;
  border-left: 8px solid var(--winner-color);
  box-shadow: 0 0 28px rgba(255, 215, 56, 0.65);
}

.winner-showcase-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.winner-Visuals-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.winner-figure-frame {
  position: relative;
  width: 64px;
  height: 84px;
  border-radius: 9px;
  border: 2.5px solid var(--winner-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: rgba(15, 10, 4, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.winner-crown-float {
  position: absolute;
  top: -13px;
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
  animation: crownBob 1.1s ease-in-out infinite alternate;
}

@keyframes crownBob {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-4px) scale(1.08);
  }
}

.winner-figure-img {
  width: 56px;
  height: 62px;
  object-fit: contain;
  margin-top: 4px;
}

.winner-pawn-pill {
  width: 100%;
  font-size: 8.5px;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  padding: 2px 0;
  margin-top: auto;
  border-radius: 0 0 6px 6px;
}

.winner-temple-img {
  width: 54px;
  height: 84px;
  object-fit: cover;
  border-radius: 9px;
  border: 2px solid #1a1004;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.winner-info-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.winner-rank-tag {
  display: inline-block;
  align-self: flex-start;
  background: #1a1004;
  color: #ffe252;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
}

.winner-name-big {
  font-size: 19px;
  font-weight: 900;
  color: #140c02;
  line-height: 1.15;
}

.winner-breakdown-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.win-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}

.win-pill.emerald {
  background: #0b4a25;
  color: #9effc5;
}

.win-pill.gold {
  background: #3d2602;
  color: #ffe266;
}

.win-pill.temple {
  background: #1a2e4c;
  color: #b8dcff;
}

.win-pill.curse {
  background: #7a0918;
  color: #ffd0d7;
}

.winner-score-pedestal {
  background: #1a1004;
  border: 2px solid #ffffff;
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 72px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.winner-score-num {
  font-size: 26px;
  font-weight: 900;
  color: #ffe252;
  line-height: 1;
}

.winner-score-pedestal .score-gem-icon {
  width: 26px;
  height: 20px;
}

.gameover-losers-header {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-top: 2px;
}

.gameover-losers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.loser-fate-card {
  background: #1b130d;
  border: 1.5px solid rgba(140, 106, 48, 0.45);
  border-left: 5px solid var(--loser-color);
  border-radius: 11px;
  padding: 10px 12px;
}

.loser-fate-card.fate-cursed {
  background: linear-gradient(135deg, #2e0910 0%, #1a070b 100%);
  border-color: #ff334b;
  box-shadow: 0 0 16px rgba(255, 51, 75, 0.3);
}

.loser-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loser-figure-wrap {
  position: relative;
  width: 44px;
  height: 58px;
  border-radius: 7px;
  border: 1.5px solid var(--loser-color);
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  flex-shrink: 0;
}

.loser-figure-img {
  width: 38px;
  height: 42px;
  object-fit: contain;
  transform: rotate(10deg);
  filter: grayscale(25%) brightness(0.9);
}

.loser-rank-tag {
  width: 100%;
  font-size: 8.5px;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  margin-top: auto;
  padding: 1px 0;
}

.loser-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loser-name {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-light);
}

.loser-deity {
  font-size: 10.5px;
  color: var(--text-muted);
}

.loser-fate-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  margin-top: 2px;
}

.loser-fate-badge.fate-cursed {
  background: #a80c20;
  color: #ffffff;
}

.loser-fate-badge.fate-trapped {
  background: rgba(255, 255, 255, 0.08);
  color: #d4c4aa;
}

.gameover-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================================
   TABLET & iPHONE / MOBILE RESPONSIVE DESIGN
   ========================================================================= */
@media (max-width: 1080px) {
  .workspace-layout {
    grid-template-columns: 1fr 340px;
  }
  .brand-sub {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Responsive Mobile Navbar so all top buttons always fit on vertical phone screens */
  .top-navbar {
    min-height: 40px;
    height: auto;
    padding: 4px 8px;
    gap: 4px 6px;
    flex-wrap: wrap;
  }

  .brand-group {
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-emblem {
    font-size: 15px;
  }

  .brand-title {
    font-size: 11.5px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-sub,
  .status-pills-group {
    display: none;
  }

  /* Hide "3D + 2D Split" button on iPhone where full-width 3D or 2D is much cleaner */
  .view-btn-split {
    display: none;
  }

  .view-btn {
    padding: 4px 7px;
    font-size: 10.5px;
  }

  .nav-actions-group {
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-btn {
    padding: 4px 7px;
    font-size: 11.5px;
  }

  .nav-btn-label {
    display: none;
  }

  /* Clean Vertical Split on iPhone: Top ~60% Interactive 3D/2D Board, Bottom ~40% Command & 4-Player Strip */
  .workspace-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .stage-area[data-view-mode='split'] {
    grid-template-columns: 1fr;
  }

  .stage-area[data-view-mode='split'] .pane-2d {
    display: none;
  }

  /* Organized 2-Row Grid on Mobile Vertical Mode:
     Row 1: 5 Equal Camera Buttons (Follow, Top-Down, 3/4 View, Sarcophagus, Gem Box)
     Row 2: 2 Equal Background Buttons (Tomb Room, Black BG)
     Zero horizontal scrolling or clipped buttons! */
  .pane-floating-toolbar {
    top: 6px;
    left: 6px;
    right: 6px;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    pointer-events: auto;
    z-index: 26;
  }

  .toolbar-divider {
    display: none;
  }

  .cam-pill-btn {
    grid-column: span 2;
    width: 100%;
    padding: 5px 2px;
    font-size: 9.5px;
    text-align: center;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .cam-pill-btn.bg-mode-btn {
    grid-column: span 5;
    font-size: 10.5px;
    padding: 5px 6px;
  }

  /* Hide long bottom instruction tag on phone so it never covers the pyramid or 2D board */
  .pane-label-tag {
    display: none;
  }

  .board2d-wrapper {
    padding: 4px;
  }

  .board2d-stage {
    height: 100%;
    width: auto;
    max-width: 100%;
    max-height: 100%;
  }

  .mummy-voice-banner {
    bottom: 6px;
    padding: 7px 10px;
    width: 94%;
  }

  .mummy-voice-title {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .mummy-voice-quote {
    font-size: 12px;
  }

  /* Compact Bottom Command Drawer (Turn Action Deck + 4-Across Player Strip) */
  .sidebar-panel {
    height: auto;
    max-height: 44dvh;
    border-left: none;
    border-top: 2px solid var(--border-gold);
  }

  .turn-action-deck {
    padding: 6px 10px;
  }

  .turn-header-strip {
    margin-bottom: 5px;
    padding-left: 6px;
  }

  .turn-explorer-avatar {
    width: 28px;
    height: 34px;
  }

  .turn-tag {
    font-size: 9px;
  }

  .turn-who strong {
    font-size: 12.5px;
  }

  .turn-die-badge {
    font-size: 14px;
    padding: 2px 7px;
  }

  .btn-primary-action {
    padding: 8px 12px;
    font-size: 13px;
  }

  .btn-move-dir,
  .btn-choice-opt,
  .btn-step-opt {
    padding: 7px 10px;
    font-size: 11.5px;
  }

  /* Mobile Sub-Tabs (Temples vs Tomb Chronicle) */
  .mobile-sidebar-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #140f0a;
    border-bottom: 1px solid var(--border-gold);
    flex-shrink: 0;
  }

  .mobile-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 8px;
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
    border-bottom: 2px solid transparent;
  }

  .mobile-tab-btn.active {
    color: var(--gold-bright);
    border-bottom-color: var(--gold-bright);
    background: rgba(245, 200, 76, 0.1);
  }

  .sidebar-section-header {
    display: none;
  }

  /* Toggle between Temples and Log on mobile based on data-mobile-panel */
  .sidebar-panel[data-mobile-panel='temples'] .tomb-event-log {
    display: none;
  }

  .sidebar-panel[data-mobile-panel='log'] .players-sidebar-list {
    display: none;
  }

  .tomb-event-log {
    max-height: 115px;
    padding: 6px 8px;
  }

  /* 4-Across Horizontal Player Score Strip on iPhone — All active Explorers fit tightly in 1 clean row! */
  .players-sidebar-list {
    display: grid;
    grid-template-columns: repeat(var(--player-count, 4), minmax(0, 1fr));
    gap: 4px;
    padding: 5px 5px;
    width: 100%;
    overflow: hidden;
  }

  .temple-player-card {
    min-width: 0;
    width: 100%;
    overflow: hidden;
    padding: 4px 3px;
    border-left-width: 1.5px;
    border-top: 4px solid var(--player-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .temple-player-card.active-turn {
    border-left-width: 2px !important;
    border-top: 4px solid var(--player-color) !important;
    transform: none;
  }

  .active-turn-ribbon {
    display: none;
  }

  .temple-card-top {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
  }

  .temple-card-visuals {
    gap: 2px;
    justify-content: center;
    max-width: 100%;
  }

  .explorer-figure-box {
    width: 30px;
    height: 40px;
    flex-shrink: 0;
  }

  .explorer-figure-thumb {
    width: 26px;
    height: 29px;
  }

  .explorer-pawn-tag {
    font-size: 5.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .temple-deity-thumb {
    width: 25px;
    height: 40px;
    flex-shrink: 0;
  }

  .temple-player-info {
    width: 100%;
    min-width: 0;
  }

  .temple-player-name-row,
  .temple-deity-sub,
  .temple-space-sub {
    display: none;
  }

  .temple-player-title-strong {
    font-size: 9.5px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .temple-score-box {
    padding: 2px 4px;
    min-width: unset;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .score-num {
    font-size: 13px;
  }

  .score-gem-icon {
    width: 14px;
    height: 11px;
  }

  .big-event-popup {
    top: 68px;
    width: 94%;
  }

  .big-event-card {
    padding: 10px 14px;
    gap: 10px;
  }

  .big-event-icon {
    font-size: 24px;
  }

  .big-event-title {
    font-size: 14px;
  }

  .big-event-sub {
    font-size: 11px;
  }

  .temple-inventory-row {
    margin-top: 3px;
    gap: 2px;
    justify-content: center;
  }

  .inv-pill {
    font-size: 8.5px;
    padding: 1px 4px;
  }

  .inv-lbl-desk {
    display: none;
  }

  .rules-columns {
    grid-template-columns: 1fr;
  }

  /* Responsive Intro Landing Card on iPhone */
  .intro-landing-card {
    width: 96vw;
    max-height: 94dvh;
  }

  .intro-hero-artwork-wrap {
    aspect-ratio: 16 / 10;
    max-height: 220px;
  }

  .intro-hero-overlay {
    padding: 12px 14px 10px;
  }

  .intro-vintage-pill {
    font-size: 9px;
    padding: 3px 9px;
  }

  .intro-main-title {
    font-size: 21px;
  }

  .intro-subtitle {
    font-size: 11px;
    line-height: 1.3;
  }

  .intro-choice-section {
    padding: 12px 14px 14px;
    gap: 10px;
  }

  .intro-mode-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .intro-mode-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .intro-mode-icon {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  .intro-mode-title {
    font-size: 14.5px;
  }

  .intro-mode-desc {
    font-size: 11px;
  }

  .modal-backdrop {
    align-items: flex-start;
    padding: 8px 6px;
  }

  .modal-card {
    width: 96vw;
    max-height: 94dvh;
    margin: auto 0;
  }

  .modal-header {
    padding: 10px 14px;
    flex-shrink: 0;
  }

  .modal-header h2 {
    font-size: 14.5px;
  }

  .modal-body {
    padding: 12px 12px 16px;
    gap: 10px;
  }

  .mp-wizard-step {
    gap: 10px;
  }

  .mp-step-field {
    padding: 10px 10px;
    gap: 7px;
  }

  .mp-step-label {
    font-size: 11.5px;
  }

  .mp-name-big-input {
    padding: 9px 11px;
    font-size: 16px; /* 16px prevents iOS Safari auto-zoom on focus */
  }

  /* Compact 4-Across Character Picker on iPhone so Piece Picker + Name Input + Start/Join Button all fit on 1 screen without scrolling! */
  .mp-char-picker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .mp-char-pick-card {
    padding: 6px 3px;
    gap: 3px;
    border-radius: 9px;
    min-width: 0;
  }

  .mp-char-visuals {
    gap: 2px;
  }

  .mp-char-fig {
    width: 26px;
    height: 36px;
  }

  .mp-char-temple {
    width: 24px;
    height: 36px;
  }

  .mp-char-name {
    font-size: 10px;
    line-height: 1.1;
  }

  .mp-char-deity {
    display: none;
  }

  .mp-char-badge {
    font-size: 8px;
    padding: 2px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .guest-cave-hero-wrap {
    max-height: 155px;
    flex-shrink: 0;
  }

  .single-bot-picker-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mp-play-current-btns {
    grid-template-columns: 1fr;
  }

  .mp-main-waiting-banner {
    top: 66px;
    font-size: 10.5px;
    padding: 5px 10px;
    border-radius: 12px;
    white-space: normal;
    text-align: center;
  }
}
