/* ==========================================================================
   gameflix — cinematic near-black / bone / ember
   No webfonts, no icon fonts, no purple. All motion is opt-out via
   prefers-reduced-motion at the bottom of the file.
   ========================================================================== */

:root {
  --bg: #0b0b0c;
  --bg-2: #101012;
  --bg-3: #151518;
  --panel: rgba(16, 16, 18, 0.94);
  --line: rgba(233, 227, 213, 0.13);
  --line-strong: rgba(233, 227, 213, 0.24);

  --bone: #e9e3d5;
  --bone-dim: rgba(233, 227, 213, 0.68);
  --bone-faint: rgba(233, 227, 213, 0.45);

  --ember: #e0642f;
  --ember-bright: #f2854d;
  --ember-deep: #7c3113;
  --ember-wash: rgba(224, 100, 47, 0.16);

  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --r-sm: 3px;
  --r: 5px;
  --r-lg: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--bone);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body.is-locked,
body.is-player {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--bone-dim);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  color: var(--ember-bright);
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ------------------------------------------------------------------ helpers */

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--bone);
  text-decoration: none;
}

.skip-link:focus {
  top: 14px;
}

.sr-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  flex: none;
}

.labeled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ------------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: linear-gradient(180deg, rgba(11, 11, 12, 0.97), rgba(11, 11, 12, 0.78) 70%, rgba(11, 11, 12, 0));
  backdrop-filter: blur(8px);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--bone);
}

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--ember-bright);
  background: rgba(224, 100, 47, 0.08);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 21, 24, 0.7);
  color: var(--bone-dim);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chip:hover {
  color: var(--bone);
  border-color: var(--line-strong);
}

.topnav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.topnav__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--bone-dim);
  font-size: 13.5px;
}

.topnav__btn:hover {
  color: var(--bone);
  background: rgba(233, 227, 213, 0.06);
}

.topnav__btn[aria-current="true"] {
  color: var(--bone);
  background: rgba(233, 227, 213, 0.08);
  box-shadow: inset 0 -2px 0 var(--ember);
}

.count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ember-wash);
  color: var(--ember-bright);
  font-size: 11px;
  text-align: center;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(280px, 34vw);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(16, 16, 18, 0.8);
  color: var(--bone-faint);
}

.search:focus-within {
  border-color: var(--line-strong);
  color: var(--bone-dim);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--bone);
  font-size: 13.5px;
}

.search input:focus {
  outline: none;
}

.search input::placeholder {
  color: var(--bone-faint);
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search__clear {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(233, 227, 213, 0.1);
  color: var(--bone-dim);
}

/* --------------------------------------------------------------------- hero */

.view {
  padding: 0 clamp(16px, 4vw, 44px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(26px, 5vw, 66px) 0 clamp(20px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
}

.hero__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ember-bright);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero__kicker::after {
  content: "";
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, var(--ember-deep), transparent);
}

.hero__title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  font-weight: 400;
}

.hero__meta {
  margin-top: 10px;
  color: var(--bone-faint);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.hero__logline {
  margin-top: 18px;
  max-width: 46ch;
  font-family: var(--font-display);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.4;
  color: var(--bone);
}

.hero__synopsis {
  margin-top: 12px;
  max-width: 58ch;
  color: var(--bone-dim);
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero__art {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero__plate-note {
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.72);
  color: var(--bone-dim);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------- art */

.art {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-3);
}

.art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--art-pos, 50% 50%);
}

.art--ember img {
  filter: saturate(1.06) contrast(1.06) brightness(0.92);
}

.art--ember::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(124, 49, 19, 0.34), rgba(11, 11, 12, 0.1) 55%, rgba(11, 11, 12, 0.62));
  mix-blend-mode: multiply;
}

.art--cold img {
  filter: saturate(0.5) contrast(1.12) brightness(0.82);
}

.art--cold::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(19, 28, 40, 0.6), rgba(11, 11, 12, 0.55));
  mix-blend-mode: multiply;
}

.art--bone img {
  filter: grayscale(0.86) contrast(1.04) brightness(0.9);
}

.art--bone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(233, 227, 213, 0.1), rgba(11, 11, 12, 0.6));
  mix-blend-mode: multiply;
}

/* shared bottom scrim used by cards and the hero plate */
.card__grade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 12, 0) 38%, rgba(11, 11, 12, 0.82) 88%, rgba(11, 11, 12, 0.95));
  pointer-events: none;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: rgba(233, 227, 213, 0.07);
  color: var(--bone);
  font-size: 13.5px;
  letter-spacing: 0.01em;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}

