:root {
  --bg: #fdf6ec;
  --ink: #3a2e26;
  --muted: #8a7567;
  --accent: #d97a4a;
  --accent-soft: #f4c8a8;
  --card: #fffaf2;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.book {
  width: 100%;
  max-width: 980px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(60, 40, 30, 0.12);
  overflow: hidden;
}
.header {
  padding: 18px 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px dashed var(--accent-soft);
  gap: 12px;
}
.header h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.5px;
}
.header .meta { font-size: 13px; color: var(--muted); }
.header .home {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  white-space: nowrap;
}
.header .home:hover { color: var(--accent); border-color: var(--accent); }
.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 700ms ease;
}
.stage img.active { opacity: 1; }
.scene-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(58, 46, 38, 0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  backdrop-filter: blur(6px);
}
.caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 28px 22px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0.78));
  color: #fff;
}
.caption .text {
  font-size: clamp(18px, 2.4vw, 26px);
  line-height: 1.5;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  min-height: 2.4em;
}
.caption .emotion {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-soft);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.controls {
  padding: 18px 24px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
button.icon {
  border: none;
  background: var(--accent);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.icon:hover { background: #c46638; transform: scale(1.05); }
button.ghost {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
}
button.ghost:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
.progress { display: flex; flex-direction: column; gap: 6px; }
.bar {
  width: 100%;
  height: 8px;
  background: var(--accent-soft);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
}
.bar .fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 120ms linear;
}
.timing {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.nav { display: flex; gap: 6px; align-items: center; }
.scene-dots {
  display: flex;
  gap: 6px;
  padding: 0 24px 18px;
}
.scene-dots .dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--accent-soft);
  cursor: pointer;
  transition: background 200ms ease;
}
.scene-dots .dot.active { background: var(--accent); }
.scene-dots .dot.done { background: #c46638; opacity: 0.5; }

/* Theme variants */
body.theme-night {
  --bg: #1a1a2e;
  --ink: #f0e6d2;
  --muted: #9a8fb0;
  --accent: #b794d4;
  --accent-soft: #44375a;
  --card: #252540;
}
body.theme-night .header { border-bottom-color: rgba(183, 148, 212, 0.3); }
body.theme-night .scene-dots .dot.done { background: #6d5a8c; }
