/* Die Punktzahl ist das einzige Textelement, das laut sein darf.
   Alles andere bleibt leise, damit der Turm der Held bleibt. */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #1B1638;
  color: #F2EEF7;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Ohne diese vier Zeilen zoomt der Doppeltipp, markiert Text
     und Pull-to-Refresh reißt dir mitten im Spiel das Bild weg. */
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#c { display: block; width: 100vw; height: 100dvh; }

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

#best {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #F2EEF7;
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
}

#score {
  margin-top: 2px;
  font-size: clamp(56px, 17vw, 104px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: #F2EEF7;
  opacity: 0.22;                 /* liegt hinter dem Spiel, stört nie */
  text-shadow: 0 2px 24px rgba(0,0,0,0.35);
}

#msg {
  margin-top: auto;
  margin-bottom: 12vh;
  max-width: 30ch;
  text-align: center;
  font-size: 15px;
  line-height: 1.55;
  opacity: 0;
  transition: opacity 260ms ease;
}
#msg.on { opacity: 0.78; }
#msg b { color: #FFE3A3; font-weight: 700; }

#sound {
  position: fixed;
  right: calc(env(safe-area-inset-right) + 12px);
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  padding: 8px 12px;
  border: 0; border-radius: 999px;
  background: rgba(242,238,247,0.08);
  color: #F2EEF7;
  font: inherit; font-size: 12px;
  opacity: 0.5;
  cursor: pointer;
}
#sound:focus-visible { outline: 2px solid #FFE3A3; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  #msg { transition: none; }
}
