/* ============ Mineshaft Dash — HUD & menus ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0a0908;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: "Courier New", Courier, monospace;
  color: #f2e9d8;
}

#wrap { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

/* ---------- chunky pixel-ish text ---------- */
.px, #score, #title, .panel-title, .big-btn {
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }

#hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px;
}

#score-box { text-shadow: 3px 3px 0 #000; }
#score { font-size: 34px; font-weight: 900; letter-spacing: 2px; color: #ffe9b0; }
#best  { font-size: 13px; color: #b7a98c; letter-spacing: 1px; }

#coin-box {
  display: flex; align-items: center; gap: 8px;
  font-size: 24px; font-weight: 900; color: #ffd94a;
  text-shadow: 2px 2px 0 #000;
  padding-top: 4px;
}

.coin-icon {
  display: inline-block; width: 18px; height: 18px;
  background: #ffd94a;
  border: 3px solid #b8860b;
  box-shadow: inset 3px 3px 0 #fff3b0;
  border-radius: 2px;
  transform: rotate(0deg);
}

.icon-btn {
  pointer-events: auto;
  background: rgba(20, 16, 10, 0.75);
  color: #f2e9d8;
  border: 2px solid #6b5430;
  font-size: 18px;
  width: 44px; height: 44px;
  cursor: pointer;
  border-radius: 4px;
}
.icon-btn:active { transform: scale(0.93); }

#btn-mute {
  position: absolute; bottom: 14px; right: 14px; z-index: 40;
}
#btn-mute.muted { opacity: 0.45; }

/* ---------- power-up bars ---------- */
#power-bars {
  position: absolute; left: 16px; bottom: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.pbar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(15, 12, 8, 0.75);
  border: 2px solid #6b5430;
  border-radius: 4px;
  padding: 4px 8px;
  width: 190px;
}
.pbar .pic { font-size: 18px; width: 26px; text-align: center; font-weight: 900; }
.pbar .track { flex: 1; height: 10px; background: #241c10; border: 1px solid #000; }
.pbar .fill { height: 100%; background: #ffd94a; width: 100%; }
.pbar.magnet .fill { background: #ff5a5a; }
.pbar.multi  .fill { background: #ffd94a; }
.pbar.leap   .fill { background: #7bea6a; }
.pbar.shield .fill { background: #9ecfff; }

/* ---------- flash messages ---------- */
#flash {
  position: absolute; top: 22%; left: 0; right: 0;
  text-align: center;
  font-size: 30px; font-weight: 900; letter-spacing: 3px;
  color: #ffdf6b; text-shadow: 3px 3px 0 #000;
  opacity: 0;
  transition: opacity 0.15s;
}
#flash.danger { color: #ff5a4a; }
#flash.show { opacity: 1; }

#hint {
  position: absolute; bottom: 22%; left: 0; right: 0;
  text-align: center; font-size: 17px; color: #d8cbae;
  text-shadow: 2px 2px 0 #000; letter-spacing: 2px;
  transition: opacity 1s; opacity: 0.9;
}
#hint.fading { opacity: 0; }

/* ---------- overlays / panels ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(12, 9, 5, 0.55) 0%, rgba(5, 4, 2, 0.88) 100%);
}

.panel {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: linear-gradient(180deg, #241b10 0%, #171008 100%);
  border: 4px solid #6b5430;
  outline: 4px solid #241b10;
  box-shadow: 0 0 0 4px #000, 0 18px 50px rgba(0,0,0,0.8);
  padding: 30px 40px;
  max-width: 88vw;
  text-align: center;
}

#title { line-height: 1.05; text-shadow: 4px 4px 0 #000; }
.t-mine { display: block; font-size: clamp(30px, 7vw, 52px); color: #c9c2b4; }
.t-dash { display: block; font-size: clamp(40px, 9.5vw, 70px); color: #ffd94a; }

#subtitle { color: #b7a98c; font-size: 14px; letter-spacing: 1px; }

#menu-stats {
  display: flex; gap: 26px; font-size: 16px; color: #d8cbae;
  align-items: center;
}
#menu-stats b { color: #ffe9b0; }

.big-btn {
  pointer-events: auto;
  font-family: inherit;
  font-size: 24px;
  padding: 14px 42px;
  background: #ffd94a;
  color: #241b10;
  border: 3px solid #b8860b;
  box-shadow: 0 6px 0 #7a5a08, 3px 3px 0 rgba(0,0,0,0.5);
  cursor: pointer;
  border-radius: 4px;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #7a5a08; }

.small-btn {
  pointer-events: auto;
  font-family: inherit;
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  padding: 9px 22px;
  background: transparent;
  color: #d8cbae;
  border: 2px solid #6b5430;
  cursor: pointer;
  border-radius: 4px;
}
.small-btn:active { transform: scale(0.95); }

#menu-controls {
  font-size: 12px; color: #8f8168; line-height: 1.9; letter-spacing: 1px;
}

.panel-title { font-size: 40px; color: #ff5a4a; text-shadow: 3px 3px 0 #000; }
#pause .panel-title { color: #ffd94a; }

#go-reason { color: #b7a98c; font-size: 15px; }
#go-newbest { color: #7bea6a; font-weight: 900; font-size: 18px; letter-spacing: 2px; }

#go-stats { display: flex; gap: 24px; margin: 6px 0; }
#go-stats div { display: flex; flex-direction: column; gap: 4px; }
#go-stats span { font-size: 12px; color: #8f8168; letter-spacing: 1px; }
#go-stats b { font-size: 24px; color: #ffe9b0; }

#skip-hint {
  position: absolute; bottom: 26px; left: 0; right: 0;
  text-align: center; font-size: 14px; letter-spacing: 2px;
  color: #b7a98c; text-shadow: 2px 2px 0 #000;
  animation: pulse 1.4s ease-in-out infinite;
  z-index: 20;
}
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

#fade {
  position: absolute; inset: 0; z-index: 50;
  background: #000; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
#fade.on { opacity: 1; }

/* ---------- small screens ---------- */
@media (max-width: 520px) {
  #score { font-size: 26px; }
  #coin-box { font-size: 19px; }
  .panel { padding: 22px 24px; gap: 11px; }
  .pbar { width: 150px; }
  #flash { font-size: 22px; }
}
