:root { --fg: #f2f2f2; --dim: #8a90a0; --accent: #ffd660; --ui: rgba(8, 8, 12, 0.74); --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; --sans: "Inter", "Helvetica Neue", "Segoe UI", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--fg); overflow: hidden; font-family: var(--mono); -webkit-font-smoothing: antialiased; }
#app { position: fixed; inset: 0; display: grid; place-items: center; }
#stage { position: relative; width: min(100vw, calc(100vh * 16 / 9)); height: min(100vh, calc(100vw * 9 / 16)); background: #000; overflow: hidden; container-type: size; }
#stage:fullscreen { width: 100vw; height: 100vh; }
#screen { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
canvas#logo, canvas#logo2 { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

/* ---------- boot + end ---------- */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #000; z-index: 5; transition: opacity .7s ease; }
.overlay.fade { opacity: 0; pointer-events: none; }
.inner { display: grid; justify-items: center; gap: 3cqh; padding: 0 16px; text-align: center; }
.court { position: relative; width: 44cqw; height: 9cqh; margin-bottom: 1cqh; }
.court i { position: absolute; background: #fff; }
.court .pad { width: .7cqw; height: 100%; top: 0; }
.court .pad.l { left: 0; animation: padl 1.6s ease-in-out infinite; }
.court .pad.r { right: 0; animation: padr 1.6s ease-in-out infinite; }
.court .dot { width: 1cqw; height: 1cqw; top: 50%; left: 1.2cqw; margin-top: -.5cqw; animation: rally 1.6s linear infinite alternate; box-shadow: 0 0 18px rgba(255,255,255,.8); }
@keyframes rally { from { left: 1.2cqw; top: 20%; } to { left: calc(100% - 2.2cqw); top: 75%; } }
@keyframes padl { 0%, 100% { transform: translateY(-28%); } 50% { transform: translateY(8%); } }
@keyframes padr { 0%, 100% { transform: translateY(-10%); } 50% { transform: translateY(26%); } }
#logo { width: min(64cqw, 760px); height: auto; filter: drop-shadow(0 0 22px rgba(255,255,255,.35)); }
.tag { margin: 0; letter-spacing: .5em; color: var(--dim); font-size: clamp(11px, 1.5cqw, 20px); }
#loader { width: min(380px, 56cqw); }
.bar { height: 8px; border: 2px solid #fff; padding: 1px; }
.bar span { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }
#loadtext { margin: 1.4cqh 0 0; font-size: clamp(11px, 1.3cqw, 16px); letter-spacing: .25em; color: var(--dim); }
#start, #replay { font: inherit; font-size: clamp(14px, 2cqw, 26px); letter-spacing: .3em; padding: .9em 1.6em .9em 1.9em; color: #000; background: #fff; border: 0; cursor: pointer; animation: pulse 1.2s steps(2, start) infinite; }
#start:hover, #start:focus-visible, #replay:hover, #replay:focus-visible { background: var(--accent); outline: none; animation: none; }
@keyframes pulse { 50% { opacity: .55; } }
.hint { margin: 0; color: #565c6c; font-size: clamp(10px, 1.2cqw, 15px); letter-spacing: .12em; }
#end { background: transparent; place-items: end center; padding-bottom: 9cqh; }
#end .inner { gap: 2cqh; }
.other { color: var(--dim); font-size: clamp(11px, 1.3cqw, 16px); letter-spacing: .15em; text-decoration: none; border-bottom: 1px solid #444; padding-bottom: 2px; }
.other:hover { color: #fff; border-color: #fff; }

/* ---------- final title ---------- */
#title { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 3cqh; pointer-events: none; z-index: 3; opacity: 0; transition: opacity 1.6s ease; }
#title.show { opacity: 1; }
#logo2 { width: min(58cqw, 900px); height: auto; filter: drop-shadow(0 0 26px rgba(255,255,255,.5)); }
#title p { margin: 0; font-family: var(--sans); font-weight: 300; letter-spacing: .55em; font-size: 2.2cqh; color: #cfd6e6; }

/* ---------- captions of the 3D eras ---------- */
#caption { position: absolute; left: 7cqw; bottom: 12cqh; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .35s ease, transform .6s cubic-bezier(.2,.8,.2,1); transform: translateY(1.2cqh); }
#caption.show { opacity: 1; transform: none; }
#caption span { display: block; }
#caption.w96 { left: 50%; bottom: 13cqh; transform: translateX(-50%); text-align: center; font-family: "Arial Black", Impact, var(--sans); font-style: italic; }
#caption.w96 .y { font-size: 9cqh; line-height: 1; background: linear-gradient(#fff 0%, #9cc8ff 46%, #20357e 54%, #8fd0ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 .5cqh 0 #0a1440); }
#caption.w96 .t { font-size: 3cqh; color: #ffe14d; letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 .3cqh 0 #7a2b00; margin-top: .6cqh; }
#caption.w01 { left: 50%; bottom: 14cqh; transform: translateX(-50%); text-align: center; font-family: var(--sans); font-weight: 200; color: #e6eeff; text-shadow: 0 0 2.4cqh rgba(130,180,255,.9); }
#caption.w01 .y { font-size: 8cqh; letter-spacing: .45em; margin-right: -.45em; }
#caption.w01 .t { font-size: 2.5cqh; letter-spacing: .6em; margin-right: -.6em; text-transform: uppercase; }
#caption.w07 { font-family: var(--sans); font-weight: 700; text-transform: uppercase; color: #f1e6d0; }
#caption.w07 .y { font-size: 6.4cqh; letter-spacing: .08em; border-left: .6cqw solid #c8a050; padding-left: 1.2cqw; line-height: 1.05; }
#caption.w07 .t { font-size: 2.3cqh; letter-spacing: .38em; padding-left: 1.8cqw; color: #c9b896; margin-top: .8cqh; }
#caption.w20 { font-family: var(--sans); font-weight: 300; color: #fff; text-shadow: 0 .2cqh 2.6cqh rgba(0,0,0,.45); transition: opacity 1.2s ease, transform 2s cubic-bezier(.2,.8,.2,1); }
#caption.w20 .y { font-size: 2.4cqh; letter-spacing: .7em; opacity: .9; }
#caption.w20 .t { font-size: 7cqh; letter-spacing: .12em; margin-top: 1cqh; font-weight: 200; }
#caption.w20 .t::after { content: ''; display: block; height: 1px; width: 100%; margin-top: 1.8cqh; background: linear-gradient(90deg, #fff, transparent); }

/* ---------- player bar ---------- */
#bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(920px, calc(100vw - 28px)); display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 12px; background: var(--ui); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 10; transition: opacity .5s ease, transform .5s ease; font-size: 14px; }
#bar.idle { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
#bar button { background: none; border: 0; color: #fff; font-size: 17px; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
#bar button:hover, #bar button:focus-visible { background: rgba(255,255,255,.14); outline: none; }
#clock { white-space: nowrap; color: #c8cede; min-width: 96px; text-align: right; }
#scrub { position: relative; flex: 1; height: 34px; cursor: pointer; touch-action: none; }
#track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: rgba(255,255,255,.18); border-radius: 2px; }
#fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #fff; border-radius: 2px; }
#knob { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.8); left: 0; }
#marks { position: absolute; inset: 0; pointer-events: none; }
#marks i { position: absolute; top: 50%; width: 2px; height: 10px; margin-top: -5px; background: rgba(255,255,255,.5); }
#tip { position: absolute; bottom: 38px; transform: translateX(-50%); white-space: nowrap; background: rgba(0,0,0,.88); padding: 4px 8px; border-radius: 6px; font-size: 13px; opacity: 0; transition: opacity .15s; pointer-events: none; }
#scrub:hover #tip { opacity: 1; }
@media (max-width: 560px) { #bar { gap: 6px; padding: 7px 8px; bottom: 8px; } #clock { display: none; } }
