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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #14110d;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, monospace, sans-serif;
  color: #f3e5c8;
}

#game-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   CROSSHAIR & HITMARKER
   ============================================================================ */
#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  pointer-events: none;
  z-index: 15;
}

.ch-line {
  position: absolute;
  background: #35ff49;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.95);
  transition: transform 0.06s ease-out;
}

.ch-top {
  width: 2px;
  height: 9px;
  left: 17px;
  top: 2px;
}

.ch-bottom {
  width: 2px;
  height: 9px;
  left: 17px;
  bottom: 2px;
}

.ch-left {
  height: 2px;
  width: 9px;
  left: 2px;
  top: 17px;
}

.ch-right {
  height: 2px;
  width: 9px;
  right: 2px;
  top: 17px;
}

.ch-dot {
  position: absolute;
  width: 2px;
  height: 2px;
  left: 17px;
  top: 17px;
  background: #35ff49;
}

#crosshair.expanded .ch-top { transform: translateY(-5px); }
#crosshair.expanded .ch-bottom { transform: translateY(5px); }
#crosshair.expanded .ch-left { transform: translateX(-5px); }
#crosshair.expanded .ch-right { transform: translateX(5px); }

#hitmarker {
  position: absolute;
  inset: 0;
}

.hm-line {
  position: absolute;
  width: 10px;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 0 4px #000;
}

#hitmarker.headshot .hm-line {
  background: #ff3b30;
  height: 2.5px;
  box-shadow: 0 0 8px #ff3b30;
}

.hm-1 { left: 6px; top: 10px; transform: rotate(45deg); }
.hm-2 { right: 6px; top: 10px; transform: rotate(-45deg); }
.hm-3 { left: 6px; bottom: 10px; transform: rotate(-45deg); }
.hm-4 { right: 6px; bottom: 10px; transform: rotate(45deg); }

/* ============================================================================
   SNIPER SCOPE OVERLAY (AWP)
   ============================================================================ */
#scope-overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 33%, rgba(0, 0, 0, 0.96) 36%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scope-circle {
  position: relative;
  width: 72vmin;
  height: 72vmin;
  border: 2px solid rgba(20, 20, 20, 0.9);
  border-radius: 50%;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.85);
}

.scope-line-h {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1.5px;
  background: rgba(0, 0, 0, 0.9);
}

.scope-line-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1.5px;
  background: rgba(0, 0, 0, 0.9);
}

.scope-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 50%;
  background: #ff2a2a;
  box-shadow: 0 0 6px #ff2a2a;
}

.scope-label {
  position: absolute;
  bottom: 8%;
  color: #35ff49;
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 2px;
  opacity: 0.75;
}

/* ============================================================================
   DAMAGE FLASH & DIRECTIONAL ARCS
   ============================================================================ */
#damage-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  background: radial-gradient(circle, transparent 45%, rgba(220, 20, 20, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

#damage-indicator {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 260px;
  height: 260px;
  margin-left: -130px;
  margin-top: -130px;
  pointer-events: none;
  z-index: 14;
}

.dmg-arc {
  position: absolute;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

#dmg-arc-top {
  top: 0; left: 25%; right: 25%; height: 14px;
  background: linear-gradient(to bottom, rgba(255, 40, 40, 0.9), transparent);
  border-top: 3px solid #ff3030;
  border-radius: 50% 50% 0 0;
}

#dmg-arc-bottom {
  bottom: 0; left: 25%; right: 25%; height: 14px;
  background: linear-gradient(to top, rgba(255, 40, 40, 0.9), transparent);
  border-bottom: 3px solid #ff3030;
  border-radius: 0 0 50% 50%;
}

#dmg-arc-left {
  left: 0; top: 25%; bottom: 25%; width: 14px;
  background: linear-gradient(to right, rgba(255, 40, 40, 0.9), transparent);
  border-left: 3px solid #ff3030;
  border-radius: 50% 0 0 50%;
}

#dmg-arc-right {
  right: 0; top: 25%; bottom: 25%; width: 14px;
  background: linear-gradient(to left, rgba(255, 40, 40, 0.9), transparent);
  border-right: 3px solid #ff3030;
  border-radius: 0 50% 50% 0;
}

/* ============================================================================
   HUD LAYOUT
   ============================================================================ */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

/* Radar */
#radar-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(14, 18, 14, 0.82);
  border: 2px solid rgba(255, 184, 77, 0.55);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

#radar-canvas {
  display: block;
  border-radius: 4px;
  background: #1a241b;
}

#radar-location {
  margin-top: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f5b942;
}

/* Top Score Bar */
#top-bar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 15, 13, 0.86);
  border: 1px solid rgba(245, 185, 66, 0.45);
  border-radius: 8px;
  padding: 6px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
}

.team-score {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 5px;
}

.team-score.t-side {
  background: rgba(217, 130, 43, 0.2);
  border: 1px solid rgba(235, 152, 62, 0.5);
}

