/* =========================================================
   COCKROACH KILLER 5000 — styles.css
   happystoner5420 Games
   ========================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Impact', 'Arial Black', 'Helvetica', sans-serif;
  color: #eee;
  cursor: none;
}

/* --------- Screens --------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.screen.active {
  display: flex;
}

/* --------- MAIN MENU --------- */
#main-menu {
  background: radial-gradient(ellipse at center, #2a1a0a 0%, #0a0604 70%, #000 100%);
  overflow: hidden;
}

.menu-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(120, 60, 20, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(80, 30, 10, 0.3) 0%, transparent 50%),
    repeating-linear-gradient(45deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 2px, transparent 2px, transparent 6px);
  pointer-events: none;
}

#menu-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
  z-index: 1;
}

.menu-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px;
}

.title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  filter: drop-shadow(0 6px 20px rgba(220, 30, 0, 0.45));
}

.title-line-1, .title-line-2 {
  font-size: clamp(48px, 9vw, 120px);
  line-height: 0.95;
  color: #e8d4a0;
  text-shadow:
    0 0 1px #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    0 4px 0 #5a2a0a,
    0 6px 12px rgba(0,0,0,0.7);
  transform: skewX(-4deg);
}

.title-line-3 {
  font-size: clamp(72px, 14vw, 180px);
  line-height: 0.9;
  color: #ff3a1a;
  text-shadow:
    0 0 1px #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    0 6px 0 #6a0a00,
    0 10px 25px rgba(255, 60, 0, 0.6);
  transform: skewX(-4deg);
  animation: pulse-red 2.4s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.3); }
}

.tagline {
  font-family: 'Courier New', monospace;
  font-size: clamp(13px, 1.4vw, 18px);
  color: #c8a878;
  letter-spacing: 0.2em;
  margin-bottom: 50px;
  text-transform: uppercase;
  opacity: 0.85;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.menu-btn {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: clamp(18px, 2vw, 26px);
  letter-spacing: 0.15em;
  padding: 16px 60px;
  min-width: 320px;
  background: linear-gradient(180deg, #1a0e06 0%, #2a160a 50%, #0a0604 100%);
  color: #e8d4a0;
  border: 2px solid #5a3a1a;
  cursor: none;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.menu-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,180,80,0.18), transparent);
  transform: translateX(-100%);
  transition: transform 350ms ease;
}

.menu-btn:hover::before { transform: translateX(100%); }

