/* ============================================
   PIXEL HOOP MASTER - Premium CSS
   ============================================ */

:root {
  --pixel-bg: #1a1a2e;
  --pixel-accent: #f0a500;
  --pixel-secondary: #008891;
  --pixel-danger: #e94560;
  --pixel-border: #f0f0f0;
  --pixel-card: #16213e;
  --pixel-radius: 4px; /* Essential for pixel art feel */
}

/* --- Base Body Overlap --- */
.pixel-game-body {
  background: var(--pixel-bg) !important;
  font-family: 'Press Start 2P', cursive;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* --- Container --- */
.game-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 60px); /* Minus header height */
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  background: #1e3a5f;
}

/* --- UI Layers --- */
.ui-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100; /* Ensure UI is on top */
}

.menu-screen, .hud-screen {
  pointer-events: auto;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(4px);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.hud-screen {
  background: transparent;
  backdrop-filter: none;
  justify-content: space-between;
  padding: 20px;
  pointer-events: none;
}

.pixel-text {
  font-size: 24px;
  color: var(--pixel-accent);
  text-shadow: 4px 4px 0 #000;
  margin-bottom: 40px;
  text-align: center;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 90%;
  max-width: 400px;
}

.pixel-btn {
  background: var(--pixel-card);
  color: #fff;
  border: 4px solid var(--pixel-accent);
  padding: 16px;
  font-size: 14px;
  font-family: 'Press Start 2P', cursive;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 6px 6px 0 #000;
  position: relative;
}

.pixel-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #000;
  background: #25335a;
}

.pixel-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.pixel-btn.secondary {
  border-color: var(--pixel-secondary);
}

.pixel-box {
  background: rgba(0,0,0,0.8);
  border: 3px solid #fff;
  padding: 10px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
}

/* --- Settings --- */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 90%;
  max-width: 400px;
  margin-bottom: 40px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 12px;
  padding: 10px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

.pixel-input {
  background: var(--pixel-card);
  color: #fff;
  border: 2px solid var(--pixel-accent);
  padding: 5px;
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
}

/* --- HUD Elements --- */
.hud-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.score-display {
  background: rgba(0,0,0,0.8);
  padding: 15px 25px;
  border: 4px solid #fff;
  display: flex;
  gap: 20px;
  font-size: 24px;
}

.vs-text { font-size: 14px; opacity: 0.5; align-self: center; }

/* --- Mobile Controls --- */
.mobile-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}

.joystick-zone {
  width: 150px; height: 150px;
  pointer-events: auto;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
}

.action-btn {
  width: 70px; height: 70px;
  background: rgba(255,255,255,0.2);
  border: 4px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-family: 'Press Start 2P', cursive;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shoot-btn {
  width: 100px; height: 100px;
  background: var(--pixel-accent);
  font-size: 14px;
}

.sub-actions {
  display: flex;
  gap: 10px;
}

/* --- Shot Meter --- */
.shot-meter-container {
  position: absolute;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 20px;
  background: rgba(0,0,0,0.8);
  border: 2px solid #fff;
}

.shot-meter-bar {
  position: relative;
  width: 100%;
  height: 100%;
}

.perfect-zone {
  position: absolute;
  top: 0;
  left: 70%;
  width: 10%;
  height: 100%;
  background: #22c55e;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--pixel-accent);
  transition: background 0.1s;
}

.meter-fill.perfect { background: #fff; box-shadow: 0 0 10px #fff; }

/* --- Utility --- */
.hidden { display: none !important; }

/* ===== SKIN SELECTOR ===== */
.skin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.skin-tab {
  padding: 10px 20px;
  background: rgba(255,255,255,0.08);
  border: 3px solid rgba(255,255,255,0.2);
  color: #aaa;
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.skin-tab.active {
  background: rgba(168,85,247,0.3);
  border-color: #a855f7;
  color: #fff;
  box-shadow: 0 0 12px rgba(168,85,247,0.4);
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 480px;
  width: 90%;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  margin-bottom: 16px;
}

.skin-card {
  background: rgba(30, 41, 59, 0.9);
  border: 3px solid rgba(255,255,255,0.15);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.skin-card:hover {
  border-color: #a855f7;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(168,85,247,0.3);
}

.skin-card.equipped {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  box-shadow: 0 0 15px rgba(34,197,94,0.25);
}

.skin-card.locked {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.skin-card.locked:hover {
  border-color: #f0a500;
  opacity: 0.85;
  filter: none;
}

.skin-avatar {
  width: 56px;
  height: 72px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skin-avatar-body {
  width: 24px;
  height: 36px;
  border-radius: 8px 8px 4px 4px;
  position: absolute;
  bottom: 12px;
}

.skin-avatar-head {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  top: 0;
}

.skin-avatar-leg-l, .skin-avatar-leg-r {
  width: 8px;
  height: 16px;
  border-radius: 0 0 4px 4px;
  position: absolute;
  bottom: 0;
}

.skin-avatar-leg-l { left: 12px; }
.skin-avatar-leg-r { right: 12px; }

.skin-avatar-shoe-l, .skin-avatar-shoe-r {
  width: 12px;
  height: 6px;
  border-radius: 2px;
  position: absolute;
  bottom: 0;
}

.skin-avatar-shoe-l { left: 8px; }
.skin-avatar-shoe-r { right: 8px; }

.skin-name {
  font-family: 'Press Start 2P', cursive;
  font-size: 7px;
  color: #fff;
  text-align: center;
  line-height: 1.3;
}

.skin-price {
  font-family: 'Press Start 2P', cursive;
  font-size: 7px;
  color: #f0a500;
}

.skin-status {
  font-family: 'Press Start 2P', cursive;
  font-size: 7px;
  padding: 4px 10px;
  border: 2px solid;
  text-align: center;
}

.skin-status.equipped-badge {
  color: #22c55e;
  border-color: #22c55e;
}

.skin-status.buy-badge {
  color: #f0a500;
  border-color: #f0a500;
  cursor: pointer;
}

.skin-status.buy-badge:hover {
  background: rgba(240,165,0,0.2);
}

.skin-status.equip-badge {
  color: #3b82f6;
  border-color: #3b82f6;
  cursor: pointer;
}

.skin-status.equip-badge:hover {
  background: rgba(59,130,246,0.2);
}

.skin-preview-label {
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  color: #a855f7;
  text-align: center;
  min-height: 18px;
  margin-bottom: 12px;
}

.skin-card .rarity-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
}

@media (max-width: 480px) {
  .skin-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .skin-tab { font-size: 7px; padding: 8px 12px; }
}
/* --- Map Selection --- */
.map-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 4px solid var(--pixel-secondary);
  padding: 8px 12px;
  cursor: pointer;
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  color: #fff;
  transition: all 0.2s;
  box-shadow: 4px 4px 0 #000;
  margin-right: 15px;
  pointer-events: auto;
}

.map-switcher:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
}

#map-menu {
  position: absolute;
  top: 80px;
  right: 150px;
  background: rgba(15, 23, 42, 0.98);
  border: 4px solid var(--pixel-accent);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
  z-index: 2000;
  width: 220px;
  box-shadow: 8px 8px 0 #000;
  pointer-events: auto;
}

.map-option {
  padding: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.1s;
  font-size: 8px;
}

.map-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.map-option.active {
  background: var(--pixel-accent);
  color: #000;
  border-color: #fff;
}
