@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: radial-gradient(circle at center, #040404 0%, #000 100%);
  font-family: "Press Start 2P", monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  position: relative;
  color: #00ff9f;
}

/* CRT scanlines overlay */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 2px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 999;
}

.game-container {
  position: relative;
  display: inline-block;
  border: 4px solid #00ff9f;
  box-shadow: 0 0 25px #00ff9f88;
}

canvas {
  display: block;
  background: radial-gradient(circle at center, #000010, #000);
}

#ui {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  line-height: 1.4;
  text-shadow: 0 0 4px #00ff9f, 0 0 8px #00ff9f;
}

#overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10;
}

.panel {
  text-align: center;
  border: 3px solid #00ff9f;
  width: 70%;
  max-width: 600px;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.4);
  animation: glowPulse 3s infinite ease-in-out;
  box-shadow: 0 0 25px #00ff9f, inset 0 0 10px #00ff9f;
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 20px #00ff9f, inset 0 0 6px #00ff9f; border-color: #00ff9f; }
  25% { box-shadow: 0 0 25px #ff00c8, inset 0 0 8px #ff00c8; border-color: #ff00c8; }
  50% { box-shadow: 0 0 25px #00ffff, inset 0 0 8px #00ffff; border-color: #00ffff; }
  75% { box-shadow: 0 0 25px #ff00c8, inset 0 0 8px #ff00c8; border-color: #ff00c8; }
  100% { box-shadow: 0 0 20px #00ff9f, inset 0 0 6px #00ff9f; border-color: #00ff9f; }
}

.arcade-title {
  font-size: 14px;
  margin-bottom: 20px;
  text-shadow:
    0 0 4px #00ff9f,
    0 0 8px #ff00c8,
    0 0 12px #00ffff;
  animation: titleGlow 4s infinite ease-in-out;
}

@keyframes titleGlow {
  0% { color: #00ff9f; text-shadow: 0 0 8px #00ff9f; }
  33% { color: #ff00c8; text-shadow: 0 0 8px #ff00c8; }
  66% { color: #00ffff; text-shadow: 0 0 8px #00ffff; }
  100% { color: #00ff9f; text-shadow: 0 0 8px #00ff9f; }
}

#owlPreview {
  display: block;
  margin: 0 auto 20px auto;
  background: transparent;
}

.help {
  font-size: 9px;
  color: #ffffffbb;
  margin-bottom: 20px;
}

.sub {
  font-size: 10px;
  color: #ffffffcc;
  margin-bottom: 15px;
}

.flicker { animation: flicker 1.3s infinite alternate; }

@keyframes flicker {
  0% { opacity: 1; }
  40% { opacity: 0.6; }
  100% { opacity: 1; }
}

.btn {
  background-color: #00ff9f;
  color: #000;
  font-family: "Press Start 2P", monospace;
  border: none;
  padding: 8px 16px;
  font-size: 10px;
  cursor: pointer;
  box-shadow: 0 0 12px #00ff9f;
  transition: transform 0.15s;
}

.btn:hover { transform: scale(1.1); }

.menu-field {
  margin: 12px 0 16px 0;
  text-align: center;
}

.menu-field label {
  display: block;
  font-size: 9px;
  color: #ffffffcc;
  margin-bottom: 8px;
}

.menu-field input,
.menu-field select {
  width: 80%;
  max-width: 320px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.75);
  color: #00ff9f;
  border: 2px solid #00ff9f;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  text-align: center;
  outline: none;
  box-shadow: 0 0 10px #00ff9f55;
}

.menu-field input::placeholder {
  color: #ffffff66;
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.secondary-btn {
  background-color: #ff00c8;
  color: #fff;
  box-shadow: 0 0 12px #ff00c8;
}

.hidden {
  display: none !important;
}

.leaderboard-panel {
  width: 80%;
  max-width: 700px;
}

.leaderboard-list {
  margin: 20px auto;
  max-height: 280px;
  overflow-y: auto;
  text-align: left;
  font-size: 12px;
  line-height: 1.6;
  border: 2px solid #00ff9f55;
  padding: 12px;
  background: rgba(0, 0, 0, 0.5);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 48px 1fr 90px 80px 72px;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  align-items: center;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-empty {
  text-align: center;
  color: #ffffff99;
  padding: 20px 0;
}

.leaderboard-owl-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaderboard-owl-canvas {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  background: transparent;
}

.owl-picker-field {
  margin: 8px 0 20px 0;
}

.owl-slider-row {
  display: grid;
  grid-template-columns: 44px 160px 44px;
  align-items: center;
  justify-content: center;
  column-gap: 10px;
}

.owl-slider-row #owlPreview {
  margin: 0;
}

.owl-nav-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #00ff9f;
  box-shadow: none;
  border: none;
}

.owl-nav-btn:hover {
  transform: scale(1.15);
  background: transparent;
  color: #00ff9f;
  box-shadow: none;
}

.owl-name {
  margin-top: 8px;
  font-size: 10px;
  color: #ffffffcc;
  text-align: center;
}