.menu-btn:hover {
  background: linear-gradient(180deg, #3a2010 0%, #5a3018 50%, #1a0e06 100%);
  border-color: #c89860;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 120, 30, 0.35);
}

.menu-btn:active { transform: translateY(0); }

.menu-btn.primary {
  background: linear-gradient(180deg, #6a1a08 0%, #a02810 50%, #4a1006 100%);
  border-color: #ff6030;
  color: #fff;
}
.menu-btn.primary:hover {
  background: linear-gradient(180deg, #8a2810 0%, #d03818 50%, #5a1208 100%);
  box-shadow: 0 8px 28px rgba(255, 60, 20, 0.55);
}

.menu-btn.danger { border-color: #6a2018; color: #d8a090; }
.menu-btn.danger:hover { border-color: #a83828; color: #fff; background: linear-gradient(180deg, #3a0a04 0%, #6a1208 50%, #1a0402 100%); }

.menu-footer {
  margin-top: 40px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #6a4828;
  letter-spacing: 0.3em;
}

/* --------- Panels (How to play, Credits, Exit) --------- */
.panel {
  background: linear-gradient(180deg, #1a0e06 0%, #0a0604 100%);
  border: 2px solid #5a3a1a;
  padding: 40px 50px;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), inset 0 0 40px rgba(0,0,0,0.4);
  text-align: center;
  position: relative;
}

.panel.small { max-width: 460px; padding: 36px 40px; }

.panel h2 {
  font-size: clamp(32px, 4.5vw, 52px);
  color: #ff5a2a;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
  text-shadow: 0 4px 16px rgba(255, 80, 20, 0.5);
  text-transform: uppercase;
}

.instructions {
  text-align: left;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.7;
  color: #d8c8a8;
  margin-bottom: 28px;
}

.instructions p { margin: 14px 0; }
.instructions b { color: #ffb060; letter-spacing: 0.08em; }
.instructions ul { margin: 8px 0 8px 24px; }
.instructions li { margin: 6px 0; }
.w-icon { display: inline-block; width: 28px; font-size: 18px; }

.credits-roll {
  font-family: 'Georgia', serif;
  line-height: 2;
  color: #d8c8a8;
  margin-bottom: 28px;
}
.credit-studio {
  font-size: 30px;
  color: #ff5a2a;
  letter-spacing: 0.15em;
  margin-bottom: 24px;
  text-shadow: 0 0 20px rgba(255,80,20,0.4);
}
.credit-thanks {
  margin-top: 24px;
  font-style: italic;
  color: #a88858;
}
.credit-year {
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #6a4828;
}

.exit-msg { font-size: 18px; color: #d8c8a8; margin-bottom: 12px; }
.exit-msg-small { font-size: 13px; color: #8a7858; margin-bottom: 24px; font-family: 'Courier New', monospace; }

/* --------- GAME SCREEN --------- */
#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #1a0f08;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.75) 0%, transparent 100%);
  z-index: 10;
  pointer-events: none;
}

.hud-stats { display: flex; gap: 36px; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: #a88858;
}
.stat-value {
  font-family: 'Impact', sans-serif;
  font-size: 28px;
  color: #ffd080;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.hud-btn {
  pointer-events: auto;
  cursor: none;
  font-family: 'Impact', sans-serif;
  letter-spacing: 0.2em;
  padding: 10px 22px;
  background: rgba(40, 20, 10, 0.85);
  color: #ffb060;
  border: 2px solid #6a3a18;
  font-size: 14px;
}
.hud-btn:hover { background: rgba(80, 40, 20, 0.95); border-color: #c89860; color: #fff; }

/* Weapon Panel */
#weapon-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 100%);
  z-index: 10;
}

.weapon-slot {
  position: relative;
  width: 96px;
  padding: 10px 8px;
  text-align: center;
  background: linear-gradient(180deg, #1a0e06 0%, #0a0604 100%);
  border: 2px solid #5a3a1a;
  cursor: none;
  transition: all 120ms ease;
}

.weapon-slot:hover {
  border-color: #c89860;
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(255, 140, 40, 0.4);
}

.weapon-slot.active {
  border-color: #ff5a2a;
  background: linear-gradient(180deg, #3a1408 0%, #1a0604 100%);
  box-shadow: 0 0 24px rgba(255, 80, 20, 0.6), inset 0 0 20px rgba(255, 80, 20, 0.15);
  transform: translateY(-4px);
}

.weapon-slot.disabled {
  opacity: 0.35;
  filter: grayscale(1);
}

.weapon-icon { font-size: 32px; line-height: 1; margin-bottom: 4px; }
.weapon-name {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #c8a878;
}
.weapon-ammo {
  font-family: 'Impact', sans-serif;
  font-size: 18px;
  color: #ffd080;
  margin-top: 2px;
}

/* Wave Announcement */
#wave-announce {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 12;
  pointer-events: none;
  animation: wave-pop 2.6s ease-out forwards;
}
#wave-announce.hidden { display: none; }

.wave-title {
  font-size: clamp(60px, 10vw, 140px);
  color: #ff3a1a;
  letter-spacing: 0.1em;
  text-shadow: 0 0 30px rgba(255, 60, 20, 0.8), 0 6px 0 #4a0a00, 0 10px 30px rgba(0,0,0,0.9);
  transform: skewX(-4deg);
}
.wave-sub {
  font-family: 'Courier New', monospace;
  font-size: clamp(14px, 1.8vw, 22px);
  color: #ffd080;
  letter-spacing: 0.25em;
  margin-top: 12px;
}

@keyframes wave-pop {
  0%   { opacity: 0; transform: scale(0.7); }
  15%  { opacity: 1; transform: scale(1.05); }
  25%  { transform: scale(1); }
  80%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}

/* Pause Overlay */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(6px);
}
.overlay.hidden { display: none; }
.overlay .menu-btn { margin: 8px 0; min-width: 280px; display: block; }

/* Custom Cursor */
#cursor {
  position: fixed;
  width: 28px;
  height: 28px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  border: 2px solid #ff5a2a;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 90, 30, 0.25) 0%, transparent 70%);
  box-shadow: 0 0 12px rgba(255, 90, 30, 0.6);
  transition: width 80ms ease, height 80ms ease, border-color 80ms ease;
  mix-blend-mode: screen;
}
#cursor.click { width: 40px; height: 40px; border-color: #ffd080; }
#cursor.hammer { border-color: #c8c8c8; background: radial-gradient(circle, rgba(200,200,200,0.3) 0%, transparent 70%); }
#cursor.raid   { border-color: #60d8a0; background: radial-gradient(circle, rgba(96,216,160,0.25) 0%, transparent 70%); }
#cursor.bomb   { border-color: #d05040; background: radial-gradient(circle, rgba(208,80,64,0.25) 0%, transparent 70%); }
#cursor.bleach { border-color: #b0e0ff; background: radial-gradient(circle, rgba(176,224,255,0.25) 0%, transparent 70%); }
#cursor.gas    { border-color: #ffa030; background: radial-gradient(circle, rgba(255,160,48,0.3) 0%, transparent 70%); }

/* Scrollbar styling for panels */
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-track { background: #1a0e06; }
.panel::-webkit-scrollbar-thumb { background: #5a3a1a; border-radius: 4px; }
.panel::-webkit-scrollbar-thumb:hover { background: #c89860; }
