:root {
  --green: #7dfda1;
  --green-dim: #2f7a4a;
  --green-deep: #041a0c;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  color: var(--green);
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- cinematic letterbox ---------- */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  height: 6.5vh;
  background: #000;
  z-index: 20;
  pointer-events: none;
}
.bar.top { top: 0; }
.bar.bottom { bottom: 0; }

/* ---------- subtitles ---------- */
#subs {
  position: fixed;
  left: 50%;
  bottom: 11vh;
  transform: translateX(-50%);
  width: min(1000px, 84vw);
  text-align: center;
  z-index: 25;
  pointer-events: none;
  line-height: 1.45;
}

#subs .line {
  display: inline-block;
  padding: 0.15em 0;
  font-size: clamp(14px, 1.7vw, 24px);
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.95), 0 2px 3px #000;
  opacity: 0;
  transition: opacity 260ms ease;
}
#subs .line.show { opacity: 1; }

#subs .who {
  display: block;
  font-size: 0.62em;
  letter-spacing: 0.28em;
  color: var(--green-dim);
  margin-bottom: 0.25em;
}
#subs .line.vo { color: #b9ffcd; font-style: italic; }
#subs .line.diegetic { color: #f2f4ee; }
#subs .line.terminal {
  color: var(--green);
  font-size: clamp(12px, 1.3vw, 18px);
  letter-spacing: 0.08em;
}

/* ---------- slate / act label ---------- */
#slate {
  position: fixed;
  top: calc(6.5vh + 14px);
  left: 22px;
  z-index: 25;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--green-dim);
  pointer-events: none;
  text-transform: uppercase;
}
#slate b {
  color: var(--green);
  font-weight: 500;
}
#slate .tc {
  display: block;
  margin-top: 4px;
  color: #2a5c3c;
  letter-spacing: 0.12em;
}

/* ---------- transport ---------- */
#transport {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 18px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 300ms ease;
}
#transport.visible { opacity: 1; }

#transport button {
  appearance: none;
  background: rgba(10, 30, 18, 0.6);
  border: 1px solid #1e5334;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 7px 11px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 140ms, border-color 140ms, color 140ms;
  white-space: nowrap;
}
#transport button:hover { background: rgba(30, 90, 55, 0.65); border-color: var(--green); }
#transport button:active { transform: translateY(1px); }

#scrub {
  position: relative;
  flex: 1;
  height: 22px;
  cursor: pointer;
}
#scrub .rail {
  position: absolute;
  top: 9px;
  left: 0;
  right: 0;
  height: 4px;
  background: #103021;
  border-radius: 2px;
  overflow: visible;
}
#scrub .fill {
  position: absolute;
  top: 9px;
  left: 0;
  height: 4px;
  width: 0;
  background: var(--green);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(125, 253, 161, 0.7);
}
#scrub .tick {
  position: absolute;
  top: 4px;
  width: 1px;
  height: 14px;
  background: #2d6b46;
}
#scrub .tick:hover { background: var(--green); }

#chapters {
  position: fixed;
  right: 18px;
  top: calc(6.5vh + 14px);
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 300ms ease;
}
#chapters.visible { opacity: 1; }
#chapters .ch {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #245a3a;
  background: none;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
  font-family: var(--mono);
  text-transform: uppercase;
  text-align: right;
}
#chapters .ch:hover { color: var(--green); }
#chapters .ch.active { color: #d8ffe6; }

/* ---------- boot / title overlay ---------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  text-align: center;
  transition: opacity 700ms ease;
}
#boot.gone { opacity: 0; pointer-events: none; }

#boot h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 92px);
  letter-spacing: 0.32em;
  font-weight: 500;
  color: #9dffbd;
  text-shadow: 0 0 26px rgba(80, 255, 140, 0.45);
}
#boot h2 {
  margin: -14px 0 0;
  font-size: clamp(10px, 1.2vw, 14px);
  letter-spacing: 0.42em;
  font-weight: 400;
  color: var(--green-dim);
}
#boot .blurb {
  max-width: 46ch;
  font-size: 12px;
  line-height: 1.9;
  color: #3c8a5c;
  letter-spacing: 0.06em;
}
#boot .blurb em { color: #6fd694; font-style: normal; }

#start {
  appearance: none;
  background: transparent;
  border: 1px solid #2f7a4a;
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.3em;
  padding: 15px 34px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 180ms ease;
}
#start:hover {
  background: rgba(45, 140, 85, 0.18);
  border-color: var(--green);
  box-shadow: 0 0 30px rgba(80, 255, 140, 0.25);
}

#loadbar {
  width: 220px;
  height: 2px;
  background: #0d2417;
}
#loadbar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width 300ms ease;
}

#boot .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--green);
  vertical-align: -0.15em;
  animation: blink 1.05s steps(1) infinite;
  box-shadow: 0 0 14px rgba(125, 253, 161, 0.9);
}
@keyframes blink { 50% { opacity: 0; } }

#hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(6.5vh + 8px);
  z-index: 24;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: #1f5133;
  pointer-events: none;
  transition: opacity 600ms ease;
}

@media (max-width: 720px) {
  #chapters { display: none; }
  #slate { font-size: 9px; }
  #transport { gap: 8px; padding: 8px 10px 10px; }
  #transport button { padding: 6px 8px; font-size: 10px; letter-spacing: 0.1em; }
  #transport button.wide { display: none; }
}
