/* ==========================================================================
   JUMP JUMP: HERO SWORD & MONSTER CRUSH
   BRIGHT, VIBRANT SUNNY SKY THEME (NO DARK/BLACK BACKGROUNDS)
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Epic fantasy wallpaper */
  background: #0284c7 url('../assets/bg.jpg') center center / cover no-repeat;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  touch-action: none;
}

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

/* --------------------------------------------------------------------------
   HUD TOP BAR (Frosted Clean White Glass)
   -------------------------------------------------------------------------- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: env(safe-area-inset-top, 16px) 18px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.hud-left {
  display: flex;
  gap: 8px;
  align-items: center;
}

.score-chip {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 2px solid #38bdf8;
  padding: 6px 16px;
  border-radius: 24px;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.score-num {
  font-size: 26px;
  font-weight: 900;
  color: #0369a1;
  letter-spacing: 0.5px;
}

.combo-chip {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
  animation: pulseCombo 0.4s infinite alternate;
}

@keyframes pulseCombo {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.sparks-chip {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 2px solid #fbbf24;
  color: #b45309;
  font-size: 15px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(56, 189, 248, 0.5);
  color: #0284c7;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.btn-icon:active {
  transform: scale(0.92);
}

/* --------------------------------------------------------------------------
   CHARGE GAUGE (Energy Tension Bar)
   -------------------------------------------------------------------------- */
#charge-gauge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.1s ease;
}

.charge-bar-bg {
  width: 74px;
  height: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid #0284c7;
  border-radius: 10px;
  padding: 2px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  transform: translate(-50%, -50%);
}

.charge-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #f59e0b, #ef4444);
  border-radius: 6px;
  transition: width 0.04s linear;
}

/* --------------------------------------------------------------------------
   SCREEN OVERLAYS (Clean, Bright Frosted Modal Panels)
   -------------------------------------------------------------------------- */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  z-index: 20;
  padding: 20px;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.screen-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.panel-card {
  background: rgba(255, 255, 255, 0.94);
  border: 3px solid #38bdf8;
  border-radius: 28px;
  padding: 30px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 16px 45px rgba(2, 132, 199, 0.35);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.game-badge {
  display: inline-block;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  border: 1px solid #bae6fd;
}

.game-title {
  font-size: 38px;
  font-weight: 900;
  color: #0369a1;
  letter-spacing: 1.5px;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.game-subtitle {
  font-size: 13px;
  font-weight: 800;
  color: #059669;
  letter-spacing: 1.5px;
  margin-top: 4px;
  margin-bottom: 20px;
}

.menu-stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  flex: 1;
  background: #f0f9ff;
  border: 2px solid #bae6fd;
  border-radius: 16px;
  padding: 10px 8px;
}

.stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.stat-val {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: #0284c7;
  margin-top: 2px;
}

/* Primary Action Buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  padding: 16px 20px;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
  transition: all 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

.btn-secondary {
  width: 100%;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  color: #334155;
  padding: 14px 20px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:active {
  transform: scale(0.97);
  background: #e2e8f0;
}

.btn-revive {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  transition: all 0.15s ease;
}

.btn-revive:active {
  transform: scale(0.96);
}

.instruction-hint {
  margin-top: 18px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   GAME OVER SCREEN
   -------------------------------------------------------------------------- */
.go-title {
  font-size: 32px;
  font-weight: 900;
  color: #ef4444;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.rage-quote-box {
  background: #fef2f2;
  border: 2px dashed #fca5a5;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.scores-display {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.score-card {
  flex: 1;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 8px;
  position: relative;
}

.score-card.main {
  border-color: #38bdf8;
  background: #f0f9ff;
}

.score-card-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-card-val {
  font-size: 28px;
  font-weight: 900;
  color: #0369a1;
  margin-top: 4px;
}

.new-badge {
  position: absolute;
  top: -10px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* --------------------------------------------------------------------------
   SHOP / HERO ARMORY MODAL
   -------------------------------------------------------------------------- */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.shop-title {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 1px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px;
}

.shop-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.15s ease;
}

.shop-item.active {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.25);
}

.shop-item-preview {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.shop-item-name {
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 4px;
}

.shop-item-desc {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 10px;
  line-height: 1.3;
}

.btn-shop-action {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-equipped {
  background: #10b981;
  color: #fff;
  cursor: default;
}

.btn-equip {
  background: #0284c7;
  color: #fff;
}

.btn-equip:hover {
  background: #0369a1;
}

.btn-buy {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.btn-buy:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}

.hidden {
  display: none !important;
}

