:root {
  --bg: #0d1117;
  --bg-2: #161b22;
  --panel: #1c232e;
  --border: #2d333b;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #4ade80;
  --accent-2: #2dd4bf;
  --danger: #f87171;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100%;
}

/* ---------- MENU ---------- */
.menu-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.menu-header { text-align: center; margin-bottom: 48px; }

.title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: 6px;
  margin: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle { color: var(--muted); margin: 12px 0 0; font-size: 1.05rem; }

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.story-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  text-align: left;
  padding: 0;
  color: var(--text);
}

.story-card:hover:not(.locked) {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(74, 222, 128, .15);
}

.story-card .card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #000;
}

.story-card .card-body { padding: 16px 18px 20px; }

.story-card .card-title { font-size: 1.25rem; margin: 0 0 6px; }
.story-card .card-desc { color: var(--muted); font-size: .9rem; margin: 0; }

.story-card.locked { cursor: not-allowed; filter: grayscale(.7) opacity(.6); }
.story-card.locked .card-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 17, 23, .45);
}
.story-card.locked .card-lock span {
  font-size: 2.2rem;
  filter: none;
}

.badge {
  display: inline-block;
  font-size: .72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(74, 222, 128, .15);
  color: var(--accent);
  margin-bottom: 10px;
}

.menu-footer { text-align: center; color: var(--muted); margin-top: 48px; font-size: .9rem; }

/* ---------- STORY / SCENE ---------- */
.story-body { overflow: hidden; }

.scene {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.scene-image {
  position: relative;
  height: 42%;
  min-height: 220px;
  background: #000;
}

.scene-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13,17,23,0) 40%, rgba(13,17,23,.9) 100%);
}

.btn-back {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(13,17,23,.55);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 3;
  backdrop-filter: blur(4px);
}
.btn-back:hover { background: rgba(13,17,23,.85); }

.scene-title {
  position: absolute;
  left: 20px;
  bottom: 14px;
  font-size: .85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(230, 237, 243, .85);
  z-index: 3;
}

.scene-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 22px 40px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.story-text {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  line-height: 1.65;
  min-height: 3.2em;
  white-space: pre-wrap;
}

.cursor {
  display: inline-block;
  animation: blink 1s steps(1) infinite;
  color: var(--accent);
  font-weight: 700;
}
@keyframes blink { 50% { opacity: 0; } }

.choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
}

.choice-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 15px 18px;
  border-radius: 12px;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}

.choice-btn:hover {
  border-color: var(--accent);
  background: #243042;
  transform: translateX(4px);
}

.choice-btn.ghost { background: transparent; }

.ending-panel { margin-top: 26px; }

.ending-title {
  font-size: 1.8rem;
  margin: 0 0 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ending-note { color: var(--muted); line-height: 1.6; margin: 0 0 20px; }

.ending-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.ending-actions .choice-btn { flex: 1; min-width: 160px; }

@media (min-width: 720px) {
  .scene { flex-direction: row; }
  .scene-image { width: 50%; height: 100%; min-height: 0; }
  .scene-content {
    padding: 60px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
