html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0b0b2a;
  overflow: hidden;
}

#game {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game canvas {
  image-rendering: auto;
}

/* --- Mobil-Brücke (js/mobile.js) --- */

/* Verstecktes Eingabefeld: fokussierbar (für die Bildschirmtastatur), aber
   optisch unsichtbar und nicht antippbar — die Tipps gehen ans Spiel-Canvas. */
#th-mobile-input {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  pointer-events: none;
  z-index: -1;
}

/* Tastatur-Hinweis für Kinder: dezent unten zentriert, sanft pulsierend.
   Nur sichtbar, solange die Tastatur nicht offen ist (.th-show via JS). */
#th-kbd-hint {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(18, 18, 63, 0.85);
  color: #ffd166;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 10;
}
#th-kbd-hint.th-show {
  opacity: 1;
  animation: th-hint-pulse 1.4s ease-in-out infinite;
}
@keyframes th-hint-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.06); }
}

/* Hochformat-Hinweis: deckt im Querformat (nur Smartphones) das ganze Bild ab. */
#th-rotate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
  background: #0b0b2a;
  color: #fff;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
#th-rotate.th-show { display: flex; }
#th-rotate .th-rotate-icon {
  font-size: 64px;
  animation: th-rotate-spin 2.2s ease-in-out infinite;
}
#th-rotate .th-rotate-msg {
  font-size: 22px;
  color: #ffd166;
  max-width: 80%;
}
@keyframes th-rotate-spin {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
}

/* Auf Touch-Geräten kein Doppeltipp-Zoom / Textauswahl auf dem Spielfeld. */
html.th-mobile, html.th-mobile body {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
