/* ===== 黄金矿工：疯狂矿山 — 样式表 ===== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --gold: #FFD700;
  --gold-dark: #DAA520;
  --gold-light: #FFF3B0;
  --mine-blue: #2C5F8A;
  --mine-blue-dark: #1A3F5C;
  --mine-blue-light: #4A8FC7;
  --brown: #8B5E3C;
  --brown-dark: #6B3F2A;
  --brown-light: #C49A6C;
  --green: #4CAF50;
  --green-dark: #388E3C;
  --orange: #FF6D00;
  --orange-dark: #E65100;
  --red: #F44336;
  --purple: #9C27B0;
  --white: #FFF8E7;
  --black: #2C2416;
  --shadow: rgba(0,0,0,0.3);
}

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

body {
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Nunito', sans-serif;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #eee, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 50px 160px, #ddd, transparent),
    radial-gradient(2px 2px at 90px 40px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 130px 80px, #fff, transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.7), transparent);
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 0;
}

#game-wrapper {
  position: relative;
  width: 960px;
  height: 640px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 2px var(--gold-dark), 0 0 0 6px rgba(218,165,32,0.2);
  overflow: hidden;
  z-index: 1;
}

#gameCanvas {
  display: block;
  width: 960px;
  height: 640px;
  background: #3E2723;
}

.ui-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 10;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.ui-overlay.active { display: flex; }

.panel {
  background: linear-gradient(180deg, #3E2723 0%, #2C1810 100%);
  border: 4px solid var(--gold-dark);
  border-radius: 20px;
  padding: 30px 40px;
  min-width: 500px;
  max-width: 700px;
  max-height: 85%;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 0 40px rgba(218,165,32,0.05);
  position: relative;
  animation: fadeIn 0.4s ease;
}

.panel::before {
  content: '';
  position: absolute;
  top: -2px; left: 20%; right: 20%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
}

.menu-title {
  font-family: 'Fredoka One', cursive;
  font-size: 52px;
  color: var(--gold);
  text-shadow: 0 4px 0 var(--gold-dark), 0 6px 20px rgba(255,215,0,0.3);
  letter-spacing: 2px;
  margin-bottom: 5px;
}

.menu-subtitle {
  font-family: 'Fredoka One', cursive;
  font-size: 22px;
  color: var(--gold-light);
  margin-bottom: 30px;
  opacity: 0.7;
}

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

.btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 20px;
  padding: 12px 40px;
  border: 3px solid transparent;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 250px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn:active { transform: scale(0.95); }
.btn-small { font-size: 16px; padding: 8px 24px; min-width: 120px; }

.btn-gold {
  background: linear-gradient(180deg, #FFD700 0%, #FFA000 100%);
  color: #3E2723;
  border-color: #FFD700;
  box-shadow: 0 4px 15px rgba(255,215,0,0.3);
}
.btn-gold:hover { box-shadow: 0 6px 25px rgba(255,215,0,0.5); transform: translateY(-2px); }

.btn-blue {
  background: linear-gradient(180deg, #4A8FC7 0%, #2C5F8A 100%);
  color: white;
  border-color: var(--mine-blue-light);
}
.btn-blue:hover { box-shadow: 0 6px 25px rgba(74,143,199,0.4); transform: translateY(-2px); }

.btn-green {
  background: linear-gradient(180deg, #66BB6A 0%, #388E3C 100%);
  color: white;
  border-color: #66BB6A;
}
.btn-green:hover { box-shadow: 0 6px 25px rgba(76,175,80,0.4); transform: translateY(-2px); }

.btn-red {
  background: linear-gradient(180deg, #EF5350 0%, #C62828 100%);
  color: white;
  border-color: #EF5350;
}
.btn-red:hover { box-shadow: 0 6px 25px rgba(244,67,54,0.4); transform: translateY(-2px); }

.btn-orange {
  background: linear-gradient(180deg, #FF8A65 0%, #E65100 100%);
  color: white;
  border-color: #FF8A65;
}
.btn-orange:hover { box-shadow: 0 6px 25px rgba(255,109,0,0.4); transform: translateY(-2px); }

.btn-disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.shop-title {
  font-family: 'Fredoka One', cursive;
  font-size: 36px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 8px;
}

.shop-coins { text-align: center; font-size: 24px; font-weight: 800; color: var(--gold); margin-bottom: 20px; }

.shop-items { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.shop-item {
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--brown);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.shop-item:hover { border-color: var(--gold-dark); background: rgba(255,215,0,0.05); }
.shop-item-icon { font-size: 32px; }
.shop-item-name { font-family: 'Fredoka One', cursive; font-size: 16px; color: var(--gold-light); }
.shop-item-level { font-size: 14px; color: var(--brown-light); }
.shop-item-desc { font-size: 12px; color: #aaa; text-align: center; }
.shop-item-cost { font-size: 18px; font-weight: 800; color: var(--gold); }
.shop-item .btn { font-size: 14px; padding: 6px 20px; min-width: 80px; }

.level-title { font-family: 'Fredoka One', cursive; font-size: 42px; color: var(--gold); text-align: center; text-shadow: 0 3px 0 var(--gold-dark); }
.level-info { font-size: 18px; color: var(--white); text-align: center; margin: 10px 0; }

.result-title { font-family: 'Fredoka One', cursive; font-size: 38px; color: var(--gold); text-align: center; }
.result-stats { display: flex; gap: 20px; justify-content: center; margin: 15px 0; flex-wrap: wrap; }
.stat-card { background: rgba(255,255,255,0.08); border-radius: 12px; padding: 12px 20px; text-align: center; min-width: 100px; }
.stat-value { font-family: 'Fredoka One', cursive; font-size: 28px; color: var(--gold); }
.stat-label { font-size: 13px; color: #aaa; margin-top: 2px; }

.boss-hp-bar {
  position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
  width: 400px; height: 28px;
  background: rgba(0,0,0,0.6); border-radius: 14px;
  border: 2px solid var(--red); overflow: hidden; z-index: 5; display: none;
}
.boss-hp-fill {
  height: 100%; background: linear-gradient(90deg, #F44336, #FF6D00, #FFD700);
  border-radius: 12px; transition: width 0.3s ease;
}
.boss-hp-label {
  position: absolute; top: 0; left: 0; right: 0; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka One', cursive; font-size: 14px; color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.hud { position: absolute; top: 0; left: 0; right: 0; display: none; justify-content: space-between; padding: 10px 16px; z-index: 5; pointer-events: none; }
.hud.active { display: flex; }
.hud-item { background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); border-radius: 12px; padding: 6px 14px; display: flex; align-items: center; gap: 8px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 16px; color: var(--white); border: 1px solid rgba(255,215,0,0.2); }
.hud-icon { font-size: 18px; }
.hud-coins { color: var(--gold); }
.hud-timer { color: var(--orange); }

.multi-options { display: flex; gap: 20px; margin: 15px 0; justify-content: center; }
.multi-card { background: rgba(255,255,255,0.06); border: 3px solid var(--brown); border-radius: 16px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s; min-width: 180px; }
.multi-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 8px 20px rgba(255,215,0,0.15); }
.multi-card-icon { font-size: 48px; margin-bottom: 8px; }
.multi-card-title { font-family: 'Fredoka One', cursive; font-size: 18px; color: var(--gold-light); }
.multi-card-desc { font-size: 13px; color: #aaa; margin-top: 4px; }

.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.08); color: var(--white); font-size: 18px; }
.settings-row:last-child { border-bottom: none; }

.controls-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; color: var(--white); font-size: 16px; margin: 10px 0; }
.controls-key { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; padding: 2px 10px; font-family: 'Fredoka One', cursive; font-size: 14px; color: var(--gold); text-align: center; }

input[type="range"] { -webkit-appearance: none; width: 200px; height: 6px; background: var(--brown); border-radius: 3px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; background: var(--gold); border-radius: 50%; cursor: pointer; border: 2px solid var(--gold-dark); }

@keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.btn-gold { animation: pulse 2s ease-in-out infinite; }

.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: var(--brown); border-radius: 3px; }

@media (max-width: 1000px) { body { transform: scale(0.85); transform-origin: center center; } }
@media (max-width: 800px) { body { transform: scale(0.7); transform-origin: center center; } }
@media (max-width: 650px) { body { transform: scale(0.55); transform-origin: center center; } }
