/* Startscreen (Carl 25.11.), Titelsequenz seit 27.11. (konzept/login-27-11/runde2, Variante D): keine Karte mehr,
   der Titel steht groß über dem abgedunkelten Kellergang und trägt alle Rückmeldungen (Zustand in body[data-z]). */
@font-face { font-family: "General Sans"; src: url("schrift/GeneralSans-Regular.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("schrift/GeneralSans-Semibold.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Bespoke Stencil"; src: url("schrift/BespokeStencil-Extrabold.woff2") format("woff2"); font-weight: 800; font-display: block; }

:root {
  --nacht: #0b0908;         /* Grund, bevor das Bild da ist */
  --creme: #efe6d4;         /* Titel und Text */
  --creme-2: #cbbfa8;       /* Datum, Hinweise */
  --rot: #e8604f;           /* "Kein Zutritt", Fehlermeldungen in Groß */
  --rot-text: #f3a497;      /* Fehlermeldungen in Fließtext, 4,5:1 auf dem dunklen Gang */
  --fokus: #e9c88b;
  --spalt: #e9c88b;         /* Lichtkante beim Aufreißen */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--nacht); overflow: hidden; overscroll-behavior: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: "General Sans", system-ui, sans-serif; color: var(--creme); -webkit-tap-highlight-color: transparent; }
::selection { background: var(--creme); color: var(--nacht); }

/* Kellergang: Bühne wie object-fit cover, damit die Lampen-Maske in Bildanteilen sitzt. Grund: alle Wandlampen an.
   Darüber das dunkle Bild, nur um die zweite Lampe freigelegt: kurze Aussetzer = Flackern (tuer.js). */
.gang { position: fixed; inset: 0; overflow: hidden; transition: opacity 0.7s ease; }
/* Safari malt die Leisten oben und unten in der Seitenfarbe: Bildrand dorthin auslaufen lassen (Mobil-Test 26.11.) */
.gang::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--nacht), rgba(11, 9, 8, 0) 40px, rgba(11, 9, 8, 0) calc(100% - 56px), var(--nacht)); }
.buehnenbild { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: max(100vw, calc(100vh * var(--ar))); aspect-ratio: var(--ar); }
.buehnenbild img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.buehnenbild .aus { opacity: 0; -webkit-mask-image: var(--maske); mask-image: var(--maske); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.quer { --ar: 1.5; --maske: radial-gradient(22% 30% at 31.5% 32%, #000 0%, rgba(0, 0, 0, 0.8) 35%, transparent 100%); }
.hoch { --ar: 0.6667; --maske: radial-gradient(34% 26% at 30.4% 32%, #000 0%, rgba(0, 0, 0, 0.8) 35%, transparent 100%); display: none; }
@media (max-aspect-ratio: 1/1) { .quer { display: none; } .hoch { display: block; } }

/* Gang abdunkeln, damit der Titel trägt; beim Hineingehen öffnet sich der Spalt (schwarz, mit heller Kante) */
.abdunkeln { position: fixed; inset: 0; pointer-events: none; background: rgba(7, 5, 4, 0.5); }
.spalt { position: fixed; inset: 0; z-index: 5; pointer-events: none; background: #050403; scale: 1 0;
  box-shadow: 0 -1px 0 var(--spalt), 0 1px 0 var(--spalt); visibility: hidden; }

.buehne { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-items: end start;
  padding: max(24px, 6vh) max(16px, 6vw) max(32px, 8vh, env(safe-area-inset-bottom)); overflow-y: auto; }
.spalte { width: 100%; max-width: 1200px; display: grid; grid-template-columns: minmax(0, 1fr); }
/* Logo: Original-SVG (viewBox 1000x1000, Wortmarke etwa y 440 bis 559), Ausschnitt mit Luft oben und unten */
.logo { display: block; width: 230px; height: 40px; overflow: hidden; margin-bottom: max(20px, 4vh); }
.logo img { display: block; width: 230px; height: 230px; margin-top: -93px; }

/* Titel: Größe nach der längsten Zeile (tuer.js setzt --zeichen), damit auch lange Nachnamen passen */
.titel { --platz: min(88vw, 1100px); margin: 0 0 0 -0.035em; color: var(--creme); transition: color 0.3s;
  font: 800 min(196px, 16.5vw, 23vh, calc(var(--platz) / (var(--zeichen, 7) * 0.74)))/0.86 "Bespoke Stencil", sans-serif; }
.titel .zeile { display: block; white-space: pre; min-height: 0.86em; will-change: auto;
  transition: translate 0.8s cubic-bezier(0.7, 0, 0.84, 0), opacity 0.45s 0.35s; }
body[data-z="fehler"] .titel { color: var(--rot); }
.datum { margin: max(18px, 3vh) 0 0; font-size: clamp(16px, 1.5vw, 21px); line-height: 1.3; color: var(--creme-2); }

.aktion { margin-top: max(22px, 4vh); display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; }
/* Microsoft-Knopf in der hellen Fassung (Vorgaben: weiß, Rand 8c8c8c, Text 5e5e5e oder dunkler) */
.sso { display: inline-flex; align-items: center; gap: 12px; padding: 16px 24px; border: 1px solid #8c8c8c; border-radius: 2px; background: #fff;
  color: #2f2f2f; font: 600 15px/1 "General Sans", system-ui, sans-serif; text-decoration: none; cursor: pointer; touch-action: manipulation;
  transition: translate 0.12s, background-color 0.15s; }
.sso:hover { background: #f1f1f1; }
.sso:active { translate: 0 1px; background: #e8e8e8; }
.ms path { transition: opacity 0.2s; }
/* läuft: die vier Quadrate pulsen im Uhrzeigersinn, bis Microsoft übernimmt */
body[data-z="laeuft"] .sso { pointer-events: none; }
body[data-z="laeuft"] .sso .ms path { animation: ms-puls 0.9s infinite ease-in-out; }
.ms path:nth-child(2) { animation-delay: 0.22s; } .ms path:nth-child(4) { animation-delay: 0.44s; } .ms path:nth-child(3) { animation-delay: 0.66s; }
@keyframes ms-puls { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
.klein { margin: 0; font-size: 14px; line-height: 1.45; color: var(--creme-2); }

/* Zugangscode (nur AUTH_MODUS=pin, entfällt mit SSO) */
.code { margin-top: 26px; max-width: 420px; }
.code[hidden] { display: none; }
.code label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.zeile-code { display: flex; gap: 8px; }
.zeile-code input { flex: 1; min-width: 0; width: 100%; border: 1px solid #7d7262; background: #15110e; border-radius: 2px; padding: 13px 14px;
  font: 500 18px/1 "General Sans", system-ui, sans-serif; letter-spacing: 0.25em; font-variant-numeric: tabular-nums; color: var(--creme); caret-color: var(--fokus); }
.zeile-code input::placeholder { color: #8a7f6e; }
.zeile-code input:focus { border-color: var(--creme-2); outline: none; }
.zeile-code button { border: 1px solid var(--creme); background: none; color: var(--creme); border-radius: 2px; padding: 0 18px;
  font: 600 15px "General Sans", system-ui, sans-serif; cursor: pointer; touch-action: manipulation; transition: translate 0.12s, background-color 0.15s; }
.zeile-code button:hover { background: var(--creme); color: var(--nacht); }
.zeile-code button:active { translate: 0 1px; }
.zeile-code button:disabled { opacity: 0.5; cursor: default; background: none; color: var(--creme); }

.meldung { min-height: 1.45em; margin: 14px 0 0; max-width: 560px; font-size: 15px; line-height: 1.45; color: var(--rot-text); }
.spalte.ruck { animation: ruck 0.38s cubic-bezier(0.3, 0, 0.3, 1); }
@keyframes ruck { 20% { translate: -7px 0; } 45% { translate: 6px 0; } 70% { translate: -2px 0; } }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 3px; }
.ohne-js { position: fixed; left: 16px; right: 16px; bottom: 32px; color: var(--creme); text-align: center; }

/* Hinein: die Titelzeilen fliegen nach oben und unten weg, der Bildschirm reißt waagerecht auf, dahinter dunkel */
body.hinein .titel .zeile:nth-child(1) { translate: 0 -70vh; opacity: 0; }
body.hinein .titel .zeile:nth-child(2) { translate: 0 70vh; opacity: 0; }
body.hinein .logo, body.hinein .datum, body.hinein .aktion, body.hinein .code, body.hinein .meldung { opacity: 0; transition: opacity 0.3s; }
body.hinein .spalt { visibility: visible; animation: spalt 1.1s 0.25s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
@keyframes spalt { 0% { scale: 0 0.002; } 30% { scale: 1 0.002; } 100% { scale: 1 1; } }
body.hinein .gang { opacity: 0; transition-delay: 0.6s; }

/* Handy: Logo kleiner */
@media (max-width: 599px) {
  .logo { width: 190px; height: 34px; }
  .logo img { width: 190px; height: 190px; margin-top: -77px; }
  .aktion { gap: 10px; }
  .sso { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .gang, .titel, .titel .zeile, .sso { transition-duration: 0.01s; transition-delay: 0s; }
  .spalte.ruck { animation: none; }
  body[data-z="laeuft"] .sso .ms path { animation-duration: 1.8s; }
  body.hinein .titel .zeile { translate: none; }
  body.hinein .spalt { animation: abblenden 0.4s forwards; scale: 1 1; opacity: 0; }
  @keyframes abblenden { to { opacity: 1; } }
}
