/* =============================================
   ARCADE.BSN.SERVICES — 80s Arcade Stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323:wght@400&display=swap');

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --neon-pink:    #ff2d78;
  --neon-cyan:    #00f5ff;
  --neon-yellow:  #ffe600;
  --neon-purple:  #b400ff;
  --neon-green:   #39ff14;
  --dark-bg:      #06000f;
  --floor-dark:   #0a0012;
  --floor-light:  #1a0033;
  --ceil-panel:   #0d001a;
  --glow-blur:    12px;
  --scanline-gap: 3px;
}

html, body {
  width: 100%; height: 100%;
  background: var(--dark-bg);
  color: #ddd;
  font-family: 'VT323', monospace;
  overflow-x: hidden;
}

/* ── Scanline overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent calc(var(--scanline-gap) - 1px),
    rgba(0,0,0,0.18) calc(var(--scanline-gap) - 1px),
    rgba(0,0,0,0.18) var(--scanline-gap)
  );
  pointer-events: none;
  z-index: 999;
}

/* ── CRT vignette ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.75) 100%);
  pointer-events: none;
  z-index: 998;
}

/* ── Entrance fade ── */
#app {
  opacity: 0;
  transition: opacity 0.8s ease;
}
#app.visible { opacity: 1; }

/* ── Marquee sign ── */
#marquee-sign {
  text-align: center;
  padding: 28px 16px 10px;
  position: relative;
}

#marquee-sign .sign-text {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.6rem, 5vw, 3.2rem);
  letter-spacing: 0.12em;
  color: var(--neon-yellow);
  text-shadow:
    0 0 6px  var(--neon-yellow),
    0 0 18px var(--neon-yellow),
    0 0 40px var(--neon-yellow),
    0 0 80px #ff8800;
  animation: sign-flicker 6s infinite;
}

.sign-tagline {
  font-family: 'VT323', monospace;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
  letter-spacing: 0.2em;
  margin-top: 6px;
  opacity: 0.9;
}

/* Marquee bulb string */
.bulb-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 10px 0 0;
}
.bulb {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--neon-yellow);
  box-shadow: 0 0 6px var(--neon-yellow), 0 0 12px #ff8800;
  animation: bulb-cycle 1.6s infinite;
}
.bulb:nth-child(odd)  { animation-delay: 0s; }
.bulb:nth-child(even) { animation-delay: 0.8s; }

/* ── Arcade room ── */
#arcade-room {
  position: relative;
  width: 100%;
  min-height: 480px;
  perspective: 900px;
  overflow: hidden;
}

/* Ceiling */
#ceiling {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 70px;
  background: var(--ceil-panel);
  border-bottom: 2px solid #2a004a;
  display: flex;
  align-items: flex-end;
  gap: 60px;
  padding: 0 40px 0;
  overflow: hidden;
}

.fluorescent {
  flex-shrink: 0;
  width: 120px; height: 14px;
  background: #e8f0ff;
  border-radius: 3px;
  box-shadow:
    0 0 10px #c0d8ff,
    0 0 30px #80b0ff,
    0 0 60px rgba(128,176,255,0.4);
  position: relative;
  top: -4px;
  animation: flicker-light 8s infinite;
}
.fluorescent:nth-child(2) { animation-delay: 2.5s; }
.fluorescent:nth-child(3) { animation-delay: 5s; }

/* Floor */
#floor {
  position: absolute;
  bottom: 0; left: -10%; right: -10%;
  height: 220px;
  background:
    /* checker pattern */
    repeating-conic-gradient(
      #1a0033 0% 25%,
      #0a0018 0% 50%
    ) 0 0 / 48px 48px;
  transform: rotateX(55deg);
  transform-origin: bottom center;
}

/* Back wall */
#back-wall {
  position: absolute;
  top: 70px; left: 0; right: 0;
  bottom: 220px;
  background: linear-gradient(180deg, #0d001a 0%, #12002a 100%);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 12px 40px;
  overflow: hidden;
}

/* Retro posters on back wall */
.wall-poster {
  flex-shrink: 0;
  width: 60px; height: 80px;
  border: 2px solid #3a006a;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  opacity: 0.7;
}
.wall-poster svg { width: 100%; height: 100%; }

/* ── Cabinet row ── */
#cabinet-row {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(16px, 3vw, 36px);
  padding: 80px clamp(16px, 4vw, 60px) 40px;
  flex-wrap: wrap;
  min-height: 480px;
}

/* ── Single cabinet ── */
.cabinet {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transform: perspective(700px) rotateX(2deg);
  transform-origin: bottom center;
  transition: transform 0.2s ease, filter 0.2s ease;
  user-select: none;
  text-decoration: none;
  width: clamp(100px, 14vw, 160px);
}

.cabinet:hover {
  transform: perspective(700px) rotateX(0deg) scale(1.06);
  filter: brightness(1.25) drop-shadow(0 0 18px var(--neon-cyan));
}
.cabinet:active {
  transform: perspective(700px) rotateX(1deg) scale(0.98);
}

