:root {
  --bg-dark: #0a0b10;
  --bg-surface: #131722;
  --bg-card: rgba(23, 28, 43, 0.95);
  --border-color: #242c42;
  --neon-cyan: #00f0ff;
  --neon-pink: #ff007f;
  --neon-yellow: #ffd000;
  --neon-green: #39ff14;
  --text-main: #f0f4fc;
  --text-muted: #8b9bb4;
  --font-display: 'Courier New', Courier, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

.arcade-container {
  width: 100vw;
  height: 100vh;
  max-width: none;
  background: var(--bg-surface);
  border: none;
  border-radius: 0;
  padding: 8px 14px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Header */
.arcade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px var(--neon-cyan));
}

.logo h1 {
  font-size: 1.4rem;
  font-family: var(--font-display);
  letter-spacing: 2px;
  color: var(--text-main);
}

.logo h1 span {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.game-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--text-main);
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.nav-btn.active {
  background: var(--neon-cyan);
  color: #000;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.arcade-actions {
  display: flex;
  gap: 6px;
}

.action-btn {
  background: #1c2233;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.action-btn:hover {
  background: #252e46;
  border-color: var(--neon-cyan);
}

/* HUD */
.arcade-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(10, 11, 16, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 16px;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hud-label {
  font-size: 0.7rem;
  font-family: var(--font-display);
  color: var(--text-muted);
  letter-spacing: 1px;
}

.hud-value {
  font-size: 1.15rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
}

.hud-value.highlight {
  color: var(--neon-green);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}

/* Stage & Canvas */
.arcade-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #050608;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1a2030;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  cursor: default;
}

/* Overlay Screen */
.arcade-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  padding: 20px;
  transition: opacity 0.25s ease;
}

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

.overlay-card {
  background: var(--bg-card);
  border: 2px solid var(--neon-cyan);
  border-radius: 16px;
  padding: 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overlay-card h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--neon-cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.overlay-card p {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.overlay-controls {
  background: rgba(10, 11, 16, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

kbd {
  background: #252e46;
  color: var(--neon-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #3d496a;
  font-family: var(--font-display);
  font-size: 0.78rem;
}

.arcade-primary-btn {
  background: var(--neon-cyan);
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
  transition: all 0.2s ease;
}

.arcade-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.8);
}

/* Touch Controls */
.arcade-touch-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(10, 11, 16, 0.6);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  touch-action: manipulation;
}

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

.dpad-middle {
  display: flex;
  gap: 4px;
}

.touch-btn {
  background: #1f273b;
  border: 1px solid var(--border-color);
  color: var(--neon-cyan);
  font-size: 1.1rem;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}

.touch-btn:active {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 10px var(--neon-cyan);
}

.btn-action {
  width: 90px;
  height: 52px;
  background: #ff007f20;
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.btn-action:active {
  background: var(--neon-pink);
  color: #fff;
  box-shadow: 0 0 12px var(--neon-pink);
}

@media (max-width: 600px) {
  .arcade-header {
    flex-direction: column;
    align-items: stretch;
  }
  .game-nav {
    justify-content: center;
  }
  .arcade-hud {
    grid-template-columns: repeat(2, 1fr);
  }
}