.btn:hover {
  background: rgba(233, 227, 213, 0.12);
  border-color: var(--bone-faint);
}

.btn:active {
  transform: translateY(1px);
}

.btn--lg {
  padding: 12px 20px;
  font-size: 14.5px;
}

.btn--tiny {
  padding: 5px 10px;
  font-size: 12px;
  gap: 6px;
}

.btn--primary {
  border-color: var(--ember);
  background: var(--ember);
  color: #140b07;
  font-weight: 600;
}

.btn--primary:hover {
  border-color: var(--ember-bright);
  background: var(--ember-bright);
}

.btn--take {
  border-color: var(--ember-deep);
  background: rgba(224, 100, 47, 0.14);
  color: var(--ember-bright);
}

.btn--take:hover {
  background: rgba(224, 100, 47, 0.22);
  border-color: var(--ember);
}

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--bone-dim);
}

.btn--ghost:hover {
  color: var(--bone);
  border-color: var(--line-strong);
  background: rgba(233, 227, 213, 0.05);
}

.btn--ghost[aria-pressed="true"] {
  color: var(--bone);
  border-color: var(--line-strong);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--bone-dim);
  transition: color 140ms var(--ease), background 140ms var(--ease), border-color 140ms var(--ease);
}

.icon-btn:hover {
  color: var(--bone);
  background: rgba(233, 227, 213, 0.1);
}

.icon-btn:disabled {
  color: rgba(233, 227, 213, 0.2);
  background: transparent;
  cursor: not-allowed;
}

.icon-btn--lg {
  width: 46px;
  height: 46px;
  border-color: var(--line);
}

.icon-btn[aria-pressed="true"] {
  color: var(--ember-bright);
  border-color: var(--ember-deep);
  background: var(--ember-wash);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--bone-dim);
  font-size: 12.5px;
  text-decoration: underline;
  text-decoration-color: rgba(233, 227, 213, 0.28);
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--bone);
}

/* ------------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.62);
  color: var(--bone-dim);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge--interactive {
  border-color: rgba(224, 100, 47, 0.5);
  background: var(--ember-wash);
  color: var(--ember-bright);
}

.badge--list {
  border-color: rgba(233, 227, 213, 0.28);
  color: var(--bone);
}

/* -------------------------------------------------------------------- rails */

.rails {
  display: grid;
  gap: clamp(26px, 3.4vw, 42px);
  padding: clamp(26px, 3.4vw, 44px) 0 60px;
}

.rail__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
}

.rail__title {
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone);
  font-weight: 500;
}

.rail__note {
  color: var(--bone-faint);
  font-size: 12px;
}

.rail__body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rail__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.rail__track::-webkit-scrollbar {
  display: none;
}

.rail__nav {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(16, 16, 18, 0.9);
  color: var(--bone-dim);
}

.rail__nav:hover {
  color: var(--bone);
  border-color: var(--line-strong);
}

.rail__nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.card {
  flex: none;
  width: clamp(216px, 21vw, 288px);
  scroll-snap-align: start;
}

.card__hit {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  overflow: hidden;
  text-align: left;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.card__hit:hover,
.card__hit:focus-visible {
  border-color: var(--ember);
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
}

.card__art {
  display: block;
  aspect-ratio: 16 / 10;
}

.card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.card__copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 3px;
  padding: 12px 14px 14px;
}

.card__title {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.15;
}

.card__meta {
  color: var(--bone-faint);
  font-size: 11.5px;
  letter-spacing: 0.05em;
}

.card__synopsis {
  display: none;
  color: var(--bone-dim);
  font-size: 12.5px;
  line-height: 1.45;
  max-height: 3.6em;
  overflow: hidden;
}

.card__hit:hover .card__synopsis,
.card__hit:focus-visible .card__synopsis {
  display: block;
}

/* -------------------------------------------------------------------- empty */

.empty {
  padding: 60px 0 90px;
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.empty__title {
  font-family: var(--font-display);
  font-size: 22px;
}

.empty__text {
  color: var(--bone-dim);
  max-width: 42ch;
}

/* ------------------------------------------------------------------- player */

.view--player {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 0;
  background: var(--bg);
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.stage__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05) brightness(0.72);
  transform-origin: 56% 44%;
}

.stage[data-kb="a"] .stage__art {
  animation: drift-a 30s var(--ease) infinite alternate;
}

