/* ARCANIS Desktop Vollbild – V10.24
   Der Button ist als echtes HTML-Element in index.php vorhanden und auf Desktop
   grundsätzlich sichtbar. JS ist nur für Klick/FULLSCREEN-Status zuständig. */

/* Alte konkurrierende Vollbildbuttons endgültig ausblenden. */
#arcPcFullscreenButtonV926,
#arcPcFullscreenButtonV927 {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Desktop: unabhängig von Halle, Match, Overlay oder Spielstatus sichtbar. */
#arcFullscreenBtnV928 {
  position: fixed !important;
  /* Spielleiste endet bei 77px; Button sitzt bewusst darunter. */
  top: 88px !important;
  right: 16px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 2147483647 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;

  width: auto !important;
  min-width: 146px !important;
  max-width: none !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 18px !important;
  margin: 0 !important;

  border: 2px solid rgba(255, 218, 107, .95) !important;
  border-radius: 999px !important;
  outline: none !important;
  background: linear-gradient(180deg, rgba(31, 24, 48, .99), rgba(8, 9, 19, .99)) !important;
  color: #ffe89b !important;
  box-shadow:
    0 10px 34px rgba(0, 0, 0, .72),
    0 0 26px rgba(255, 204, 72, .30),
    0 0 12px rgba(74, 213, 255, .30),
    inset 0 1px 0 rgba(255, 255, 255, .13) !important;

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 12px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  letter-spacing: .10em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  white-space: nowrap !important;

  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: manipulation !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  filter: none !important;
  clip: auto !important;
  clip-path: none !important;
  overflow: visible !important;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}

#arcFullscreenBtnV928 .arc-desktop-fullscreen-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 23px !important;
  height: 23px !important;
  flex: 0 0 23px !important;
  color: #8eeaff !important;
  font: 900 24px/1 Arial, sans-serif !important;
  text-shadow: 0 0 12px rgba(71, 218, 255, .70) !important;
}

#arcFullscreenBtnV928 .arc-desktop-fullscreen-text {
  display: inline !important;
  color: inherit !important;
}

#arcFullscreenBtnV928:hover {
  transform: translateY(-1px) scale(1.02) !important;
  border-color: #fff0b8 !important;
  box-shadow:
    0 13px 38px rgba(0, 0, 0, .78),
    0 0 34px rgba(255, 210, 76, .42),
    0 0 18px rgba(75, 218, 255, .38) !important;
}

#arcFullscreenBtnV928:active {
  transform: scale(.96) !important;
}

#arcFullscreenBtnV928:disabled {
  opacity: .72 !important;
  cursor: wait !important;
}

/* Im echten Browser-Vollbild soll der Button verschwinden. */
body.arc-desktop-native-fullscreen > #arcFullscreenBtnV928,
html:fullscreen body > #arcFullscreenBtnV928,
html:-webkit-full-screen body > #arcFullscreenBtnV928 {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Mobile/Tablet-Touchgeräte: Vollbildbutton NIEMALS anzeigen.
   Wichtig: Der Button startet im HTML bereits hidden/display:none und wird nur
   durch JS auf einem echten Desktop freigeschaltet. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  #arcFullscreenBtnV928 {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}


/* ========================================================================== 
   ARCANIS V10.13 – FULLSCREEN MODAL / OVERLAY SAFETY
   Browser-Fullscreen läuft auf <html>, damit ALLE Body-Overlays sichtbar
   bleiben. Diese Regeln sichern zusätzlich Viewport, Position und Ebenen.
   ========================================================================== */
html:fullscreen,
html:-webkit-full-screen {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  overflow: hidden !important;
  background: #05070b !important;
}

html:fullscreen body,
html:-webkit-full-screen body {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  overflow: hidden !important;
  background: #05070b !important;
}

/* Der aktive Spieltisch füllt im Dokument-Fullscreen weiterhin exakt den
   gesamten Bildschirm aus. */
html:fullscreen #game.active,
html:-webkit-full-screen #game.active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  width: 100dvw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
}

/* Standard-Modal und alle dialogartigen Overlays müssen über dem Spieltisch
   und dessen Effekt-Layern liegen. hidden/geschlossene Elemente werden durch
   diese Regeln NICHT eingeblendet. */
html:fullscreen #modal:not(.hidden),
html:-webkit-full-screen #modal:not(.hidden),
html:fullscreen .modal:not(.hidden),
html:-webkit-full-screen .modal:not(.hidden),
html:fullscreen [role="dialog"],
html:-webkit-full-screen [role="dialog"],
html:fullscreen .dialog,
html:-webkit-full-screen .dialog,
html:fullscreen .popup,
html:-webkit-full-screen .popup,
html:fullscreen #handReviewPanel:not(.hidden),
html:-webkit-full-screen #handReviewPanel:not(.hidden),
html:fullscreen #roundIntroOverlay:not(.hidden),
html:-webkit-full-screen #roundIntroOverlay:not(.hidden),
html:fullscreen #arb810Layer.open,
html:-webkit-full-screen #arb810Layer.open {
  z-index: 2147483640 !important;
}

/* Vollbild-Videos / Lade- und Abschluss-Overlays sollen ebenfalls innerhalb
   des nativen Vollbilds sichtbar bleiben. Ihre eigene Sichtbarkeitslogik
   (.is-visible usw.) bleibt unangetastet. */
html:fullscreen #arcanisWizardVideoOverlay.is-visible,
html:-webkit-full-screen #arcanisWizardVideoOverlay.is-visible,
html:fullscreen #arcV910Preloader.is-visible,
html:-webkit-full-screen #arcV910Preloader.is-visible,
html:fullscreen #arcWorldFinaleOverlay,
html:-webkit-full-screen #arcWorldFinaleOverlay {
  z-index: 2147483639 !important;
}

/* Hinweise/Toasts bleiben oberhalb geöffneter Dialoge lesbar. */
html:fullscreen #toast.show,
html:-webkit-full-screen #toast.show,
html:fullscreen #arb810Toast.show,
html:-webkit-full-screen #arb810Toast.show,
html:fullscreen .reconnect-banner,
html:-webkit-full-screen .reconnect-banner,
html:fullscreen .arcanis-rejoin-notice,
html:-webkit-full-screen .arcanis-rejoin-notice {
  z-index: 2147483646 !important;
}
