@font-face {
  font-family: Inter;
  src: url('fonts/Inter.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Tight';
  src: url('fonts/InterTight.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

.wordmark {
  font-size: clamp(21px, 1.85vw, 23px);
  font-weight: 800;
  letter-spacing: .15em;
  text-indent: .15em;
  color: #fbfaf9;
  transform: translate(-50%, -4px);
}
.wordmark:focus-visible { outline-offset: 6px; }

:is(#heroT, #finT) { animation: phosphor-dip 18.6s infinite; }
#finT { animation-delay: 3.1s; }
@keyframes phosphor-dip {
  0%, 57.9%, 59.1%, 100% {
    text-shadow: -1.3px 0 #ff96466b, 1.3px 0 #ff004080, 0 0 9px #ff3c24e6, 0 0 26px #ff2b1c99, 0 0 64px #ff2b1c57;
  }
  58.25% {
    text-shadow: -1.3px 0 #ff96466b, 1.3px 0 #ff004080, 0 0 9px #ff3c24e6, 0 0 26px #ff2b1c78, 0 0 64px #ff2b1c36;
  }
}
.uv-static :is(#heroT, #finT) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  :is(#heroT, #finT) { animation: none; }
}

.hero .cue {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: max-content;
  height: auto;
  margin: 34px 0 0;
  padding: 4px 10px 6px;
  transform: translateX(-50%);
  border: 0;
  color: var(--ink);
  font: 600 13px/1.2 var(--text);
  text-decoration: none;
  opacity: .86;
  pointer-events: auto;
}
.hero .cue span {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}
.hero .cue:hover, .hero .cue:focus-visible { opacity: 1; }

#pg-ab { width: min(680px, calc(100% - 44px)); }
#pg-ab .ab { margin-top: 18px; }
#pg-ab .ab-scope {
  height: clamp(148px, 28svh, 232px);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #28070772 8%, #21060554 36%, #18050324 57%, #18050300 73%);
}
#pg-ab .ab-scope[role="img"] { cursor: default; }
#pg-ab .ab-scope:focus-visible { outline-offset: -5px; }
#pg-ab .ab-row { margin-top: 12px; flex-wrap: wrap; }
#pg-ab .ab-sw button { min-width: 104px; }
#pg-ab .ab-note { margin-top: 10px; color: var(--ph-ink); }
.ab-time { display: block; margin-top: -3px; color: var(--ph-ink); font: 500 12px/16px var(--mono); }

.page.info { width: min(540px, calc(100% - 44px)); }
.info .pg-t { text-transform: uppercase; }
.info .pg-s { max-width: 54ch; margin-inline: auto; text-wrap: balance; }

.scene-layout { height: calc(var(--scene-length, 16) * 100svh); }
.scene-layout .fallback-image { display: none; }
.scene-veil { position: fixed; inset: 0; z-index: 100; opacity: 0; background: var(--void); pointer-events: none; }
.fin .lnk2:disabled { color: inherit; text-decoration: none; cursor: default; }
.tools button:disabled { cursor: default; }

.dive:not(.scene-layout) { height: auto; }
.dive:not(.scene-layout) .view { position: relative; height: auto; overflow: visible; padding: 48px 0; text-align: center; }
.dive:not(.scene-layout) :is(.paper, .halo, .sheet, .stage, .dark, .world, .crtfx, .tools, .hud-row, #modSr, #noteScr) { display: none; }
.dive:not(.scene-layout) .anchor { position: relative; display: block; }
.dive:not(.scene-layout) :is(.wordmark, .hero, .note, .hud, .hud-top, .page, .modlist) {
  position: static;
  margin-inline: auto;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none;
  filter: none !important;
  pointer-events: auto;
}
.dive:not(.scene-layout) .fallback-image { display: block; width: min(92%, 580px); height: auto; margin: 8px auto 0; }
.dive:not(.scene-layout) .hero { padding: 0 16px; }
.dive:not(.scene-layout) .hero .cue { position: static; margin-inline: auto; transform: none; }
.dive:not(.scene-layout) :is(.note, .hud, .page, .fin) { padding: 42px 0 0; }
.dive:not(.scene-layout) .note { width: min(480px, calc(100% - 44px)); border: 0; background: none; }
.dive:not(.scene-layout) .hud-top { padding: 0; text-align: center; background: none; }
.dive:not(.scene-layout) .modlist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  gap: 12px;
  width: min(500px, calc(100% - 44px));
  margin: 18px auto 0;
  padding: 0;
  list-style: none;
  background: none;
  color: var(--ph-ink);
  text-align: left;
  font: 500 13px/1.4 var(--mono);
}
.dive:not(.scene-layout) .modlist small { display: block; color: var(--ph-dim); }
.dive:not(.account-ready) [data-panel-open] { visibility: hidden; }

@media (max-width: 760px) {
  .wordmark { font-size: 17px; transform: translate(-50%, -2px); }
  #pg-ab .ab-scope { height: clamp(136px, 23svh, 190px); }
  #pg-ab .ab-sw button { min-width: 88px; }
}

@media (max-height: 720px) {
  .hero .cue { margin-top: 23px; }
  #pg-ab .ab-scope { height: clamp(120px, 26svh, 174px); }
}

@media (min-width: 761px) and (max-width: 1200px) {
  .hud-top, .hud-row { isolation: isolate; }
  .hud-top::before, .hud-row::before {
    content: '';
    position: absolute;
    inset: -14px -28px;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at 40% 50%, #080303fa 12%, #080303e3 52%, #08030300 79%);
  }
}

.view.side-by-side .wordmark { left: 27%; font-size: 17px; }
.side-by-side .hero {
  left: 55.5%; right: max(3%, env(safe-area-inset-right)); text-align: left;
}
.side-by-side .hero .pg-t { font-size: clamp(31px, 4.4vw, 44px); }
.side-by-side .hero .acts { justify-content: flex-start; gap: 8px; margin-top: 16px; }
.side-by-side .hero .btn { padding-inline: clamp(10px, 1.4vw, 18px); }
.side-by-side .hero .cue {
  position: static; display: inline-flex; align-items: center; gap: 9px;
  margin: 12px 0 0; padding: 5px 4px 5px 0; transform: none;
}
.side-by-side .hero .status { position: static; margin: 8px 0 0; text-align: left; }
.side-by-side .hero .status:empty { display: none; }
.side-by-side .fin .quiet { margin-top: 6px; }
.side-by-side .note {
  left: max(55%, calc(51% + 38px)); right: max(3%, env(safe-area-inset-right)); top: 36%; bottom: auto;
  width: auto; padding: 0; border: 0; background: none;
}
.side-by-side .tools {
  top: auto; bottom: max(6px, env(safe-area-inset-bottom));
  right: max(10px, env(safe-area-inset-right));
}
.side-by-side .tools button { height: 30px; padding: 0 9px; }
.side-by-side .hud-top, .side-by-side .hud-row {
  left: max(16px, env(safe-area-inset-left)); width: 31%; transform: none;
  padding: 0; text-align: left;
}
.side-by-side .hud-top { top: 16px; white-space: normal; }
.side-by-side .hud-top .pg-t { font-size: 26px; }
.side-by-side .hud-row { bottom: 14px; }
.side-by-side #pg-ab .ab-scope { height: clamp(78px, 25svh, 125px); }
.side-by-side #pg-ab .ab, .side-by-side #pg-ab .ab-row { margin-top: 8px; }
.uv-static .side-by-side .hud-top { width: 27%; }
.uv-static .side-by-side .modlist {
  left: 64%; top: 47%; width: 65%; padding: 6px;
  grid-template-columns: repeat(3, 1fr); gap: 6px 8px; font-size: 17px;
}

#pg-ab .ab { position: relative; }
.ab-hint { margin: 10px 0 0; font: 500 13px/1.4 var(--mono); color: var(--ph-ink); }
.ab-hint[hidden] { display: none; }
.ab[data-v] .ab-scope[role="slider"] { cursor: pointer; }
.ab:is([data-v="1"], [data-v="4"]) .ab-hint {
  background: linear-gradient(90deg, #c98d82 0%, #c98d82 38%, #fff4ef 50%, #c98d82 62%, #c98d82 100%) 0 0 / 260% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: ab-hint-flow 2.8s linear infinite;
}
.ab[data-v="4"][data-hint="state"] .ab-hint { animation: none; }
.ab[data-v="4"] .ab-scope { touch-action: pan-y; }
@keyframes ab-hint-flow { from { background-position: 115% 0; } to { background-position: -15% 0; } }
.uv-static .ab-hint { animation: none; }
@media (prefers-reduced-motion: reduce) { .ab-hint { animation: none; } }

.wordmark { font-size: clamp(26px, 2.4vw, 30px); letter-spacing: .04em; text-indent: .04em; --wm-h: 24px; --wm-gap: 54px; }
@media (max-width: 760px) { .wordmark { font-size: 22px; } }

.crtfx.uv-nolines { background: radial-gradient(120% 100% at 50% 52%, transparent 58%, rgba(0, 0, 0, calc(.6 * var(--vig, 0)))); }
.crtfx.uv-softlines { background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px), radial-gradient(120% 100% at 50% 52%, transparent 58%, rgba(0, 0, 0, calc(.6 * var(--vig, 0)))); }

@property --hv { syntax: '<percentage>'; inherits: false; initial-value: 112%; }
#pg-ab .ab-hint.hfx { -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--hv) - 12%), transparent var(--hv)); mask-image: linear-gradient(90deg, #000 calc(var(--hv) - 12%), transparent var(--hv)); }

#tools { gap: 0; }
#tools button { position: relative; width: 34px; height: 34px; padding: 0; font-size: 0; }
#tools button[hidden] { display: none; }
#tools button::after { content: ''; position: absolute; inset: 0; background: currentColor;
  -webkit-mask: var(--ic) center / 16px 16px no-repeat; mask: var(--ic) center / 16px 16px no-repeat; }
#tools button::before { content: attr(data-tip); position: absolute; right: -1px; bottom: calc(100% + 9px); padding: 6px 10px; white-space: nowrap;
  font: 500 12px/16px Inter, sans-serif; color: var(--ink); background: #070606ee; border: 1px solid var(--line2); pointer-events: none;
  opacity: 0; transform: translateY(5px); transition: opacity .18s, transform .22s cubic-bezier(.3, .7, .2, 1); }
#tools button:is(:hover, :focus-visible)::before { opacity: 1; transform: none; }
.inw #tools button::before { color: var(--ph-ink); border-color: rgba(255, 43, 28, .3); background: rgba(8, 3, 3, .9); }
#tools [data-sound][aria-pressed="true"] { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 9.5h3.5L11.5 5.5v13L7 14.5H3.5z'/><path d='M15 9.2a4 4 0 0 1 0 5.6M17.8 6.6a7.6 7.6 0 0 1 0 10.8'/></svg>"); }
#tools [data-sound]:not([aria-pressed="true"]) { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 9.5h3.5L11.5 5.5v13L7 14.5H3.5z'/><path d='M15.5 9.5l5 5M20.5 9.5l-5 5'/></svg>"); }
#tools [data-static]:not([aria-pressed="true"]) { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'><path d='M3 8.5c2.2-2 3.8 2 6 0s3.8-2 6 0 3.8 2 6 0M3 15.5c2.2-2 3.8 2 6 0s3.8-2 6 0 3.8 2 6 0'/></svg>"); }
#tools [data-static][aria-pressed="true"] { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'><path d='M3 8.5h18M3 15.5h18'/></svg>"); }
#tools [data-replay] { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M4.6 13.2A7.6 7.6 0 1 0 6.9 6.6'/><path d='M4.4 3.8v4.6H9'/></svg>"); }
.side-by-side #tools button { width: 30px; height: 30px; padding: 0; }
@media (max-width: 760px) { #tools button::before { bottom: auto; top: calc(100% + 9px); transform: translateY(-5px); } }   
.side-by-side #tools button::before { top: auto; bottom: calc(100% + 9px); transform: translateY(5px); }   
@media (prefers-reduced-motion: reduce) { #tools button::before { transition: none; } }
.uv-static #tools button::before { transition: none; }

@property --roll { syntax: '<length>'; inherits: false; initial-value: -200px; }   
@property --crawl { syntax: '<length>'; inherits: false; initial-value: 0px; }
html:is([data-crtroll="1"], [data-crtroll="2"], [data-crtroll="3"]) :is(#heroT, #finT)::after {
  background: linear-gradient(180deg, rgba(255, 226, 212, 0), rgba(255, 226, 212, .5) 50%, rgba(255, 226, 212, 0)) 0 var(--roll) / 100% .6em no-repeat,
    repeating-linear-gradient(180deg, rgba(9, 2, 2, 0) 0 2px, rgba(9, 2, 2, .5) 2px 3px) 0 var(--crawl) / 100% 3px;
  -webkit-background-clip: text; background-clip: text; will-change: transform;
}
html[data-crtroll="1"] :is(#heroT, #finT)::after { animation: crt-roll 2608.696ms linear infinite; }
html[data-crtroll="2"] :is(#heroT, #finT)::after { animation: crt-crawl 1s steps(3) infinite; }
html[data-crtroll="3"] :is(#heroT, #finT)::after { animation: crt-roll 2608.696ms linear infinite, crt-crawl 1s steps(3) infinite; }
@keyframes crt-roll { 0% { --roll: -.8em; animation-timing-function: cubic-bezier(.35, 0, .65, 1); } 46% { --roll: 1.1em; } 100% { --roll: 1.1em; } }
@keyframes crt-crawl { from { --crawl: 0px; } to { --crawl: 3px; } }
.uv-static :is(#heroT, #finT)::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) { :is(#heroT, #finT)::after { animation: none !important; } }

@keyframes red-pulse-1 { 0% { filter: brightness(1.18); animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 70%, 100% { filter: brightness(1); } }
@keyframes red-pulse-2 { 0% { filter: brightness(1.32); animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 70%, 100% { filter: brightness(1); } }
html.uv-pulse[data-pulse="1"] :is(.cb-crt, .pg-t, .btn.ph, .uv-stops button.on i, #halo, .note.red h2) { will-change: filter; animation: red-pulse-1 652.174ms infinite; }
html.uv-pulse[data-pulse="2"] :is(.cb-crt, .pg-t, .btn.ph, .uv-stops button.on i, #halo, .note.red h2) { will-change: filter; animation: red-pulse-2 652.174ms infinite; }
html.uv-pulse[data-pulse="1"] :is(#heroT, #finT) { animation: phosphor-dip 18.6s infinite, red-pulse-1 652.174ms infinite; }
html.uv-pulse[data-pulse="2"] :is(#heroT, #finT) { animation: phosphor-dip 18.6s infinite, red-pulse-2 652.174ms infinite; }
html.uv-pulse #finT { animation-delay: 3.1s, 0s; }

.paper { background: radial-gradient(ellipse at 50% 45%, #161c20, #101417 60%, #0a0c0e); overflow: hidden; }
.paper::before { content: ''; position: absolute; left: 0; right: 0; top: -50px; bottom: 0; will-change: transform; animation: paper-drift 6s linear infinite;
  background: linear-gradient(rgba(206, 218, 226, .028) 1px, transparent 1px) 0 var(--gy) / 10px 10px,
    linear-gradient(90deg, rgba(206, 218, 226, .028) 1px, transparent 1px) 0 var(--gy) / 10px 10px,
    linear-gradient(rgba(206, 218, 226, .06) 1px, transparent 1px) 0 var(--gy) / 50px 50px,
    linear-gradient(90deg, rgba(206, 218, 226, .06) 1px, transparent 1px) 0 var(--gy) / 50px 50px; }
@keyframes paper-drift { from { transform: translateY(0); } to { transform: translateY(50px); } }
.uv-static .paper::before { animation: none; }
@media (prefers-reduced-motion: reduce) { .paper::before { animation: none; } }

.stage.fly .spill { opacity: 0 !important; transition: opacity .2s; }
.stage.unfly .spill { transition: opacity .7s; }

html:not([data-crtglow="1"]) .spill.crt { display: none; }
html:not([data-wheelglow="1"]) .spill.wheel { display: none; }
