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

:root {
  --bg-deep: #0f0f12;
  --bg-surface: #1a1a22;
  --text-primary: #f5f0e8;
  --text-muted: rgba(245, 240, 232, 0.55);
  --board-frame: linear-gradient(145deg, #3a3530 0%, #2a2520 40%, #1f1b18 100%);
  --board-inner-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.5);
  --cell-radius: 3px;
  --zone-label-bg: rgba(15, 15, 18, 0.75);
  --page-bg: url('assets/zones/bg.png');
  --zone-cells-1: url('assets/zones/1.png');
  --zone-cells-2: url('assets/zones/2.png');
  --zone-cells-3: url('assets/zones/3.png');
  --zone-cells-4: url('assets/zones/4.png');
  --scrollbar-size: 10px;
  --scrollbar-track: rgba(12, 12, 16, 0.92);
  --scrollbar-thumb: linear-gradient(180deg, #e8c860 0%, #b8860b 55%, #8b6914 100%);
  --scrollbar-thumb-hover: linear-gradient(180deg, #ffd700 0%, #daa520 55%, #b8860b 100%);
  --scrollbar-border: rgba(15, 15, 18, 0.95);
}

/* ── Custom scrollbars (game style) ── */
* {
  scrollbar-width: thin;
  scrollbar-color: #b8860b var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(218, 165, 32, 0.08);
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 8px rgba(218, 165, 32, 0.18);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 10px rgba(218, 165, 32, 0.32);
}

*::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #daa520 0%, #8b6914 100%);
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

html {
  scrollbar-width: thin;
  scrollbar-color: #b8860b var(--scrollbar-track);
  font-size: 16px;
  min-height: 100%;
  background-color: var(--bg-deep);
  background-image: var(--page-bg);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: min(100%, 1200px) auto;
  background-attachment: scroll;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  background: transparent;
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

body.state-locked {
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

body.state-entry {
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

body.state-game {
  position: relative;
  align-items: flex-start;
  padding: var(--game-offset, 100dvh) 16px 24px;
}

body.state-game .page {
  width: 100%;
  max-width: none;
}

.page {
  width: 90%;
  max-width: 828px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.game-screen {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ── Code screen ── */
.code-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.code-screen[hidden] {
  display: none !important;
}

.code-card {
  max-width: 380px;
}

.code-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.code-input {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.code-error {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #ffb4b4;
  text-align: center;
}

.code-error[hidden] {
  display: none !important;
}

.confirm-actions--single {
  justify-content: center;
}

.confirm-actions--single .btn-primary {
  min-width: 120px;
}

/* ── Entry screen ── */
.entry-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.entry-screen[hidden] {
  display: none !important;
}

.entry-card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  border-radius: 16px;
  background: rgba(15, 15, 18, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.entry-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #f5f0e8 0%, #c9b896 50%, #daa520 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.entry-subtitle {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 8px 0 24px;
}

.field-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
  border-color: rgba(218, 165, 32, 0.5);
  box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.15);
}

.avatar-picker {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.avatar-option {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.avatar-option:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.avatar-option--selected {
  border-color: #daa520;
  box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.25);
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.avatar-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.avatar-upload:hover,
.avatar-upload--active {
  border-color: rgba(218, 165, 32, 0.5);
  background: rgba(218, 165, 32, 0.08);
}

.avatar-upload-text {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.custom-avatar-preview {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #daa520;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #e8c860 0%, #b8860b 100%);
  color: #1a1a12;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(184, 134, 11, 0.35);
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-secondary:hover {
  border-color: rgba(218, 165, 32, 0.45);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.play-scroll-bar {
  position: absolute;
  top: 2.5vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 1200px);
  max-width: 1200px;
  padding: 0 20px;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  z-index: 45;
  pointer-events: none;
}

.top-hud {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 1200px);
  max-width: 1200px;
  padding: 0 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  z-index: 45;
  pointer-events: none;
}

.top-hud[hidden] {
  display: none !important;
}

body.game-battle-mode .top-hud {
  display: none !important;
}

.btn-fortune-temp {
  pointer-events: auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(218, 165, 32, 0.45);
  background: rgba(15, 15, 18, 0.78);
  color: #f0d060;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-fortune-temp:hover {
  border-color: rgba(255, 230, 140, 0.55);
  background: rgba(218, 165, 32, 0.14);
  color: #ffe8a0;
}

.screen-size-label {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 15, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(245, 240, 232, 0.82);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  flex-shrink: 0;
}

.play-scroll-bar[hidden] {
  display: none !important;
}

@media (min-height: 751px) {
  body.state-game .play-scroll-bar:not([hidden]) {
    top: 84vh;
    justify-content: center;
  }
}

.btn-play-scroll {
  position: static;
  pointer-events: auto;
  padding: 14px 29px;
  border: 1px solid rgba(255, 230, 140, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, #e8c860 0%, #b8860b 100%);
  color: #1a1a12;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn-play-scroll:hover {
  transform: translateY(-1px);
  box-shadow:
    0 8px 28px rgba(184, 134, 11, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* ── Player bar on game screen ── */
.player-bar {
  width: 100%;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(218, 165, 32, 0.35);
}

.player-panel {
  display: grid;
  grid-template-columns: 25% 20% 20% 10% 25%;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  border: none;
  border-radius: 0;
  background: rgba(15, 15, 18, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: none;
  gap: 0;
}

.player-panel-section {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
  padding: 0 6px;
  border-left: 1px solid rgba(218, 165, 32, 0.22);
}

.player-panel-section:first-child {
  border-left: none;
}

.player-panel-section--identity {
  gap: 10px;
  padding-left: 10px;
}

.player-panel-section--stats {
  justify-content: center;
  gap: 6px;
}

.player-panel-section--artifacts {
  justify-content: center;
}

.player-panel-section--initiation-ready {
  padding: 2px 6px;
}

.btn-initiation-panel {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 18px;
  border: 2px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(135deg, #e8c860 0%, #b8860b 100%) padding-box,
    linear-gradient(
      120deg,
      #fff8dc,
      #ffd700,
      #ffec8b,
      #ffb830,
      #fffacd,
      #b8860b,
      #ffe066,
      #fff6d0,
      #ffd700
    ) border-box;
  background-size: auto, 400% 400%;
  color: #1a1a12;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  animation: initiation-gold-flow 4s linear infinite, initiation-btn-glow 2.4s ease-in-out infinite;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-initiation-panel:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-initiation-panel[hidden] {
  display: none !important;
}

#player-artifacts[hidden] {
  display: none !important;
}

.player-panel-section--daily {
  justify-content: center;
  padding: 4px 4px;
}

.player-panel-section--restart {
  justify-content: center;
  padding-right: 10px;
}

.player-block {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
}

.player-block--identity {
  flex: 1 1 auto;
  min-width: 0;
  gap: 12px;
  padding: 2px 4px;
}

.player-block--hearts {
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(232, 90, 113, 0.12);
  border: 1px solid rgba(232, 90, 113, 0.28);
  flex: 1 1 0;
  justify-content: center;
}

.player-block--coins {
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(218, 165, 32, 0.12);
  border: 1px solid rgba(218, 165, 32, 0.28);
  flex: 1 1 0;
  justify-content: center;
}

.player-block--artifacts {
  gap: 4px;
  padding: 2px 0;
  justify-content: center;
  flex-wrap: nowrap;
}

.player-block--daily {
  gap: 0;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  width: auto;
  min-width: 28px;
  justify-content: center;
}

.player-block--daily-available {
  background: rgba(126, 200, 126, 0.12);
  border-color: rgba(126, 200, 126, 0.32);
}

.player-block--daily-used {
  background: rgba(232, 90, 113, 0.12);
  border-color: rgba(232, 90, 113, 0.32);
}

.player-daily-move-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #5ecf5e;
  box-shadow: 0 0 8px rgba(94, 207, 94, 0.65);
}

.player-block--daily-used .player-daily-move-dot {
  background: #e85a71;
  box-shadow: 0 0 8px rgba(232, 90, 113, 0.55);
}

.daily-limit-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  z-index: 1200;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(24, 24, 28, 0.94);
  border: 1px solid rgba(218, 165, 32, 0.45);
  color: #f5f0e6;
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.daily-limit-toast--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.player-artifact-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid transparent;
  padding: 0;
  background: transparent;
  font: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.player-artifact-slot--buyable {
  cursor: pointer;
}

.player-artifact-slot--buyable:not(.player-artifact-slot--affordable) {
  cursor: not-allowed;
}

.player-artifact-slot--buyable.player-artifact-slot--affordable:hover {
  border-color: rgba(218, 165, 32, 0.45);
  background: rgba(218, 165, 32, 0.06);
}

.player-artifact-slot--required {
  animation: artifact-purchase-required 1.4s ease-in-out infinite;
}

@keyframes artifact-purchase-required {
  0%,
  100% {
    border-color: rgba(218, 165, 32, 0.55);
    box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.25);
  }

  50% {
    border-color: rgba(255, 215, 0, 0.95);
    box-shadow: 0 0 12px rgba(218, 165, 32, 0.45);
  }
}

.player-artifact-slot:disabled {
  cursor: default;
}

.player-artifact-slot:focus-visible {
  outline: 2px solid rgba(218, 165, 32, 0.65);
  outline-offset: 2px;
}

.player-artifact-slot--active {
  border-color: rgba(218, 165, 32, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 215, 0, 0.35),
    0 0 10px rgba(218, 165, 32, 0.35);
  background: rgba(218, 165, 32, 0.1);
}

.player-artifact {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.player-artifact--dim {
  opacity: 0.32;
  filter: grayscale(0.55) brightness(0.85);
}

.player-artifact--active {
  opacity: 1;
  filter: none;
}

.player-artifact-count {
  position: absolute;
  right: -3px;
  bottom: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(218, 165, 32, 0.95);
  color: #1a1408;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.player-heart-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}

.player-panel-section--artifacts .player-artifact-slot {
  width: 32px;
  height: 32px;
}

.player-panel-section--artifacts .player-artifact {
  width: 26px;
  height: 26px;
}

.player-heart-count,
.player-coin-count {
  font-variant-numeric: tabular-nums;
  font-size: clamp(1rem, 1.4vw, 1.56rem);
  font-weight: 600;
  line-height: 1;
}

.player-heart-count {
  color: #f08a9a;
}

.player-coin-count {
  color: #f0d060;
}

.player-coin-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(145deg, #f0d060 0%, #daa520 55%, #b8860b 100%);
  border: 1px solid rgba(255, 230, 140, 0.65);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.player-avatar-btn {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
  transition: transform 0.15s, box-shadow 0.2s;
}

.player-avatar-btn:focus-visible {
  outline: 2px solid rgba(218, 165, 32, 0.65);
  outline-offset: 2px;
}

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(218, 165, 32, 0.45);
  display: block;
}

.player-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 1.6vw, 2.1rem);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.btn-restart {
  width: 100%;
  flex-shrink: 1;
  padding: 10px 8px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: clamp(0.72rem, 1.1vw, 1.16rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
}

.btn-restart:hover {
  color: var(--text-primary);
  background: rgba(218, 165, 32, 0.1);
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.modal--open {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 28px 24px 24px;
  border-radius: 16px;
  background: rgba(22, 22, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 50;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.12);
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 20px;
}

.modal-card .field-input {
  margin-bottom: 16px;
}

.modal-card .btn-primary {
  margin-top: 8px;
}

.modal-subtitle {
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: -12px 0 18px;
}

.modal-card--wide {
  max-width: 560px;
}

.modal-card--content {
  max-width: min(92vw, 720px);
}

.modal-card--confirm {
  max-width: 380px;
}

.confirm-message {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-primary);
  margin: -8px 0 10px;
}

.confirm-hint {
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
}

.confirm-actions .btn-primary,
.confirm-actions .btn-secondary {
  flex: 1;
  width: auto;
  margin-top: 0;
}

.cover-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 4px;
}

.cover-card {
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.cover-card:hover {
  border-color: rgba(218, 165, 32, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.cover-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.cover-card--missing {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-card__placeholder {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.cards-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 24px 8px;
}

.cards-empty code {
  color: rgba(218, 165, 32, 0.85);
  font-size: 0.75rem;
}

.content-card-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: min(75vh, 640px);
  overflow: auto;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.content-card-image {
  max-width: 100%;
  max-height: min(75vh, 620px);
  width: auto;
  height: auto;
  display: block;
  border-radius: 8px;
}

.content-card-fallback {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.cell--trigger {
  cursor: pointer;
}

.cell--trigger::after {
  box-shadow:
    inset 0 0 0 2px rgba(218, 165, 32, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--trigger:hover {
  filter: brightness(1.08);
}

.cell--dice {
  cursor: pointer;
}

.cell--dice::after {
  box-shadow:
    inset 0 0 0 2px rgba(220, 140, 90, 0.42),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--dice:hover {
  filter: brightness(1.08);
}

.cell--colors {
  cursor: pointer;
}

.cell--colors::after {
  box-shadow:
    inset 0 0 0 2px rgba(180, 120, 255, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--colors:hover {
  filter: brightness(1.08);
}

.cell--cell29 {
  cursor: pointer;
}

.cell--cell29::after {
  box-shadow:
    inset 0 0 0 2px rgba(100, 180, 255, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--cell29:hover {
  filter: brightness(1.08);
}

.cell--cell12 {
  cursor: pointer;
}

.cell--cell12::after {
  box-shadow:
    inset 0 0 0 2px rgba(200, 160, 255, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--cell12:hover {
  filter: brightness(1.08);
}

.cell12-picker {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}

.cell12-result-view {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  max-height: min(75vh, 640px);
  overflow: auto;
  padding: 4px;
}

.cell12-result-image {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, 720px);
  width: auto;
  height: auto;
  max-height: min(70vh, 580px);
  object-fit: contain;
  display: block;
  border-radius: 8px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .cell12-result-view {
    flex-direction: column;
    align-items: center;
  }

  .cell12-result-image {
    max-width: 100%;
  }
}

.cell--cell42 {
  cursor: pointer;
}

.cell--cell42::after {
  box-shadow:
    inset 0 0 0 2px rgba(255, 170, 90, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--cell42:hover {
  filter: brightness(1.08);
}

.cell--simple-image {
  cursor: pointer;
}

.cell--simple-image::after {
  box-shadow:
    inset 0 0 0 2px rgba(140, 220, 160, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--simple-image:hover {
  filter: brightness(1.08);
}

.cell42-picker {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}

.color-picker {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}

.dice-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 4px;
  overflow: visible;
}

.modal--dice .modal-card--wide {
  display: flex;
  flex-direction: column;
  max-width: min(94vw, 680px);
  max-height: none;
}

.modal--dice .modal-desc-actions {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 12px;
}

.dice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.dice-card:hover {
  border-color: rgba(220, 140, 90, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.dice-card__media {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  overflow: hidden;
  background: #fff;
}

.dice-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.dice-card__title {
  display: block;
  padding: 6px 4px;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.62rem, 2vw, 0.85rem);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  color: #111;
  background: #fff;
  pointer-events: none;
}

.modal-card--dice-roll {
  max-width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: min(92vh, 640px);
}

.dice-roll-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  max-height: min(48vh, 340px);
  padding: 12px;
  perspective: 900px;
  flex: 0 1 auto;
  overflow: hidden;
}

.dice-cube-wrap {
  width: min(64vw, 140px);
  height: min(64vw, 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dice-cube {
  --dice-half: 70px;
  position: relative;
  width: calc(var(--dice-half) * 2);
  height: calc(var(--dice-half) * 2);
  transform-style: preserve-3d;
  will-change: transform;
}

.dice-cube[hidden] {
  display: none !important;
}

.dice-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 10px;
  backface-visibility: hidden;
}

.dice-pips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 72%;
  height: 72%;
  gap: 0;
  background: linear-gradient(145deg, #f8f4ec 0%, #e8e0d0 100%);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.25);
}

.dice-pip {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: transparent;
  transform: scale(0.42);
}

.dice-pips--1 .dice-pip:nth-child(5),
.dice-pips--2 .dice-pip:nth-child(1),
.dice-pips--2 .dice-pip:nth-child(9),
.dice-pips--3 .dice-pip:nth-child(1),
.dice-pips--3 .dice-pip:nth-child(5),
.dice-pips--3 .dice-pip:nth-child(9),
.dice-pips--4 .dice-pip:nth-child(1),
.dice-pips--4 .dice-pip:nth-child(3),
.dice-pips--4 .dice-pip:nth-child(7),
.dice-pips--4 .dice-pip:nth-child(9),
.dice-pips--5 .dice-pip:nth-child(1),
.dice-pips--5 .dice-pip:nth-child(3),
.dice-pips--5 .dice-pip:nth-child(5),
.dice-pips--5 .dice-pip:nth-child(7),
.dice-pips--5 .dice-pip:nth-child(9),
.dice-pips--6 .dice-pip:nth-child(1),
.dice-pips--6 .dice-pip:nth-child(3),
.dice-pips--6 .dice-pip:nth-child(4),
.dice-pips--6 .dice-pip:nth-child(6),
.dice-pips--6 .dice-pip:nth-child(7),
.dice-pips--6 .dice-pip:nth-child(9) {
  background: #1a1510;
}

.dice-face--1 {
  transform: rotateY(0deg) translateZ(var(--dice-half));
}

.dice-face--2 {
  transform: rotateY(180deg) translateZ(var(--dice-half));
}

.dice-face--3 {
  transform: rotateY(90deg) translateZ(var(--dice-half));
}

.dice-face--4 {
  transform: rotateY(-90deg) translateZ(var(--dice-half));
}

.dice-face--5 {
  transform: rotateX(90deg) translateZ(var(--dice-half));
}

.dice-face--6 {
  transform: rotateX(-90deg) translateZ(var(--dice-half));
}

.dice-cube--rolling {
  animation: dice-cube-roll 3.3s cubic-bezier(0.15, 0.85, 0.25, 1) forwards;
}

@keyframes dice-cube-roll {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  }
  20% {
    transform: rotateX(180deg) rotateY(120deg) rotateZ(45deg);
  }
  45% {
    transform: rotateX(360deg) rotateY(300deg) rotateZ(120deg);
  }
  70% {
    transform: rotateX(540deg) rotateY(480deg) rotateZ(200deg);
  }
  100% {
    transform: var(--dice-final-rotate);
  }
}

.dice-cube-wrap[hidden] {
  display: none !important;
}

.dice-roll-result-image {
  max-width: 100%;
  max-height: min(42vh, 280px);
  width: auto;
  height: auto;
  display: block;
  border-radius: 10px;
  object-fit: contain;
}

.dice-roll-result-image[hidden] {
  display: none !important;
}

.dice-roll-result {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 6px;
  flex-shrink: 0;
}

.cell--video {
  cursor: pointer;
}

.cell--video::after {
  box-shadow:
    inset 0 0 0 2px rgba(130, 190, 255, 0.38),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--video:hover {
  filter: brightness(1.08);
}

.cell--audio {
  cursor: pointer;
}

.cell--audio .cell-number,
.cell--audio .cell-check,
.cell--audio .cell-avatar {
  cursor: pointer;
}

.cell--audio::after {
  box-shadow:
    inset 0 0 0 2px rgba(190, 140, 255, 0.42),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--audio:hover {
  filter: brightness(1.08);
}

.modal-card--audio-desc {
  max-width: min(92vw, 560px);
}

.modal-card--audio-player {
  max-width: min(90vw, 520px);
}

#audio-player-modal.modal--open {
  z-index: 110;
}

#audio-player-modal .modal-title {
  margin-bottom: 12px;
}

.audio-desc-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  max-height: min(55vh, 480px);
  overflow: auto;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.audio-desc-image {
  max-width: 100%;
  max-height: min(55vh, 460px);
  width: auto;
  height: auto;
  display: block;
  border-radius: 8px;
}

.modal-card--audio-desc .btn-primary {
  width: 100%;
}

.audio-player-wrap {
  width: 100%;
  padding: 18px 16px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.zone-audio-player {
  width: 100%;
  display: block;
}

.audio-player-fallback {
  margin-top: 12px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.audio-player-fallback[hidden] {
  display: none !important;
}

.modal-card--video-desc {
  max-width: min(92vw, 560px);
}

.modal-card--video-player {
  max-width: min(90vw, 680px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

#video-player-modal.modal--open {
  z-index: 110;
}

#video-player-modal .modal-title {
  margin-bottom: 12px;
}

.video-player-wrap {
  position: relative;
  width: 100%;
  max-height: min(56vh, calc(100dvh - 180px));
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.video-player-wrap .video-js {
  width: 100% !important;
  height: auto !important;
  max-height: min(56vh, calc(100dvh - 200px));
  aspect-ratio: 16 / 9;
  font-family: 'Montserrat', sans-serif;
}

.video-player-wrap .video-js.vjs-fluid:not(.vjs-audio-only-mode) {
  padding-top: 0 !important;
}

.video-player-wrap .video-js .vjs-tech {
  object-fit: contain;
}

.video-desc-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  max-height: min(55vh, 480px);
  overflow: auto;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.video-desc-image {
  max-width: 100%;
  max-height: min(55vh, 460px);
  width: auto;
  height: auto;
  display: block;
  border-radius: 8px;
}

.modal-card--video-desc .btn-primary {
  margin-top: 0;
}

.modal-desc-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  width: 100%;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.modal-desc-actions .btn-primary,
.modal-desc-actions .btn-secondary {
  width: 100%;
  margin-top: 0;
}

.cell--cell59 {
  cursor: pointer;
}

.cell--cell59::after {
  box-shadow:
    inset 0 0 0 2px rgba(180, 255, 200, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--cell59:hover {
  filter: brightness(1.08);
}

.cell--cell61 {
  cursor: pointer;
}

.cell--cell61::after {
  box-shadow:
    inset 0 0 0 2px rgba(255, 220, 140, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--cell61:hover {
  filter: brightness(1.08);
}

.cell59-role-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding: 4px;
}

.cell59-role-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.cell59-role-card:hover {
  border-color: rgba(218, 165, 32, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.cell59-role-card__cover,
.cell59-role-card__content {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  pointer-events: none;
}

.cell59-role-card__label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}

.cell59-role-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-height: min(75vh, 640px);
  overflow-y: auto;
  padding: 4px;
}

.cell59-role-view__cover,
.cell59-role-view__content {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(35vh, 300px);
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.modal-desc-actions--split {
  flex-direction: row;
  flex-wrap: wrap;
}

.modal-desc-actions--split .btn-primary {
  flex: 1 1 calc(50% - 5px);
  width: auto;
}

.modal-desc-actions--split .btn-mark-complete {
  flex: 1 1 100%;
}

.cell--cell58 {
  cursor: pointer;
}

.cell--cell58::after {
  box-shadow:
    inset 0 0 0 2px rgba(255, 140, 100, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14);
}

.cell--cell58:hover {
  filter: brightness(1.08);
}

.modal-card--audio-desc .modal-desc-actions {
  margin-top: 12px;
}

.video-player-wrap .vjs-big-play-button {
  background-color: rgba(184, 134, 11, 0.9);
  border: none;
  border-radius: 50%;
  width: 2.2em;
  height: 2.2em;
  line-height: 2.2em;
  margin-top: -1.1em;
  margin-left: -1.1em;
}

.video-player-wrap .vjs-big-play-button:hover,
.video-player-wrap .vjs-big-play-button:focus {
  background-color: #daa520;
}

.video-player-wrap .vjs-play-progress,
.video-player-wrap .vjs-volume-level {
  background-color: #daa520;
}

.video-player-wrap .vjs-slider-bar {
  background: rgba(218, 165, 32, 0.35);
}

.video-player-wrap .vjs-control-bar {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
}

.video-player-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.video-player-fallback[hidden] {
  display: none !important;
}

.video-player-fallback:not([hidden]) {
  display: flex;
}

/* ── Scene layout ── */
.board-scene {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: 7vh 7vw;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.4s ease, visibility 1.4s ease;
}

.board-scene.board-scene--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.board-stack {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 2px solid rgba(218, 165, 32, 0.72);
  border-radius: 12px;
  overflow: hidden;
  transform-origin: center top;
  background: transparent;
  box-shadow:
    0 0 0 1px rgba(255, 230, 140, 0.18),
    0 10px 36px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 230, 140, 0.2);
}

/* ── Board wrapper ── */
.board-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-inline: auto;
  padding: 10px;
  border-radius: 0;
  transform-origin: center top;
  background: rgba(15, 15, 18, 0.3);
  border: none;
  box-shadow: none;
}

.board {
  display: flex;
  flex-direction: row;
  gap: 0;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--board-inner-shadow);
}

/* ── Zone ── */
.zone {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
}

.zone + .zone {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.board-scene--visible .zone {
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
}

.board-scene--visible .zone.zone--revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.zone-header {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  padding: 7px 8px;
  min-height: calc(1.44rem * 1.2 + 14px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--zone-label-bg);
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 3;
  max-width: calc(100% - 8px);
  text-align: center;
  border-top: 2px solid rgba(255, 255, 255, 0.15);
}

.zone-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.44rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.zone-subtitle {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Zone accent line on top edge */
.zone::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  z-index: 1;
}

.zone--illusions::before { background: linear-gradient(90deg, #b0b0b0, #606060); }
.zone--body::before     { background: linear-gradient(90deg, #7ec87e, #2d6b2d); }
.zone--temple::before   { background: linear-gradient(90deg, #6aabf0, #1a4a8a); }
.zone--kingdom::before  { background: linear-gradient(90deg, #ffd700, #b8860b); }

/* ── Rows & Cells ── */
.zone-rows {
  display: flex;
  flex-direction: column;
  padding-top: 78px;
  width: 100%;
}

.board-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
}

.cell {
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.cell::before {
  content: none;
}

/* Cell inner bevel for volume */
.cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--cell-radius);
  pointer-events: none;
  z-index: 1;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14),
    inset 2px 0 3px rgba(255, 255, 255, 0.06),
    inset -2px 0 3px rgba(0, 0, 0, 0.06);
}

.cell-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.35rem, 4.2vw, 2.625rem);
  font-weight: 700;
  line-height: 1;
  z-index: 2;
  letter-spacing: -0.02em;
}

.cell-number--double {
  font-size: clamp(1.125rem, 3.45vw, 2.175rem);
}

.cell-check {
  position: absolute;
  z-index: 3;
  left: 7%;
  bottom: 7%;
  width: 28%;
  height: 28%;
  min-width: 14px;
  min-height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--cell-radius);
  background: linear-gradient(145deg, #4a4038 0%, #2a2520 55%, #1f1b18 100%);
  border: 1px solid rgba(218, 165, 32, 0.5);
  color: #daa520;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.5rem, 1.6vw, 0.85rem);
  font-weight: 700;
  line-height: 1;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.cell-check::before {
  content: '✓';
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cell-check--double::before {
  content: '✓✓';
  letter-spacing: -0.12em;
  font-size: clamp(0.45rem, 1.35vw, 0.72rem);
}

.cell-check[hidden] {
  display: none !important;
}

.cell-avatar {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 52%;
  height: 52%;
  min-width: 26px;
  min-height: 26px;
  transform: translate(-50%, -46%);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(218, 165, 32, 0.85);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  pointer-events: none;
  background: linear-gradient(145deg, #3a3530 0%, #1f1b18 100%);
}

.cell-avatar[hidden] {
  display: none !important;
}

.cell--visited::after {
  box-shadow:
    inset 0 0 0 2px rgba(218, 165, 32, 0.38),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14),
    inset 2px 0 3px rgba(255, 255, 255, 0.06),
    inset -2px 0 3px rgba(0, 0, 0, 0.06);
}

.cell--completed::after {
  box-shadow:
    inset 0 0 0 2px rgba(218, 165, 32, 0.52),
    inset 0 2px 4px rgba(255, 255, 255, 0.18),
    inset 0 -2px 5px rgba(0, 0, 0, 0.14),
    inset 2px 0 3px rgba(255, 255, 255, 0.06),
    inset -2px 0 3px rgba(0, 0, 0, 0.06);
}

.cell--current::after {
  box-shadow:
    inset 0 0 0 3px rgba(218, 165, 32, 0.82),
    inset 0 0 14px rgba(218, 165, 32, 0.22),
    inset 0 2px 4px rgba(255, 255, 255, 0.22),
    inset 0 -2px 5px rgba(0, 0, 0, 0.16),
    inset 2px 0 3px rgba(255, 255, 255, 0.08),
    inset -2px 0 3px rgba(0, 0, 0, 0.08);
}

.cell--current .cell-number {
  opacity: 0.28;
}

.cell--visited .cell-number {
  opacity: 0.82;
}

.cell--completed .cell-number {
  opacity: 0.82;
}

.zone--illusions .cell--visited .cell-check {
  border-color: rgba(180, 180, 180, 0.55);
  color: #e8e8e8;
}

.zone--illusions .cell--completed .cell-check {
  border-color: rgba(180, 180, 180, 0.55);
  color: #e8e8e8;
}

.zone--body .cell--visited .cell-check {
  border-color: rgba(126, 200, 126, 0.55);
  color: #b8f0b8;
}

.zone--body .cell--completed .cell-check {
  border-color: rgba(126, 200, 126, 0.55);
  color: #b8f0b8;
}

.zone--temple .cell--visited .cell-check {
  border-color: rgba(106, 171, 240, 0.55);
  color: #9ec8ff;
}

.zone--temple .cell--completed .cell-check {
  border-color: rgba(106, 171, 240, 0.55);
  color: #9ec8ff;
}

.zone--kingdom .cell--visited .cell-check {
  border-color: rgba(255, 215, 0, 0.65);
  color: #ffd700;
}

.zone--kingdom .cell--completed .cell-check {
  border-color: rgba(255, 215, 0, 0.65);
  color: #ffd700;
}

.zone--illusions .cell--current .cell-avatar {
  border-color: rgba(200, 200, 200, 0.9);
}

.zone--body .cell--current .cell-avatar {
  border-color: rgba(126, 200, 126, 0.9);
}

.zone--temple .cell--current .cell-avatar {
  border-color: rgba(106, 171, 240, 0.9);
}

.zone--kingdom .cell--current .cell-avatar {
  border-color: rgba(255, 215, 0, 0.95);
}

/* ── Фоны клеток: PNG + приглушение + расцветка зоны ── */
.zone--illusions .cell--light {
  background-image:
    linear-gradient(155deg, rgba(255,255,255,0.2) 0%, transparent 45%),
    linear-gradient(155deg,
      rgba(222,222,222,0.84) 0%,
      rgba(196,196,196,0.84) 45%,
      rgba(176,176,176,0.84) 100%),
    linear-gradient(rgba(0,0,0,0.38), rgba(0,0,0,0.38)),
    var(--zone-cells-1);
  background-size: cover;
  background-position: center;
}
.zone--illusions .cell--dark {
  background-image:
    linear-gradient(155deg, rgba(255,255,255,0.06) 0%, transparent 50%),
    linear-gradient(155deg,
      rgba(148,148,148,0.86) 0%,
      rgba(120,120,120,0.86) 50%,
      rgba(98,98,98,0.86) 100%),
    linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)),
    var(--zone-cells-1);
  background-size: cover;
  background-position: center;
}
.zone--illusions .cell-number { color: rgba(40, 40, 40, 0.9); text-shadow: 0 1px 3px rgba(255,255,255,0.35); }
.zone--illusions .cell--dark .cell-number { color: rgba(255, 255, 255, 0.92); text-shadow: 0 1px 4px rgba(0,0,0,0.6); }

.zone--body .cell--light {
  background-image:
    linear-gradient(150deg, rgba(255,255,255,0.22) 0%, transparent 42%),
    linear-gradient(150deg,
      rgba(184,224,184,0.84) 0%,
      rgba(152,204,152,0.84) 40%,
      rgba(126,184,126,0.84) 100%),
    linear-gradient(rgba(0,0,0,0.38), rgba(0,0,0,0.38)),
    var(--zone-cells-2);
  background-size: cover;
  background-position: center;
}
.zone--body .cell--dark {
  background-image:
    linear-gradient(150deg, rgba(160,220,160,0.1) 0%, transparent 48%),
    linear-gradient(150deg,
      rgba(69,133,69,0.86) 0%,
      rgba(50,112,50,0.86) 50%,
      rgba(36,88,36,0.86) 100%),
    linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)),
    var(--zone-cells-2);
  background-size: cover;
  background-position: center;
}
.zone--body .cell-number { color: rgba(20, 60, 20, 0.9); text-shadow: 0 1px 3px rgba(255,255,255,0.3); }
.zone--body .cell--dark .cell-number { color: rgba(220, 255, 220, 0.92); text-shadow: 0 1px 4px rgba(0,0,0,0.55); }

.zone--temple .cell--light {
  background-image:
    linear-gradient(148deg, rgba(255,255,255,0.24) 0%, transparent 44%),
    linear-gradient(148deg,
      rgba(184,208,240,0.84) 0%,
      rgba(152,184,228,0.84) 45%,
      rgba(120,160,212,0.84) 100%),
    linear-gradient(rgba(0,0,0,0.38), rgba(0,0,0,0.38)),
    var(--zone-cells-3);
  background-size: cover;
  background-position: center;
}
.zone--temple .cell--dark {
  background-image:
    linear-gradient(148deg, rgba(140,190,255,0.1) 0%, transparent 50%),
    linear-gradient(148deg,
      rgba(52,88,144,0.86) 0%,
      rgba(34,72,128,0.86) 50%,
      rgba(20,48,96,0.86) 100%),
    linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)),
    var(--zone-cells-3);
  background-size: cover;
  background-position: center;
}
.zone--temple .cell-number { color: rgba(15, 40, 90, 0.9); text-shadow: 0 1px 3px rgba(255,255,255,0.3); }
.zone--temple .cell--dark .cell-number { color: rgba(210, 230, 255, 0.92); text-shadow: 0 1px 4px rgba(0,0,0,0.55); }

.zone--kingdom .cell--light {
  background-image:
    linear-gradient(145deg, rgba(255,255,230,0.35) 0%, transparent 42%),
    linear-gradient(145deg,
      rgba(248,238,176,0.84) 0%,
      rgba(236,216,120,0.84) 35%,
      rgba(212,184,72,0.84) 100%),
    linear-gradient(rgba(0,0,0,0.38), rgba(0,0,0,0.38)),
    var(--zone-cells-4);
  background-size: cover;
  background-position: center;
}
.zone--kingdom .cell--dark {
  background-image:
    linear-gradient(145deg, rgba(255,230,140,0.15) 0%, transparent 46%),
    linear-gradient(145deg,
      rgba(212,170,40,0.86) 0%,
      rgba(176,136,24,0.86) 45%,
      rgba(136,96,8,0.86) 100%),
    linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)),
    var(--zone-cells-4);
  background-size: cover;
  background-position: center;
}
.zone--kingdom .cell-number { color: rgba(80, 55, 0, 0.9); text-shadow: 0 1px 3px rgba(255,255,255,0.35); }
.zone--kingdom .cell--dark .cell-number { color: rgba(255, 248, 220, 0.94); text-shadow: 0 1px 4px rgba(0,0,0,0.55); }

/* ── Image click zoom (+50%) ── */
img.img-zoomable {
  cursor: zoom-in;
  transition: transform 0.25s ease;
  transform-origin: center center;
}

img.img-zoomable.img-zoomed {
  cursor: zoom-out;
  transform: scale(1.5);
  position: relative;
  z-index: 40;
}

.content-card-view:has(img.img-zoomed),
.video-desc-view:has(img.img-zoomed),
.audio-desc-view:has(img.img-zoomed),
.cell12-result-view:has(img.img-zoomed),
.dice-roll-scene:has(img.img-zoomed) {
  overflow: visible;
}

/* ── Responsive ── */
@media (max-width: 420px) {
  .entry-card {
    padding: 24px 18px;
  }

  .avatar-option {
    width: 48px;
    height: 48px;
  }

  .player-avatar {
    width: 38px;
    height: 38px;
  }

  .player-name {
    font-size: 1.9rem;
  }

  .zone-header {
    padding: 4px 5px;
    min-height: calc(1.16rem * 1.2 + 8px);
  }

  .zone-rows {
    padding-top: 67px;
  }

  .zone-title {
    font-size: 1.16rem;
  }
}

/* ── Fortune wheel (temporary) ── */
.modal-card--fortune {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.fortune-wheel-scene {
  position: relative;
  width: min(72vw, 300px);
  aspect-ratio: 1;
  margin: 8px 0 4px;
}

.fortune-wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid #ffd700;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  z-index: 4;
}

.fortune-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(218, 165, 32, 0.85);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  transform: rotate(0deg);
  will-change: transform;
  overflow: hidden;
  background: transparent;
}

.fortune-wheel__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.fortune-wheel__icon {
  pointer-events: none;
  user-select: none;
  font-size: 22px;
}

.fortune-wheel__icon--large {
  font-size: 34px;
}

.fortune-wheel__icon--small {
  font-size: 18px;
}

.fortune-wheel__icon-img {
  pointer-events: none;
}

.fortune-wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18%;
  height: 18%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(145deg, #f0d060 0%, #b8860b 100%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.modal-card--fortune .btn-primary {
  min-width: 160px;
}

.fortune-wheel-result {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: #f0d060;
  text-align: center;
}

.fortune-wheel-result[hidden] {
  display: none !important;
}

/* ── Initiation celebration ── */
.modal--initiation {
  padding: 12px;
}

.initiation-backdrop {
  background:
    radial-gradient(circle at 50% 20%, rgba(218, 165, 32, 0.28) 0%, transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(120, 80, 200, 0.22) 0%, transparent 45%),
    rgba(0, 0, 0, 0.82);
}

.initiation-card {
  position: relative;
  width: min(100%, 560px);
  max-width: none;
  max-height: min(94vh, 820px);
  padding: 28px 24px 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: none;
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(38, 32, 24, 0.98) 0%, rgba(18, 16, 28, 0.98) 45%, rgba(24, 20, 16, 0.98) 100%) padding-box,
    linear-gradient(
      120deg,
      #fff8dc,
      #ffd700,
      #ffec8b,
      #ffb830,
      #fffacd,
      #b8860b,
      #ffe066,
      #fff6d0,
      #ffd700
    ) border-box;
  background-size: auto, 400% 400%;
  border: 2px solid transparent;
  box-shadow:
    0 0 24px rgba(218, 165, 32, 0.28),
    0 28px 80px rgba(0, 0, 0, 0.65);
  animation:
    initiation-card-in 0.85s cubic-bezier(0.2, 0.9, 0.25, 1) both,
    initiation-gold-flow 5s linear infinite;
}

@keyframes initiation-gold-flow {
  0% {
    background-position: 0% 50%, 0% 50%;
  }
  50% {
    background-position: 0% 50%, 100% 50%;
  }
  100% {
    background-position: 0% 50%, 0% 50%;
  }
}

@keyframes initiation-card-in {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.initiation-rays {
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(218, 165, 32, 0.07) 18deg,
    transparent 36deg,
    transparent 60deg,
    rgba(255, 220, 120, 0.06) 78deg,
    transparent 96deg,
    transparent 120deg,
    rgba(218, 165, 32, 0.07) 138deg,
    transparent 156deg,
    transparent 180deg,
    rgba(255, 220, 120, 0.06) 198deg,
    transparent 216deg,
    transparent 240deg,
    rgba(218, 165, 32, 0.07) 258deg,
    transparent 276deg,
    transparent 300deg,
    rgba(255, 220, 120, 0.06) 318deg,
    transparent 336deg,
    transparent 360deg
  );
  animation: initiation-rays-spin 28s linear infinite;
  pointer-events: none;
}

@keyframes initiation-rays-spin {
  to { transform: rotate(360deg); }
}

.initiation-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 230, 140, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 200, 80, 0.75) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 1.5px, transparent 2.5px);
  background-size: 120px 120px, 180px 180px, 240px 240px;
  background-position: 0 0, 40px 60px, 80px 20px;
  opacity: 0.35;
  animation: initiation-sparkle-drift 12s linear infinite;
}

@keyframes initiation-sparkle-drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(-120px); }
}

.initiation-close {
  z-index: 5;
}

.initiation-artifacts {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 64px;
}

.initiation-artifact {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(218, 165, 32, 0.55));
  animation: initiation-artifact-float 2.8s ease-in-out infinite;
}

.initiation-artifact--1 { animation-delay: 0s; }
.initiation-artifact--2 { animation-delay: 0.35s; }
.initiation-artifact--3 { animation-delay: 0.7s; }
.initiation-artifact--4 { animation-delay: 1.05s; }

@keyframes initiation-artifact-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.06); }
}

.initiation-eyebrow {
  position: relative;
  z-index: 2;
  margin: 0 0 6px;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(218, 165, 32, 0.85);
  text-align: center;
}

.initiation-title {
  position: relative;
  z-index: 2;
  margin: 0 0 16px;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  background: linear-gradient(135deg, #fff6d0 0%, #ffd700 35%, #daa520 70%, #fff0b0 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: initiation-title-shine 4s ease-in-out infinite;
  filter: drop-shadow(0 2px 12px rgba(218, 165, 32, 0.35));
}

@keyframes initiation-title-shine {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.initiation-scroll {
  position: relative;
  z-index: 2;
  width: 100%;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  padding: 4px 2px;
  margin-bottom: 16px;
}

.initiation-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.initiation-line {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  line-height: 1.55;
  color: rgba(245, 240, 232, 0.88);
  opacity: 0;
  transform: translateY(10px);
  animation: initiation-line-in 0.7s ease forwards;
  animation-delay: var(--line-delay, 0s);
}

@keyframes initiation-line-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.initiation-line--hero {
  font-size: clamp(1.35rem, 3.6vw, 1.65rem);
  font-weight: 700;
  text-align: center;
  color: #ffd700;
  text-shadow: 0 0 24px rgba(218, 165, 32, 0.45);
  padding: 8px 0 4px;
}

.initiation-line--instruction {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-muted);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(218, 165, 32, 0.18);
  background: rgba(218, 165, 32, 0.06);
}

.initiation-line--welcome {
  font-size: clamp(1.25rem, 3.2vw, 1.5rem);
  font-weight: 600;
  text-align: center;
  color: #f5e6a8;
}

.initiation-line--finale {
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  font-weight: 600;
  text-align: center;
  font-style: italic;
  color: rgba(255, 240, 200, 0.95);
}

.initiation-audio-hint {
  position: relative;
  z-index: 2;
  margin: 0 0 12px;
  font-size: 0.78rem;
  line-height: 1.55;
  text-align: center;
  color: rgba(218, 165, 32, 0.85);
}

.initiation-audio-hint[hidden] {
  display: none !important;
}

.initiation-start-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
  padding: 16px 20px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  border: 2px solid transparent;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #e8c860 0%, #b8860b 100%) padding-box,
    linear-gradient(
      120deg,
      #fff8dc,
      #ffd700,
      #ffec8b,
      #ffb830,
      #fffacd,
      #b8860b,
      #ffe066,
      #fff6d0,
      #ffd700
    ) border-box;
  background-size: auto, 400% 400%;
  animation:
    initiation-gold-flow 4s linear infinite,
    initiation-btn-glow 2.4s ease-in-out infinite;
}

.initiation-start-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

@keyframes initiation-btn-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.35), 0 8px 24px rgba(184, 134, 11, 0.35);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(218, 165, 32, 0.12), 0 12px 32px rgba(184, 134, 11, 0.45);
  }
}

.initiation-start-btn:disabled {
  opacity: 0.75;
  animation: initiation-gold-flow 4s linear infinite;
  cursor: default;
}

@media (max-width: 480px) {
  .initiation-artifact {
    width: 42px;
    height: 42px;
  }

  .initiation-card {
    padding: 22px 16px 18px;
  }
}
