/* Campaign features: registration progress, story map/player, share picker */

/* ---- Registration progress bar ---- */
.prereg-progress { margin-top: 22px; max-width: 480px; width: 100%; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.progress-count strong { color: var(--carrot-2); font-family: var(--font-pixel); font-size: 14px; }
.progress-track { position: relative; height: 16px; background: #000; border: 2px solid var(--pink); overflow: visible; margin-top: 6px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--carrot), var(--carrot-2)); transition: width .6s ease; }
.progress-milestones { position: absolute; inset: 0; pointer-events: none; }
.milestone {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--disabled); border-radius: 50%;
  color: var(--disabled); pointer-events: auto;
}
.milestone svg { width: 12px; height: 12px; }
.milestone.is-unlocked { border-color: var(--carrot-2); color: var(--carrot-2); box-shadow: 0 0 10px rgba(255, 211, 106, .65); }
.progress-hint { margin-top: 18px; font-size: 13px; color: var(--muted); }
.progress-hint strong {
  color: var(--pink-2);
  font-size: 1.55em;
  font-weight: 900;
  font-family: var(--font-pixel);
  letter-spacing: 0.02em;
}

/* ---- Language switcher (scalable dropdown) ---- */
.lang {
  position: relative;
  flex: none;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--pink);
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.lang-toggle:hover,
.lang.is-open .lang-toggle {
  background: rgba(255, 61, 180, 0.12);
  color: var(--pink-2);
}
.lang-caret {
  font-size: 14px;
  line-height: 1;
  color: var(--carrot-2);
  transition: transform 0.15s steps(2);
}
.lang.is-open .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: max(100%, 148px);
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--card, #100c14);
  border: 2px solid var(--pink);
  box-shadow: 4px 4px 0 #000;
}
.lang-menu[hidden] { display: none; }
.lang-menu a,
.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 1px solid var(--line, rgba(255, 247, 251, 0.12));
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.lang-menu li:last-child a,
.lang-menu li:last-child button { border-bottom: 0; }
.lang-menu a:hover,
.lang-menu button:hover:not(:disabled) {
  background: rgba(255, 61, 180, 0.12);
  color: var(--pink-2);
}
.lang-menu a.active {
  background: var(--pink);
  color: #14010c;
}
.lang-menu button:disabled {
  color: var(--disabled);
  cursor: not-allowed;
}
.lang-soon {
  font-family: var(--font-pixel);
  font-size: 7px;
  letter-spacing: 0.04em;
  color: var(--carrot-2);
  opacity: 0.85;
}
.lang-menu button:disabled .lang-soon { color: var(--disabled); }

/* ---- Nav right cluster (equal gaps on desktop) ---- */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
/* Flatten so Pre-Register / $CARROT / Story / Share / Lang share one gap */
.nav-links {
  display: contents;
  margin-left: 0;
}
.nav-right > .share-btn { order: 1; }
.nav-links .lang { order: 2; }
.nav-right > .nav-toggle { order: 3; }

.story-btn,
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--pink);
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.story-btn svg,
.share-btn svg { width: 14px; height: 14px; color: var(--carrot-2); flex: none; }
.story-btn:hover,
.share-btn:hover { background: rgba(255, 61, 180, 0.12); color: var(--pink-2); }

/* Desktop / web nav CTAs */
a.nav-prereg {
  display: inline-flex;
  align-items: center;
  background: var(--pink);
  color: #14010c;
  border: 2px solid var(--pink);
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
a.nav-prereg:hover,
.nav-links a.nav-prereg:hover {
  background: var(--pink-2);
  color: #14010c;
  border-color: var(--pink-2);
}

a.nav-carrot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--pink);
  padding: 6px 10px 6px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
