/* ---------- Splash: arcade machine powering on ---------- */
.splash {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--bg);
}
/* Vignette, like a curved CRT */
.splash::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .65) 100%);
  z-index: 1;
}

.splash__hud {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: calc(var(--s-4) + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  font-family: var(--font-mono);
  font-size: clamp(11px, .6rem + .4vw, 15px);
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--text-2);
}
.splash__hud b { font-weight: 500; color: var(--accent); }

.splash__main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-5);
  padding: var(--s-8) var(--gutter);
  text-align: center;
}

.splash__logo {
  width: clamp(64px, 12vw, 96px);
  height: auto;
  border-radius: 22%;
  box-shadow: 0 0 40px rgba(124, 255, 79, .35);
}

.splash__title {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: clamp(52px, 9vw, 112px);
  line-height: .95;
  letter-spacing: 0;
  text-wrap: balance;
}
.splash__title span { display: inline-block; white-space: nowrap; }
.splash__glow {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow), 0 0 40px rgba(124, 255, 79, .3);
}

.splash__tagline {
  font-family: var(--font-mono);
  font-size: clamp(12px, .65rem + .35vw, 15px);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.press-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  margin-top: var(--s-6);
  padding: 0 var(--s-10);
  font-family: var(--font-pixel);
  font-size: clamp(20px, 1rem + 1vw, 28px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--r-btn);
  box-shadow: 0 0 0 1px var(--accent), 0 0 24px var(--accent-glow);
  animation: pulse 1.6s ease-in-out infinite;
  transition: transform var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.press-start:active, .press-start.is-pressed { transform: translateY(2px) scale(.97); }
.press-start:focus-visible { outline: 3px solid var(--text); outline-offset: 5px; }
@media (hover: hover) { .press-start:hover { box-shadow: 0 0 0 1px var(--accent), 0 0 44px var(--accent-glow); } }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(124, 255, 79, .35); }
  50% { box-shadow: 0 0 0 1px var(--accent), 0 0 46px rgba(124, 255, 79, .7); }
}

.splash__status {
  min-height: 1.5em;
  font-family: var(--font-mono);
  font-size: clamp(12px, .65rem + .3vw, 14px);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-2);
}
.splash__status b { color: var(--accent); font-weight: 500; }
.splash__status a { color: var(--accent); text-decoration: underline; }

/* ---------- Cover strip ---------- */
.strip {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding-block: var(--s-4) calc(var(--s-6) + env(safe-area-inset-bottom));
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}
.strip__track {
  display: flex;
  gap: var(--s-3);
  width: max-content;
  animation: marquee var(--strip-duration, 60s) linear infinite;
}
.strip__tile {
  position: relative;
  flex: none;
  width: 140px;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-input);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
  opacity: .75;
  container-type: inline-size;
}
.strip__tile img { width: 100%; height: 100%; object-fit: cover; }
.strip__tile .cover-fallback { padding: var(--s-2); }
.strip__tile .cover-fallback span { font-size: clamp(10px, 9cqi, 18px); }
@media (min-width: 768px) {
  .strip__track { gap: var(--s-4); }
  .strip__tile { width: 220px; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Scanlines over everything ---------- */
.splash__scanlines {
  position: fixed;
  inset: 0;
  z-index: 3;
  opacity: .55;
  animation: scan-roll 8s linear infinite;
}
@keyframes scan-roll { to { background-position: 0 100px; } }

/* ---------- CRT power-on transition ---------- */
.crt {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: var(--bg);
  opacity: 0;
}
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: center;
  background: radial-gradient(ellipse at center, #fff 0%, #D8FFC9 30%, var(--accent) 60%, var(--bg) 100%);
  transform: scaleY(0);
}
.splash.is-starting .crt { animation: crt-bg 420ms ease-out forwards; }
.splash.is-starting .crt::after { animation: crt-expand 420ms cubic-bezier(.6, 0, .4, 1) forwards; }
@keyframes crt-bg {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes crt-expand {
  0% { transform: scaleX(.2) scaleY(.004); opacity: 1; }
  30% { transform: scaleX(1) scaleY(.004); opacity: 1; }
  70% { transform: scaleX(1) scaleY(1); opacity: .9; }
  100% { transform: scaleX(1) scaleY(1); opacity: 0; }
}

/* ---------- Short screens (phone landscape) ---------- */
@media (max-height: 520px) {
  .splash__main { gap: var(--s-2); padding-block: var(--s-3); }
  .splash__logo { display: none; }
  .splash__title { font-size: clamp(40px, 8vw, 72px); }
  .press-start { min-height: 52px; margin-top: var(--s-2); }
  .strip { padding-block: var(--s-2) calc(var(--s-3) + env(safe-area-inset-bottom)); }
  .strip__tile { width: 120px; }
}

/* ---------- Reduced motion: no pulse, no strip scroll, no scanline roll ---------- */
@media (prefers-reduced-motion: reduce) {
  .press-start, .strip__track, .splash__scanlines { animation: none !important; }
  .strip__track { transform: none; }
}
