:root {
  --bg: #07090c;
  --accent: #f0c36a;
  --mint: #3ecf9a;
  --ink: #f4f0e6;
  --muted: rgba(244, 240, 230, 0.42);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  position: fixed;
  inset: 0;
  touch-action: none;
  overscroll-behavior: none;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

#c {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}

#brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.46em;
  color: var(--accent);
  opacity: 0.88;
  padding-left: 0.46em;
  text-transform: uppercase;
}

#score {
  margin-top: 6px;
  font-size: clamp(64px, 20vw, 104px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.9;
  color: var(--ink);
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}

#score.pop {
  animation: scorepop 0.28s cubic-bezier(0.2, 1.4, 0.3, 1);
}

#combo {
  min-height: 28px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mint);
  opacity: 0;
  transform: translateY(6px) scale(0.92);
  text-shadow: 0 0 18px rgba(62, 207, 154, 0.35);
}

#combo.on {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: combopop 0.34s cubic-bezier(0.2, 1.6, 0.3, 1);
}

#hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.78;
  transition: opacity 0.45s ease;
}

#hint.dim {
  opacity: 0.28;
}

#hint.hide {
  opacity: 0;
}

#over {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 12, 0.58);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

#over[hidden] {
  display: none;
}

.over-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 320px);
  animation: overin 0.38s cubic-bezier(0.2, 1.1, 0.3, 1);
}

.over-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.42em;
  color: var(--muted);
  padding-left: 0.42em;
}

#overScore {
  margin: 8px 0 28px;
  font-size: clamp(84px, 26vw, 128px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.88;
  color: var(--ink);
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-variant-numeric: tabular-nums;
}

#otro {
  appearance: none;
  border: 1.5px solid var(--accent);
  background: rgba(240, 195, 106, 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.38em;
  padding: 16px 36px 16px 48px;
  border-radius: 999px;
  min-width: 200px;
  min-height: 56px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 0 0 0 rgba(240, 195, 106, 0.0), 0 10px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

#otro:active {
  transform: scale(0.97);
  background: rgba(240, 195, 106, 0.18);
  box-shadow: 0 0 28px rgba(240, 195, 106, 0.22);
}

@keyframes scorepop {
  0% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@keyframes combopop {
  0% { transform: translateY(8px) scale(0.7); opacity: 0; }
  60% { transform: translateY(-2px) scale(1.08); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes overin {
  from { transform: translateY(16px) scale(0.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #score.pop, #combo.on, .over-inner {
    animation: none;
  }
}