a.nav-carrot img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: none;
}
a.nav-carrot:hover,
.nav-links a.nav-carrot:hover {
  background: rgba(255, 61, 180, 0.12);
  color: var(--pink-2);
}
@media (max-width: 860px) {
  .nav-inner {
    position: relative;
    flex-wrap: nowrap;
  }
  .nav-right {
    flex: 1;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    position: static;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    order: unset;
    margin: 0;
    padding: 14px 12px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    background:
      radial-gradient(120% 90% at 0% 0%, rgba(255, 61, 180, 0.26), transparent 55%),
      radial-gradient(90% 70% at 100% 100%, rgba(255, 122, 26, 0.1), transparent 50%),
      var(--card, #100c14);
    border: 3px solid var(--pink);
    box-shadow:
      0 0 0 3px #000,
      7px 7px 0 3px rgba(0, 0, 0, 0.85),
      0 18px 42px rgba(255, 61, 180, 0.22);
  }
  .nav-links.is-open {
    display: flex;
    animation: nav-drawer-in 0.22s ease;
  }
  @keyframes nav-drawer-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @media (prefers-reduced-motion: reduce) {
    .nav-links.is-open { animation: none; }
  }
  .nav-links::before {
    content: "MENU";
    display: block;
    width: fit-content;
    margin: 0 4px 8px;
    padding: 4px 8px;
    font-family: var(--font-pixel);
    font-size: 9px;
    letter-spacing: 0.12em;
    color: #14010c;
    background: var(--carrot-2);
    box-shadow: 2px 2px 0 #000;
  }
  .nav-links .lang { order: unset; }
  .nav-right > .share-btn { order: 1; }
  .nav-right > .nav-toggle { order: 2; }

  .nav-links > a,
  .nav-links > .story-btn {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 13px 14px;
    border: 2px solid rgba(255, 247, 251, 0.1);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    justify-content: flex-start;
    cursor: pointer;
  }
  .nav-links > a:hover,
  .nav-links > .story-btn:hover,
  .nav-links > a:focus-visible,
  .nav-links > .story-btn:focus-visible {
    border-color: var(--pink);
    background: rgba(255, 61, 180, 0.14);
    color: var(--pink-2);
    outline: none;
  }
  .nav-links > .story-btn svg {
    width: 16px;
    height: 16px;
    color: var(--carrot-2);
    flex: none;
  }
  .nav-links > a.nav-prereg {
    background: var(--pink);
    color: #14010c;
    border-color: var(--pink);
  }
  .nav-links > a.nav-prereg:hover,
  .nav-links > a.nav-prereg:focus-visible {
    background: var(--pink-2);
    color: #14010c;
    border-color: var(--pink-2);
  }
  .nav-links > a.nav-carrot {
    border-color: var(--pink);
  }
  .nav-links > a.nav-carrot img {
    width: 18px;
    height: 18px;
  }

  /* Share: same box as hamburger, icon only */
  .nav-right > .share-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    box-sizing: border-box;
  }
  .nav-right > .share-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .nav-right > .share-btn svg {
    width: 18px;
    height: 18px;
  }

  .nav-links .lang {
    margin-top: 6px;
    width: 100%;
    align-self: stretch;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 61, 180, 0.35);
  }
  .nav-links .lang-toggle {
    width: 100%;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 13px;
  }
  .nav-links .lang-menu {
    left: 0;
    right: 0;
    min-width: 100%;
    top: calc(100% + 4px);
  }

  /* Dim page while menu is open */
  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(5, 3, 8, 0.55);
    backdrop-filter: blur(2px);
  }
  body.nav-open .nav {
    z-index: 70;
  }
}

