:root {
  --ink: #fef7ff;
  --ink-dim: rgba(254, 247, 255, 0.66);
  --pop: #ff3ec8;
  --cyan: #33e6ff;
  --night: #1d0f3d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: "Barlow", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.stage.is-dragging { cursor: grabbing; }
.stage.is-hot { cursor: pointer; }

.plate {
  position: fixed;
  top: max(22px, env(safe-area-inset-top, 0px) + 16px);
  left: max(22px, env(safe-area-inset-left, 0px) + 16px);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.1s ease 0.2s, transform 1.1s ease 0.2s;
}

.plate.is-in { opacity: 1; transform: none; }

.plate__eyebrow {
  margin: 0 0 8px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(51, 230, 255, 0.5);
}

.plate__title {
  margin: 0;
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-weight: 800;
  font-size: clamp(44px, 7.2vw, 92px);
  line-height: 0.92;
  text-shadow: 0 2px 30px rgba(29, 15, 61, 0.9), 0 0 40px rgba(255, 62, 200, 0.25);
}

.plate__line {
  margin: 14px 0 0;
  max-width: 32ch;
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 500;
  color: var(--ink-dim);
}

.hint {
  position: fixed;
  right: max(22px, env(safe-area-inset-right, 0px) + 16px);
  bottom: max(96px, env(safe-area-inset-bottom, 0px) + 92px);
  z-index: 4;
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.hint.is-in { opacity: 0.9; }
.hint.is-out { opacity: 0; }

.chip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6;
  width: min(300px, calc(100vw - 40px));
  padding: 14px 16px 12px;
  border-radius: 14px;
  background: rgba(22, 11, 46, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 44px rgba(10, 4, 28, 0.5);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.chip.is-open {
  opacity: 1;
  transform: none;
}

.chip__bar {
  display: block;
  width: 38px;
  height: 3px;
  border-radius: 2px;
  background: var(--pop);
  box-shadow: 0 0 14px currentColor;
  margin-bottom: 9px;
}

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

.chip__kicker {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.chip__controls { display: flex; gap: 6px; pointer-events: auto; }

.chip__btn {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chip__btn:hover { background: rgba(255, 255, 255, 0.16); }
.chip__btn--close { border-color: rgba(255, 62, 200, 0.55); }

.chip__title {
  margin: 7px 0 5px;
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-weight: 800;
  font-size: 23px;
  line-height: 1.02;
}

.chip__body {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-dim);
}

.chip__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 0;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.chip__stats > div { min-width: 0; }

.chip__stats dt {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 1px;
}

.chip__stats dd {
  margin: 0;
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-weight: 700;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.chip__stats dd em {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-dim);
}

.hud {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px) + 12px);
  bottom: max(96px, env(safe-area-inset-bottom, 0px) + 92px);
  z-index: 7;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(8, 4, 20, 0.82);
  border: 1px solid rgba(51, 230, 255, 0.35);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: #b8f4ff;
  white-space: pre;
  pointer-events: none;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  gap: 14px;
  background: var(--night);
  transition: opacity 0.8s ease;
}

.veil.is-done { opacity: 0; pointer-events: none; }

.veil__mark {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.34em;
  color: var(--ink-dim);
  text-align: center;
}

.veil__bar {
  width: 168px;
  height: 2px;
  margin: 0 auto;
  background: rgba(254, 247, 255, 0.16);
  overflow: hidden;
}

.veil__fill {
  display: block;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pop));
  transition: width 0.4s ease;
}

.fallback {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
  margin: 0;
  padding: 0 24px;
  text-align: center;
  color: var(--ink-dim);
}

@media (max-width: 700px) {
  .hint { display: none; }
  .chip {
    width: min(300px, calc(100vw - 28px));
  }
}

.ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(64px, env(safe-area-inset-bottom, 0px) + 60px);
  z-index: 4;
  margin: 0;
  padding: 5px 16px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(254, 247, 255, 0.72);
  background: linear-gradient(180deg, rgba(18, 8, 42, 0), rgba(18, 8, 42, 0.65));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(10, 4, 28, 0.8);
}

.audio {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px) + 14px);
  top: max(18px, env(safe-area-inset-top, 0px) + 14px);
  z-index: 6;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(22, 11, 46, 0.7);
  color: rgba(254, 247, 255, 0.55);
  font-size: 16px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.audio:active { transform: scale(0.94); }
.audio.is-on {
  color: #33e6ff;
  border-color: rgba(51, 230, 255, 0.6);
  box-shadow: 0 0 18px rgba(51, 230, 255, 0.35);
}

.rail {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px) + 12px);
  bottom: max(96px, env(safe-area-inset-bottom, 0px) + 92px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-start;
}

.rail__chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(22, 11, 46, 0.72);
  color: rgba(254, 247, 255, 0.85);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.rail__chip:active { transform: scale(0.96); }
.rail__chip:hover { border-color: rgba(51, 230, 255, 0.6); color: #fff; }
.rail__chip--tour { border-color: rgba(255, 62, 200, 0.55); color: #fff; }
.rail__chip.is-on { border-color: rgba(51, 230, 255, 0.7); color: #33e6ff; }

.tour {
  position: fixed;
  left: 50%;
  bottom: max(120px, env(safe-area-inset-bottom, 0px) + 112px);
  transform: translateX(-50%) translateY(10px);
  z-index: 7;
  width: min(430px, calc(100vw - 32px));
  padding: 16px 18px 13px;
  border-radius: 16px;
  background: rgba(22, 11, 46, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 50px rgba(10, 4, 28, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tour.is-open { opacity: 1; pointer-events: auto; transform: translateX(-50%); }

.tour__step {
  margin: 0 0 4px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #33e6ff;
}

.tour__title {
  margin: 0 0 6px;
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-weight: 800;
  font-size: 24px;
}

.tour__body {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(254, 247, 255, 0.72);
}

.tour__row { display: flex; justify-content: space-between; gap: 10px; }

.tour__btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(51, 230, 255, 0.55);
  background: rgba(51, 230, 255, 0.12);
  color: #fff;
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}

.tour__btn:active { transform: scale(0.97); }
.tour__btn:hover { background: rgba(51, 230, 255, 0.24); }
.tour__btn--ghost { border-color: rgba(255, 255, 255, 0.22); background: transparent; color: rgba(254, 247, 255, 0.7); }

@media (max-width: 700px) {
  .rail { bottom: max(150px, env(safe-area-inset-bottom, 0px) + 146px); gap: 6px; }
  .rail__chip { padding: 6px 11px; font-size: 10px; }
}
