/* =====================================================================
   mobile.css — Vollbild-/Fokusmodus für alle Spiele
   Wird von jeder Spielseite über ../mobile.css eingebunden.
   ===================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Kopieren/Selektion und iOS-Callout auf Spielseiten sperren */
html,
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Im Fokusmodus nicht scrollen (die Spielfläche füllt den Bildschirm) */
html.is-fs,
html.is-fs body {
  overflow: hidden;
  overscroll-behavior: none;
}

html.is-fs body {
  height: 100dvh;
  min-height: 100dvh;
  padding: 0;
}

/* App füllt den Bildschirm und zentriert den sichtbaren Inhalt */
html.is-fs .app {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: none;
  width: 100%;
  height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 48px)
    calc(env(safe-area-inset-right) + 8px)
    calc(env(safe-area-inset-bottom) + 8px)
    calc(env(safe-area-inset-left) + 8px);
  gap: 8px;
}

/* Überflüssiges Bedien-Chrome ausblenden */
html.is-fs .app__head,
html.is-fs .backlink,
html.is-fs .hint,
html.is-fs .app__foot,
html.is-fs .tabs {
  display: none !important;
}

/* Während des Spielens keine Doppeltipp-/Scroll-Gesten */
html.is-fs .game,
html.is-fs .stage,
html.is-fs .board-wrap {
  touch-action: none;
}

/* ---------------------------------------------------------------------
   Vollbild-Button
   --------------------------------------------------------------------- */
.fs-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  right: calc(env(safe-area-inset-right) + 8px);
  z-index: 1000;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-color, #333333);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-bg, #242424) 82%, transparent);
  color: var(--text, #ffffff);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.fs-btn:hover {
  border-color: var(--accent, #8354f7);
  color: var(--accent-hover, #9b72f9);
}

.fs-btn:active {
  transform: scale(0.94);
}

.fs-btn:focus-visible {
  outline: none;
  border-color: var(--accent, #8354f7);
  box-shadow: 0 0 0 3px rgba(131, 84, 247, 0.12);
}

.fs-btn svg {
  width: 20px;
  height: 20px;
}

.fs-btn .icon-compress {
  display: none;
}

html.is-fs .fs-btn .icon-expand {
  display: none;
}

html.is-fs .fs-btn .icon-compress {
  display: block;
}

/* ---------------------------------------------------------------------
   Querformat-Hinweis (nur für Landscape-Spiele)
   --------------------------------------------------------------------- */
.rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(27, 27, 27, 0.92);
  color: var(--text, #ffffff);
}

.rotate-hint.is-show {
  display: flex;
}

.rotate-hint__inner {
  max-width: 280px;
  font-weight: 600;
}

.rotate-hint__inner svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  color: var(--accent-hover, #9b72f9);
}

@media (prefers-reduced-motion: reduce) {
  .fs-btn {
    transition: none;
  }
}