/* Cabinet marquee header */
.cab-marquee {
  width: 100%;
  padding: 5px 4px 4px;
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.32rem, 1.1vw, 0.52rem);
  line-height: 1.4;
  letter-spacing: 0.05em;
  border-radius: 4px 4px 0 0;
  background: var(--marquee-color, #1a0033);
  color: #fff;
  text-shadow: 0 0 6px currentColor;
  box-shadow:
    0 0 8px var(--marquee-color, #b400ff),
    inset 0 0 12px rgba(255,255,255,0.05);
  word-break: break-word;
  hyphens: auto;
}

/* Cabinet body */
.cab-body {
  width: 100%;
  background: var(--cabinet-color, #12002a);
  padding: 4px;
  border-left: 3px solid rgba(255,255,255,0.08);
  border-right: 3px solid rgba(0,0,0,0.4);
}

/* Screen bezel */
.cab-screen-bezel {
  background: #050005;
  border: 2px solid #2a003a;
  border-radius: 2px;
  padding: 3px;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  width: 100%;
}

/* CRT screen glow overlay */
.cab-screen-bezel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
}

/* Screen content area */
.cab-screen {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1px;
  font-size: clamp(0.35rem, 1vw, 0.55rem);
  font-family: 'Press Start 2P', monospace;
  color: #fff;
}

.cab-screen img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Animated placeholder screen */
.screen-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: 'VT323', monospace;
  font-size: clamp(0.6rem, 1.8vw, 0.9rem);
  color: var(--screen-glow, #00ffff);
  background: #050010;
  text-align: center;
  padding: 4px;
  animation: screen-attract 3s infinite;
}

/* Control panel stub */
.cab-controls {
  width: 95%;
  height: 18px;
  background: var(--cabinet-color, #12002a);
  border-left: 2px solid rgba(255,255,255,0.07);
  border-right: 2px solid rgba(0,0,0,0.5);
  border-bottom: 3px solid rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
}

.joystick-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #333;
  border: 1px solid #555;
}
.button-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Cabinet base */
.cab-base {
  width: 90%;
  height: 22px;
  background: var(--cabinet-color, #12002a);
  border-radius: 0 0 4px 4px;
  border-bottom: 3px solid rgba(0,0,0,0.7);
  border-left: 2px solid rgba(255,255,255,0.05);
  border-right: 2px solid rgba(0,0,0,0.5);
}

/* Cabinet title below */
.cab-title {
  margin-top: 6px;
  font-family: 'VT323', monospace;
  font-size: clamp(0.65rem, 1.8vw, 0.9rem);
  color: var(--marquee-color, #b400ff);
  text-shadow: 0 0 6px var(--marquee-color, #b400ff);
  text-align: center;
  letter-spacing: 0.08em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Empty arcade state ── */
#empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 60px 20px;
  min-height: 400px;
}

.insert-coin {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1rem, 3vw, 1.8rem);
  color: var(--neon-yellow);
  text-shadow:
    0 0 8px var(--neon-yellow),
    0 0 24px var(--neon-yellow),
    0 0 48px #ff8800;
  animation: blink-coin 1.1s step-end infinite;
  text-align: center;
  letter-spacing: 0.1em;
}

.coming-soon {
  font-family: 'VT323', monospace;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
  letter-spacing: 0.2em;
  text-align: center;
}

/* Lonely flickering cabinet */
.lone-cabinet {
  opacity: 0;
  animation: ghost-cabinet 4s ease-in-out infinite;
}

/* ── Modal / game overlay ── */
#game-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#game-modal.open { display: flex; }

#modal-frame-wrap {
  position: relative;
  width: min(96vw, 900px);
  height: min(90vh, 680px);
  border: 3px solid var(--neon-cyan);
  box-shadow: 0 0 0 1px #000, 0 0 30px var(--neon-cyan), 0 0 60px rgba(0,245,255,0.3);
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}

#modal-frame-wrap iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}

#modal-close {
  position: absolute;
  top: 8px; right: 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--neon-pink);
  text-shadow: 0 0 8px var(--neon-pink);
  background: transparent;
  border: 1px solid var(--neon-pink);
  padding: 6px 10px;
  cursor: pointer;
  letter-spacing: 0.1em;
  z-index: 10;
}
#modal-close:hover { background: rgba(255,45,120,0.15); }

#modal-title {
  margin-top: 10px;
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--neon-cyan);
  letter-spacing: 0.2em;
  text-shadow: 0 0 8px var(--neon-cyan);
}

/* ── Footer ── */
#arcade-footer {
  text-align: center;
  padding: 24px 16px 32px;
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
  color: #440066;
  letter-spacing: 0.12em;
}

/* ── Animations ── */
@keyframes sign-flicker {
  0%,18%,20%,60%,62%,100% { opacity: 1; }
  19%,61%                   { opacity: 0.4; }
}

@keyframes bulb-cycle {
  0%,49%  { opacity: 1; box-shadow: 0 0 6px var(--neon-yellow), 0 0 12px #ff8800; }
  50%,100% { opacity: 0.2; box-shadow: none; }
}

@keyframes flicker-light {
  0%,94%,100% { opacity: 1; }
  95%,97%     { opacity: 0.3; }
  96%,98%     { opacity: 0.8; }
}

@keyframes blink-coin {
  0%,49%  { opacity: 1; }
  50%,100% { opacity: 0; }
}

@keyframes ghost-cabinet {
  0%,100%  { opacity: 0; }
  25%,75%  { opacity: 0.25; }
  50%       { opacity: 0.08; }
}

@keyframes screen-attract {
  0%,85%   { opacity: 1; }
  90%,95%  { opacity: 0.4; }
  92%      { opacity: 0.9; }
  100%     { opacity: 1; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  body::after,
  .cab-screen-bezel::before { display: none; }

  #app { opacity: 1; transition: none; }

  .sign-text,
  .fluorescent,
  .bulb,
  .insert-coin,
  .lone-cabinet,
  .screen-placeholder,
  #game-modal { animation: none !important; opacity: 1 !important; }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  #ceiling { gap: 30px; padding: 0 16px; }
  .fluorescent { width: 80px; }
  #back-wall { gap: 16px; padding: 8px 16px; }
  #cabinet-row { padding: 60px 8px 32px; gap: 12px; }
  .cabinet { width: clamp(80px, 28vw, 130px); }
}
