* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a2332;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}
#wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#game {
  display: block;
  width: min(100vw, calc(100vh * 390 / 700));
  height: min(100vh, calc(100vw * 700 / 390));
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  background: #87CEEB;
}
#hud {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 0; right: 0;
  pointer-events: none;
  z-index: 2;
  padding: 0 10px;
}
#hud-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: min(100vw, calc(100vh * 390 / 700));
  margin: 0 auto;
  gap: 8px;
}
.collect {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 72px;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.22);
  color: #fff;
  font-weight: 800;
  font-size: clamp(16px, 4.2vw, 20px);
  text-shadow: 0 2px 0 rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
}
.collect .times {
  opacity: 0.85;
  font-size: 0.85em;
  margin: 0 1px;
}
.collect .icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
/* CSS bone glyphs */
.icon.white-bone {
  background:
    radial-gradient(circle at 30% 35%, #fff 0 28%, transparent 30%),
    radial-gradient(circle at 70% 35%, #fff 0 28%, transparent 30%),
    radial-gradient(circle at 30% 70%, #fff 0 28%, transparent 30%),
    radial-gradient(circle at 70% 70%, #fff 0 28%, transparent 30%),
    linear-gradient(90deg, transparent 22%, #f2f2f2 22% 78%, transparent 78%);
  background-color: transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.2));
}
.icon.gold-bone {
  background:
    radial-gradient(circle at 30% 35%, #ffe566 0 28%, transparent 30%),
    radial-gradient(circle at 70% 35%, #ffe566 0 28%, transparent 30%),
    radial-gradient(circle at 30% 70%, #ffe566 0 28%, transparent 30%),
    radial-gradient(circle at 70% 70%, #ffe566 0 28%, transparent 30%),
    linear-gradient(90deg, transparent 22%, #ffd000 22% 78%, transparent 78%);
  box-shadow: 0 0 10px rgba(255, 200, 0, 0.75), 0 1px 2px rgba(0,0,0,0.25);
  animation: goldPulse 1.1s ease-in-out infinite;
}
@keyframes goldPulse {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.15); transform: scale(1.06); }
}
#score-wrap {
  flex: 1;
  text-align: center;
  min-width: 0;
}
#score {
  font-size: clamp(34px, 8vw, 50px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0,0,0,0.25), 0 0 12px rgba(0,0,0,0.2);
  letter-spacing: 1px;
  line-height: 1;
}
#best {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  min-height: 1.2em;
}
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 22, 34, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 3;
  padding: 20px;
}
#overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.panel {
  width: min(320px, 92vw);
  background: linear-gradient(180deg, #fff9f0 0%, #ffe8cc 100%);
  border-radius: 20px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.8);
  border: 2px solid rgba(180, 110, 40, 0.2);
}
.panel h1 {
  font-size: 32px;
  font-weight: 900;
  color: #5c3a14;
  letter-spacing: -0.5px;
}
.tag {
  margin-top: 6px;
  color: #8a6238;
  font-size: 14px;
  font-weight: 600;
}
.hint {
  margin-top: 14px;
  color: #6b5538;
  font-size: 13px;
}
#startBtn {
  margin-top: 18px;
  border: none;
  border-radius: 999px;
  padding: 14px 36px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #ff9f43 0%, #e67e22 100%);
  box-shadow: 0 6px 0 #c46510, 0 10px 20px rgba(230,126,34,0.35);
  cursor: pointer;
  transition: transform 0.08s ease;
}
#startBtn:active { transform: translateY(3px); box-shadow: 0 3px 0 #c46510; }
.foot {
  margin-top: 14px;
  min-height: 1.4em;
  color: #5c3a14;
  font-weight: 700;
  font-size: 15px;
}
