/**
 * Indian Simulator: Village Mud Wars
 * Stylesheet: Vibrant Indian Festival & Gorehabba Aesthetic
 */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #2b180d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #fff;
}

#application-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

/* Fullscreen Canvas for Mud on Screen */
#splatter-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* ============================================================
   HUD OVERLAY
   ============================================================ */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

/* TOP BAR */
.hud-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.hud-pill {
  background: rgba(38, 22, 10, 0.85);
  border: 2px solid #ff9800;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(4px);
}

.pill-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffb74d;
  text-transform: uppercase;
}

.pill-value {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.pill-combo {
  border-color: #ffd54f;
  min-width: 110px;
}
.pill-combo .pill-value {
  color: #ffd54f;
  transition: transform 0.15s ease-out;
}

/* MINIMAP */
.minimap-wrapper {
  position: relative;
  background: rgba(38, 22, 10, 0.9);
  border: 2px solid #ff9800;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

#minimap-canvas {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: block;
}

.minimap-legend {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  color: #ffe082;
  white-space: nowrap;
  letter-spacing: 1px;
}

/* ============================================================
   CENTER CROSSHAIR & CHARGE BAR
   ============================================================ */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 12;
}

.ch-dot {
  width: 8px;
  height: 8px;
  background: #fff;
  border: 2px solid #ff6f00;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

#charge-bar-container {
  position: absolute;
  top: calc(50% + 24px);
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #ffb74d;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 12;
}

#charge-bar-inner {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff9800, #ffeb3b);
  border-radius: 4px;
  box-shadow: 0 0 8px #ffb300;
}

/* CLEAN SCREEN MUD PROMPT */
#clean-prompt {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(78, 42, 19, 0.9);
  border: 2px solid #ffc107;
  color: #ffe082;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
  display: none;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { transform: translateX(-50%) scale(0.96); }
  100% { transform: translateX(-50%) scale(1.04); }
}

/* ============================================================
   BOTTOM BAR & AMMO SELECTOR
   ============================================================ */
.hud-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.hud-ammo-box {
  background: rgba(38, 22, 10, 0.88);
  border: 2px solid #ff9800;
  border-radius: 14px;
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.ammo-type-label {
  font-size: 13px;
  font-weight: 800;
  color: #ffca28;
  letter-spacing: 1px;
}

.ammo-count-val {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
}

.ammo-shortcuts {
  font-size: 11px;
  color: #ffe082;
  opacity: 0.85;
  margin-top: 4px;
}

.hud-controls-hint {
  background: rgba(38, 22, 10, 0.75);
  border: 1px solid rgba(255, 152, 0, 0.4);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 11px;
  color: #ffe082;
  line-height: 1.6;
}

/* FLOATING POPUPS */
#floating-popups {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.floating-popup {
  position: absolute;
  font-size: 20px;
  font-weight: 900;
  padding: 8px 16px;
  border-radius: 8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  animation: floatUp 1.8s forwards ease-out;
  pointer-events: none;
  white-space: nowrap;
}

.popup-positive {
  color: #ffeb3b;
  background: rgba(46, 26, 12, 0.85);
  border: 2px solid #ffb300;
}

.popup-negative {
  color: #ff8a80;
  background: rgba(60, 20, 20, 0.85);
  border: 2px solid #ff5252;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  75% { opacity: 1; transform: translate(-50%, -30px) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(0.9); }
}

/* ============================================================
   MODAL SCREENS (MENU & GAME OVER)
   ============================================================ */
.ui-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(22, 12, 6, 0.88);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-card {
  background: linear-gradient(145deg, #3d2110, #241308);
  border: 3px solid #ff9800;
  border-radius: 20px;
  width: 90%;
  max-width: 620px;
  padding: 36px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-align: center;
}

.modal-badge {
  display: inline-block;
  background: #ff6f00;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 34px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 15px;
  color: #ffca28;
  font-weight: 600;
  margin-bottom: 22px;
}

.modal-body {
  font-size: 14px;
  color: #ffecb3;
  line-height: 1.6;
  margin-bottom: 24px;
  text-align: left;
  background: rgba(0, 0, 0, 0.35);
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.instructions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.inst-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.inst-key {
  background: #ff9800;
  color: #000;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
}

.modal-btn-row {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, #ff8f00, #e65100);
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(230, 81, 0, 0.5);
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(230, 81, 0, 0.7);
  background: linear-gradient(135deg, #ffa000, #f57c00);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #ff9800;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  color: #ffca28;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 152, 0, 0.2);
}

/* GAME OVER STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.stat-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 152, 0, 0.4);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.stat-num {
  font-size: 24px;
  font-weight: 900;
  color: #ffd54f;
}

.stat-title {
  font-size: 11px;
  font-weight: 700;
  color: #ffb74d;
  text-transform: uppercase;
}

.title-badge {
  font-size: 18px;
  font-weight: 900;
  color: #ffeb3b;
  background: rgba(255, 152, 0, 0.25);
  border: 2px dashed #ff9800;
  padding: 10px;
  border-radius: 12px;
  margin: 14px 0 20px 0;
}
