/* ═══════════════════════════════════════════════════════════════
   arcade_zone.css  –  Styles for the Interactive Arcade Zone
   ═══════════════════════════════════════════════════════════════ */

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

.arcade-zone-section {
  background-color: #05070e;
  background-image: 
    linear-gradient(rgba(255, 0, 128, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 128, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  padding: var(--space-20) var(--space-8);
  border-bottom: var(--border-lg);
  color: var(--color-bg-cream);
  position: relative;
  overflow: hidden;
}

.arcade-zone-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  position: relative;
  z-index: var(--z-base);
}

.arcade-zone-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.arcade-zone-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(24px, 5vw, 42px);
  color: hsl(330, 100%, 58%);
  text-shadow: 0 0 10px hsl(330, 100%, 58%), 0 0 20px rgba(255, 0, 128, 0.4);
  text-transform: uppercase;
}

.arcade-zone-sub {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(10px, 2vw, 12px);
  color: hsl(140, 100%, 50%);
  text-shadow: 0 0 8px rgba(0, 255, 0, 0.4);
}

/* ── ARCADE CABINET CONSOLE ──────────────────────────────────── */

.arcade-cabinet {
  width: 100%;
  max-width: 600px;
  background-color: #1a1d24;
  border: 16px solid #2d3139;
  border-bottom-width: 24px;
  border-radius: var(--radius-lg);
  box-shadow: 
    0 20px 40px rgba(0,0,0,0.8),
    inset 0 0 20px rgba(0,0,0,0.9);
  position: relative;
  overflow: hidden;
}

/* Speaker grill style details */
.arcade-cabinet::before {
  content: '░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background-color: #14171d;
  color: #2d3139;
  font-family: monospace;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  overflow: hidden;
  border-bottom: 4px solid var(--color-ink);
}

/* CRT Screen Wrapper */
.arcade-screen-wrapper {
  margin-top: 20px; /* Spacer below speakers */
  background-color: #000;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0,0,0,1);
}

/* Inner neon green screen bezel glow */
.arcade-screen-glow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.15);
  pointer-events: none;
  z-index: 8;
  transition: box-shadow var(--duration-base) ease;
}

.arcade-screen-glow.pink {
  box-shadow: inset 0 0 20px rgba(255, 0, 128, 0.2);
}

.arcade-screen-glow.blue {
  box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.2);
}

/* CRT Screen Scanline CSS Overlay */
.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 4px, 6px 100%;
  animation: crtFlicker 0.15s infinite;
}

@keyframes crtFlicker {
  0% { opacity: 0.985; }
  50% { opacity: 1.0; }
  100% { opacity: 0.99; }
}

/* Game canvas and viewport */
.game-viewport {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

#arcade-canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* Screen overlay text info */
.game-overlay-text {
  position: absolute;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: hsl(140, 100%, 50%);
  text-shadow: 0 0 5px rgba(0,255,0,0.5);
  text-align: center;
  pointer-events: none;
}

.game-score-board {
  position: absolute;
  top: var(--space-3);
  left: var(--space-4);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #fff;
  z-index: 7;
}

/* ── GAME SELECTION PUSH-BUTTONS ─────────────────────────────── */

.arcade-control-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.arcade-panel-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: hsl(0, 0%, 50%);
  text-transform: uppercase;
}

.arcade-buttons-row {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-4);
  background-color: #14171d;
  border: 4px solid var(--color-ink);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.arcade-push-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--color-ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  outline: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.arcade-push-btn::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background-image: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.4) 0%, transparent 60%);
  pointer-events: none;
}

.arcade-push-btn .btn-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.8);
  margin-top: 2px;
}

/* Button colors */
.arcade-push-btn.red {
  background-color: #ef4444;
  box-shadow: 0 6px 0 #b91c1c, 0 8px 10px rgba(0,0,0,0.5);
}
.arcade-push-btn.red.active, .arcade-push-btn.red:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b91c1c, 0 4px 5px rgba(0,0,0,0.5);
}

.arcade-push-btn.blue {
  background-color: #3b82f6;
  box-shadow: 0 6px 0 #1d4ed8, 0 8px 10px rgba(0,0,0,0.5);
}
.arcade-push-btn.blue.active, .arcade-push-btn.blue:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1d4ed8, 0 4px 5px rgba(0,0,0,0.5);
}

.arcade-push-btn.yellow {
  background-color: #f59e0b;
  box-shadow: 0 6px 0 #b45309, 0 8px 10px rgba(0,0,0,0.5);
}
.arcade-push-btn.yellow.active, .arcade-push-btn.yellow:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b45309, 0 4px 5px rgba(0,0,0,0.5);
}

/* ── TIC-TAC-TOE GAME BOARD ──────────────────────────────────── */

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  width: 260px;
  height: 260px;
  background-color: var(--color-ink);
  border: 4px solid var(--color-ink);
  border-radius: var(--radius-sm);
  display: none;
}

.ttt-cell {
  background-color: #0b0d19;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--duration-fast) ease;
  position: relative;
}

