/* ─── Container für Espanol Trainer Block (Standard) ──────────────── */
.etp-trainer-block {
    position: relative;
    background: #F4EAD5;
    background-image: radial-gradient(var(--surface2) 1px, transparent 1.4px);
    background-size: 22px 22px;
    border-radius: var(--r);
    overflow: hidden;
    isolation: isolate;
}
.etp-trainer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4EAD5;
    color: #D79A2B;
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 1;
}
.etp-trainer-root {
    position: relative;
    z-index: 2;
    background: transparent;
    min-height: 100%;
}

/* ─── Vollbild-Modus ──────────────────────────────────────────────── */
/* Wird per JS body-class auf <html> und <body> gesetzt */
html.etp-fullscreen-active,
body.etp-fullscreen-active {
    overflow: hidden !important;
    height: 100% !important;
    height: 100dvh !important; /* iOS: dynamic vh berücksichtigt URL-Bar */
    margin: 0 !important;
    padding: 0 !important;
}

/* Häufige Theme-Strukturen verstecken — defensiv mit !important */
body.etp-fullscreen-active > header,
body.etp-fullscreen-active > footer,
body.etp-fullscreen-active #masthead,
body.etp-fullscreen-active #colophon,
body.etp-fullscreen-active #site-header,
body.etp-fullscreen-active #mobile-nav,
body.etp-fullscreen-active #wpadminbar,
body.etp-fullscreen-active .site-header,
body.etp-fullscreen-active .site-footer,
body.etp-fullscreen-active .mobile-nav,
body.etp-fullscreen-active .mobile-menu,
body.etp-fullscreen-active .mobile-menu-overlay,
body.etp-fullscreen-active .site-wrapper > header,
body.etp-fullscreen-active .site-wrapper > footer,
body.etp-fullscreen-active .entry-header,
body.etp-fullscreen-active .entry-footer,
body.etp-fullscreen-active .entry-title,
body.etp-fullscreen-active .page-header,
body.etp-fullscreen-active .page-title,
body.etp-fullscreen-active .breadcrumbs,
body.etp-fullscreen-active .comments-area,
body.etp-fullscreen-active .scroll-progress,
body.etp-fullscreen-active nav.main-navigation,
body.etp-fullscreen-active nav.navigation {
    display: none !important;
    visibility: hidden !important;
}

/* Block selbst soll Vollbild einnehmen */
.etp-trainer-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    background: #F4EAD5 !important;
    background-image: radial-gradient(var(--surface2) 1px, transparent 1.4px) !important;
    background-size: 22px 22px !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important; /* iOS-Fix: dynamic vh statt static — sonst rutscht der untere Button unter die URL-Bar und der Container scrollt nicht */
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 99000 !important;
    /* Phase 9b.1 Hotfix: Body ist im Fullscreen-Mode auf overflow:hidden gesperrt
       (damit das Theme nicht reinpfuscht), der Trainer-Container selbst hatte
       aber keine eigene Scroll-Strategie — Inhalt über 100vh war damit tot.
       Jetzt scrollt der Container intern; overscroll-contain hält Rubber-Band
       vom Body fern, -webkit-overflow-scrolling sichert iOS-Momentum. */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Content-Bereich sollte auf vollen Raum gehen */
body.etp-fullscreen-active #content,
body.etp-fullscreen-active main,
body.etp-fullscreen-active .site-main,
body.etp-fullscreen-active .entry-content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* ─── Float-Buttons im Vollbildmodus über dem Trainer ─────────────── */
/* Diese Buttons werden per JS an den <body> gehängt, brauchen daher
   einen höheren z-index als der Trainer-Container (99000). */
body.etp-fullscreen-active .vocab-start-float,
body.etp-fullscreen-active .swipe-btn-floating,
body.etp-fullscreen-active .lucas-nudge-overlay,
body.etp-fullscreen-active .lucas-intro-overlay,
body.etp-fullscreen-active .lucas-gain-pop,
body.etp-fullscreen-active .etp-lock-toast,
body.etp-fullscreen-active .call-modal-overlay,
body.etp-fullscreen-active #etp-account-dropdown,
body.etp-fullscreen-active .motiv-backdrop,
body.etp-fullscreen-active .motiv-sheet,
body.etp-fullscreen-active .lucas-reward-overlay {
    z-index: 99500 !important;
}

/* Phase 14: Motivations-Sheet und Reward-Karte werden per JS ans <body>
   gehängt — analog Lucas-Intro. Im Fullscreen müssen sie über dem Trainer
   (z-index 99000) liegen, sonst verschwinden sie geräuschlos hinter dem
   Container. Lucas-Reward zusätzlich noch höher als das Sheet, damit die
   Karte ein eventuell offenes Streak-Sheet überlagert. */
body.etp-fullscreen-active .lucas-reward-overlay {
    z-index: 99600 !important;
}

/* 0.26.5: Celebration- & Bezahl-Sheets (0.25.2/0.26) hängen ebenfalls am
   <body> — sie fehlten auf dieser Whitelist und verschwanden im Fullscreen
   geräuschlos hinter dem Trainer-Container. Genau die dokumentierte Falle
   zwei Absätze weiter oben. Auch toki-toast und sq-preview-overlay werden
   an den <body> gehängt und gehören abgesichert. */
body.etp-fullscreen-active .celebr-backdrop,
body.etp-fullscreen-active .toki-toast,
body.etp-fullscreen-active .sq-preview-overlay {
    z-index: 99700 !important;
}

/* 0.29.3: Toki-Helper hängt jetzt am <body> (statt im Container) — im
   Fullscreen braucht er damit Whitelist-Einträge über 99000. Bewusst
   UNTER den Sheets/Overlays (99500+): der Hilfe-Knopf soll nie eine
   Celebration oder ein Bezahl-Sheet überdecken. */
body.etp-fullscreen-active .toki-helper-btn      { z-index: 99100 !important; }
body.etp-fullscreen-active .toki-helper-backdrop { z-index: 99120 !important; }
body.etp-fullscreen-active .toki-helper-sheet    { z-index: 99140 !important; }

/* 0.29.5: Solange das ZS-Fullscreen-Modal (z-index 999999) offen ist,
   MUSS der Toki-Helper darüber liegen — auch im App-Fullscreen, wo die
   99100er-Whitelist-Regel oben per !important gilt. Doppelklassen-
   Selektor schlägt die Einzelklassen-Regel unabhängig von der
   Cascade-Reihenfolge. */
body.zs-fs-open .toki-helper-btn,
body.etp-fullscreen-active.zs-fs-open .toki-helper-btn      { z-index: 1000050 !important; }
body.zs-fs-open .toki-helper-backdrop,
body.etp-fullscreen-active.zs-fs-open .toki-helper-backdrop { z-index: 1000060 !important; }
body.zs-fs-open .toki-helper-sheet,
body.etp-fullscreen-active.zs-fs-open .toki-helper-sheet    { z-index: 1000070 !important; }
