* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #12071f;
  font-family: "Baloo 2", "Segoe UI", Tahoma, sans-serif;
  user-select: none;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#ui button {
  pointer-events: auto;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(18, 7, 31, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.pill .lbl {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.6;
  letter-spacing: 2px;
}

.coin-pill {
  color: #ffd94d;
}

.coin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9a3, #ffb52e 70%, #b57e14);
  box-shadow: 0 0 8px rgba(255, 200, 60, 0.8);
}

.coin-pill.pulse {
  animation: pulse 0.25s ease;
}

@keyframes pulse {
  50% { transform: scale(1.18); }
}

.icon-btn {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 7, 31, 0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.15); }
.icon-btn:active { transform: scale(0.92); }

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at center, rgba(20, 8, 38, 0.35), rgba(10, 4, 20, 0.75));
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
}

.logo {
  font-size: clamp(52px, 11vw, 110px);
  font-weight: 800;
  color: #fff;
  letter-spacing: 4px;
  line-height: 0.9;
  text-shadow: 0 0 30px rgba(255, 140, 80, 0.55), 0 4px 0 rgba(0, 0, 0, 0.35);
}

.logo span {
  color: #ffd94d;
  text-shadow: 0 0 34px rgba(255, 200, 60, 0.8), 0 4px 0 rgba(0, 0, 0, 0.35);
}

.tagline {
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 3px;
  font-size: clamp(12px, 2vw, 16px);
  text-transform: uppercase;
}

.btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 2px;
  color: #2b1000;
  padding: 14px 46px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(180deg, #ffd94d, #ff9a3d);
  box-shadow: 0 6px 0 #b35c12, 0 12px 28px rgba(255, 150, 50, 0.4);
  transition: transform 0.08s, box-shadow 0.08s;
}

.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b35c12; }

.keys {
  display: flex;
  gap: 22px;
  margin-top: 10px;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom-width: 3px;
  border-radius: 8px;
  padding: 4px 10px;
  font-family: inherit;
  font-weight: 700;
  color: #fff;
}

.hint {
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

/* ---------- panels ---------- */
.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 300px;
  padding: 34px 44px;
  border-radius: 26px;
  background: rgba(22, 9, 40, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: popIn 0.4s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes popIn {
  from { transform: scale(0.7) translateY(30px); opacity: 0; }
}

.panel-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #ff5f6d;
  text-shadow: 0 0 24px rgba(255, 80, 100, 0.5);
}

#paused .panel-title { color: #ffd94d; text-shadow: 0 0 24px rgba(255, 200, 60, 0.5); }

.stat {
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  letter-spacing: 2px;
}

.stat b {
  color: #fff;
  font-size: 22px;
}

.stat.gold b { color: #ffd94d; }

/* ---------- toast ---------- */
#toast {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 800;
  color: #ffd94d;
  letter-spacing: 6px;
  text-shadow: 0 0 40px rgba(255, 200, 60, 0.9), 0 4px 0 rgba(0, 0, 0, 0.4);
  animation: toastPop 0.8s ease forwards;
  pointer-events: none;
}

@keyframes toastPop {
  0% { transform: translateX(-50%) scale(0.4); opacity: 0; }
  25% { transform: translateX(-50%) scale(1.15); opacity: 1; }
  70% { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(1.05); opacity: 0; }
}

.hidden { display: none !important; }
