:root {
  --bg-top: #d9ded7;
  --bg-bottom: #b8c2c7;
  --panel: rgba(250, 248, 244, 0.9);
  --panel-strong: rgba(248, 246, 241, 0.96);
  --text: #1f2428;
  --muted: #5d656c;
  --accent: #8b4d37;
  --accent-strong: #6e3927;
  --line: rgba(30, 36, 40, 0.12);
  --shadow: 0 24px 70px rgba(18, 23, 28, 0.16);
  --radius: 24px;
}

body[data-theme="bus"] {
  --bg-top: #d7d9d6;
  --bg-bottom: #bcc6cb;
  --accent: #8d4737;
  --accent-strong: #6a2c1f;
}

body[data-theme="taxi"] {
  --bg-top: #ddd7c7;
  --bg-bottom: #c4bcae;
  --accent: #8b6a16;
  --accent-strong: #69500e;
}

body[data-theme="police"] {
  --bg-top: #d3dbe2;
  --bg-bottom: #bac6d2;
  --accent: #385c7a;
  --accent-strong: #26465f;
}

body[data-theme="fire"] {
  --bg-top: #ddd2cc;
  --bg-bottom: #cdb9b1;
  --accent: #8b4938;
  --accent-strong: #6f3022;
}

body[data-theme="market"] {
  --bg-top: #d8ddd1;
  --bg-bottom: #c5ccbf;
  --accent: #566c40;
  --accent-strong: #40502f;
}

body[data-theme="home"] {
  --bg-top: #dcd8dd;
  --bg-bottom: #c5c0c7;
  --accent: #5e5667;
  --accent-strong: #474150;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.38), transparent 30%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

button {
  font: inherit;
}

.app-shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: "Segoe UI", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.subtitle {
  margin: 12px 0 0;
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.difficulty-control {
  display: grid;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(80, 57, 30, 0.08);
}

.difficulty-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "Segoe UI", sans-serif;
}

.difficulty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: "Segoe UI", sans-serif;
}

.difficulty-row input[type="range"] {
  width: 150px;
  accent-color: var(--accent-strong);
}

.pill,
.nav-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(80, 57, 30, 0.08);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

.pill.accent,
.nav-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-color: transparent;
}

.pill:hover,
.nav-btn:hover {
  transform: translateY(-1px);
}

.pill:disabled,
.nav-btn:disabled {
  cursor: default;
  opacity: 0.5;
  transform: none;
}

.status-card,
.scene-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.status-card {
  padding: 16px 18px;
  margin-bottom: 16px;
}

.status-row,
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.status-row {
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
  font-family: "Segoe UI", sans-serif;
}

.progress-track {
  height: 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.25s ease;
}

.meta-row {
  margin-top: 12px;
}

.meta-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 700;
}

.scene-card {
  overflow: hidden;
}

.scene-banner {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  background: #8c8f92;
}

.scene-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-image-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(10, 12, 16, 0.75), rgba(10, 12, 16, 0.16) 48%, rgba(10, 12, 16, 0.06)),
    linear-gradient(90deg, rgba(15, 17, 20, 0.28), transparent 35%, rgba(15, 17, 20, 0.1));
}

.scene-badge {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(248, 246, 241, 0.9);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 20px 40px rgba(10, 12, 16, 0.18);
}

.scene-icon {
  font-size: 2.8rem;
}

.scene-banner-copy {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.location-label {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.84);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 800;
  font-family: "Segoe UI", sans-serif;
}

h2 {
  margin: 0;
  color: #f6f2eb;
  text-shadow: 0 10px 28px rgba(0,0,0,0.42);
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.scene-body {
  padding: 20px 28px 0;
}

.scene-text {
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  line-height: 1.82;
  max-width: 72ch;
}

.scene-text p {
  margin: 0 0 1em;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 10px;
}

.support-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  padding: 16px;
}

.support-card h3 {
  margin: 0 0 8px;
  font-size: 0.94rem;
  font-family: "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.support-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.story-card {
  border-color: rgba(0, 0, 0, 0.06);
}

.choices {
  display: grid;
  gap: 12px;
  padding: 8px 28px 8px;
}

.choice-btn {
  text-align: left;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 24px rgba(18, 23, 28, 0.08);
  font-family: "Segoe UI", sans-serif;
}

.choice-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.choice-btn span {
  font-weight: 700;
}

.choice-btn strong {
  color: var(--accent-strong);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 28px 28px;
}

.error-box {
  margin: 40px auto;
  max-width: 760px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  color: #6b2016;
}

@media (max-width: 760px) {
  .hero {
    display: block;
  }

  .hero-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }

  .scene-banner {
    min-height: 260px;
    padding: 20px 18px;
  }

  .scene-badge {
    width: 92px;
    height: 92px;
  }

  .scene-body,
  .nav-row,
  .choices {
    padding-left: 18px;
    padding-right: 18px;
  }

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