*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --cabinet-bg: #1a1a2e;
  --cabinet-dark: #0f0f1a;
  --marquee-bg: linear-gradient(180deg, #ff0040, #ff6b00, #ffd000);
  --bezel-bg: #111;
  --panel-bg: #222;
  --accent-red: #ff0040;
  --accent-blue: #0066ff;
  --accent-yellow: #ffd000;
  --accent-green: #00ff66;
  --neon-glow: 0 0 20px rgba(255, 0, 64, 0.5), 0 0 40px rgba(255, 0, 64, 0.3);
  --btn-color1: #ffd000;
  --btn-color2: #ff0040;
  --btn-color3: #0066ff;
  --btn-color4: #00ff66;
  --btn-color5: #ff6b00;
  --btn-color6: #9900ff;
}
html, body {
  width: 100%; height: 100%;
  background: #0a0a0f;
  color: #fff;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  overflow: hidden;
  user-select: none;
}
#app {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a0f 70%);
}
.cabinet {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 960px;
  display: flex; flex-direction: column;
  padding: 0 20px;
}
.marquee {
  position: relative;
  height: 70px;
  margin: 15px 0 0;
  background: linear-gradient(180deg, #1a0033, #2d004d);
  border: 2px solid #ff0040;
  border-radius: 8px 8px 0 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: var(--neon-glow);
}
.marquee-glow {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,0,64,0.1), rgba(255,107,0,0.15), rgba(255,208,0,0.1), transparent);
  animation: marqueeSweep 3s ease-in-out infinite;
}
@keyframes marqueeSweep {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}
.marquee-content {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  gap: 40px;
}
.game-title {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(90deg, #ff0040, #ff6b00, #ffd000, #ff6b00, #ff0040);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleShine 3s linear infinite;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: none;
  filter: drop-shadow(0 0 10px rgba(255, 0, 64, 0.5));
}
@keyframes titleShine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.coin-display, .start-display {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: #ffd000;
}
.coin-indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #333;
  border: 1px solid #666;
}
.coin-indicator.active { background: #00ff66; box-shadow: 0 0 10px #00ff66; }
.coin-key, .start-key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border: 1px solid rgba(255,208,0,0.5);
  border-radius: 3px;
  font-size: 10px; font-weight: bold; color: #ffd000;
}
.speaker-panel {
  position: absolute; top: 85px;
  width: 60px; height: 200px;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-lr;
  font-size: 10px; letter-spacing: 4px; color: rgba(255,255,255,0.08);
  font-weight: 900;
  pointer-events: none;
}
.speaker-left { left: 5px; }
.speaker-right { right: 5px; }
.screen-area {
  position: relative;
  flex: 1;
  margin: 8px 12px;
  display: flex; align-items: center; justify-content: center;
}
.bezel {
  position: relative;
  width: 100%; max-width: 800px;
  aspect-ratio: 4/3;
  background: var(--bezel-bg);
  border: 3px solid #333;
  border-radius: 12px;
  padding: 20px;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.8), 0 0 20px rgba(255,0,64,0.15);
}
.bezel-corner {
  position: absolute;
  width: 30px; height: 30px;
  border-color: #555; border-style: solid; z-index: 2;
}
.bezel-corner.tl { top: 5px; left: 5px; border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.bezel-corner.tr { top: 5px; right: 5px; border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }
.bezel-corner.bl { bottom: 5px; left: 5px; border-width: 0 0 2px 2px; border-radius: 0 0 0 4px; }
.bezel-corner.br { bottom: 5px; right: 5px; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }
.screen-wrapper {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  border-radius: 4px;
}
.screen-border {
  position: relative;
  width: 100%; height: 100%;
}
#canvas {
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
  background: #000;
}
.scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 1;
}
.screen-reflection {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 40%, transparent 60%, rgba(255,255,255,0.02) 100%);
  pointer-events: none;
  z-index: 2;
}
.overlay-status {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  background: rgba(0,0,0,0.7);
  transition: opacity 0.4s;
}
.overlay-status.hidden { opacity: 0; pointer-events: none; }
.status-content {
  text-align: center;
}
.status-icon { font-size: 48px; margin-bottom: 10px; color: #ff0040; }
.status-text { font-size: 24px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; }
.status-sub { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 5px; }
.control-panel {
  background: linear-gradient(180deg, var(--panel-bg), #1a1a2e);
  border: 2px solid #333;
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 12px 20px 10px;
  margin: 0 0 8px;
}
.panel-inner {
  display: flex; align-items: center; gap: 20px;
}
.joystick-area {
  display: flex; flex-direction: column; align-items: center;
  min-width: 80px;
}
.joystick-base {
  position: relative;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #444, #222);
  border: 2px solid #555;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.joystick-shaft {
  position: absolute;
  width: 14px; height: 40px;
  background: linear-gradient(90deg, #333, #555, #333);
  border-radius: 4px;
  top: -10px;
}
.joystick-ball {
  position: absolute;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff0040, #990026);
  top: -18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.joystick-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.3); margin-top: 4px;
}
.buttons-area {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.button-row {
  display: flex; gap: 8px;
  justify-content: center;
}
.arcade-btn {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: inherit;
  transition: transform 0.05s, box-shadow 0.05s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
}
.arcade-btn:active, .arcade-btn.pressed {
  transform: translateY(3px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.arcade-btn span { font-size: 14px; font-weight: bold; color: rgba(255,255,255,0.9); line-height: 1; }
.arcade-btn small { font-size: 7px; color: rgba(255,255,255,0.5); text-transform: uppercase; line-height: 1; }
.btn-yellow { background: radial-gradient(circle at 35% 35%, #ffd000, #b89400); }
.btn-red { background: radial-gradient(circle at 35% 35%, #ff3355, #b8002a); }
.btn-blue { background: radial-gradient(circle at 35% 35%, #3388ff, #0044b3); }
.btn-green { background: radial-gradient(circle at 35% 35%, #33ff77, #009944); }
.btn-orange { background: radial-gradient(circle at 35% 35%, #ff8833, #b85500); }
.btn-purple { background: radial-gradient(circle at 35% 35%, #aa44ff, #6600cc); }
.controls-help {
  display: flex; gap: 14px; justify-content: center;
  margin-top: 6px;
  font-size: 9px; color: rgba(255,255,255,0.2);
  letter-spacing: 0.5px;
}
.controls-help span { display: flex; align-items: center; gap: 3px; }
.game-bar {
  background: rgba(0,0,0,0.6);
  border-top: 1px solid #333;
  padding: 6px 0;
  width: 100%;
  max-width: 960px;
}
.bar-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 0 15px;
}
.bar-title {
  font-size: 10px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 2px; color: #ff0040;
  white-space: nowrap;
}
.game-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  flex: 1;
  padding: 2px 0;
  scrollbar-width: none;
}
.game-tabs::-webkit-scrollbar { display: none; }
.game-tab {
  padding: 4px 12px;
  font-size: 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
}
.game-tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
.game-tab.active {
  background: linear-gradient(90deg, rgba(255,0,64,0.3), rgba(255,107,0,0.3));
  border-color: #ff0040;
  color: #fff;
}
.bar-controls {
  display: flex; gap: 4px;
}
.bar-btn {
  width: 28px; height: 28px;
  border: 1px solid #444;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: #888;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}
.bar-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.loading-box {
  text-align: center;
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid #333;
  border-top-color: #ff0040;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 10px; }
.loading-bar {
  width: 200px; height: 4px;
  background: #333; border-radius: 2px; overflow: hidden;
}
.loading-progress {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff0040, #ffd000);
  border-radius: 2px;
  transition: width 0.3s;
}
@media (max-width: 640px) {
  .cabinet { padding: 0 8px; }
  .marquee { height: 50px; }
  .game-title { font-size: 16px; letter-spacing: 2px; }
  .marquee-content { gap: 15px; }
  .coin-key, .start-key { width: 16px; height: 16px; font-size: 8px; }
  .speaker-panel { display: none; }
  .bezel { padding: 10px; }
  .arcade-btn { width: 38px; height: 38px; }
  .arcade-btn span { font-size: 11px; }
  .arcade-btn small { display: none; }
  .control-panel { padding: 8px 10px; }
  .panel-inner { gap: 10px; }
  .joystick-area { min-width: 50px; }
  .joystick-base { width: 44px; height: 44px; }
  .joystick-shaft { width: 10px; height: 30px; top: -6px; }
  .joystick-ball { width: 18px; height: 18px; top: -12px; }
  .game-bar { font-size: 10px; }
  .game-tab { padding: 3px 8px; font-size: 10px; }
}
