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

:root {
  --bg: #0a0a0c;
  --fg: #f0e8d8;
  --muted: #8a8478;
  --accent: #c9a96a;
  --paper: rgba(15, 12, 10, 0.78);
  --paper-border: rgba(201, 169, 106, 0.18);
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Iowan Old Style", "Songti SC", "Noto Serif", Georgia, serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--paper-border);
  color: var(--fg);
  padding: 10px 22px;
  border-radius: 2px;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
}

button:hover {
  background: rgba(201, 169, 106, 0.1);
  border-color: var(--accent);
}

button:active {
  transform: scale(0.97);
}

/* Title screen */
#title-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, #1a1410 0%, #0a0a0c 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  z-index: 100;
  transition: opacity 1s ease;
}

#title-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

#title-screen h1 {
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow: 0 0 40px rgba(201, 169, 106, 0.2);
  margin-bottom: 1rem;
}

#title-screen h1 .subtitle {
  display: block;
  font-size: 0.32em;
  letter-spacing: 0.4em;
  color: var(--muted);
  margin-top: 0.6rem;
  font-style: italic;
}

#title-screen .tagline {
  max-width: 540px;
  color: var(--muted);
  margin-bottom: 2.5rem;
  font-style: italic;
  font-size: 1rem;
}

#start-btn {
  padding: 14px 48px;
  font-size: 1rem;
  letter-spacing: 0.2em;
}

#title-screen .credits {
  margin-top: 3rem;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  max-width: 720px;
  line-height: 1.8;
}

#title-screen .hint {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

/* Stage */
#stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#image-layer {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

#scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}

#scene-img.visible {
  opacity: 1;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, transparent 40%);
}

/* HUD */
#hud {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.hud-pill {
  pointer-events: auto;
  padding: 6px 14px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--paper-border);
  color: var(--muted);
}

#skip-btn:hover { color: var(--fg); }

/* Text panel */
#text-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem clamp(1rem, 5vw, 4rem) 2.5rem;
  background: linear-gradient(to top, var(--paper) 0%, transparent 100%);
  z-index: 5;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}

#zh-text {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  letter-spacing: 0.03em;
  color: var(--accent);
  max-width: 760px;
  line-height: 1.7;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#zh-text.visible {
  opacity: 0.8;
}

#en-text {
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  letter-spacing: 0.01em;
  max-width: 720px;
  line-height: 1.6;
  font-style: italic;
  min-height: 1.6em;
}

#en-text .caret {
  display: inline-block;
  width: 0.6em;
  margin-left: 2px;
  border-bottom: 1px solid var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Choices */
#choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.75rem;
  opacity: 0;
  transition: opacity 0.7s ease;
}

#choices.visible { opacity: 1; }

#choices button {
  font-size: 0.95rem;
  padding: 11px 24px;
  letter-spacing: 0.06em;
  background: rgba(15, 12, 10, 0.6);
}

/* Continue / restart */
#continue-btn,
#restart-btn {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
}

/* Oracle reveal */
#oracle-reveal {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

#oracle-btn {
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 7px 16px;
  border-style: dashed;
}

#oracle-btn:hover {
  color: var(--accent);
}

#oracle-reasoning {
  max-width: 680px;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.4);
  border-left: 2px solid var(--accent);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
}

/* Mobile */
@media (max-width: 700px) {
  #zh-text { font-size: 0.95rem; }
  #en-text { font-size: 1.05rem; }
  #text-panel { padding: 1.5rem 1rem 1.75rem; }
  #title-screen .credits { font-size: 0.62rem; }
}
