/* ===== Arcade Cabinet ===== */

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  min-height: 100vh;
  color: #eee;
  font-family: 'VT323', 'Press Start 2P', monospace;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse at 50% 30%, #1a1a2a 0%, #050508 60%, #000 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 10px 40px;
  min-height: 100vh;
  box-sizing: border-box;
}

#arcade {
  width: 100%;
  max-width: 1080px;
}

.cabinet {
  position: relative;
  background: linear-gradient(180deg, #c11818 0%, #8a0a0a 100%);
  border-radius: 24px 24px 12px 12px;
  padding: 14px 18px 18px;
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.8),
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -6px 20px rgba(0, 0, 0, 0.5);
  border: 3px solid #3a0505;
}

.cabinet::before,
.cabinet::after {
  content: '';
  position: absolute;
  top: 40px;
  bottom: 20px;
  width: 14px;
  background: linear-gradient(90deg, #7a0606, #c11818);
  border-radius: 4px;
}
.cabinet::before { left: 4px; }
.cabinet::after  { right: 4px; }

/* Marquee */
.marquee {
  background: linear-gradient(180deg, #fff3a8 0%, #ffd641 50%, #ffaa08 100%);
  border: 3px solid #3a0505;
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.6),
    inset 0 -3px 8px rgba(0, 0, 0, 0.2),
    0 4px 20px rgba(255, 170, 8, 0.4);
  position: relative;
  margin-bottom: 12px;
}

.marquee h1 {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1rem, 3vw, 1.8rem);
  color: #c11818;
  text-shadow:
    2px 2px 0 #fff,
    3px 3px 0 #3a0505,
    0 0 16px rgba(255, 230, 100, 0.6);
  letter-spacing: 0.1em;
  line-height: 1.1;
}

.marquee-stars {
  font-size: 0.8rem;
  color: #8a0a0a;
  letter-spacing: 0.5em;
  margin-top: 4px;
}

/* CRT Bezel */
.bezel {
  position: relative;
  background: #111;
  border-radius: 16px;
  padding: 24px;
  border: 8px solid #0a0a0a;
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.95),
    inset 0 4px 12px rgba(0, 0, 0, 1),
    0 0 0 3px #3a0505,
    0 10px 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.screen {
  position: relative;
  background: #0a0a18;
  border-radius: 10px;
  min-height: 560px;
  padding: 20px;
  overflow: hidden;
  z-index: 1;
  box-shadow: inset 0 0 80px rgba(0, 100, 180, 0.15);
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.18) 2px,
      rgba(0, 0, 0, 0.18) 3px
    );
  z-index: 5;
  border-radius: 10px;
  mix-blend-mode: multiply;
}

.crt-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 30% 10%,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0) 50%
  );
  z-index: 6;
  border-radius: 10px;
}

.game-panel {
  color: #d0e8ff;
}
.game-panel.hidden { display: none; }

/* Menu */
.crt-title {
  font-family: 'Press Start 2P', monospace;
  color: #00f0ff;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  text-align: center;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
  margin-bottom: 8px;
  letter-spacing: 0.1em;
  animation: crt-flicker 4s infinite;
}

.crt-subtitle {
  text-align: center;
  color: #88d0ff;
  font-size: 1.2rem;
  margin-bottom: 24px;
  opacity: 0.85;
}

@keyframes crt-flicker {
  0%, 98%, 100% { opacity: 1; }
  99% { opacity: 0.6; }
}

#game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  padding: 4px;
  max-width: 820px;
  margin: 0 auto;
}