.stage[data-kb="b"] .stage__art {
  animation: drift-b 26s var(--ease) infinite alternate;
}

.stage[data-kb="c"] .stage__art {
  animation: drift-c 34s var(--ease) infinite alternate;
}

.stage[data-kb="still"] .stage__art {
  animation: none;
}

.stage__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 42%, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(180deg, rgba(11, 11, 12, 0.55), rgba(11, 11, 12, 0) 26%, rgba(11, 11, 12, 0) 52%, rgba(11, 11, 12, 0.88));
}

.stage__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(124, 49, 19, 0.16), transparent 45%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.stage__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: clamp(12px, 2vw, 22px) clamp(14px, 3vw, 30px);
}

.stage__titles {
  min-width: 0;
}

.stage__series {
  color: var(--bone-faint);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage__episode {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 400;
  line-height: 1.1;
}

.mode {
  margin-left: auto;
  display: flex;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(11, 11, 12, 0.72);
  backdrop-filter: blur(6px);
}

.mode__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--bone-dim);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.mode__btn:hover {
  color: var(--bone);
}

.mode__btn[aria-pressed="true"] {
  background: rgba(233, 227, 213, 0.1);
  color: var(--bone);
}

.mode__btn--take[aria-pressed="true"] {
  background: var(--ember);
  color: #140b07;
  font-weight: 600;
}

.stage__chapter {
  position: absolute;
  top: clamp(74px, 10vw, 104px);
  left: clamp(14px, 3vw, 30px);
  z-index: 5;
  padding: 5px 10px;
  border-left: 2px solid var(--ember);
  background: rgba(11, 11, 12, 0.5);
  color: var(--bone-dim);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------- captions */

.captions {
  position: absolute;
  left: 50%;
  bottom: clamp(126px, 17vh, 176px);
  z-index: 5;
  transform: translateX(-50%);
  width: min(78ch, 86vw);
  text-align: center;
  pointer-events: none;
}

.captions--off .caption {
  display: none;
}

.caption {
  display: grid;
  gap: 6px;
  justify-items: center;
  animation: caption-in 320ms var(--ease);
}

.caption__who {
  color: var(--ember-bright);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.caption__text {
  font-family: var(--font-display);
  font-size: clamp(17px, 2.1vw, 24px);
  line-height: 1.36;
  color: var(--bone);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.9);
}

.caption--scene .caption__text {
  font-size: clamp(14px, 1.6vw, 17px);
  letter-spacing: 0.05em;
  color: var(--bone-dim);
}

@keyframes caption-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------- hint */

.hint {
  position: absolute;
  left: 50%;
  bottom: clamp(190px, 26vh, 250px);
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 9px 9px 16px;
  border: 1px solid rgba(224, 100, 47, 0.45);
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.86);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}

.hint p {
  color: var(--ember-bright);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------------ choices */

.choices {
  position: absolute;
  left: 50%;
  bottom: clamp(112px, 15vh, 160px);
  transform: translateX(-50%);
  z-index: 8;
  width: min(880px, 92vw);
  padding: clamp(16px, 2.4vw, 26px);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--ember);
  border-radius: var(--r-lg);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: rise 260ms var(--ease);
}

.choices__kicker {
  color: var(--ember-bright);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.choices__prompt {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.3vw, 25px);
  line-height: 1.24;
}

.choices__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  border-radius: var(--r);
  background: rgba(233, 227, 213, 0.04);
  text-align: left;
  transition: border-color 150ms var(--ease), background 150ms var(--ease), transform 150ms var(--ease);
}

.choice:hover,
.choice:focus-visible {
  border-color: var(--ember);
  border-left-color: var(--ember);
  background: var(--ember-wash);
  transform: translateY(-2px);
}

.choice__index {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ember-bright);
  font-size: 12.5px;
}

.choice__body {
  display: grid;
  gap: 4px;
}

.choice__label {
  font-family: var(--font-display);
  font-size: 17.5px;
  line-height: 1.2;
}

.choice__sub {
  color: var(--bone-dim);
  font-size: 12.5px;
  line-height: 1.45;
}

.choices__defer {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bone-faint);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.choices__defer:hover {
  color: var(--bone-dim);
}

/* ------------------------------------------------------------------ endings */

.ending {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 40px);
  background: rgba(11, 11, 12, 0.82);
  backdrop-filter: blur(6px);
}

.ending__card {
  width: min(620px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--ember);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: rise 300ms var(--ease);
}

