* {
  box-sizing: border-box;
}

:root {
  --text: #f5f7fb;
  --muted: #b8bfcc;
  --card: rgba(10, 12, 18, 0.76);
  --border: rgba(255, 255, 255, 0.08);
  --button: rgba(255, 255, 255, 0.92);
  --button-text: #111827;
  --accent: #a5b9ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  transition: background-image 0.45s ease;
}

#background-overlay {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(5, 7, 12, 0.36), rgba(5, 7, 12, 0.72)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 40%);
  pointer-events: none;
}

.game-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.scene-card {
  width: 100%;
  max-width: 860px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: fadeUp 0.45s ease;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.chapter-label,
.location-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 10px;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.character-box {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.character-intro {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.character-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.character-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.character-role {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.character-mood {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(165, 185, 255, 0.16);
  color: #d9e3ff;
  font-size: 0.88rem;
  white-space: nowrap;
}

.scene-text {
  line-height: 1.8;
  font-size: 1.14rem;
  color: #edf1f7;
  margin-bottom: 22px;
  animation: fadeIn 0.35s ease;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.stat-box {
  min-width: 130px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px 14px;
  border-radius: 14px;
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.inventory-wrap {
  margin-bottom: 22px;
}

.inventory-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.inventory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inventory-item,
.inventory-empty {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.92rem;
}

.inventory-item {
  background: rgba(255, 255, 255, 0.1);
}

.inventory-empty {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.choices {
  display: grid;
  gap: 12px;
}

.choice-btn,
.restart-btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.choice-btn {
  background: var(--button);
  color: var(--button-text);
}

.choice-btn:hover,
.restart-btn:hover {
  transform: translateY(-2px);
  opacity: 0.97;
}

.restart-btn {
  margin-top: 18px;
  background: var(--accent);
  color: #111827;
}

.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

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

@media (max-width: 700px) {
  .scene-card {
    padding: 22px;
    border-radius: 20px;
  }

  .top-bar,
  .character-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .scene-text {
    font-size: 1.03rem;
  }

  .stat-box {
    min-width: calc(50% - 6px);
  }
}
