/* ============================================================
   FREE BROWSER GAMES — Arcade-Brutalist Portal
   Heavy borders, neon signs, CRT atmosphere, monospace structure.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #0a0807;
  --bg-warm: #0d0a08;
  --bg-elevated: #14100c;
  --bg-cabinet: #16110d;
  --bg-cabinet-hi: #1c1612;

  /* Text */
  --fg: #f4ebd0;          /* warm off-white, slightly aged */
  --fg-bright: #ffffff;
  --fg-dim: #8a7a65;
  --fg-muted: #4a3f33;

  /* Arcade neons */
  --neon-amber: #ffb347;
  --neon-amber-hot: #ff8c1a;
  --neon-red: #ff3322;
  --neon-pink: #ff2dc4;
  --neon-cyan: #00ffff;
  --neon-green: #00ff66;

  /* Frame/border colors */
  --frame: #2a1f15;
  --frame-bright: #5a3f25;
  --frame-hot: #ff6600;

  /* Per-card accents (overridden inline) */
  --accent: var(--neon-cyan);
  --accent-2: var(--neon-pink);

  /* Type */
  --font-marquee: 'Major Mono Display', 'JetBrains Mono', monospace;
  --font-mono: 'JetBrains Mono', monospace;
  --font-crt: 'VT323', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   Atmosphere layers — fixed, behind everything
   ============================================================ */

/* Grid backdrop — thicker and amber-tinted, more present than before */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255,140,40,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,140,40,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  animation: gridDrift 80s linear infinite;
}

@keyframes gridDrift {
  to { background-position: 40px 40px, 40px 40px; }
}

/* Warm radial glow from the top — like an arcade marquee lighting the room */
.bg-glow {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,140,40,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 90%, rgba(255,45,196,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(0,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* Faint CRT scanlines over the whole page (subtle — not the loud version) */
.bg-scanlines {
  position: fixed; inset: 0; z-index: 100;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.5;
}

body > *:not(.bg-grid):not(.bg-glow):not(.bg-scanlines) {
  position: relative; z-index: 2;
}

/* ============================================================
   MARQUEE — the arcade-sign style header
   ============================================================ */

.marquee {
  position: relative;
  margin: 32px auto 0;
  max-width: 1280px;
  padding: 0 32px;
}

/* The bulb strips above and below the marquee — pulsing dots */
.marquee-bulbs {
  height: 16px;
  background-image:
    radial-gradient(circle, var(--neon-amber) 2px, transparent 3px),
    radial-gradient(circle, rgba(255,179,71,0.3) 6px, transparent 7px);
  background-size: 22px 16px, 22px 16px;
  background-position: 8px center, 8px center;
  animation: bulbsBlink 1.4s steps(2, start) infinite;
}

@keyframes bulbsBlink {
  0%, 49% { filter: brightness(1); }
  50%, 100% { filter: brightness(0.55); }
}

.marquee-bulbs-bottom {
  animation-delay: 0.7s; /* alternate with top */
}

/* The main marquee content */
.marquee-content {
  position: relative;
  background: linear-gradient(180deg, #1a0e08 0%, #0e0805 100%);
  border: 4px solid var(--frame-hot);
  border-top: none;
  border-bottom: none;
  padding: 32px 24px 36px;
  text-align: center;
  box-shadow:
    inset 0 0 60px rgba(255,102,0,0.15),
    0 0 40px rgba(255,102,0,0.25);
}

/* Corner stars on the marquee */
.marquee-corner {
  position: absolute;
  font-family: var(--font-crt);
  font-size: 24px;
  color: var(--neon-amber);
  text-shadow: 0 0 8px var(--neon-amber);
  animation: cornerTwinkle 2s ease-in-out infinite;
}
.marquee-corner-tl { top: 8px; left: 12px; }
.marquee-corner-tr { top: 8px; right: 12px; animation-delay: 0.5s; }
.marquee-corner-bl { bottom: 8px; left: 12px; animation-delay: 1s; }
.marquee-corner-br { bottom: 8px; right: 12px; animation-delay: 1.5s; }

@keyframes cornerTwinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.marquee-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--neon-amber);
  text-shadow: 0 0 8px rgba(255,179,71,0.6);
  margin-bottom: 14px;
  animation: eyebrowScroll 14s linear infinite;
}

@keyframes eyebrowScroll {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.55; }
}

/* The actual neon title */
.marquee-title {
  font-family: var(--font-marquee);
  font-size: clamp(28px, 6.5vw, 78px);
  font-weight: normal;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--neon-amber);
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  /* Multi-layer text-shadow to fake neon tube glow without expensive blur */
  text-shadow:
    0 0 4px var(--neon-amber),
    0 0 12px var(--neon-amber-hot),
    0 0 24px rgba(255,140,26,0.7),
    0 0 48px rgba(255,140,26,0.4),
    2px 2px 0 #1a0a00;
  animation: titleHum 4s ease-in-out infinite;
}

