@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/PressStart2P.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --c-cyan: #4cf9ff;
  --c-magenta: #ff4cf3;
  --c-yellow: #fff94c;
  --c-orange: #ff9a4c;
  --c-blue: #4c6bff;
  --c-green: #4cff8f;
  --c-white: #f4f4ff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: "Press Start 2P", monospace;
}

body {
  position: relative;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}

#starfield {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- floor + bouncing ball ---------- */

#floor {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- middle fx front layer (drawn IN FRONT of the logo) ---------- */

/* Same z-index as #logo-wrap but later in the DOM, so it paints over the
   logo; still below the scroller bars/controls (z-index 5+). Transparent
   except where an effect's optional drawFront() paints, see initMiddleFx(). */
#fx-front {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- logo ---------- */

#logo-wrap {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: none;
}

#logo {
  font-size: clamp(48px, 14vw, 160px);
  letter-spacing: 0.05em;
  color: var(--c-white);
  animation: logobounce 1.8s ease-in-out infinite, logohue 4s linear infinite;
  text-shadow:
    3px 3px 0 #b30000,
    6px 6px 0 #700000,
    0 0 25px currentColor,
    0 0 60px currentColor;
  will-change: transform, filter;
}

@keyframes logobounce {
  0%, 100% { transform: translateY(0) scaleY(1); }
  45%      { transform: translateY(-18px) scaleY(1.03); }
  55%      { transform: translateY(-18px) scaleY(1.03); }
  75%      { transform: translateY(4px) scaleY(0.97); }
}

@keyframes logohue {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

#logo-sub {
  margin-top: 22px;
  font-size: clamp(9px, 1.6vw, 15px);
  color: var(--c-cyan);
  letter-spacing: 0.15em;
  text-shadow: 0 0 10px var(--c-cyan);
  opacity: 0.9;
}

/* ---------- top scroller ---------- */

#top-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 46px;
  z-index: 5;
  background: linear-gradient(to bottom, #1a0033, #000 90%);
  border-bottom: 2px solid var(--c-magenta);
  box-shadow: 0 0 18px var(--c-magenta);
  overflow: hidden;
}

#top-scroller {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- bottom sine scroller ---------- */

#bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90px;
  z-index: 5;
  background: linear-gradient(to top, #001a33, #000 90%);
  border-top: 2px solid var(--c-cyan);
  box-shadow: 0 0 18px var(--c-cyan);
}

#bottom-scroller {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- middle fx debug label ---------- */

#fx-label {
  position: absolute;
  top: 54px;
  right: 10px;
  z-index: 5;
  font-size: 8px;
  color: #888;
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px currentColor;
  pointer-events: none;
}

/* ---------- footer credit ---------- */

#credit {
  position: absolute;
  bottom: 94px;
  right: 10px;
  z-index: 5;
  font-size: 8px;
  color: #666;
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* ---------- controls (music + fx switch buttons) ---------- */

#controls {
  position: absolute;
  bottom: 96px;
  left: 10px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 20px);
}

.retro-btn {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  background: #000;
  border: 2px solid currentColor;
  border-radius: 0;
  padding: 6px 8px;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.retro-btn:active {
  transform: translateY(1px);
}

#music-toggle {
  color: var(--c-yellow);
  box-shadow: 0 0 10px var(--c-yellow);
}
#music-toggle:hover { background: #1a1500; }

#track-toggle {
  color: var(--c-green);
  box-shadow: 0 0 10px var(--c-green);
}
#track-toggle:hover { background: #001a05; }

#fx-top {
  color: var(--c-magenta);
  box-shadow: 0 0 10px var(--c-magenta);
}
#fx-top:hover { background: #1a0018; }

#fx-middle {
  color: var(--c-blue);
  box-shadow: 0 0 10px var(--c-blue);
}
#fx-middle:hover { background: #05001a; }

#fx-bottom {
  color: var(--c-cyan);
  box-shadow: 0 0 10px var(--c-cyan);
}
#fx-bottom:hover { background: #001a1a; }

