@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
  --font-display: 'Press Start 2P', cursive;
  --font-ui: 'VT323', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body, html { width: 100%; height: 100%; overflow: hidden; font-family: var(--font-ui), system-ui; background: #000; }

#gameContainer {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: #111;
  box-shadow: inset 0 0 120px 40px rgba(0,0,0,0.9), inset 0 0 40px 10px rgba(0,0,0,0.5);
}

#gameCanvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

#scanlines {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  z-index: 10;
}

#ui-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

#hud {
  display: none;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 24px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  pointer-events: auto;
  justify-content: space-between;
  align-items: center;
  z-index: 30;
}

.hud-item {
  font-family: var(--font-ui);
  font-size: 28px;
  color: #FFD700;
  text-shadow: 0 0 8px rgba(255,215,0,0.5);
  letter-spacing: 2px;
}

.hud-btn {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 24px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s;
}

.hud-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: #FFD700;
  transform: scale(1.1);
}

.overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at center, rgba(10,10,30,0.92) 0%, rgba(0,0,0,0.97) 100%);
  pointer-events: auto;
  z-index: 50;
  gap: 20px;
}

.pixel-text {
  font-family: var(--font-display);
  text-shadow: 4px 4px 0px rgba(0,0,0,0.8), 0 0 20px rgba(255,215,0,0.4);
}

.game-title {
  font-size: 42px;
  color: #FFD700;
  margin-bottom: 10px;
  animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { transform: scale(1); text-shadow: 4px 4px 0px rgba(0,0,0,0.8), 0 0 20px rgba(255,215,0,0.4); }
  50% { transform: scale(1.05); text-shadow: 4px 4px 0px rgba(0,0,0,0.8), 0 0 40px rgba(255,215,0,0.7); }
}

.subtitle {
  font-family: var(--font-ui);
  font-size: 32px;
  color: #aaa;
  margin-bottom: 10px;
}

.whed-intro {
  font-family: var(--font-ui);
  font-size: 28px;
  color: #ccc;
}

.whed-name {
  color: #FF6B6B;
  font-weight: bold;
  font-size: 32px;
}

.arcade-btn {
  font-family: var(--font-display);
  font-size: 22px;
  color: #000;
  background: linear-gradient(180deg, #FFD700, #FFA500);
  border: 4px solid #FF8C00;
  padding: 16px 48px;
  border-radius: 12px;
  cursor: pointer;
  pointer-events: auto;
  text-transform: uppercase;
  letter-spacing: 3px;
  transition: all 0.2s;
  box-shadow: 0 6px 0 #B8860B, 0 0 30px rgba(255,215,0,0.3);
  margin-top: 15px;
}

.arcade-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #B8860B, 0 0 50px rgba(255,215,0,0.5);
  background: linear-gradient(180deg, #FFE44D, #FFB733);
}

.arcade-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #B8860B, 0 0 20px rgba(255,215,0,0.2);
}

.retry-btn {
  background: linear-gradient(180deg, #FF4444, #CC0000);
  border-color: #990000;
  color: #fff;
  box-shadow: 0 6px 0 #660000, 0 0 30px rgba(255,0,0,0.3);
}

.retry-btn:hover {
  background: linear-gradient(180deg, #FF6666, #EE2222);
  box-shadow: 0 9px 0 #660000, 0 0 50px rgba(255,0,0,0.5);
}

.retry-btn:active {
  box-shadow: 0 2px 0 #660000, 0 0 20px rgba(255,0,0,0.2);
}

.controls-hint {
  font-family: var(--font-ui);
  font-size: 24px;
  color: #888;
  text-align: center;
  margin-top: 20px;
  line-height: 2;
}

.death-title {
  font-size: 48px;
  color: #FF2222;
  text-shadow: 4px 4px 0px rgba(0,0,0,0.8), 0 0 30px rgba(255,0,0,0.6);
  animation: deathShake 0.5s ease-in-out;
}

@keyframes deathShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-15px) rotate(-2deg); }
  40% { transform: translateX(15px) rotate(2deg); }
  60% { transform: translateX(-10px) rotate(-1deg); }
  80% { transform: translateX(10px) rotate(1deg); }
}

.death-msg {
  font-family: var(--font-ui);
  font-size: 30px;
  color: #FF8888;
  margin-top: 10px;
}

.final-score {
  font-family: var(--font-ui);
  font-size: 36px;
  color: #FFD700;
}

.final-streak {
  font-family: var(--font-ui);
  font-size: 28px;
  color: #aaa;
}

.win-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 30px 60px;
  background: radial-gradient(ellipse, rgba(0,80,0,0.9), rgba(0,40,0,0.95));
  border: 4px solid #00FF00;
  border-radius: 20px;
  text-align: center;
  pointer-events: none;
  z-index: 60;
  animation: winPop 0.4s ease-out;
  box-shadow: 0 0 60px rgba(0,255,0,0.4);
}

.win-banner h2 {
  color: #00FF00;
  font-size: 36px;
}

.win-points {
  font-family: var(--font-ui);
  font-size: 32px;
  color: #FFD700;
  margin-top: 10px;
}

@keyframes winPop {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Shop styles */
.shop-title {
  font-size: 32px;
  color: #FFD700;
}

.shop-coins {
  font-family: var(--font-ui);
  font-size: 28px;
  color: #ffffff;
}

.shop-coins #shopPoints {
  color: #FFD700;
  font-weight: bold;
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 600px;
  width: 90%;
}

.shop-item {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
}

.shop-item:hover {
  border-color: #FFD700;
  background: rgba(255,255,255,0.12);
}

.shop-icon {
  font-size: 36px;
  margin-bottom: 6px;
}

.shop-name {
  font-family: var(--font-display);
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 4px;
}

.shop-desc {
  font-family: var(--font-ui);
  font-size: 20px;
  color: #cccccc;
  margin-bottom: 6px;
}

.shop-owned {
  font-family: var(--font-ui);
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 8px;
}

.shop-buy-btn {
  font-family: var(--font-display);
  font-size: 12px;
  color: #000;
  background: linear-gradient(180deg, #FFD700, #FFA500);
  border: 3px solid #FF8C00;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s;
  box-shadow: 0 4px 0 #B8860B;
}

.shop-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #B8860B;
  background: linear-gradient(180deg, #FFE44D, #FFB733);
}

.shop-buy-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #B8860B;
}

.shop-menu-btn {
  font-size: 18px;
  padding: 12px 36px;
}

/* Leaderboard panel - always visible in top-right corner */
.leaderboard-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
  pointer-events: none;
  z-index: 25;
  min-width: 170px;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 215, 0, 0.05);
}

.lb-header {
  font-family: var(--font-display);
  font-size: 11px;
  color: #FFD700;
  text-align: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
  letter-spacing: 1px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.lb-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.lb-label {
  font-family: var(--font-ui);
  font-size: 18px;
  color: #aaa;
  flex: 1;
  letter-spacing: 1px;
}

.lb-value {
  font-family: var(--font-ui);
  font-size: 20px;
  color: #FFD700;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
  min-width: 30px;
  text-align: right;
}