.team-score.ct-side {
  background: rgba(66, 147, 214, 0.2);
  border: 1px solid rgba(93, 173, 240, 0.5);
}

.team-tag {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 1px;
}

.t-side .team-tag, .t-color { color: #ffae42; }
.ct-side .team-tag, .ct-color { color: #5eb5ff; }

.score-num {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  min-width: 24px;
  text-align: center;
}

.alive-count {
  font-size: 11px;
  color: #cbbda3;
}

.round-clock-box {
  text-align: center;
  min-width: 88px;
  padding: 0 8px;
}

#round-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #c8b696;
}

#round-timer {
  font-family: monospace;
  font-size: 22px;
  font-weight: 900;
  color: #f5b942;
}

#round-timer.bomb-alert {
  color: #ff3b30;
  animation: pulseBomb 0.65s infinite alternate;
}

@keyframes pulseBomb {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.55; transform: scale(1.07); }
}

/* Killfeed */
#killfeed {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  max-width: 360px;
}

.kf-item {
  background: rgba(15, 14, 12, 0.84);
  border-right: 3px solid #f5b942;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.kf-weapon {
  color: #d9c8a9;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

.kf-hs {
  color: #ff453a;
  font-weight: 900;
  font-size: 11px;
}

/* Center Banner & Bomb Progress */
#center-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 14, 12, 0.9);
  border: 2px solid #f5b942;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #f5b942;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
  text-align: center;
}

#respawn-banner {
  position: absolute;
  top: 32%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(160, 25, 25, 0.88);
  border: 1px solid #ff6b6b;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

#bomb-action-hint {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 15, 13, 0.88);
  border: 1px solid #f5b942;
  padding: 10px 18px;
  border-radius: 6px;
  text-align: center;
  min-width: 240px;
}

#bomb-action-text {
  font-size: 12px;
  font-weight: 800;
  color: #f5b942;
  margin-bottom: 6px;
}

.bomb-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  overflow: hidden;
}

#bomb-progress-bar {
  width: 0%;
  height: 100%;
  background: #ff453a;
}

/* Chat & Controls Bar */
#chat-panel {
  position: absolute;
  left: 16px;
  bottom: 84px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#chat-messages {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 135px;
  overflow: hidden;
  font-size: 12px;
  text-shadow: 0 1px 2px #000;
}

.chat-line {
  background: rgba(12, 12, 12, 0.55);
  padding: 3px 8px;
  border-radius: 4px;
  width: fit-content;
  max-width: 100%;
  word-break: break-word;
}

#chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 14, 12, 0.92);
  border: 1px solid #f5b942;
  padding: 5px 8px;
  border-radius: 4px;
  pointer-events: auto;
}

.chat-prefix {
  font-size: 11px;
  font-weight: 800;
  color: #f5b942;
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12px;
}

.controls-mini-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  color: #cbbda3;
  opacity: 0.85;
}

.controls-mini-bar span {
  background: rgba(15, 14, 12, 0.72);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Bottom Left Vitals (Classic CS amber glow) */
#vitals-panel {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.vital-box {
  background: rgba(16, 14, 11, 0.84);
  border: 1px solid rgba(245, 185, 66, 0.45);
  border-radius: 6px;
  padding: 6px 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.vital-icon {
  font-size: 20px;
  font-weight: 900;
  color: #f5b942;
}

.vital-val {
  font-family: monospace;
  font-size: 28px;
  font-weight: 900;
  color: #f5b942;
  text-shadow: 0 0 10px rgba(245, 185, 66, 0.45);
}

.vital-box.low-hp .vital-val,
.vital-box.low-hp .vital-icon {
  color: #ff453a;
  text-shadow: 0 0 12px rgba(255, 69, 58, 0.7);
}

.money-box .vital-val {
  color: #4cd964;
  font-size: 22px;
}

/* Bottom Right Weapon & Ammo */
#weapon-panel {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

#weapon-slots {
  display: flex;
  gap: 6px;
}

.w-slot {
  background: rgba(16, 14, 11, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: #bda988;
}

.w-slot.active {
  background: rgba(245, 185, 66, 0.22);
  border-color: #f5b942;
  color: #fff;
  font-weight: 700;
}

.slot-key {
  color: #f5b942;
  font-weight: 800;
  margin-right: 3px;
}

.ammo-readout {
  background: rgba(16, 14, 11, 0.86);
  border: 1px solid rgba(245, 185, 66, 0.45);
  border-radius: 6px;
  padding: 6px 16px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

#hud-weapon-name {
  font-size: 13px;
  font-weight: 800;
  color: #d6c3a3;
  letter-spacing: 1px;
}

.ammo-numbers {
  font-family: monospace;
  color: #f5b942;
  text-shadow: 0 0 10px rgba(245, 185, 66, 0.45);
}

#hud-clip {
  font-size: 28px;
  font-weight: 900;
}

.ammo-sep {
  margin: 0 4px;
  color: #8c7b61;
}

#hud-reserve {
  font-size: 18px;
  font-weight: 700;
  color: #cbb693;
}

