/* Echo Rise — cozy cute casual climber */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #3a3a5a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

#wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #3a3a6a 0%, #6a5a8a 45%, #c898a8 100%);
}

#game {
  display: block;
  background: #6a5a8a;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  cursor: pointer;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(40, 30, 50, 0.35);
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  color: #fff8f0;
  text-shadow: 0 1px 4px rgba(60, 40, 50, 0.45);
  font-weight: 600;
  letter-spacing: 0.02em;
}

#hud .top {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: clamp(13px, 2.8vw, 18px);
}

#hud .score-block { text-align: left; }
#hud .best-block { text-align: right; opacity: 0.85; font-size: 0.9em; color: #ffe8d0; }
#hud .combo {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(16px, 4vw, 28px);
  color: #ff9a7a;
  text-shadow: 0 2px 8px rgba(180, 80, 60, 0.35);
  opacity: 0;
  transition: opacity 0.15s;
}
#hud .combo.on { opacity: 1; }

#overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: transparent;
}

#overlay .card {
  text-align: center;
  color: #fff8f0;
  padding: 28px 30px;
  max-width: 90vw;
  pointer-events: none;
  background: rgba(255, 244, 230, 0.12);
  border: 1px solid rgba(255, 230, 210, 0.35);
  border-radius: 20px;
  box-shadow: 0 10px 36px rgba(40, 30, 50, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
}

#overlay h1 {
  font-size: clamp(28px, 8vw, 48px);
  font-weight: 800;
  background: linear-gradient(135deg, #ffe8c8, #ffb0a0 45%, #e8a0c0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 10px rgba(180, 100, 80, 0.35));
  margin-bottom: 4px;
}

#overlay .subtitle {
  font-size: clamp(13px, 3.2vw, 16px);
  color: #ffe0c8;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

#overlay .tag {
  font-size: clamp(12px, 3vw, 15px);
  opacity: 0.88;
  margin-bottom: 16px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.45;
  color: #fff0e4;
}

#overlay .hint {
  font-size: clamp(13px, 3.2vw, 16px);
  line-height: 1.55;
  opacity: 0.95;
  max-width: 340px;
  margin: 0 auto;
  color: #fff8f0;
}

#overlay .hint kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 220, 190, 0.22);
  border: 1px solid rgba(255, 200, 170, 0.45);
  font-family: inherit;
  font-size: 0.92em;
  color: #ffe8d0;
}

#overlay .pulse {
  margin-top: 20px;
  font-size: clamp(12px, 2.8vw, 14px);
  color: #ffc8a0;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

#overlay.hidden { display: none; }

#death {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(50, 35, 55, 0.45);
  pointer-events: none;
}

#death.show { display: flex; }

#death .card {
  text-align: center;
  color: #fff8f0;
  pointer-events: none;
  background: rgba(255, 244, 230, 0.14);
  border: 1px solid rgba(255, 210, 190, 0.35);
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 10px 32px rgba(40, 30, 50, 0.3);
}

#death h2 {
  font-size: clamp(26px, 7vw, 40px);
  color: #ffb0a8;
  text-shadow: 0 2px 10px rgba(160, 60, 80, 0.35);
  margin-bottom: 10px;
}

#death .stats {
  font-size: clamp(14px, 3.5vw, 18px);
  line-height: 1.7;
  opacity: 0.95;
}

#death .record {
  color: #ffe8a0;
  text-shadow: 0 2px 8px rgba(180, 140, 40, 0.4);
  font-weight: 700;
  margin-top: 8px;
  min-height: 1.4em;
}

#death .again {
  margin-top: 18px;
  font-size: clamp(13px, 3vw, 15px);
  color: #ffc8a0;
  animation: pulse 1.2s ease-in-out infinite;
}

#pause {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(50, 35, 55, 0.55);
  color: #fff8f0;
  font-size: clamp(18px, 5vw, 28px);
  letter-spacing: 0.08em;
  pointer-events: none;
}

#pause.show { display: flex; }