@keyframes titleHum {
  0%, 92%, 100% { filter: brightness(1); }
  93% { filter: brightness(0.7); }
  94% { filter: brightness(1); }
  96% { filter: brightness(0.85); }
}

.marquee-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--fg-dim);
  margin-top: 18px;
}

.signature {
  color: var(--neon-amber);
}

/* ============================================================
   STATUS BAR — the line below the marquee, like a machine's info strip
   ============================================================ */

.status-bar {
  max-width: 1280px;
  margin: 16px auto 48px;
  padding: 0 32px;
}

.status-bar-inner {
  display: flex;
  gap: 0;
  border: 2px solid var(--frame-bright);
  background: #0a0604;
  font-family: var(--font-mono);
}

.status-item {
  flex: 1;
  padding: 12px 18px;
  border-right: 2px solid var(--frame);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.status-item:last-child { border-right: none; }

.status-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
}

.status-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-credit {
  color: var(--neon-amber);
  font-family: var(--font-crt);
  font-size: 24px;
  line-height: 1;
}

.status-item-power {
  flex: 0 0 auto;
  background: rgba(0,255,102,0.04);
  position: relative;
}

.status-item-power .status-value {
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green);
}

.status-led {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--neon-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon-green);
  animation: ledPulse 1.6s ease-in-out infinite;
}

@keyframes ledPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   Page layout
   ============================================================ */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

/* ============================================================
   PROMPT — the "select a cabinet" intro
   ============================================================ */

.prompt {
  text-align: center;
  padding: 40px 0 56px;
  border-bottom: 2px dashed var(--frame);
  margin-bottom: 56px;
}

.prompt-arrows {
  font-family: var(--font-crt);
  font-size: 28px;
  color: var(--neon-amber);
  letter-spacing: 0.3em;
  margin-bottom: 12px;
  animation: arrowBounce 1.2s ease-in-out infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(6px); opacity: 1; }
}

.prompt-text {
  font-family: var(--font-crt);
  font-size: 36px;
  color: var(--fg);
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-shadow: 0 0 8px rgba(255,179,71,0.3);
}

.prompt-blink {
  color: var(--neon-amber);
  animation: cursorBlink 1s steps(2, start) infinite;
}

@keyframes cursorBlink {
  to { opacity: 0; }
}

.prompt-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  margin-top: 16px;
  text-transform: uppercase;
}

/* ============================================================
   CABINETS — arcade-cabinet shaped cards
   ============================================================ */

.cabinets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 32px;
  margin-bottom: 80px;
}

/* Each cabinet — has marquee strip, screen, control panel */
.cabinet {
  position: relative;
  background: var(--bg-cabinet);
  border: 3px solid var(--frame-bright);
  border-radius: 6px 6px 4px 4px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
  animation: cabinetEnter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  overflow: hidden;
}

.cabinet:nth-child(1) { animation-delay: 0.1s; }
.cabinet:nth-child(2) { animation-delay: 0.2s; }
.cabinet:nth-child(3) { animation-delay: 0.3s; }
.cabinet:nth-child(4) { animation-delay: 0.4s; }
.cabinet:nth-child(5) { animation-delay: 0.5s; }

@keyframes cabinetEnter {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.cabinet:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow:
    0 12px 0 -2px rgba(0,0,0,0.6),
    0 0 40px rgba(255,140,40,0.15),
    0 0 0 1px var(--accent) inset;
}

/* The "marquee strip" at the top of each cabinet — title in neon */
.cab-marquee {
  position: relative;
  background: linear-gradient(180deg, #1a1410 0%, #100a07 100%);
  border-bottom: 3px solid var(--frame-bright);
  padding: 18px 20px 16px;
  text-align: center;
  overflow: hidden;
}

/* Bulbs on either side of the title */
.cab-marquee::before,
.cab-marquee::after {
  content: '● ● ●';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 2px;
  opacity: 0.7;
  text-shadow: 0 0 6px var(--accent);
}
.cab-marquee::before { left: 10px; }
.cab-marquee::after  { right: 10px; }

.cab-title {
  font-family: var(--font-marquee);
  font-size: 22px;
  font-weight: normal;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1;
  text-shadow:
    0 0 4px var(--accent),
    0 0 12px var(--accent),
    0 0 24px rgba(255,255,255,0.2),
    2px 2px 0 #000;
}

/* The "screen" — the canvas preview, with bezel */
.cab-screen-bezel {
  background: #000;
  padding: 12px;
  border-bottom: 3px solid var(--frame-bright);
  position: relative;
}

.cab-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
  border: 2px solid #1a1410;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.cab-screen canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Scanlines on the screen */
.cab-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.25) 0px,
    rgba(0,0,0,0.25) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* CRT vignette on the screen */
