@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Rajdhani:wght@400;600;700&display=swap');

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

body {
  background: #0a0a12;
  color: #e8e0d0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: #12121e;
  border-bottom: 2px solid #ff6a00;
  flex-shrink: 0;
}

#header h1 {
  font-family: 'Bangers', cursive;
  font-size: 28px;
  color: #ff6a00;
  letter-spacing: 2px;
  text-shadow: 0 0 12px #ff6a0066;
}

#stats {
  display: flex;
  gap: 20px;
  align-items: center;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
}

.stat-icon { font-size: 20px; }
.stat-val { color: #ffe066; }

#wave-info { font-family: 'Bangers', cursive; font-size: 22px; color: #aaffaa; letter-spacing: 1px; }

#speed-btns {
  display: flex;
  gap: 4px;
}

.speed-btn {
  padding: 4px 12px;
  background: transparent;
  color: #e8e0d0;
  border: 1px solid #ff6a0055;
  border-radius: 4px;
  font-family: 'Bangers', cursive;
  font-size: 17px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.speed-btn:hover { background: #1e1e30; border-color: #ff6a00; }
.speed-btn.active { background: #ff6a00; color: #fff; border-color: #ff6a00; }

#main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#game-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#sidebar {
  width: 200px;
  background: #12121e;
  border-left: 2px solid #ff6a0044;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

#sidebar h2 {
  font-family: 'Bangers', cursive;
  font-size: 20px;
  color: #ff6a00;
  padding: 8px 10px 4px;
  border-bottom: 1px solid #ff6a0033;
  letter-spacing: 1px;
}

.tower-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-bottom: 1px solid #1e1e2e;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  text-align: left;
  color: #e8e0d0;
  font-family: 'Rajdhani', sans-serif;
}

.tower-btn:hover { background: #1e1e30; }
.tower-btn.selected { background: #2a1a00; border-left: 3px solid #ff6a00; }
.tower-btn.locked { opacity: 0.4; cursor: not-allowed; }
.tower-btn.cant-afford { opacity: 0.55; }

.tbtn-top { display: flex; align-items: center; gap: 8px; }
.tbtn-img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.tbtn-name { font-weight: 700; font-size: 15px; }
.tbtn-cost { color: #ffe066; font-size: 13px; margin-top: 2px; }
.tbtn-desc { font-size: 11px; color: #a09880; margin-top: 2px; line-height: 1.3; }
.tbtn-badge {
  font-size: 10px; font-weight: 700; padding: 1px 5px;
  border-radius: 3px; background: #ff3333; color: #fff; margin-left: 4px;
}

#btn-launch {
  margin: 10px;
  padding: 10px;
  background: #ff6a00;
  color: #fff;
  font-family: 'Bangers', cursive;
  font-size: 20px;
  letter-spacing: 1px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

#btn-launch:hover { background: #ff8c33; transform: scale(1.03); }
#btn-launch:disabled { background: #555; cursor: not-allowed; transform: none; }

#sell-btn {
  margin: 0 10px 10px;
  padding: 7px;
  background: transparent;
  color: #ff6666;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid #ff6666;
  border-radius: 6px;
  cursor: pointer;
  display: none;
  transition: background 0.15s;
}
#sell-btn:hover { background: #ff666622; }

#intro-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a12;
  z-index: 200;
  padding: 20px;
}

#intro-box {
  background: #12121e;
  border: 3px solid #ff6a00;
  border-radius: 14px;
  padding: 36px 48px;
  max-width: 680px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px #ff6a0033;
}

#intro-title {
  font-family: 'Bangers', cursive;
  font-size: 38px;
  color: #ff6a00;
  letter-spacing: 3px;
  text-shadow: 0 0 20px #ff6a0088;
  margin-bottom: 24px;
}

#intro-text {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

#intro-text p {
  font-size: 15px;
  color: #c8c0b0;
  line-height: 1.6;
}

#intro-text strong {
  color: #ffe066;
}

#intro-cri {
  font-family: 'Bangers', cursive !important;
  font-size: 22px !important;
  color: #ff6a00 !important;
  letter-spacing: 2px;
  text-align: center !important;
  text-shadow: 0 0 12px #ff6a0066;
}

#intro-btn {
  padding: 12px 36px;
  background: #ff6a00;
  color: #fff;
  font-family: 'Bangers', cursive;
  font-size: 26px;
  letter-spacing: 2px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 0 24px #ff6a0066;
}

#intro-btn:hover { background: #ff8c33; transform: scale(1.04); }

#msg-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0008;
  z-index: 100;
}

#msg-box {
  background: #12121e;
  border: 3px solid #ff6a00;
  border-radius: 12px;
  padding: 32px 48px;
  text-align: center;
  max-width: 420px;
}

#msg-box h2 {
  font-family: 'Bangers', cursive;
  font-size: 42px;
  margin-bottom: 10px;
}

#msg-box p { font-size: 17px; margin-bottom: 20px; color: #a09880; white-space: pre-line; }

#msg-box button {
  padding: 10px 28px;
  background: #ff6a00;
  color: #fff;
  font-family: 'Bangers', cursive;
  font-size: 22px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 1px;
}

#msg-box button:hover { background: #ff8c33; }

#range-indicator {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: 2px dashed #ff6a0088;
  transform: translate(-50%, -50%);
  display: none;
}

#tooltip {
  position: absolute;
  background: #1a1a2e;
  border: 1px solid #ff6a0066;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  pointer-events: none;
  display: none;
  z-index: 50;
  max-width: 160px;
  color: #e8e0d0;
}
