* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --pink: #ff4fa3;
  --cyan: #35e0ff;
  --yellow: #ffd94a;
  --purple: #b06cff;
  --dark: #0d0a1e;
  --panel: rgba(16, 10, 40, 0.92);
}

html, body {
  height: 100%;
  background: #060412;
  overflow: hidden;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-wrap {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  aspect-ratio: 16 / 9;
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: none;
  background: #000;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: clamp(8px, 1.6vmin, 14px);
}
.hud-top {
  position: absolute;
  top: 1.5%;
  left: 1.5%;
  right: 1.5%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.hud-bottom {
  position: absolute;
  bottom: 1.5%;
  left: 1.5%;
  right: 1.5%;
  display: flex;
  justify-content: space-between;
}
.hud-box {
  background: rgba(10, 6, 28, 0.7);
  border: 2px solid rgba(255, 79, 163, 0.5);
  padding: 0.5em 0.8em;
  display: flex;
  align-items: center;
  gap: 0.6em;
  text-shadow: 0 0 6px var(--pink);
}
.hud-label { color: var(--pink); font-size: 0.7em; }
#hud-combo { color: var(--yellow); text-shadow: 0 0 8px var(--yellow); }
#hud-laser-box, #hud-hairball-box { border-color: rgba(53, 224, 255, 0.5); }
#hud-laser-icon, #hud-hairball-icon { width: 2em; height: 2em; image-rendering: pixelated; }
.hud-flash { animation: hudflash 0.3s; }
@keyframes hudflash {
  0%, 100% { background: rgba(10, 6, 28, 0.7); }
  50% { background: rgba(255, 40, 60, 0.85); }
}

.coin-dot {
  display: inline-block;
  width: 0.9em; height: 0.9em;
  background: var(--yellow);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--yellow), inset -2px -2px 0 rgba(160, 100, 0, 0.6);
  vertical-align: middle;
}

/* ---------- Screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2vmin;
  text-align: center;
  font-size: clamp(9px, 1.8vmin, 16px);
  z-index: 5;
}
.screen.overlay { background: rgba(6, 4, 18, 0.82); }

.screen h2 {
  font-size: 2em;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan), 3px 3px 0 #14346b;
  letter-spacing: 0.08em;
}

/* Title */
.title-logo { line-height: 1.05; margin-top: -1vmin; }
.title-meow {
  font-size: clamp(30px, 8.5vmin, 74px);
  color: var(--pink);
  text-shadow: 0 0 18px var(--pink), 0 0 44px rgba(255, 79, 163, 0.55), 4px 4px 0 #5c1040;
  letter-spacing: 0.06em;
  animation: neon 2.4s ease-in-out infinite;
}
.title-command {
  font-size: clamp(18px, 5vmin, 44px);
  color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan), 3px 3px 0 #0c3a5c;
  letter-spacing: 0.34em;
  margin-left: 0.34em;
}
@keyframes neon {
  0%, 100% { text-shadow: 0 0 18px var(--pink), 0 0 44px rgba(255,79,163,.55), 4px 4px 0 #5c1040; }
  50% { text-shadow: 0 0 26px var(--pink), 0 0 70px rgba(255,79,163,.8), 4px 4px 0 #5c1040; }
}
#title-cat {
  width: clamp(90px, 20vmin, 190px);
  image-rendering: pixelated;
}
.title-stats {
  display: flex;
  gap: 3em;
  color: var(--yellow);
  font-size: 0.85em;
  text-shadow: 0 0 6px rgba(255, 217, 74, 0.7);
  background: rgba(6, 4, 18, 0.75);
  padding: 0.6em 1.2em;
  border: 1px solid rgba(176, 108, 255, 0.3);
}
.title-hint {
  font-size: 0.62em;
  color: #a99ee0;
  letter-spacing: 0.1em;
  background: rgba(6, 4, 18, 0.75);
  padding: 0.5em 1em;
}

/* Buttons */
.menu { display: flex; flex-direction: column; gap: 1.4vmin; align-items: center; }
.btn {
  font-family: inherit;
  font-size: 1em;
  color: #fff;
  background: linear-gradient(180deg, #2a1b5e, #170f38);
  border: 2px solid var(--purple);
  box-shadow: 0 0 10px rgba(176, 108, 255, 0.35), inset 0 0 12px rgba(176, 108, 255, 0.15);
  padding: 0.85em 1.6em;
  cursor: pointer;
  letter-spacing: 0.1em;
  min-width: 15em;
  text-shadow: 0 0 6px rgba(176, 108, 255, 0.9);
  transition: transform 0.06s, box-shadow 0.12s;
}
.btn:hover {
  border-color: var(--pink);
  box-shadow: 0 0 16px rgba(255, 79, 163, 0.6), inset 0 0 14px rgba(255, 79, 163, 0.25);
  transform: translateY(-2px);
}
.btn:active { transform: translateY(1px); }
.btn-big {
  border-color: var(--pink);
  color: #fff;
  font-size: 1.15em;
  box-shadow: 0 0 16px rgba(255, 79, 163, 0.55), inset 0 0 14px rgba(255, 79, 163, 0.2);
}
.btn-small { min-width: 0; padding: 0.6em 1em; font-size: 0.8em; }

/* Help */
#screen-help { background: var(--panel); }
.help-body {
  max-width: 72%;
  text-align: left;
  font-size: 0.72em;
  line-height: 2;
  color: #cfc8f2;
}
.help-body b { color: var(--yellow); }
.help-body p { margin-bottom: 0.9em; }
.key {
  color: var(--cyan);
  border: 1px solid var(--cyan);
  padding: 0.15em 0.45em;
  margin-right: 0.5em;
  box-shadow: 0 0 6px rgba(53, 224, 255, 0.4);
}

/* Shop */
#screen-shop {
  background: var(--panel);
  justify-content: flex-start;
  padding: 2.5vmin 3vmin;
  gap: 1.6vmin;
}
.shop-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.shop-header h2 { font-size: 1.5em; }
.shop-coins {
  color: var(--yellow);
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-shadow: 0 0 8px rgba(255, 217, 74, 0.7);
}
.shop-tabs { display: flex; gap: 0.8vmin; flex-wrap: wrap; justify-content: center; }
.shop-tab {
  font-family: inherit;
  font-size: 0.75em;
  color: #9a8fd6;
  background: transparent;
  border: 2px solid #3a2a77;
  padding: 0.7em 1.2em;
  cursor: pointer;
  letter-spacing: 0.08em;
}
.shop-tab.active {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(53, 224, 255, 0.4);
  text-shadow: 0 0 6px rgba(53, 224, 255, 0.8);
}
.shop-grid {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5em, 1fr));
  gap: 1.2vmin;
  align-content: start;
  padding-bottom: 1vmin;
}
.shop-card {
  background: rgba(30, 18, 66, 0.75);
  border: 2px solid #3a2a77;
  padding: 1em 0.6em 0.9em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7em;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.shop-card:hover { border-color: var(--purple); box-shadow: 0 0 12px rgba(176, 108, 255, 0.35); }
.shop-card.equipped {
  border-color: var(--yellow);
  box-shadow: 0 0 14px rgba(255, 217, 74, 0.4);
}
.shop-card.locked { opacity: 0.9; }
.shop-card canvas {
  width: 6.5em; height: 6.5em;
  image-rendering: pixelated;
  background: rgba(6, 4, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.shop-card .card-name { font-size: 0.68em; color: #e8e2ff; line-height: 1.5; }
.shop-card .card-desc { font-size: 0.5em; color: #8f86c9; line-height: 1.6; min-height: 2.6em; }
.shop-card .card-price {
  font-size: 0.62em;
  color: var(--yellow);
  display: flex; align-items: center; gap: 0.4em;
}
.shop-card .card-price.owned { color: #6ee79a; }
.shop-card .card-price.equipped-tag { color: var(--yellow); }
.shop-card .card-price.cant { color: #ff5f6e; }

/* Game over */
.over-title { color: var(--pink) !important; text-shadow: 0 0 16px var(--pink), 3px 3px 0 #5c1040 !important; }
.over-sub { color: #8f86c9; font-size: 0.75em; margin-top: -1.4vmin; }
.over-stats {
  display: flex;
  flex-direction: column;
  gap: 1.2vmin;
  font-size: 1em;
  color: #e8e2ff;
}
.over-stats span { color: var(--cyan); }
.over-coins, .over-coins span { color: var(--yellow) !important; text-shadow: 0 0 8px rgba(255,217,74,.6); }
#over-best { color: var(--pink); animation: neon 1.2s infinite; }

/* Scrollbar */
.shop-grid::-webkit-scrollbar { width: 10px; }
.shop-grid::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.shop-grid::-webkit-scrollbar-thumb { background: #3a2a77; }
