:root {
  --bg: #0d0c0b;
  --panel: rgba(20, 18, 16, 0.86);
  --panel-soft: rgba(40, 33, 27, 0.72);
  --border: rgba(196, 169, 131, 0.18);
  --text: #f2e8d7;
  --muted: #b6aa96;
  --shadow: rgba(0, 0, 0, 0.45);
  --warrior: #c4815c;
  --scientist: #8eaab0;
  --explorer: #8f9d6e;
  --accent: #d1b381;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(97, 83, 63, 0.22), transparent 30%),
    linear-gradient(180deg, #191611 0%, #0d0c0b 55%, #090807 100%);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

body { min-height: 100vh; }

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.sidebar,
.stage-panel { min-width: 0; }

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

.brand,
.panel,
.scene-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px var(--shadow);
  backdrop-filter: blur(10px);
}

.brand,
.panel {
  border-radius: 18px;
  padding: 18px;
}

.scene-wrap {
  border-radius: 24px;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2,
.choice-title {
  margin: 0;
  font-weight: 600;
  line-height: 1.05;
}

h1 { font-size: clamp(2rem, 3.6vw, 2.7rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }

.lead,
.scene-subtitle,
.scene-text,
.choice-prompt,
.token-list,
.log-list,
.ghost-button,
.depth-label { color: var(--muted); }

.lead {
  margin: 12px 0 0;
  line-height: 1.6;
}

.panel-header,
.scene-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.stat .label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
  color: var(--text);
}

.accent-warrior strong { color: var(--warrior); }
.accent-scientist strong { color: var(--scientist); }
.accent-explorer strong { color: var(--explorer); }

.token-list,
.log-list {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.55;
}

.token-list li + li,
.log-list li + li { margin-top: 8px; }

.empty { font-style: italic; }

.stage-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.scene-header {
  padding: 18px 22px;
  background: linear-gradient(180deg, rgba(21, 18, 15, 0.96), rgba(21, 18, 15, 0.7));
}

.scene-subtitle {
  max-width: 36ch;
  line-height: 1.5;
  text-align: right;
}

.scene {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #090807;
}

.scene-image,
.scene-video,
.scene-vignette,
.hotspot-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-image,
.scene-video { object-fit: cover; }

.scene-video {
  mix-blend-mode: screen;
  opacity: 0.18;
  pointer-events: none;
}

.scene-vignette {
  background:
    radial-gradient(circle at 30% 20%, transparent 0 25%, rgba(8, 6, 5, 0.24) 70%),
    linear-gradient(180deg, rgba(10, 9, 8, 0.2) 0%, rgba(8, 7, 6, 0.52) 100%);
  pointer-events: none;
}

.hotspot-layer { z-index: 3; }

.hotspot {
  position: absolute;
  border: 1px dashed rgba(241, 226, 198, 0.15);
  background: rgba(241, 226, 198, 0.04);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.hotspot::after {
  content: attr(data-label);
  position: absolute;
  left: 10px;
  bottom: calc(100% + 8px);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(10, 9, 8, 0.88);
  border: 1px solid rgba(241, 226, 198, 0.2);
  color: var(--text);
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.hotspot:hover,
.hotspot:focus-visible {
  transform: translateY(-2px);
  background: rgba(241, 226, 198, 0.12);
  border-color: rgba(241, 226, 198, 0.4);
  outline: none;
}

.hotspot:hover::after,
.hotspot:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.hotspot.used {
  opacity: 0.32;
  cursor: default;
}

.bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
  gap: 20px;
}

.narrative-panel,
.log-panel { min-height: 240px; }

.scene-text {
  margin: 8px 0 0;
  font-size: 1.02rem;
  line-height: 1.7;
}

.choice-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.choice-title { font-size: 1.25rem; }

.choice-prompt {
  margin: 8px 0 0;
  line-height: 1.6;
}

.choice-buttons {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.choice-button,
.ghost-button {
  border-radius: 14px;
  border: 1px solid rgba(241, 226, 198, 0.18);
  background: rgba(241, 226, 198, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.choice-button {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
}

.choice-button:hover,
.choice-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(241, 226, 198, 0.42);
  background: rgba(241, 226, 198, 0.12);
  outline: none;
}

.choice-button strong,
.choice-button span { display: block; }

.choice-button span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.choice-button.warrior strong { color: var(--warrior); }
.choice-button.scientist strong { color: var(--scientist); }
.choice-button.explorer strong { color: var(--explorer); }

.ghost-button {
  padding: 8px 12px;
  font-family: inherit;
}

.log-list {
  max-height: 300px;
  overflow: auto;
}

.hidden { display: none; }

.ending .scene-vignette {
  background:
    radial-gradient(circle at 50% 40%, rgba(205, 170, 116, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(10, 9, 8, 0.26) 0%, rgba(8, 7, 6, 0.66) 100%);
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .scene-subtitle { text-align: left; }
}

@media (max-width: 720px) {
  .shell {
    padding: 12px;
    gap: 12px;
  }

  .brand,
  .panel,
  .scene-header { padding: 14px; }

  .scene { aspect-ratio: 4 / 3; }
  .hotspot { border-radius: 10px; }
}
