/* ==========================================================================
   CODUM.TR — RETRO-FUTURISTIC ARCADE SNAKE CSS
   Isolated Component Stylesheet — Refined & Compact Proportions
   ========================================================================== */

.codum-arcade-section {
  padding: 40px 0 35px 0;
  position: relative;
  overflow: hidden;
}

/* Subtle ambient glow behind arcade cabinet */
.codum-arcade-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 540px;
  height: 380px;
  background: radial-gradient(circle, rgba(0, 245, 160, 0.08) 0%, rgba(0, 245, 212, 0.02) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.codum-arcade-section .codum-section-head {
  margin-bottom: 20px;
  text-align: center;
}

.codum-arcade-section .codum-section-head h2 {
  font-size: 1.75rem;
  margin: 6px 0 4px 0;
  letter-spacing: -0.02em;
}

.codum-arcade-section .codum-section-head p {
  font-size: 0.84rem;
  max-width: 520px;
  margin: 0 auto;
  color: var(--codum-text-muted, rgba(255, 255, 255, 0.7));
}

/* Viewport Container — Compact & Sleek Arcade Cabinet */
.codum-arcade-viewport {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(0, 245, 160, 0.24);
  background: radial-gradient(circle at 50% 15%, #081611 0%, #050b09 50%, #030605 100%);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85), inset 0 0 50px rgba(0, 245, 160, 0.03);
  padding: 16px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}

/* Top Telemetry & Scoreboard HUD */
.arcade-hud-header {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.arcade-score-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(8, 14, 12, 0.85);
  border: 1px solid rgba(0, 245, 160, 0.2);
  border-radius: 6px;
  padding: 6px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  min-width: 90px;
}

.arcade-score-card.score-rekor {
  align-items: flex-end;
  border-color: rgba(0, 245, 212, 0.2);
}

.arcade-score-label {
  font-family: 'Press Start 2P', var(--font-mono), monospace;
  font-size: 0.52rem;
  color: var(--codum-text-dim, rgba(255, 255, 255, 0.45));
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.arcade-score-val {
  font-family: 'Press Start 2P', var(--font-mono), monospace;
  font-size: 1.05rem;
  color: var(--codum-neon-green, #00f5a0);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(0, 245, 160, 0.4);
}

.score-rekor .arcade-score-val {
  color: var(--codum-cyan, #00f5d4);
  text-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}

/* Center HUD Badge */
.arcade-brand-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 16, 13, 0.9);
  border: 1px solid rgba(0, 245, 160, 0.3);
  border-radius: var(--radius-full, 9999px);
  padding: 4px 12px;
  font-family: var(--font-mono), monospace;
  font-size: 0.66rem;
  font-weight: 700;
  color: #d1fae5;
  letter-spacing: 0.06em;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.arcade-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--codum-neon-green, #00f5a0);
  box-shadow: 0 0 8px var(--codum-neon-green, #00f5a0);
  animation: arcade-pulse 1.8s infinite ease-in-out;
}

@keyframes arcade-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.25); box-shadow: 0 0 12px var(--codum-neon-green, #00f5a0); }
}

/* Main Canvas Wrapper — Compact & Sharp 280px Height */
.arcade-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 280px;
  border-radius: 10px;
  border: 1px solid rgba(0, 245, 160, 0.3);
  background-color: #030806;
  background-image: 
    linear-gradient(to right, rgba(0, 245, 160, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 245, 160, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(0, 245, 160, 0.03);
  overflow: hidden;
  box-sizing: border-box;
}

.arcade-canvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  cursor: default;
}

/* Overlay (Start, Pause, Game Over) */
.arcade-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 6, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  z-index: 15;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.arcade-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.arcade-overlay-title {
  font-family: 'Press Start 2P', var(--font-mono), monospace;
  font-size: 1.15rem;
  color: var(--codum-neon-green, #00f5a0);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(0, 245, 160, 0.5);
  line-height: 1.4;
}

.arcade-overlay-title.over {
  color: #ff3366;
  text-shadow: 0 0 14px rgba(255, 51, 102, 0.6);
}

.arcade-overlay-desc {
  font-family: var(--font-mono), monospace;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 380px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.arcade-score-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(14, 24, 20, 0.85);
  border: 1px solid rgba(0, 245, 160, 0.25);
  border-radius: 6px;
  padding: 8px 16px;
  margin-bottom: 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
}

.arcade-score-summary .stat-score {
  color: var(--codum-neon-green);
}

.arcade-score-summary .stat-rekor {
  color: var(--codum-cyan);
}

.arcade-record-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fbbf24;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  padding: 5px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
  animation: arcade-record-pulse 1.2s infinite alternate;
}

@keyframes arcade-record-pulse {
  from { transform: scale(0.96); box-shadow: 0 0 8px rgba(251, 191, 36, 0.2); }
  to { transform: scale(1.04); box-shadow: 0 0 16px rgba(251, 191, 36, 0.6); }
}

.arcade-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--codum-neon-green, #00f5a0) 0%, #00d9f5 100%);
  color: #030806;
  font-family: 'Press Start 2P', var(--font-mono), monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 10px 20px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 245, 160, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.arcade-btn-action:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 22px rgba(0, 245, 160, 0.55);
  filter: brightness(1.08);
}

.arcade-btn-action:active {
  transform: translateY(0) scale(0.98);
}

.arcade-control-hints {
  margin-top: 14px;
  font-family: var(--font-mono), monospace;
  font-size: 0.7rem;
  color: var(--codum-text-dim, rgba(255, 255, 255, 0.5));
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.arcade-kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 600;
}

/* Modern Round D-Pad Controls — Compact Desktop & Ergonomic Mobile */
.arcade-mobile-dpad {
  width: 100%;
  max-width: 260px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  box-sizing: border-box;
}

.dpad-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dpad-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 20, 16, 0.88);
  border: 1.5px solid rgba(0, 245, 160, 0.4);
  color: var(--codum-neon-green, #00f5a0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), inset 0 0 10px rgba(0, 245, 160, 0.1);
  cursor: pointer;
  transition: background 0.1s ease, transform 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.dpad-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}

.dpad-btn:hover {
  background: rgba(0, 245, 160, 0.16);
  border-color: var(--codum-neon-green, #00f5a0);
  color: #fff;
}

.dpad-btn:active,
.dpad-btn.active {
  background: rgba(0, 245, 160, 0.32);
  border-color: #00f5d4;
  transform: scale(0.92);
  box-shadow: 0 0 16px var(--codum-neon-green, #00f5a0);
  color: #fff;
}

.dpad-center-hub {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(6, 12, 10, 0.6);
  border: 1px dashed rgba(0, 245, 160, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dpad-center-hub-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 245, 160, 0.4);
}

.dpad-guidance-text {
  font-family: var(--font-mono), monospace;
  font-size: 0.64rem;
  color: var(--codum-text-dim, rgba(255, 255, 255, 0.45));
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .codum-arcade-section {
    padding: 35px 0 30px 0;
  }

  .codum-arcade-viewport {
    max-width: 100%;
    padding: 14px 12px 16px 12px;
  }

  .arcade-canvas-wrap {
    height: 260px;
  }

  .dpad-btn {
    width: 50px;
    height: 50px;
  }

  .dpad-btn svg {
    width: 20px;
    height: 20px;
  }

  .dpad-row {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .codum-arcade-section {
    padding: 30px 0 25px 0;
  }

  .arcade-canvas-wrap {
    height: 240px;
  }

  .arcade-score-card {
    min-width: 75px;
    padding: 4px 8px;
  }

  .arcade-score-val {
    font-size: 0.9rem;
  }

  .arcade-overlay-title {
    font-size: 0.95rem;
  }

  .arcade-overlay-desc {
    font-size: 0.7rem;
    margin-bottom: 12px;
  }

  .arcade-btn-action {
    font-size: 0.62rem;
    padding: 8px 16px;
  }
}
