/* Shell chrome, the one global stylesheet (docs/testing-and-isolation.md:
   game styles stay scoped under the game's root element). Dark-neon
   default: same brand hues, purple-black canvas, neon accents. */

.s-topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 20px;
  background: var(--s-surface);
  border-bottom: 1px solid var(--s-gray-30);
  box-shadow: 0 1px 24px rgba(160, 92, 255, 0.18);
}
.s-logo {
  color: var(--s-purple);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  text-shadow: 0 0 18px rgba(160, 92, 255, 0.55);
}
.s-topbar-title {
  color: var(--s-gray-60);
  font-size: 13px;
}

.s-layout {
  display: flex;
  min-height: calc(100vh - 49px);
}

.s-sidebar {
  width: 220px;
  flex: none;
  background: var(--s-gray-10);
  padding: 16px 0;
}
.s-sidebar a {
  display: block;
  padding: 8px 20px;
  color: var(--s-gray-60);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.s-sidebar a.active {
  color: var(--s-purple);
  font-weight: 600;
  border-left-color: var(--s-purple);
  background: var(--s-surface);
  box-shadow: inset 3px 0 12px -6px rgba(160, 92, 255, 0.6);
  text-shadow: 0 0 14px rgba(160, 92, 255, 0.5);
}
.s-sidebar .s-badge {
  font-size: 11px;
  color: var(--s-gray-60);
  margin-left: 6px;
}

.s-main {
  flex: 1;
  padding: 24px;
  min-width: 0;
}

.s-empty {
  max-width: 560px;
  color: var(--s-gray-90);
}
.s-empty h1 {
  color: var(--s-purple);
  font-size: 22px;
  font-weight: 600;
}
.s-empty code {
  font-family: var(--font-mono);
  background: var(--s-gray-10);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--s-cobalt-tint);
}

/* Arcade landing: the home screen when no game is routed. 80s outrun cabinet —
   Structural Collective logo over a neon "arcade" marquee, on a perspective
   grid floor + starfield. Lives entirely inside the empty state, so it vanishes
   the moment a game mounts. Every animation is switched off under
   prefers-reduced-motion at the bottom of this file. */
.arcade-hero {
  position: relative;
  margin: -24px; /* bleed past .s-main's 24px padding, edge to edge */
  min-height: calc(100vh - 49px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 8%, #23103d 0%, var(--s-bg) 55%, #0c0416 100%);
  isolation: isolate;
}

.arcade-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Starfield — a handful of placed stars plus a fine dusting, gently twinkling. */
.arcade-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 24%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 82% 16%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 68% 38%, var(--s-purple-light), transparent),
    radial-gradient(1.3px 1.3px at 33% 12%, var(--s-cobalt-tint), transparent),
    radial-gradient(1.2px 1.2px at 90% 42%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 8% 46%, var(--s-orchid-tint), transparent),
    radial-gradient(1px 1px at 50% 8%, #fff, transparent),
    radial-gradient(1px 1px at 60% 22%, #fff, transparent);
  background-repeat: no-repeat;
  animation: arcade-twinkle 4.5s ease-in-out infinite alternate;
}
/* fine dusting layer, offset rhythm */
.arcade-stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 25% 30%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 45% 18%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 72% 28%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 88% 10%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 12% 20%, rgba(255,255,255,.5), transparent);
  background-repeat: no-repeat;
  animation: arcade-twinkle 3.2s ease-in-out infinite alternate-reverse;
}

/* Soft purple sun-glow sitting behind the logo/word. */
.arcade-glow {
  position: absolute;
  left: 50%;
  top: 40%;
  width: min(72vw, 660px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(160, 92, 255, 0.30) 0%,
    rgba(245, 94, 245, 0.14) 42%,
    transparent 68%);
  filter: blur(8px);
}

/* Perspective neon grid receding to the horizon, scrolling toward the viewer. */
.arcade-floor {
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: 0;
  height: 52%;
  background-image:
    linear-gradient(to right, rgba(245, 94, 245, 0.55) 1px, transparent 1px),
    linear-gradient(to top, rgba(127, 176, 255, 0.42) 1px, transparent 1px);
  background-size: 3.2rem 3.2rem;
  transform: perspective(340px) rotateX(74deg);
  transform-origin: bottom center;
  animation: arcade-floor 1.8s linear infinite;
  -webkit-mask-image: linear-gradient(to top, #000 4%, transparent 82%);
  mask-image: linear-gradient(to top, #000 4%, transparent 82%);
}

/* Glowing horizon line where the floor meets deep space. */
.arcade-horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent, var(--s-orchid), var(--s-cobalt-tint), transparent);
  box-shadow:
    0 0 24px 6px rgba(245, 94, 245, 0.55),
    0 0 64px 14px rgba(15, 107, 255, 0.32);
}

