:root {
  --bg: #0a0e18;
  --panel: #121826;
  --panel-alt: #182030;
  --red: #c41e2a;
  --cyan: #7ec8e3;
  --ice: #c8d8e8;
  --white: #f2f4f8;
  --mute: #8a96a8;
  --green: #6bbf7a;
  --amber: #d4a017;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #05070c;
  color: var(--white);
  font-family: "Segoe UI", system-ui, sans-serif;
}

#stage {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto auto;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 0.75rem 0.4rem;
}

#deck {
  position: relative;
  outline: none;
  border-radius: 0.55rem;
  overflow: hidden;
  background: var(--bg) center / cover no-repeat;
  background-image: url("./assets/bg-night.png");
  min-height: 0;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: calc(100vh - 5.5rem);
  margin: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.slide {
  display: none;
  position: absolute;
  inset: 0;
  padding: 1.1rem 1.35rem 1rem;
  overflow: auto;
}
.slide.is-active { display: flex; flex-direction: column; gap: 0.7rem; }

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}
h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--red);
}
.cyan { color: var(--cyan) !important; }
.red { color: var(--red) !important; }
.green { color: var(--green) !important; }
.amber { color: var(--amber) !important; }
.cyan-text { color: var(--cyan); }

ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ice);
  line-height: 1.45;
  font-size: clamp(0.88rem, 1.55vw, 1rem);
}
ul.tight { padding-left: 1rem; font-size: 0.92rem; }
li + li { margin-top: 0.28rem; }

.note {
  margin: -0.25rem 0 0;
  color: var(--amber);
  font-size: 0.92rem;
}

.split {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 1rem;
  min-height: 0;
  align-items: stretch;
}
.split ul {
  background: var(--panel);
  border-radius: 0.45rem;
  padding: 0.95rem 0.95rem 0.95rem 1.35rem;
}

figure {
  margin: 0;
  background: var(--panel-alt);
  border-radius: 0.45rem;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
figure img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  flex: 1;
}
figure img.cover { object-fit: cover; }
figcaption {
  margin-top: 0.35rem;
  text-align: center;
  color: var(--mute);
  font-size: 0.78rem;
  line-height: 1.3;
}
figcaption em { color: var(--mute); font-style: normal; font-size: 0.72rem; }
.planned { color: var(--amber); font-size: 0.7rem; letter-spacing: 0.04em; }

.panel {
  background: var(--panel);
  border-radius: 0.45rem;
  padding: 0.75rem 0.9rem 0.75rem 1.3rem;
}

.flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.step {
  flex: 1 1 0;
  min-width: 4.5rem;
  background: var(--panel-alt);
  border-radius: 0.4rem;
  padding: 0.45rem 0.35rem 0.35rem;
  text-align: center;
}
.step img {
  width: 100%;
  height: 3.6rem;
  object-fit: contain;
  image-rendering: pixelated;
}
.step span {
  display: block;
  margin-top: 0.2rem;
  color: var(--cyan);
  font-size: 0.78rem;
}
.arrow { color: var(--red); font-size: 1.1rem; flex: 0 0 auto; }

.grid-2, .grid-3, .grid-4 {
  flex: 1;
  display: grid;
  gap: 0.7rem;
  min-height: 0;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--panel);
  border-radius: 0.45rem;
  padding: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  min-height: 0;
}
.card.tall { flex-direction: column; }
.card.center { flex-direction: column; align-items: center; text-align: center; }
.card img {
  width: 4.2rem;
  height: 4.2rem;
  object-fit: contain;
  image-rendering: pixelated;
  flex: 0 0 auto;
}
.card img.wide {
  width: 100%;
  height: 5.5rem;
}
.card p { margin: 0; color: var(--ice); font-size: 0.9rem; line-height: 1.4; }
.card ul { font-size: 0.9rem; }

.cast {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}
.cast figure {
  padding: 0.4rem 0.3rem 0.35rem;
}
.cast img {
  height: 4.8rem;
}

.stack {
  display: grid;
  gap: 0.55rem;
  min-height: 0;
}
.stack figure { min-height: 0; }

.bleed {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 42%;
  object-fit: cover;
  opacity: 0.9;
  pointer-events: none;
}
.bleed.dim { inset: 0; height: 100%; opacity: 0.35; }
.veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.55), rgba(10, 14, 24, 0.82));
  pointer-events: none;
}
.center-stack {
  position: relative;
  z-index: 1;
  margin: auto;
  text-align: center;
  max-width: 42rem;
}
.logo {
  width: min(78%, 28rem);
  height: auto;
  image-rendering: pixelated;
}
.kicker {
  margin: 0.7rem 0 0.35rem;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.95rem;
}
.lede {
  margin: 0;
  color: var(--ice);
  font-size: 1rem;
}
.close-box {
  margin-top: 1rem;
  background: var(--panel);
  border-radius: 0.5rem;
  padding: 0.9rem 1rem 1rem;
}
.close-box p { margin: 0; }
.close-box .lede { margin-top: 0.45rem; }
.links { margin-top: 0.85rem !important; }
.links a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 600;
}
.links a:hover { text-decoration: underline; }

#chrome {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.55rem 0 0.15rem;
}
#chrome button {
  appearance: none;
  border: 1px solid #243044;
  background: var(--panel);
  color: var(--white);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
}
#chrome button:hover { border-color: var(--red); }
#dots { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: center; max-width: 18rem; }
#dots button {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: #3a465c;
}
#dots button[aria-current="true"] { background: var(--red); width: 1.1rem; }
#counter {
  color: var(--mute);
  font-size: 0.8rem;
  min-width: 3rem;
  text-align: right;
}
#hint {
  margin: 0;
  text-align: center;
  color: #5d6a80;
  font-size: 0.72rem;
  padding-bottom: 0.35rem;
}

@media (max-width: 820px) {
  #deck { aspect-ratio: auto; max-height: none; min-height: 70vh; }
  .split, .grid-2, .grid-3, .grid-4, .cast {
    grid-template-columns: 1fr 1fr;
  }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .cast { grid-template-columns: repeat(3, 1fr); }
  .flow { flex-wrap: wrap; justify-content: center; }
  .arrow { display: none; }
}