.game-card {
  font-family: 'Press Start 2P', monospace;
  background: #000c;
  border: 3px solid var(--game-color, #00f0ff);
  color: #fff;
  padding: 14px 8px;
  cursor: pointer;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow:
    0 0 0 1px #000 inset,
    0 4px 12px rgba(0, 0, 0, 0.6),
    0 0 12px var(--game-color, #00f0ff);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}
.game-card:hover,
.game-card:focus {
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    0 0 0 1px #000 inset,
    0 6px 20px rgba(0, 0, 0, 0.8),
    0 0 20px var(--game-color, #00f0ff),
    0 0 40px var(--game-color, #00f0ff);
  background: linear-gradient(180deg, #001a2a, #000);
  outline: none;
}
.card-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  line-height: 1;
  filter: drop-shadow(0 0 8px var(--game-color, #00f0ff));
}
.card-name {
  font-size: 0.7rem;
  color: var(--game-color, #00f0ff);
  text-shadow: 0 0 6px currentColor;
}
.card-tag {
  display: block;
  margin-top: 6px;
  font-size: 0.55rem;
  color: #fff8;
  letter-spacing: 0.1em;
}

.crt-footer {
  text-align: center;
  color: #ffc107;
  margin-top: 32px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
}
.blink-slow { animation: blink 1.5s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* Control panel */
.control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  color: #ffe;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  gap: 10px;
  flex-wrap: wrap;
}
.arcade-btn {
  background: #ffd641;
  color: #3a0505;
  border: 3px solid #3a0505;
  padding: 8px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  cursor: pointer;
  border-radius: 6px;
  letter-spacing: 0.1em;
  box-shadow: 0 3px 0 #3a0505, 0 0 12px rgba(255, 214, 65, 0.4);
  transition: transform 0.1s;
}
.arcade-btn:hover { background: #ffe870; transform: translateY(-1px); }
.arcade-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #3a0505; }
.arcade-btn.hidden { visibility: hidden; }

.brand {
  color: #ffd641;
  text-shadow: 0 0 8px rgba(255, 214, 65, 0.6);
  flex: 1;
  text-align: center;
}
.coins {
  color: #00f0ff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
}

/* Joystick + buttons row */
.joystick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 30px 0;
  gap: 20px;
}
.joystick {
  width: 44px;
  height: 60px;
  background: radial-gradient(circle at 50% 20%, #f22, #800 70%);
  border: 3px solid #222;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: relative;
  box-shadow: inset 0 -4px 8px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.6);
}
.joystick::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 10px;
  background: #222;
  border-radius: 50%;
  box-shadow: 0 3px 4px rgba(0,0,0,0.6);
}
.arcade-buttons {
  display: flex;
  gap: 10px;
}
.ab {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #111;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.5), 0 3px 5px rgba(0,0,0,0.5);
}
.ab.red { background: radial-gradient(circle at 40% 30%, #ff6464, #a00); }
.ab.yellow { background: radial-gradient(circle at 40% 30%, #ffe870, #c80); }
.ab.green { background: radial-gradient(circle at 40% 30%, #6cff64, #080); }
.ab.blue { background: radial-gradient(circle at 40% 30%, #64a8ff, #004); }

@media (max-width: 640px) {
  .joystick-row { display: none; }
  .cabinet::before, .cabinet::after { display: none; }
  .bezel { padding: 12px; }
  .screen { padding: 12px; min-height: 500px; }
  .control-panel { font-size: 0.6rem; }
}

/* Shared generic game UI */
.mini-game {
  color: #d0e8ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: 'VT323', monospace;
}
.mini-game h2 {
  font-family: 'Press Start 2P', monospace;
  color: #ffd641;
  font-size: 1.2rem;
  text-shadow: 0 0 10px rgba(255, 214, 65, 0.6);
  letter-spacing: 0.08em;
  margin: 0;
}
.mini-game .hud {
  display: flex;
  gap: 20px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: #00f0ff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}
.mini-game .hud span strong {
  color: #fff;
  margin-left: 6px;
}
.mini-game .mg-info {
  font-size: 1.1rem;
  color: #c8d8ff;
  text-align: center;
  min-height: 1.5em;
}
.mini-game button.mg-btn {
  font-family: 'Press Start 2P', monospace;
  background: #ffd641;
  color: #3a0505;
  border: 2px solid #3a0505;
  padding: 8px 14px;
  font-size: 0.7rem;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 3px 0 #3a0505;
  letter-spacing: 0.08em;
}
.mini-game button.mg-btn:hover { background: #ffe870; }
.mini-game button.mg-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3a0505; }
.mini-game canvas {
  background: #0a0a18;
  border: 3px solid #00f0ff;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), inset 0 0 30px rgba(0,0,0,0.6);
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.mini-game .mg-controls-help {
  color: #888;
  font-size: 0.95rem;
  font-family: 'VT323', monospace;
  text-align: center;
}
.mg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  font-family: 'Press Start 2P', monospace;
  color: #ffd641;
  text-align: center;
  padding: 20px;
  border-radius: 10px;
  z-index: 10;
}
.mg-overlay .big {
  font-size: 1.4rem;
  text-shadow: 0 0 12px rgba(255, 214, 65, 0.8);
}
.mg-overlay .sub {
  font-size: 0.9rem;
  color: #00f0ff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

/* Reversi inside arcade: reduce padding — existing styles still apply */
#reversi-screen #app {
  background: transparent;
}
#reversi-screen h1 {
  font-size: 1.4rem;
}

/* Menu screen needs to be relative for overlays */
#menu-screen, #generic-screen, #reversi-screen {
  position: relative;
  min-height: 520px;
}
