/* ---------------------------------------------------------------------------
   WebGL-Ansicht "Premium Patio Apartment" (Apartment Nr 27)
   gemeinsam fuer alle Sprachseiten de/ pl/ en/ cs/
   --------------------------------------------------------------------------- */

:root {
  --bg:        #10141a;
  --panel:     #171d26;
  --panel-2:   #1f2733;
  --linie:     #2c3746;
  --text:      #e6ebf2;
  --text-leise:#93a1b3;
  --akzent:    #3ec8b0;   /* Gelaender tuerkisgruen aus dem Modell */
  --akzent-2:  #2a9c8a;
  --breite:    320px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Die Buehne nimmt immer das ganze Fenster ein; das Bedienfeld liegt als
   einblendbare Leiste darueber - so aendert sich beim Ein- und Ausblenden
   die Groesse der Zeichenflaeche nicht und der Bildausschnitt bleibt stehen. */
body { display: block; }

/* --- Bühne ---------------------------------------------------------------- */

#buehne { position: relative; overflow: hidden; width: 100%; height: 100%; }

#leinwand { display: block; width: 100%; height: 100%; }

/* Die Modellflaechen sind fast weiss.  Helle Schrift mit dunklem Schein
   verwischt darauf bis zur Unleserlichkeit - deshalb liegen alle Texte auf
   der Buehne auf einer leicht abgedunkelten Flaeche statt auf einem Schein. */
.ueberlagerung {
  position: absolute;
  pointer-events: none;
  background: rgba(14, 18, 24, .66);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 9px;
  padding: 8px 12px;
}

#kopf { top: 16px; left: 18px; }
#kopf h1 {
  margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .2px;
  color: #f2f5f9;
}
#kopf h1 span { color: var(--akzent); font-weight: 400; }
#kopf p { margin: 3px 0 0; font-size: 12.5px; color: #b9c5d4; }

#status {
  left: 18px; bottom: 54px;
  font-size: 12.5px; color: #b9c5d4;
  max-width: min(560px, calc(100% - 90px));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#status-objekt { color: var(--akzent); font-weight: 600; }

#hinweis-maus {
  left: 18px; bottom: 16px;
  font-size: 11.5px; color: #9aa8b9;
  padding: 6px 12px;
  max-width: calc(100% - 240px);   /* Platz fuer die Sprachwahl rechts */
}

/* Sprachwahl unten rechts - schlichte Links auf ../de/ usw., ohne Cookies
   und ohne gespeicherte Vorliebe. */
#sprachwahl {
  right: 16px; bottom: 16px;
  pointer-events: auto;              /* .ueberlagerung schaltet sie sonst ab */
  display: flex; gap: 2px;
  padding: 4px;
}
#sprachwahl a {
  padding: 3px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .4px;
  color: #9aa8b9; text-decoration: none;
  transition: background .15s, color .15s;
}
#sprachwahl a:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
#sprachwahl a.aktiv { color: #04231e; background: var(--akzent); }
#sprachwahl a:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }

/* Knopfleiste oben rechts: Bedienfeld-Schalter und Rückweg zur Hauptseite.
   Beide sitzen in einem gemeinsamen Behaelter, damit sie zusammen zur Seite
   ruecken, wenn das Bedienfeld einfaehrt. */
#knopfleiste {
  position: fixed; top: 16px; right: 16px; z-index: 40;
  display: flex; flex-direction: column; gap: 8px;
  transition: right .25s ease;
}
#knopfleiste.offen { right: calc(min(var(--breite), 88vw) + 16px); }

.buehnen-knopf {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--linie); border-radius: 8px;
  background: rgba(23,29,38,.92); color: var(--text);
  font-size: 17px; line-height: 1; cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .15s, border-color .15s, color .15s;
}
.buehnen-knopf:hover { background: #26313f; border-color: #3c4a5c; }
#zur-hauptseite:hover { color: var(--akzent); }
.buehnen-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* --- Ladeschirm ----------------------------------------------------------- */

#ladeschirm {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .5s ease;
}
#ladeschirm.weg { opacity: 0; pointer-events: none; }
.lade-box { width: 260px; text-align: center; }
.lade-titel { font-size: 15px; margin-bottom: 14px; letter-spacing: .3px; }
.lade-balken {
  height: 3px; border-radius: 2px; background: var(--panel-2); overflow: hidden;
}
.lade-balken i {
  display: block; height: 100%; width: 0%;
  background: var(--akzent); transition: width .25s ease;
}
.lade-text { margin-top: 10px; font-size: 12px; color: var(--text-leise); }
.lade-text.fehler { color: #ff8b7a; text-align: left; line-height: 1.6; }
.lade-text code {
  display: block; margin-top: 8px; padding: 8px 10px;
  background: var(--panel-2); border-radius: 6px;
  color: var(--text); font-size: 11.5px; white-space: pre-wrap; word-break: break-all;
}

/* --- Bedienfeld ----------------------------------------------------------- */

#bedienfeld {
  position: fixed; inset: 0 0 0 auto; z-index: 30;
  width: min(var(--breite), 88vw);
  background: var(--panel);
  border-left: 1px solid var(--linie);
  overflow-y: auto;
  padding: 18px 18px 40px;
  box-shadow: -12px 0 40px rgba(0,0,0,.45);
  /* Geschlossen zusaetzlich visibility:hidden - dann liegt das Bedienfeld
     weder in der Tabulator-Reihenfolge noch im Screenreader.  Der Umschalt-
     punkt wird ans Ende der Bewegung gelegt (Verzoegerung .25s), damit das
     Ausfahren noch zu sehen ist. */
  visibility: hidden;
  transform: translateX(100%);
  transition: transform .25s ease, visibility 0s linear .25s;
}
#bedienfeld.offen {
  visibility: visible;
  transform: none;
  transition: transform .25s ease, visibility 0s linear 0s;
}

