:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-soft: #273549;
  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #132a3e 0%, var(--bg) 70%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.app-shell {
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: var(--accent);
  color: #042f2e;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
}

.brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
}

.chapter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chapter-btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chapter-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.chapter-btn.active {
  background: var(--accent);
  color: #042f2e;
  font-weight: 700;
  border-color: var(--accent);
}

.stage-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1120;
  border: 2px solid rgba(20, 184, 166, 0.35);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.sound-overlay {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
  border: 1px solid rgba(20, 184, 166, 0.75);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s, background 0.15s;
}

.sound-overlay:hover {
  background: rgba(20, 184, 166, 0.92);
  color: #042f2e;
}

.sound-overlay.hidden {
  display: none;
}

#stage {
  width: 100%;
  height: 100%;
  display: block;
}

.caption-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
  min-height: 54px;
  display: flex;
  align-items: center;
}

#caption-text {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
}

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

.controls-center {
  display: flex;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, opacity 0.15s;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #042f2e;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
}