.ending__kicker {
  color: var(--ember-bright);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.ending__name {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.06;
}

.ending__tagline {
  margin-top: 10px;
  color: var(--bone);
  font-size: 14.5px;
}

.ending__blurb {
  margin-top: 12px;
  color: var(--bone-dim);
  font-size: 13.5px;
}

.ending__path {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ending__path-title {
  color: var(--bone-faint);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ending__score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--ember-bright);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ending__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* --------------------------------------------------------------- story path */

.path {
  position: absolute;
  top: clamp(70px, 9vw, 96px);
  right: clamp(12px, 2.4vw, 26px);
  bottom: clamp(120px, 17vh, 168px);
  z-index: 7;
  width: min(320px, 84vw);
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: slide-in 240ms var(--ease);
}

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

.path__head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone);
}

.path__list {
  margin-top: 14px;
  overflow-y: auto;
  display: grid;
  gap: 2px;
  padding-right: 4px;
}

.path__row {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border-left: 2px solid var(--line);
}

.path__row.is-current {
  border-left-color: var(--ember);
  background: rgba(233, 227, 213, 0.05);
}

.path__row.is-upcoming {
  opacity: 0.5;
  border-left-color: transparent;
}

.path__scene {
  color: var(--bone);
  font-size: 12.5px;
  line-height: 1.35;
}

.path__row.is-upcoming .path__scene {
  color: var(--bone-faint);
}

.path__choice {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(224, 100, 47, 0.5);
  border-radius: 999px;
  color: var(--ember-bright);
  font-size: 11.5px;
}

.path__choice--auto {
  border-color: var(--line-strong);
  color: var(--bone-dim);
}

.path__auto {
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(233, 227, 213, 0.12);
  color: var(--bone-faint);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.path__legend {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ----------------------------------------------------------------- controls */

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: 0 clamp(14px, 3vw, 30px) clamp(12px, 2vw, 20px);
}

.progress {
  position: relative;
  padding: 12px 0;
  cursor: pointer;
}

.progress__track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(233, 227, 213, 0.18);
  overflow: visible;
}

.progress__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ember);
  box-shadow: 0 0 12px rgba(224, 100, 47, 0.5);
}

.progress:hover .progress__track,
.progress:focus-visible .progress__track {
  height: 6px;
}

.mark {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 12px;
  transform: translate(-50%, -50%);
  background: rgba(233, 227, 213, 0.55);
  border-radius: 1px;
}

.mark--decision {
  width: 9px;
  height: 9px;
  background: var(--ember-bright);
  border: 1px solid rgba(11, 11, 12, 0.8);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 8px rgba(224, 100, 47, 0.6);
}

.controls__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.controls__time {
  margin-left: 8px;
  color: var(--bone-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.controls__spacer {
  flex: 1;
}

.controls__keys {
  margin-top: 8px;
  color: rgba(233, 227, 213, 0.3);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

/* -------------------------------------------------------------------- sheet */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 34px);
  background: rgba(5, 5, 6, 0.76);
  backdrop-filter: blur(4px);
}

.sheet__panel {
  position: relative;
  width: min(940px, 100%);
  max-height: 92vh;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 240ms var(--ease);
}

.sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgba(11, 11, 12, 0.8);
  border-color: var(--line);
}

.sheet__scroll {
  max-height: 92vh;
  overflow-y: auto;
}

.sheet__panel > .sheet__scroll {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.sheet__art {
  position: relative;
  min-height: 300px;
}

.sheet__plate {
  position: absolute;
  inset: 0;
}

.sheet__body {
  padding: clamp(20px, 3vw, 34px);
  display: grid;
  gap: 12px;
  align-content: start;
}

.sheet__kicker {
  color: var(--bone-faint);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sheet__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.04;
  font-weight: 400;
}

.sheet__tagline {
  color: var(--ember-bright);
  font-size: 14px;
}

.sheet__synopsis {
  color: var(--bone-dim);
  max-width: 56ch;
}

.sheet__status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--bone-dim);
  font-size: 12.5px;
}

.sheet__status--live {
  border-color: rgba(224, 100, 47, 0.45);
  background: var(--ember-wash);
  color: var(--ember-bright);
}

.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.sheet__subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--bone);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.endings__list {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.endings__item {
  display: grid;
  grid-template-columns: 20px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--bone-faint);
}

.endings__item.is-unlocked {
  border-color: rgba(224, 100, 47, 0.4);
  color: var(--bone);
}