.ttt-cell:hover {
  background-color: #121528;
}

/* Glowing signs */
.ttt-symbol {
  font-family: 'Press Start 2P', monospace;
  font-size: 32px;
  line-height: 1;
}

.ttt-symbol.x {
  color: var(--color-neon-blue);
  text-shadow: 0 0 10px var(--color-neon-blue);
}

.ttt-symbol.u {
  color: var(--color-neon-pink);
  text-shadow: 0 0 10px var(--color-neon-pink);
}

/* ── GAME CONTROLS INSTRUCTIONS BAR ──────────────────────────── */

.arcade-help-bar {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: hsl(0, 0%, 70%);
  text-align: center;
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-6);
  background-color: #090b12;
  margin-top: var(--space-4);
  max-width: 450px;
}

/* ── SYNTHWAVE WINNER POPUP MODAL ─────────────────────────────── */

.arcade-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background-color: rgba(5, 7, 14, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) ease;
  padding: var(--space-4);
}

.arcade-modal.active {
  opacity: 1;
  pointer-events: all;
}

.arcade-modal-content {
  background-color: #0c0f18;
  border: var(--border-lg);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 
    0 0 30px rgba(255, 0, 128, 0.3),
    10px 10px 0 var(--color-ink);
  transform: scale(0.9);
  transition: transform var(--duration-base) var(--ease-bounce);
}

.arcade-modal.active .arcade-modal-content {
  transform: scale(1);
}

.arcade-modal-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 20px;
  color: hsl(140, 100%, 50%);
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
  margin-bottom: var(--space-6);
  text-transform: uppercase;
}

.arcade-modal-desc {
  font-size: var(--text-md);
  color: var(--color-bg-cream);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-6);
}

.arcade-coupon-code {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: var(--text-2xl);
  color: var(--color-primary);
  background-color: var(--color-ink);
  border: 3px dashed var(--color-primary);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  letter-spacing: 2px;
  margin-bottom: var(--space-8);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
}

.arcade-modal-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: var(--text-xs);
  width: 100%;
  background-color: var(--color-neon-pink);
  color: #fff;
  border: var(--border-lg);
  border-radius: var(--radius-pill);
  box-shadow: 5px 5px 0 var(--color-ink);
  padding: var(--space-4) 0;
  cursor: pointer;
  transition: transform var(--duration-fast) ease;
}

.arcade-modal-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--color-ink);
}

/* ── RESPONSIVE DESIGN & VIRTUAL TOUCH GAMEPAD ──────────────── */

.arcade-touch-controls {
  display: none;
  width: 100%;
  max-width: 480px;
  margin-top: var(--space-6);
  padding: var(--space-4);
  background-color: #14171d;
  border: 4px solid var(--color-ink);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 5px 5px 0 var(--color-ink);
  justify-content: space-between;
  align-items: center;
}

.touch-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dpad-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dpad-btn {
  width: 46px;
  height: 46px;
  background-color: #2d3139;
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 var(--color-ink);
  transition: transform 0.05s ease, background-color 0.1s ease;
  user-select: none;
  touch-action: manipulation;
}

.dpad-btn:active {
  transform: translate(1px, 1px);
  background-color: var(--color-accent-pink);
  box-shadow: 1px 1px 0 var(--color-ink);
}

.dpad-center {
  width: 46px;
  height: 46px;
  background-color: #14171d;
  border-radius: var(--radius-sm);
}

.touch-actions {
  display: flex;
  align-items: center;
}

.action-btn.fire {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #ef4444;
  border: 4px solid var(--color-ink);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 #b91c1c, 0 6px 8px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
}

.action-btn.fire:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #b91c1c, 0 2px 4px rgba(0,0,0,0.5);
  background-color: #f87171;
}

/* Tablet & Mobile Breakpoints */
@media (max-width: 1024px) {
  .arcade-touch-controls {
    display: flex;
  }
  .arcade-cabinet {
    max-width: 480px;
    border-width: 10px;
  }
}

@media (max-width: 767px) {
  .arcade-cabinet {
    max-width: 100%;
    border-width: 8px;
    border-bottom-width: 16px;
  }
  .arcade-screen-wrapper {
    margin-top: 10px;
  }
  .arcade-cabinet::before {
    font-size: 10px;
    height: 16px;
    line-height: 16px;
  }
  .arcade-push-btn {
    width: 70px;
    height: 70px;
  }
  .arcade-push-btn .btn-text {
    font-size: 6px;
  }
  .ttt-board {
    width: 220px;
    height: 220px;
  }
  .ttt-symbol {
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .arcade-buttons-row {
    gap: var(--space-3);
    padding: var(--space-2);
  }
  .arcade-push-btn {
    width: 60px;
    height: 60px;
  }
  .arcade-help-bar {
    font-size: 16px;
    padding: var(--space-2);
  }
  .arcade-touch-controls {
    padding: var(--space-2);
  }
  .action-btn.fire {
    width: 64px;
    height: 64px;
    font-size: 8px;
  }
}