#reload-indicator {
  color: #ff9f0a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

/* ============================================================================
   MODALS: LOBBY, BUY MENU, SCOREBOARD, PAUSE
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: radial-gradient(circle at center, rgba(28, 22, 15, 0.84) 0%, rgba(10, 8, 6, 0.94) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lobby-card {
  width: 100%;
  max-width: 720px;
  background: linear-gradient(180deg, #231d15 0%, #17130e 100%);
  border: 2px solid #d49b3b;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  text-align: center;
}

.lobby-top-badge {
  display: inline-block;
  background: rgba(212, 155, 59, 0.18);
  border: 1px solid rgba(212, 155, 59, 0.55);
  color: #f5b942;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.lobby-title {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 5px;
  color: #f7e6c4;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.8);
}

.lobby-subtitle {
  color: #c2b091;
  font-size: 14px;
  margin-top: 4px;
  margin-bottom: 16px;
}

.lobby-status {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #4cd964;
  margin-bottom: 18px;
}

.lobby-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.lobby-form label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #d49b3b;
}

#player-name-input {
  width: 280px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #d49b3b;
  background: #100d0a;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.team-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.team-btn {
  cursor: pointer;
  padding: 16px 12px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.team-btn:hover {
  transform: translateY(-2px);
}

.t-btn {
  border-color: rgba(255, 160, 50, 0.6);
  background: linear-gradient(180deg, rgba(217, 118, 34, 0.25), rgba(40, 24, 12, 0.6));
}
.t-btn:hover { border-color: #ffae42; background: rgba(217, 118, 34, 0.38); }

.auto-btn {
  border-color: rgba(76, 217, 100, 0.65);
  background: linear-gradient(180deg, rgba(52, 168, 83, 0.28), rgba(16, 38, 22, 0.6));
}
.auto-btn:hover { border-color: #4cd964; background: rgba(52, 168, 83, 0.42); }

.ct-btn {
  border-color: rgba(94, 181, 255, 0.6);
  background: linear-gradient(180deg, rgba(50, 130, 210, 0.25), rgba(14, 26, 42, 0.6));
}
.ct-btn:hover { border-color: #5eb5ff; background: rgba(50, 130, 210, 0.38); }

.team-badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 6px;
  color: #f5b942;
}

.ct-btn .team-badge { color: #5eb5ff; }
.auto-btn .team-badge { color: #4cd964; }

.team-model-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}

.team-loadout {
  font-size: 11px;
  color: #c9bca6;
}

.lobby-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
  text-align: left;
  background: rgba(0, 0, 0, 0.35);
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 12px;
  color: #cbbba0;
}

.lobby-controls-grid strong {
  color: #f5b942;
}

/* Buy Modal */
.buy-card {
  width: 100%;
  max-width: 540px;
  background: #1b1610;
  border: 2px solid #f5b942;
  border-radius: 10px;
  padding: 22px;
}

.buy-header h2 {
  font-size: 20px;
  color: #f5b942;
}

.buy-sub {
  font-size: 12px;
  color: #b8a688;
}

.buy-grid {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.buy-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(245, 185, 66, 0.35);
  border-radius: 6px;
  color: #fff;
  text-align: left;
}

.buy-item:hover {
  background: rgba(245, 185, 66, 0.2);
  border-color: #f5b942;
}

.buy-key {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: #f5b942;
  color: #14110d;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buy-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.buy-info small {
  color: #bdae93;
  font-size: 11px;
}

.buy-price {
  color: #4cd964;
  font-family: monospace;
  font-size: 15px;
  font-weight: 800;
}

/* Scoreboard */
.scoreboard-card {
  width: 100%;
  max-width: 780px;
  background: rgba(20, 17, 13, 0.95);
  border: 2px solid rgba(245, 185, 66, 0.6);
  border-radius: 10px;
  padding: 22px;
}

.sb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.sb-header h2 {
  font-size: 20px;
  color: #f5b942;
}

#sb-server-info {
  font-size: 12px;
  color: #b5a489;
}

.sb-round-score {
  font-size: 24px;
  font-weight: 900;
}

.sb-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sb-team-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 4px;
}

.t-col .sb-team-title { background: rgba(217, 130, 43, 0.25); color: #ffae42; }
.ct-col .sb-team-title { background: rgba(66, 147, 214, 0.25); color: #5eb5ff; }

.sb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sb-table th {
  text-align: left;
  color: #9e8f75;
  font-size: 11px;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sb-table td {
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Pause Banner */
#pause-banner {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pause-box {
  background: #1b1610;
  border: 2px solid #f5b942;
  padding: 24px 32px;
  border-radius: 10px;
  text-align: center;
}

.pause-box h3 {
  color: #f5b942;
  margin-bottom: 6px;
}

.pause-box p {
  font-size: 13px;
  color: #c9b99c;
  margin-bottom: 16px;
}

.pause-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.action-btn {
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  background: #f5b942;
  color: #14110d;
  font-weight: 800;
  font-size: 13px;
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #f3e5c8;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