.arcade-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 32px 20px;
  text-align: center;
}

.arcade-logo-svg {
  width: clamp(190px, 30vw, 320px);
  height: auto;
  fill: #fff;
  filter:
    drop-shadow(0 0 10px rgba(160, 92, 255, 0.65))
    drop-shadow(0 0 28px rgba(160, 92, 255, 0.38));
  animation: arcade-flicker 7s steps(1, end) infinite;
}

/* The marquee word. Chrome gradient fill on top, neon outline behind, a light
   band sweeping across on repeat. */
.arcade-word {
  position: relative;
  display: inline-block;
  margin: 0;
  font-weight: 900;
  font-size: clamp(3.4rem, 15vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-shadow: none; /* override the global h1 glow; ::before owns the neon */
}
.arcade-word span {
  display: block;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.arcade-word-fill {
  background-image: linear-gradient(180deg,
    #ffffff 0%,
    var(--s-cobalt-tint) 30%,
    #ffffff 47%,
    #ffffff 52%,
    var(--s-orchid) 72%,
    #b41f83 100%);
}
/* neon outline + outer glow, tucked behind the chrome fill */
.arcade-word::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: transparent;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.6),
    0 0 10px var(--s-orchid),
    0 0 26px var(--s-orchid),
    0 0 52px rgba(245, 94, 245, 0.7),
    0 0 78px rgba(15, 107, 255, 0.45);
  animation: arcade-pulse 2.8s ease-in-out infinite;
}
/* sweeping shine */
.arcade-word-shine {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(105deg,
    transparent 32%,
    rgba(255, 255, 255, 0.85) 46%,
    rgba(255, 255, 255, 0.95) 50%,
    transparent 64%);
  background-size: 250% 100%;
  background-repeat: no-repeat;
  animation: arcade-shine 3.6s ease-in-out infinite;
}

.arcade-tagline {
  margin: 0;
  color: var(--s-purple-light);
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  letter-spacing: 0.16em;
  text-transform: lowercase;
  text-shadow: 0 0 14px rgba(160, 92, 255, 0.5);
}
.arcade-cue {
  margin: 0;
  color: var(--s-gray-60);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.arcade-cue-arrow {
  display: inline-block;
  color: var(--s-cobalt-tint);
  animation: arcade-nudge 1.4s ease-in-out infinite;
}

@keyframes arcade-floor { to { background-position: 0 3.2rem; } }
@keyframes arcade-twinkle { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes arcade-pulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}
@keyframes arcade-shine {
  0% { background-position: 155% 0; }
  55%, 100% { background-position: -55% 0; }
}
@keyframes arcade-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-4px); }
}
/* Neon tubes never sit perfectly still — a couple of quick dropouts. */
@keyframes arcade-flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.72; }
  94% { opacity: 1; }
  96% { opacity: 0.6; }
  97% { opacity: 1; }
}

/* Branded runtime error card: a broken game is one bad page, never a broken
   shell. */
.s-error-card {
  border: 1px solid var(--s-gray-30);
  border-radius: 8px;
  padding: 20px;
  max-width: 560px;
  background: var(--s-surface);
}
.s-error-card h2 {
  color: var(--s-red-functional);
  font-size: 15px;
  margin: 0 0 8px;
}
.s-error-card p {
  color: var(--s-gray-90);
  font-size: 13px;
  margin: 0;
}

@media (max-width: 1023px) {
  .s-layout { flex-direction: column; }
  .s-main { padding: 12px; }
  .s-sidebar { width: auto; display: flex; overflow-x: auto; padding: 0; }
  .s-sidebar a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .s-sidebar a.active { border-bottom-color: var(--s-purple); }

  .arcade-hero { margin: -12px; min-height: calc(100vh - 49px - 44px); }
  .arcade-floor { height: 46%; }
  .arcade-horizon { bottom: 46%; }
  .arcade-content { gap: 16px; }
}

/* Freeze the cabinet for anyone who asked for less motion — the static frame is
   still a full neon scene, just not moving. */
@media (prefers-reduced-motion: reduce) {
  .arcade-stars,
  .arcade-stars::after,
  .arcade-floor,
  .arcade-logo-svg,
  .arcade-word::before,
  .arcade-word-shine,
  .arcade-cue-arrow {
    animation: none;
  }
  .arcade-word-shine { opacity: 0; }
}