/* ---- Modal shell (share picker only; no pre-reg modal) ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5,3,8,.82); backdrop-filter: blur(4px);
  display: grid; place-items: center; z-index: 100; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative; width: min(460px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--card); border: 2px solid var(--pink); box-shadow: var(--shadow); padding: 32px 26px 26px;
}
.modal-close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
  background: transparent; border: 2px solid var(--pink); color: var(--pink-2);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.modal-close:hover { background: rgba(255, 61, 180, 0.12); }
.modal-badge {
  display: inline-block; font-family: var(--font-pixel); font-size: 10px; letter-spacing: .1em;
  color: #14010c; background: var(--carrot-2); padding: 5px 8px; margin-bottom: 14px;
}

/* ---- Share picker ---- */
.share-modal { width: min(1000px, 100%); }
.share-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas: "preview ." "preview head" "preview side" "preview .";
  column-gap: 32px; align-items: start;
}
.share-head { grid-area: head; padding-right: 40px; }
.share-head h2 { margin-bottom: 14px; }
.share-preview {
  grid-area: preview; position: relative; margin: 0 9px 9px 0; background: #000;
  border: 3px solid var(--text);
  box-shadow: 0 0 0 3px #000, 9px 9px 0 3px rgba(0, 0, 0, 0.85), 0 0 60px rgba(255, 61, 180, 0.35);
  touch-action: pan-y;
}
.share-preview img {
  display: block; height: min(580px, calc(90vh - 90px)); width: auto; max-width: none;
  aspect-ratio: 4 / 5; object-fit: cover; user-select: none; -webkit-user-drag: none;
}
.share-preview::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px var(--pink);
}
.share-preview-tag {
  position: absolute; top: 12px; left: 12px; z-index: 1; background: var(--pink); color: #14010c;
  font-size: 13px; font-weight: 900; letter-spacing: 0.06em; padding: 4px 10px; box-shadow: 3px 3px 0 #000;
}
.share-preview.is-popping { animation: share-pop .38s cubic-bezier(.2, .9, .3, 1.25); }
@keyframes share-pop { from { transform: scale(0.93); opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .share-preview.is-popping { animation: none; } }
.share-side { grid-area: side; display: grid; gap: 14px; min-width: 0; }
.share-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px; padding-top: 8px; }
.share-pick { position: relative; display: grid; gap: 6px; text-align: center; cursor: pointer; }
.share-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.share-pick-img {
  position: relative; display: block; aspect-ratio: 4 / 5; background: #000; border: 3px solid var(--line);
  box-shadow: 3px 3px 0 #000; opacity: 0.55; transition: transform .15s steps(3), opacity .15s;
}
.share-pick-img img { width: 100%; height: 100%; object-fit: cover; }
.share-pick:hover .share-pick-img { opacity: 0.85; transform: translateY(-3px); }
.share-pick input:checked ~ .share-pick-img {
  opacity: 1; border-color: var(--pink); box-shadow: 3px 3px 0 #000, 0 0 16px rgba(255, 61, 180, 0.5);
}
.share-pick input:focus-visible ~ .share-pick-img { outline: 2px solid var(--carrot-2); outline-offset: 3px; }
.share-pick-check {
  position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; display: none; place-items: center;
  background: var(--pink); color: #14010c; box-shadow: 2px 2px 0 #000;
}
.share-pick-check svg { width: 12px; height: 12px; }
.share-pick input:checked ~ .share-pick-img .share-pick-check { display: grid; }
.share-pick-label { font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-pick input:checked ~ .share-pick-label { color: var(--pink-2); }
.share-copy { padding: 14px; border: 2px solid var(--line); background: rgba(0, 0, 0, 0.28); }
.share-copy-label { margin-bottom: 6px; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.share-text { font-size: 15px; line-height: 1.75; color: #f3e6ef; }
.share-link { margin-top: 8px; font-size: 12px; color: #7dffd2; overflow-wrap: anywhere; }
.share-cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.share-cta svg { width: 16px; height: 16px; }
.share-more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-more button {
  background: transparent; color: var(--pink-2); border: 2px solid var(--pink);
  font-size: 14px; font-weight: 800; padding: 10px 8px; cursor: pointer;
}
.share-more button:hover { background: rgba(255, 61, 180, 0.12); }
.share-status { font-size: 13px; font-weight: 700; line-height: 1.5; color: #7dffd2; }
.share-status:empty { margin-top: -14px; }
.share-status.is-err { color: #ff6b72; }
@media (max-width: 899px) {
  .share-modal { width: min(520px, 100%); }
  .share-layout {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
    grid-template-areas: "head" "preview" "side";
  }
  .share-preview { justify-self: center; width: min(calc(100% - 9px), 48vh * 0.8); margin-bottom: 20px; }
  .share-preview img { width: 100%; height: auto; max-width: 100%; }
  .share-go-bar {
    position: sticky; bottom: -18px; z-index: 2; margin: -16px -18px -18px; padding: 16px 18px 18px;
    background: linear-gradient(rgba(16, 12, 20, 0), var(--card) 14px);
  }
}
@media (max-width: 720px) {
  .share-overlay { padding: 12px; }
  .share-modal { padding: 30px 18px 18px; max-height: calc(100dvh - 24px); }
}
@media (max-width: 480px) {
  .share-picks { gap: 8px; }
  .share-pick-label { display: none; }
  .share-pick-check { top: -7px; right: -7px; width: 18px; height: 18px; }
  .share-pick-check svg { width: 10px; height: 10px; }
}

/* ---- Story map ---- */
.story-head, .sticker-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.story-head h3, .sticker-head h3 { font-size: 26px; line-height: 1.35; margin-bottom: 6px; }
.story-head p, .sticker-head p { color: var(--muted); font-size: 15px; }
.story-count, .sticker-count { font-size: 13px; font-weight: 800; color: var(--carrot-2); border: 2px solid var(--carrot-2); padding: 6px 10px; white-space: nowrap; }

/* ---- Sticker packs ---- */
.sticker-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; margin-top: 30px; }
.sticker-preview { position: relative; margin: 0 9px 9px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 26px 14px 14px; background: #000; border: 3px solid var(--text); box-shadow: 0 0 0 3px #000, 9px 9px 0 3px rgba(0, 0, 0, 0.85), 0 0 50px rgba(255, 61, 180, 0.25); }
.sticker-preview::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px var(--pink); }
.sticker-preview img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.sticker-preview.is-popping { animation: share-pop .38s cubic-bezier(.2, .9, .3, 1.25); }
.sticker-tag { position: absolute; top: -14px; left: 14px; z-index: 1; background: var(--pink); color: #14010c; font-size: 13px; font-weight: 900; letter-spacing: 0.04em; padding: 4px 10px; box-shadow: 3px 3px 0 #000; }
.sticker-side { display: grid; gap: 14px; min-width: 0; }
.sticker-label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.sticker-langs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.sticker-lang { position: relative; cursor: pointer; }
.sticker-lang input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sticker-lang span { display: block; padding: 7px 11px; background: #07050a; border: 2px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.sticker-lang:hover span { border-color: var(--pink); color: var(--text); }
.sticker-lang input:checked + span { background: var(--pink); border-color: var(--pink); color: #14010c; box-shadow: 3px 3px 0 #000; }
.sticker-lang input:focus-visible + span { outline: 2px solid var(--carrot-2); outline-offset: 3px; }
.sticker-go { display: flex; justify-content: center; text-align: center; text-decoration: none; }
.sticker-note { font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .sticker-preview.is-popping { animation: none; } }
@media (max-width: 860px) { .sticker-body { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 480px) {
  .sticker-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 24px 10px 10px; }
  .sticker-preview img:nth-of-type(n+7) { display: none; }
}

.story-map { position: relative; margin-top: 30px; padding-top: 44px; }
.story-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.story-path path { fill: none; stroke-width: 4; stroke-linecap: square; }
.story-path .path-all { stroke: var(--disabled); stroke-dasharray: 8 8; }
.story-path .path-lit { stroke: var(--carrot-2); }
.story-nodes { position: relative; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.story-node { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.story-node:nth-child(even) { margin-top: 110px; }
.story-tile {
  position: relative; flex: none; width: 92px; height: 92px; display: grid; place-items: center;
  background: #07050a center / cover no-repeat; border: 3px solid var(--carrot-2);
  box-shadow: 4px 4px 0 #000, 0 0 22px rgba(255, 211, 106, 0.4); transition: transform .15s steps(3);
}
button.story-tile { padding: 0; cursor: pointer; }
button.story-tile:hover,
.story-node:has(.story-node-cta:hover) .story-tile { transform: translateY(-4px); }
.story-node.is-locked .story-tile {
  border: 3px dashed var(--disabled); box-shadow: 4px 4px 0 #000; color: var(--disabled);
  background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255, 255, 255, 0.03) 6px 12px);
}
.story-tile-num {
  position: absolute; top: -12px; left: -12px; font-family: var(--font-pixel); font-size: 9px;
  background: var(--carrot-2); color: #14010c; padding: 4px 5px;
}
.story-node.is-locked .story-tile-num { background: var(--disabled); }
.story-lock { width: 30px; height: 30px; }
.story-bunny {
  position: absolute; left: 50%; bottom: calc(100% + 8px); width: 30px; height: 30px; margin-left: -15px;
  filter: drop-shadow(2px 2px 0 #000); animation: bunny-hop .9s steps(2) infinite;
}
@keyframes bunny-hop { 50% { transform: translateY(-6px); } }
.story-node-info { display: grid; gap: 4px; justify-items: center; }
.story-node-info small { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.story-node-info b { font-size: 15px; line-height: 1.35; }
.story-node.is-locked .story-node-info b { color: var(--disabled); }
.story-node-actions { display: grid; gap: 8px; margin-top: 6px; }
.story-node-cta {
  background: var(--pink); color: #14010c; border: 0; font-size: 13px; font-weight: 900;
  padding: 7px 14px; cursor: pointer; box-shadow: 3px 3px 0 #000;
}
.story-node-cta:hover { background: var(--pink-2); }
.story-node-read {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(0, 0, 0, 0.35); color: var(--text); border: 2px solid rgba(255, 255, 255, 0.28);
  font-size: 12px; font-weight: 800; padding: 5px 12px; cursor: pointer;
}
.story-node-read svg { width: 12px; height: 12px; color: var(--carrot-2); }
.story-node-read:hover { border-color: var(--pink); color: var(--pink-2); }
.story-tbc { font-family: var(--font-pixel); font-size: 8px; line-height: 1.6; letter-spacing: 0.06em; color: var(--pink-2); }

/* ---- Story player ---- */
.player {
  position: fixed; inset: 0; z-index: 200; overflow: hidden; background: #000; color: var(--text);
  outline: none; user-select: none; -webkit-user-select: none;
}
.player[hidden] { display: none; }
.player-stage { position: absolute; inset: 0; cursor: pointer; }
.player-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.16) 3px 4px);
}
.player-screen { position: absolute; inset: 0; }
.player-screen img,
.player-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-screen [hidden] { display: none; }
.player-fade { position: absolute; inset: 0; z-index: 1; background: #000; opacity: 0; pointer-events: none; transition: opacity .25s, background-color .25s; }
.player-stage.is-fading .player-fade { opacity: 1; }
/* Last-scene video ended: fade solid #101010 over the clip immediately (before end-card click) */
.player-stage.is-ending .player-fade {
  background: #101010;
  opacity: 1;
  transition: opacity 0.8s ease, background-color 0.8s ease;
}
@media (prefers-reduced-motion: reduce) {
  .player-stage.is-ending .player-fade { transition: none; }
}
@media not all and (min-aspect-ratio: 3/2) {
  .player-screen img,
  .player-screen video { right: auto; width: auto; max-width: none; aspect-ratio: 16 / 9; will-change: transform; }
}
.player-card {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center;
  gap: 12px; padding: 72px 20px; text-align: center; background: rgba(5, 3, 8, 0.5); cursor: default;
}
/* End card: solid #101010 (veil may already be fading from video end); title card stays translucent */
.player-card.is-end {
  background: #101010;
  animation: player-end-bg 0.8s ease;
}
@keyframes player-end-bg {
  from { background-color: transparent; }
  to { background-color: #101010; }
}
@media (prefers-reduced-motion: reduce) {
  .player-card.is-end { animation: none; }
}
/* Skip card fade when the stage veil already finished the transition */
.player-stage.is-ending .player-card.is-end {
  animation: none;
}
.player-card[hidden] { display: none; }
.player-card-kicker { font-size: 14px; font-weight: 800; letter-spacing: 0.2em; color: var(--carrot-2); text-shadow: 2px 2px 0 #000; }
.player-card h2 { font-size: clamp(30px, 6vw, 56px); line-height: 1.2; text-shadow: 4px 4px 0 #000; }
.player-card-hint {
  margin-top: 14px; font-family: var(--font-pixel); font-size: 11px; color: var(--pink-2);
  text-shadow: 2px 2px 0 #000; animation: blink 1s steps(2) infinite;
}
.player-card-tbc { font-family: var(--font-pixel); font-size: clamp(16px, 3.4vw, 30px); line-height: 1.5; color: var(--pink-2); text-shadow: 3px 3px 0 #000; }
.player-card-next { font-size: 15px; color: #e9dde6; text-shadow: 0 2px 0 #000; }
.player-card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.player-card-actions button { height: 44px; padding: 0 18px; font-size: 14px; }
.player-card .player-card-read { margin-top: 4px; height: 36px; padding: 0 14px; color: var(--text); border-color: rgba(255, 255, 255, 0.6); }
.player-card-actions .player-btn { color: var(--text); border-color: var(--text); }
@keyframes blink { 50% { opacity: 0; } }

.player-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3; padding-bottom: 28px;
  background: linear-gradient(rgba(0, 0, 0, 0.7), transparent); pointer-events: none;
}
.player-progress { height: 4px; background: rgba(255, 255, 255, 0.12); }
.player-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--carrot), var(--carrot-2)); transition: width .3s steps(6); }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.player-meta {
  min-width: 0; display: flex; align-items: baseline; gap: 12px; font-size: 13px; font-weight: 700;
  color: #e9dde6; text-shadow: 0 1px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player .kicker { margin: 0; }
.player-actions { flex: none; display: flex; gap: 6px; pointer-events: auto; }
.player-btn {
  height: 32px; min-width: 32px; padding: 0 10px; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45); color: #e9dde6; border: 2px solid rgba(255, 255, 255, 0.28);
  font-size: 13px; font-weight: 800; cursor: pointer;
}
.player-btn:hover { color: var(--text); border-color: var(--pink); }
.player-btn[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #14010c; }
.player-btn.is-pixel { font-family: var(--font-pixel); font-size: 9px; }
.player-btn svg { width: 16px; height: 16px; }

.player-dialog-wrap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 64px 24px 28px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5)); pointer-events: none;
}
.player-dialog {
  position: relative; width: min(960px, 100%); min-height: 150px; margin: 0 auto; padding: 24px 28px 26px;
  background: rgba(12, 8, 16, 0.55); border: 3px solid rgba(255, 247, 251, 0.9);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.55), inset 0 0 0 3px rgba(0, 0, 0, 0.45), inset 0 0 0 5px var(--pink);
  cursor: pointer; pointer-events: auto;
}
.player-dialog.is-hidden { visibility: hidden; }
.player-tag {
  position: absolute; top: -15px; left: 18px; background: var(--pink); color: #14010c;
  font-size: 12px; font-weight: 900; padding: 3px 10px; box-shadow: 3px 3px 0 #000;
}
.player-text { font-size: 19px; line-height: 1.8; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.9); }
html[lang="en"] .player-text { font-size: 18px; line-height: 1.65; }
.player-rest { color: transparent; text-shadow: none; }
.player-next { position: absolute; right: 16px; bottom: 8px; font-size: 12px; color: var(--carrot-2); visibility: hidden; }
.player-dialog.is-done .player-next { visibility: visible; animation: nudge .8s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* ---- Story text version ---- */
.story-text {
  position: fixed; inset: 0; z-index: 210; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); outline: none;
}
.story-text[hidden] { display: none; }
.story-text-progress { flex: none; height: 4px; background: #1a1020; }
.story-text-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--carrot), var(--carrot-2)); }
.story-text-bar {
  flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; background: rgba(5, 3, 8, 0.94); border-bottom: 2px solid var(--pink-dim);
}
.story-text-bar .kicker { margin: 0; }
.story-text-scroll {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' shape-rendering='crispEdges'%3E%3Cg fill='%23fff' fill-opacity='.3'%3E%3Crect x='18' y='26' width='2' height='2'/%3E%3Crect x='104' y='14' width='2' height='2'/%3E%3Crect x='160' y='96' width='2' height='2'/%3E%3Crect x='58' y='132' width='2' height='2'/%3E%3C/g%3E%3Cg fill='%23ffd36a' fill-opacity='.45'%3E%3Crect x='82' y='70' width='2' height='6'/%3E%3Crect x='80' y='72' width='6' height='2'/%3E%3C/g%3E%3Cg fill='%23ff6ec8' fill-opacity='.4'%3E%3Crect x='142' y='152' width='2' height='6'/%3E%3Crect x='140' y='154' width='6' height='2'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(800px 420px at 50% 0%, rgba(255, 61, 180, 0.16), transparent 70%),
    var(--bg);
}

.st-hero { position: relative; min-height: clamp(300px, 54vh, 500px); display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 40px; overflow: hidden; }
.st-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.st-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(5, 3, 8, 0) 25%, rgba(5, 3, 8, 0.55) 60%, var(--bg)); }
.st-hero-inner { position: relative; z-index: 1; width: min(720px, 100%); text-align: center; }
.st-chapter { display: inline-block; background: var(--pink); color: #14010c; font-size: 13px; font-weight: 900; letter-spacing: 0.14em; padding: 5px 14px; box-shadow: 4px 4px 0 #000; }
.st-title { margin: 16px 0 12px; font-size: clamp(36px, 7vw, 62px); line-height: 1.15; text-shadow: 4px 4px 0 #000, 0 0 30px rgba(255, 61, 180, 0.5); }
.st-sub { font-family: var(--font-pixel); font-size: 10px; letter-spacing: 0.16em; color: var(--carrot-2); text-shadow: 2px 2px 0 #000; }

.st-body { width: min(720px, 100% - 32px); margin: 0 auto; padding: 4px 0 80px; }
.st-divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 40px; }
.st-divider::before,
.st-divider::after { content: ""; flex: 1; max-width: 220px; height: 4px; background: repeating-linear-gradient(90deg, var(--pink) 0 8px, transparent 8px 14px); opacity: 0.5; }
.st-divider svg { flex: none; width: 30px; height: 30px; filter: drop-shadow(2px 2px 0 #000); }
.st-divider svg.st-gem { width: 16px; height: 16px; }
.st-divider.is-small { margin: 44px 0; }
.st-divider.is-small svg.st-gem { width: 12px; height: 12px; }

.st-scene { margin: 0; }
.st-figure { position: relative; margin: 0 0 30px; background: #000; border: 3px solid var(--text); box-shadow: 0 0 0 3px #000, 9px 9px 0 3px rgba(0, 0, 0, 0.85); }
.st-figure::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px var(--pink); }
.st-figure img,
.st-figure video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.st-figure-num {
  position: absolute; top: -15px; left: -15px; z-index: 1; font-family: var(--font-pixel); font-size: 11px;
  background: var(--carrot-2); color: #14010c; padding: 6px 7px; box-shadow: 3px 3px 0 #000;
}
.st-para { font-size: 18px; line-height: 2; color: #f3e6ef; }
html[lang="en"] .st-para { line-height: 1.8; }
.st-para.has-dropcap::first-letter {
  float: left; margin: 7px 14px 0 0; padding: 6px 12px; font-size: 2.5em; line-height: 1; font-weight: 900;
  color: #14010c; background: var(--pink); border-style: solid; border-color: #000; border-width: 0 5px 5px 0;
}

@media (min-width: 900px) {
  .st-body { width: min(1100px, 100% - 64px); }
  .st-scene.has-media { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; }
  .st-scene.has-media.is-flipped { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .st-scene.is-flipped .st-figure { order: 2; }
  .st-scene.is-flipped .st-figure-num { left: auto; right: -15px; }
  .st-scene .st-figure { margin: 0; }
  .st-divider.is-small { margin: 64px 0; }
}

.st-end { margin-top: 64px; text-align: center; }
.st-tbc { font-family: var(--font-pixel); font-size: clamp(16px, 4vw, 24px); line-height: 1.5; color: var(--pink-2); text-shadow: 3px 3px 0 #000; }
.st-tbc::after { content: "_"; animation: blink 1s steps(2) infinite; }
.st-next {
  display: flex; align-items: center; gap: 16px; width: min(440px, 100%); margin: 26px auto 0; padding: 16px 18px;
  text-align: left; background: rgba(0, 0, 0, 0.4); border: 3px dashed var(--disabled);
}
.st-next .story-lock { flex: none; width: 34px; height: 34px; color: var(--disabled); }
.st-next small { display: block; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.st-next b { display: block; font-size: 17px; line-height: 1.4; }
.st-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.st-actions button { height: 46px; padding: 0 20px; font-size: 15px; }
.st-actions .player-btn { background: transparent; color: var(--text); border-color: var(--text); }
.st-actions .submit { box-shadow: 4px 4px 0 #000; }

@media (max-height: 500px) {
  .player-bar { padding: 6px 12px; }
  .player-dialog-wrap { padding: 32px 16px 12px; }
  .player-dialog { min-height: 0; padding: 16px 20px 18px; }
  .player-text,
  html[lang="en"] .player-text { font-size: 15px; line-height: 1.6; }
}

@media (max-width: 720px) {
  .story-head h3 { font-size: 22px; }
  .story-map { padding-top: 34px; }
  .story-nodes { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .story-node:nth-child(even) { margin-top: 0; }
  .story-node { flex-direction: row; gap: 18px; text-align: left; }
  .story-node:nth-child(even) { flex-direction: row-reverse; text-align: right; }
  .story-tile { width: 80px; height: 80px; }
  .story-node-info { justify-items: start; }
  .story-node:nth-child(even) .story-node-info { justify-items: end; }
  .player-bar { padding: 8px 12px; }
  .player-meta .kicker { display: none; }
  .player-dialog-wrap { padding: 48px 12px 16px; }
  .player-dialog { min-height: 176px; padding: 22px 18px 24px; }
  .player-text,
  html[lang="en"] .player-text { font-size: 16px; }
  .st-hero { min-height: 44vh; padding-bottom: 28px; }
  .st-para { font-size: 16px; }
  .st-figure { box-shadow: 0 0 0 3px #000, 6px 6px 0 3px rgba(0, 0, 0, 0.85); }
  .st-figure-num { top: -12px; left: -8px; }
}