.endings__mark {
  grid-row: span 2;
  color: var(--bone-faint);
}

.endings__item.is-unlocked .endings__mark {
  color: var(--ember-bright);
}

.endings__name {
  font-family: var(--font-display);
  font-size: 15.5px;
}

.endings__tease {
  font-size: 12px;
}

.episodes__list {
  margin-top: 10px;
  display: grid;
}

.episode {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 11px;
  border-top: 1px solid var(--line);
}

.episode--live {
  border-left: 2px solid var(--ember);
  background: rgba(224, 100, 47, 0.07);
}

.episode__num {
  color: var(--bone-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.episode__body {
  flex: 1;
  display: grid;
  gap: 2px;
}

.episode__title {
  font-size: 14.5px;
}

.episode__meta {
  color: var(--bone-faint);
  font-size: 11.5px;
}

.episode__locked {
  color: rgba(233, 227, 213, 0.28);
}

/* -------------------------------------------------------------------- about */

.about {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 34px);
  background: rgba(5, 5, 6, 0.78);
  backdrop-filter: blur(4px);
}

.about__panel {
  position: relative;
  width: min(820px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--ember);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  box-shadow: var(--shadow);
  animation: rise 240ms var(--ease);
}

.about__close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.about__kicker {
  color: var(--ember-bright);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.about__panel h2 {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
}

.about__grid {
  margin-top: 20px;
  display: grid;
  gap: 18px;
}

.about__grid dt {
  color: var(--bone);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.about__grid dd {
  margin: 0;
  color: var(--bone-dim);
  font-size: 13.5px;
}

.about__fine {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--bone-faint);
  font-size: 12px;
}

/* ------------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  left: clamp(14px, 3vw, 30px);
  bottom: clamp(14px, 3vw, 26px);
  z-index: 70;
  display: grid;
  gap: 8px;
  max-width: min(420px, 88vw);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--bone-faint);
  border-radius: var(--r);
  background: var(--panel);
  backdrop-filter: blur(8px);
  color: var(--bone);
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: rise 220ms var(--ease);
}

.toast--player {
  border-left-color: var(--ember);
}

.toast--auto {
  border-left-color: var(--line-strong);
  color: var(--bone-dim);
}

.toast .icon {
  color: var(--ember-bright);
  margin-top: 1px;
}

/* --------------------------------------------------------------------- foot */

.foot {
  display: grid;
  gap: 12px;
  padding: 26px clamp(16px, 4vw, 44px) 40px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.foot__note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 90ch;
  color: var(--bone-faint);
  font-size: 12px;
}

.foot__note .icon {
  margin-top: 2px;
  color: var(--ember);
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.foot__year {
  margin-left: auto;
  color: rgba(233, 227, 213, 0.3);
  font-size: 11.5px;
}

/* --------------------------------------------------------------- animations */

@keyframes drift-a {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.12) translate3d(-1.6%, 1%, 0);
  }
}

@keyframes drift-b {
  from {
    transform: scale(1.1) translate3d(1.4%, -1%, 0);
  }
  to {
    transform: scale(1.03) translate3d(-1%, 0.6%, 0);
  }
}

@keyframes drift-c {
  from {
    transform: scale(1.02) translate3d(0, 0.6%, 0);
  }
  to {
    transform: scale(1.14) translate3d(0.8%, -1.2%, 0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .topnav {
    gap: 0;
  }
  .topnav__label {
    display: none;
  }
  .topnav__btn {
    padding: 8px 10px;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero__art {
    aspect-ratio: 16 / 9;
    order: -1;
  }
  .sheet__panel > .sheet__scroll {
    grid-template-columns: 1fr;
  }
  .sheet__art {
    min-height: 200px;
  }
}

@media (max-width: 720px) {
  .choices__list {
    grid-template-columns: 1fr;
  }
  .path {
    top: auto;
    bottom: clamp(150px, 22vh, 200px);
    right: 50%;
    transform: translateX(50%);
    max-height: 46vh;
  }
  .controls__keys {
    display: none;
  }
  .stage__chapter {
    display: none;
  }
  .captions {
    bottom: clamp(140px, 22vh, 190px);
  }
  .search {
    display: none;
  }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .stage__art {
    transform: none !important;
  }

  .card__hit:hover,
  .card__hit:focus-visible,
  .choice:hover,
  .choice:focus-visible {
    transform: none;
  }

  .rail__track {
    scroll-behavior: auto;
  }

  .caption {
    animation: none;
  }
}