/* Kopfzeile mit Schliessen-Knopf.  sticky + negativer Rand: sie reicht bis an
   die Kanten des Bedienfelds und bleibt beim Scrollen oben stehen. */
.bedienfeld-kopf {
  position: sticky; top: -18px; z-index: 1;
  display: flex; justify-content: flex-end;
  margin: -18px -18px 16px;
  padding: 12px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--linie);
}
#bedienfeld-schliessen {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--linie); border-radius: 7px;
  background: var(--panel-2); color: var(--text);
  font: inherit; font-size: 12.5px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
#bedienfeld-schliessen span { font-size: 14px; line-height: 1; }
#bedienfeld-schliessen:hover { background: #26313f; border-color: #3c4a5c; color: var(--akzent); }
#bedienfeld-schliessen:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

#bedienfeld section { margin-bottom: 26px; }

#bedienfeld h2 {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--akzent);
}

.fussnote { margin: 8px 0 0; font-size: 11px; color: var(--text-leise); }
.fussnote a { color: var(--akzent); }
.fussnote code { font-size: 10.5px; color: #b7c3d2; }

/* Ansichts-Knöpfe */

.knopfgitter { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.knopfgitter button {
  padding: 8px 6px;
  border: 1px solid var(--linie); border-radius: 7px;
  background: var(--panel-2); color: var(--text);
  font-size: 11.5px; line-height: 1.25; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.knopfgitter button:hover { background: #26313f; border-color: #3c4a5c; }
.knopfgitter button.aktiv {
  background: var(--akzent-2); border-color: var(--akzent); color: #04231e;
  font-weight: 600;
}

/* Regler */

.regler { display: flex; align-items: center; gap: 10px; }
.regler input[type=range] {
  flex: 1; accent-color: var(--akzent); cursor: pointer;
}
.regler output {
  width: 48px; text-align: right;
  font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-leise);
}

/* Ebenen / Häkchen */

.ebenen-gruppe { margin-bottom: 10px; }
.ebenen-gruppe > .kopf {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; margin-bottom: 4px;
}
.ebenen-gruppe > .kopf .zahl {
  margin-left: auto; font-size: 10.5px; font-weight: 400; color: #6f7d8f;
}
.ebenen-gruppe .kinder { padding-left: 22px; }

label.haken {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0; font-size: 12.5px; cursor: pointer;
  color: var(--text);
}
label.haken input { accent-color: var(--akzent); cursor: pointer; }
.kinder label.haken { color: var(--text-leise); font-size: 12px; }

.knopfreihe { display: flex; gap: 6px; margin-top: 12px; }
.knopfreihe button {
  flex: 1; padding: 8px 4px;
  border: 1px solid var(--linie); border-radius: 7px;
  background: var(--panel-2); color: var(--text);
  font-size: 11.5px; cursor: pointer;
}
.knopfreihe button:hover { background: #26313f; }

/* Tabellen */

#raeume { width: 100%; border-collapse: collapse; font-size: 11.5px; }
#raeume td { padding: 3px 0; border-bottom: 1px solid #202836; vertical-align: top; }
#raeume tr:last-child td { border-bottom: none; }
#raeume td.nr { width: 16px; color: var(--akzent); }
#raeume td.flaeche {
  text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums; color: var(--text-leise);
}
#raeume tr.summe td { border-top: 1px solid var(--linie); font-weight: 600; padding-top: 6px; }
#raeume small { display: block; color: #6f7d8f; }

#modellinfo { margin: 0; font-size: 11.5px; }
#modellinfo dt { color: var(--text-leise); }
#modellinfo dd { margin: 0 0 7px; }

/* --- schmale Fenster ------------------------------------------------------ */

@media (max-width: 820px) {
  #hinweis-maus { display: none; }
  #kopf h1 { font-size: 18px; }
  #kopf { top: 14px; left: 16px; max-width: calc(100% - 80px); }
}

/* Handy: das Bedienfeld nimmt 88 % der Breite ein, die Knopfleiste wuerde
   daneben an den Bildrand gedraengt.  Geschlossen wird dann ueber den Knopf
   im Bedienfeld selbst. */
@media (max-width: 560px) {
  #knopfleiste.offen { visibility: hidden; }
}

/* --- Einbettungsmodus (?einbettung) -------------------------------------- */
/* Im iframe der Fotoseite von premium-patio-apartment.de bleibt nur die
   Szene: kein Kopf, keine Knoepfe, kein Bedienfeld, keine Anzeigen unten. */
.eingebettet #kopf,
.eingebettet #status,
.eingebettet #hinweis-maus,
.eingebettet #sprachwahl,
.eingebettet #knopfleiste,
.eingebettet #bedienfeld { display: none; }

.eingebettet #leinwand { cursor: grab; }
.eingebettet #leinwand:active { cursor: grabbing; }

/* Bewegungsreduzierung respektieren */
@media (prefers-reduced-motion: reduce) {
  #bedienfeld, #knopfleiste { transition: none; }
}