.cab-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Status badge — top right of screen */
.cab-status {
  position: absolute;
  top: 18px; right: 18px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 4px 8px;
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--accent);
  color: var(--accent);
  z-index: 3;
  text-transform: uppercase;
  text-shadow: 0 0 4px var(--accent);
}

/* Year badge — top left of screen */
.cab-year {
  position: absolute;
  top: 18px; left: 18px;
  font-family: var(--font-crt);
  font-size: 16px;
  color: var(--fg);
  padding: 2px 8px;
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--frame-bright);
  z-index: 3;
  line-height: 1.2;
}

/* The "control panel" — info area below the screen */
.cab-panel {
  padding: 20px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.cab-tagline {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(255,255,255,0.1);
}

.cab-description {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-dim);
  line-height: 1.65;
}

.cab-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.cab-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--frame-bright);
  color: var(--fg-dim);
}

.cab-id {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
  text-transform: uppercase;
  margin-left: auto;
  display: flex;
  align-items: center;
}

/* The play button — looks like a physical arcade button */
.cab-buttons {
  padding: 16px 20px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 2px dashed var(--frame);
  margin-top: 16px;
}

.cab-controls {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  text-transform: uppercase;
  flex: 1;
  line-height: 1.4;
}

.cab-play {
  position: relative;
  font-family: var(--font-marquee);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: #000;
  background: var(--accent);
  padding: 12px 22px 12px 22px;
  border: 2px solid #000;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  /* arcade button feel — physical depth */
  box-shadow:
    0 4px 0 0 #000,
    0 0 12px var(--accent);
}

.cabinet:hover .cab-play {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 0 #000,
    0 0 20px var(--accent);
}

.cab-play::after {
  content: ' ▸';
}

/* Coin slot — a physical detail at the bottom of each cabinet */
.cab-coinslot {
  height: 8px;
  background: #000;
  border-top: 2px solid var(--frame-bright);
  position: relative;
}

.cab-coinslot::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 3px;
  background: #1a0a00;
  border: 1px solid #000;
  border-radius: 1px;
}

/* ============================================================
   COMING SOON — empty cabinet slots
   ============================================================ */

.coming-soon {
  border-top: 2px dashed var(--frame);
  padding-top: 48px;
}

.coming-soon-header {
  text-align: center;
  font-family: var(--font-marquee);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--neon-amber);
  text-shadow: 0 0 8px rgba(255,179,71,0.5);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.cs-flicker {
  color: var(--neon-red);
  font-family: var(--font-crt);
  font-size: 28px;
  animation: csflicker 0.6s steps(2, start) infinite;
  text-shadow: 0 0 10px var(--neon-red);
}

@keyframes csflicker {
  to { opacity: 0.3; }
}

.coming-soon-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.empty-slot {
  border: 2px dashed var(--frame-bright);
  padding: 36px 16px;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--fg-muted);
  background: rgba(255,255,255,0.01);
  position: relative;
}

.empty-slot-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.2em;
  margin-bottom: 4px;
}

.empty-slot-num {
  display: block;
  font-family: var(--font-marquee);
  font-size: 36px;
  color: var(--frame-bright);
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  border-top: 4px double var(--frame-bright);
  background: var(--bg-warm);
  padding: 0;
  margin-top: 32px;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-right: 2px solid var(--frame);
  border-left: 2px solid var(--frame);
}

.footer-cell {
  padding: 20px 24px;
  border-right: 2px solid var(--frame);
  font-family: var(--font-mono);
}

.footer-cell:last-child { border-right: none; }

.footer-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.footer-value {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--fg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 720px) {
  .marquee { padding: 0 16px; margin-top: 16px; }
  .marquee-content { padding: 24px 12px 28px; }
  .marquee-title { font-size: clamp(24px, 9vw, 48px); letter-spacing: 0.02em; }
  .marquee-eyebrow { font-size: 9px; letter-spacing: 0.2em; }
  .marquee-corner { font-size: 16px; }

  .status-bar { padding: 0 16px; }
  .status-bar-inner { flex-wrap: wrap; }
  .status-item { flex: 1 1 50%; border-bottom: 2px solid var(--frame); }
  .status-item:nth-last-child(-n+2) { border-bottom: none; }

  .page { padding: 0 16px 48px; }
  .prompt-text { font-size: 24px; }
  .cabinets { grid-template-columns: 1fr; gap: 24px; }
  .cab-title { font-size: 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-cell { border-right: none; border-bottom: 2px solid var(--frame); }
  .footer-cell:last-child { border-bottom: none; }
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
