/* ==========================================================================
   creakom.tv – Digitaler Showroom · Overlay-Stylesheet
   --------------------------------------------------------------------------
   Übernimmt die CI-Tokens der Hauptsite (styles.css v3, Dark Mode):
   Basis #1E2A2C / #141E20, Türkis #A4D8DE als Leitfarbe, Rot #B61918 nur CTA.
   Alles hier ist reines DOM-Overlay über dem WebGL-Canvas.
   ========================================================================== */

:root {
  --c-red:            #B61918;
  --c-red-hover:      #8F1413;
  --c-turquoise:      #A4D8DE;
  --c-turquoise-deep: #5FA9B3;
  --c-line:           rgba(164,216,222,.20);
  --c-line-strong:    rgba(164,216,222,.32);
  --c-base:           #1E2A2C;
  --c-surface:        #233235;
  --c-surface-2:      #2A3D42;
  --c-ink:            #141E20;
  --c-text:           #C8D8DC;
  --c-text-muted:     #6E9098;
  --c-white:          #FFFFFF;

  --glass:        rgba(20,30,32,.72);
  --glass-strong: rgba(20,30,32,.92);

  --font-sans: "Segoe UI", "Segoe UI Variable Display", -apple-system,
               BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --radius: 3px;
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-med:  340ms;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--c-ink);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body { touch-action: none; -webkit-tap-highlight-color: transparent; }

h1, h2, h3 { color: var(--c-white); font-weight: 300; line-height: 1.1; letter-spacing: -.018em; }
h3 { font-weight: 600; letter-spacing: 0; }
b, strong { font-weight: 600; color: var(--c-white); }
em { font-style: normal; color: var(--c-turquoise); }
a { color: var(--c-turquoise); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--c-white); }
svg { display: block; width: 1em; height: 1em; fill: currentColor; }
:focus-visible { outline: 2px solid var(--c-turquoise); outline-offset: 3px; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.eyebrow {
  font-size: .6875rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--c-turquoise-deep);
}

/* --------------------------------------------------------------- BUTTONS */
.btn {
  --btn-bg: transparent;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.5rem; border: 1px solid var(--c-line-strong);
  background: var(--btn-bg); color: var(--c-white);
  font: inherit; font-weight: 600; font-size: .9375rem;
  border-radius: var(--radius); cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn svg { width: .9em; height: .9em; }
.btn:hover:not(:disabled) { border-color: var(--c-turquoise); background: rgba(164,216,222,.10); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }

.btn--primary { --btn-bg: var(--c-red); border-color: var(--c-red); }
.btn--primary:hover:not(:disabled) { --btn-bg: var(--c-red-hover); border-color: var(--c-red-hover); }
.btn--ghost { background: rgba(164,216,222,.05); }
.btn--sm { padding: .55rem 1rem; font-size: .8125rem; }

/* ------------------------------------------------------------------- BOOT */
.boot {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(2rem + var(--safe-t)) 1.5rem calc(1.5rem + var(--safe-b));
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(164,216,222,.10) 0%, transparent 60%),
    linear-gradient(165deg, #1E2A2C 0%, #141E20 60%, #101819 100%);
  text-align: center;
  transition: opacity 620ms var(--ease), visibility 620ms;
}
.boot.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }

.boot__grid {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image:
    linear-gradient(rgba(164,216,222,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(164,216,222,.055) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 60% at 50% 45%, #000 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000 0%, transparent 100%);
}

.boot__inner { position: relative; max-width: 47rem; display: grid; gap: 1.15rem; justify-items: center; }

/* Wortmarke ist die Originaldatei: farbige Bildmarke plus weißer Schriftzug */
img.wordmark { width: clamp(11rem, 26vw, 15rem); height: auto; }

.boot h1 { font-size: clamp(1.9rem, 1.2rem + 3.1vw, 3.5rem); }
.boot__sub { color: var(--c-text); font-size: 1.0625rem; max-width: 34rem; }

.boot__bar {
  width: min(22rem, 74vw); height: 2px; margin-top: .5rem;
  background: rgba(164,216,222,.16); overflow: hidden;
}
.boot__bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--c-turquoise-deep), var(--c-turquoise));
  transition: width 260ms var(--ease);
}
.boot__status { font-size: .8125rem; color: var(--c-text-muted); min-height: 1.4em; }
.boot__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: .25rem; }

.boot__proof {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem 1.5rem;
  margin-top: 2.25rem; padding-top: 1.75rem; border-top: 1px solid var(--c-line);
  width: min(46rem, 92vw); list-style: none;
}
.boot__proof li { display: grid; gap: .15rem; }
.boot__proof b { font-size: clamp(1.3rem,.9rem + 1.3vw,1.9rem); font-weight: 300; color: var(--c-white); }
.boot__proof b span { color: var(--c-turquoise); }
.boot__proof li > span { font-size: .75rem; color: var(--c-text-muted); line-height: 1.35; }
@media (max-width: 620px) {
  .boot__proof { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .boot__proof li:nth-child(n+3) { display: none; }
}

.boot__legal { position: absolute; bottom: calc(1rem + var(--safe-b)); display: flex; gap: 1.25rem; font-size: .75rem; }
.boot__legal a { color: var(--c-text-muted); }

/* ---------------------------------------------------------------- TOPBAR */
.topbar {
  position: fixed; z-index: 40;
  top: var(--safe-t); left: var(--safe-l); right: var(--safe-r);
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem clamp(.75rem, 2.5vw, 1.5rem);
  background: linear-gradient(180deg, rgba(20,30,32,.88) 0%, rgba(20,30,32,0) 100%);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.topbar__brand {
  display: flex; align-items: center; gap: .55rem;
  white-space: nowrap;
}
.topbar__brand img { width: 7.5rem; height: auto; }
.topbar__brand em {
  padding-left: .55rem; border-left: 1px solid var(--c-line-strong);
  font-size: .6875rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--c-text-muted);
}

.topbar__crumb {
  flex: 1 1 auto; min-width: 0; text-align: center;
  display: grid; gap: .05rem;
  opacity: 0; transform: translateY(-4px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.topbar__crumb.is-in { opacity: 1; transform: none; }
.topbar__crumb strong {
  display: block; font-weight: 300; font-size: .9375rem; color: var(--c-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__actions { display: flex; gap: .5rem; }
.topbar__actions .btn { background: var(--glass); backdrop-filter: blur(6px); }

@media (max-width: 700px) {
  .topbar__brand em { display: none; }
  .topbar__actions .btn span { display: none; }
  .topbar__actions .btn { padding: .55rem .7rem; }
  .topbar__crumb .eyebrow { font-size: .625rem; }
}

/* ------------------------------------------------------------------ MENU */
.menu {
  position: fixed; z-index: 45;
  top: calc(var(--safe-t) + 3.4rem); right: calc(var(--safe-r) + clamp(.75rem, 2.5vw, 1.5rem));
  width: min(21rem, calc(100vw - 1.5rem));
  max-height: calc(100vh - var(--safe-t) - 5.5rem);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 1.1rem; display: grid; gap: .85rem;
  background: var(--glass-strong); backdrop-filter: blur(14px);
  border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  transform-origin: top right;
  animation: pop 260ms var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

.menu ul { list-style: none; display: grid; gap: .3rem; }
.menu button {
  width: 100%; display: grid; grid-template-columns: 3px 1fr; gap: .75rem;
  align-items: stretch; text-align: left;
  padding: .6rem .7rem; border: 1px solid transparent; border-radius: var(--radius);
  background: rgba(164,216,222,.04); color: var(--c-text); font: inherit; cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.menu button:hover, .menu button.is-active { background: rgba(164,216,222,.11); border-color: var(--c-line-strong); }
.menu button i { display: block; background: var(--dot, var(--c-turquoise)); border-radius: 2px; }
.menu button b { display: block; font-weight: 600; font-size: .875rem; color: var(--c-white); }
.menu button small { display: block; font-size: .75rem; color: var(--c-text-muted); line-height: 1.35; }
.menu__foot { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .85rem; border-top: 1px solid var(--c-line); }

/* --------------------------------------------------------------- RETICLE */
.reticle {
  position: fixed; z-index: 20; top: 50%; left: 50%; translate: -50% -50%;
  width: 26px; height: 26px; pointer-events: none;
  display: grid; place-items: center;
}
.reticle i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--c-white); opacity: .55;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45);
  transition: all 180ms var(--ease);
}
.reticle.is-hot i {
  width: 20px; height: 20px; background: transparent; opacity: 1;
  border: 1px solid var(--c-turquoise);
  box-shadow: 0 0 12px rgba(164,216,222,.7), inset 0 0 8px rgba(164,216,222,.35);
}

.prompt {
  position: fixed; z-index: 21; left: 50%; top: calc(50% + 28px); translate: -50% 0;
  padding: .4rem .75rem; pointer-events: none; white-space: nowrap;
  background: var(--glass); border: 1px solid var(--c-line-strong); border-radius: var(--radius);
  font-size: .8125rem; color: var(--c-white); backdrop-filter: blur(6px);
  animation: pop 180ms var(--ease);
}
.prompt b { color: var(--c-turquoise); }

/* ------------------------------------------------------------------- INFO */
.info {
  position: fixed; z-index: 50;
  top: calc(var(--safe-t) + 3.4rem); right: calc(var(--safe-r) + clamp(.75rem, 2.5vw, 1.5rem));
  width: min(25rem, calc(100vw - 1.5rem));
  max-height: calc(100vh - var(--safe-t) - var(--safe-b) - 6rem);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 1.4rem 1.4rem 1.5rem;
  background: var(--glass-strong); backdrop-filter: blur(14px);
  border: 1px solid var(--c-line); border-left: 2px solid var(--accent, var(--c-turquoise));
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  display: grid; gap: .8rem; align-content: start;
  animation: slide-in 320ms var(--ease);
}
@keyframes slide-in { from { opacity: 0; transform: translateX(22px); } }
.info h2 { font-size: 1.45rem; }
.info .eyebrow { color: var(--accent, var(--c-turquoise)); }
.info__claim { font-size: .9375rem; color: var(--c-text); }
.info__list { list-style: none; display: grid; gap: .45rem; }
.info__list li {
  position: relative; padding-left: 1.1rem; font-size: .875rem; color: var(--c-text);
}
.info__list li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 6px; height: 1px; background: var(--accent, var(--c-turquoise));
}
.info__list li b { color: var(--c-white); }
.info__cta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }

.info__close {
  position: absolute; top: .6rem; right: .6rem;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--c-text-muted); cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.info__close:hover { color: var(--c-white); border-color: var(--c-line-strong); }
.info__close svg { width: 14px; height: 14px; }

@media (max-width: 620px) {
  .info {
    top: auto; left: .5rem; right: .5rem; width: auto;
    bottom: calc(var(--safe-b) + .5rem);
    max-height: 58vh;
    animation: slide-up 320ms var(--ease);
  }
  @keyframes slide-up { from { opacity: 0; transform: translateY(26px); } }
  .menu { top: auto; bottom: calc(var(--safe-b) + .5rem); left: .5rem; right: .5rem; width: auto; max-height: 62vh; }
}

/* ------------------------------------------------------------------ TOOLS */
.tools {
  position: fixed; z-index: 40;
  right: calc(var(--safe-r) + clamp(.75rem, 2.5vw, 1.5rem));
  bottom: calc(var(--safe-b) + clamp(.75rem, 2.5vw, 1.5rem));
  display: grid; gap: .4rem; justify-items: end;
}
.tool {
  min-width: 2.5rem; height: 2.5rem; padding: 0 .7rem;
  display: grid; place-items: center;
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--c-line); border-radius: var(--radius);
  color: var(--c-text); font: inherit; font-size: .75rem; font-weight: 600;
  letter-spacing: .06em; cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.tool:hover { border-color: var(--c-turquoise); color: var(--c-white); background: rgba(164,216,222,.12); }
.tool svg { width: 14px; height: 14px; }
#btn-vr { border-color: var(--c-turquoise); color: var(--c-turquoise); }
#btn-vr.is-active { background: var(--c-turquoise); color: var(--c-ink); }

.hint {
  position: fixed; z-index: 30;
  left: calc(var(--safe-l) + clamp(.75rem, 2.5vw, 1.5rem));
  bottom: calc(var(--safe-b) + clamp(.75rem, 2.5vw, 1.5rem));
  max-width: min(24rem, 60vw);
  padding: .5rem .8rem;
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--c-line); border-left: 2px solid var(--c-turquoise-deep);
  border-radius: var(--radius);
  font-size: .8125rem; color: var(--c-text);
  transition: opacity var(--t-med) var(--ease);
}
.hint kbd {
  display: inline-block; padding: 0 .3rem; margin: 0 .05rem;
  border: 1px solid var(--c-line-strong); border-radius: 2px;
  font: inherit; font-size: .75rem; color: var(--c-white); background: rgba(164,216,222,.08);
}
.hint.is-fading { opacity: 0; }
@media (max-width: 620px) { .hint { max-width: calc(100vw - 5.5rem); font-size: .75rem; } }

/* ---------------------------------------------------------- TOUCH CONTROLS */
.touch { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.stick {
  position: absolute; pointer-events: auto;
  left: calc(var(--safe-l) + 1.25rem); bottom: calc(var(--safe-b) + 4.5rem);
  width: 116px; height: 116px; border-radius: 50%;
  background: radial-gradient(circle, rgba(20,30,32,.55) 0%, rgba(20,30,32,.28) 70%, transparent 100%);
  border: 1px solid var(--c-line);
  display: grid; place-items: center;
  touch-action: none;
}
.stick i {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(164,216,222,.22); border: 1px solid var(--c-turquoise);
  box-shadow: 0 0 18px rgba(164,216,222,.28);
  transition: transform 90ms linear;
}
.touch__act {
  position: absolute; pointer-events: auto;
  right: calc(var(--safe-r) + 1.25rem); bottom: calc(var(--safe-b) + 11rem);
  width: 84px; height: 84px; border-radius: 50%;
  background: rgba(182,25,24,.82); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font: inherit; font-size: .75rem; font-weight: 600; letter-spacing: .04em;
  cursor: pointer;
}
.touch__act:active { background: var(--c-red-hover); }

/* ------------------------------------------------------------------ MODAL */
.modal {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; padding: 1rem;
  background: rgba(10,16,17,.72); backdrop-filter: blur(4px);
  animation: fade 220ms var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal__box {
  position: relative; width: min(52rem, 100%);
  max-height: calc(100vh - 2rem); overflow-y: auto;
  padding: 1.8rem clamp(1.1rem, 3vw, 2.2rem);
  background: linear-gradient(160deg, #233235 0%, #1A2729 100%);
  border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  display: grid; gap: 1rem;
}
.modal h2 { font-size: 1.7rem; }
.help__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; }
.help__cols h3 {
  font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--c-turquoise); padding-bottom: .5rem; margin-bottom: .6rem;
  border-bottom: 1px solid var(--c-line);
}
.help__cols dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; font-size: .8125rem; }
.help__cols dt { color: var(--c-white); font-weight: 600; white-space: nowrap; }
.help__cols dd { color: var(--c-text-muted); }
.help__note { font-size: .8125rem; color: var(--c-text-muted); padding-top: .5rem; border-top: 1px solid var(--c-line); }

/* ------------------------------------------------------------------- VEIL */
.veil {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  display: grid; place-items: center;
  opacity: 0; transition: opacity 420ms var(--ease);
  background:
    radial-gradient(90% 70% at 50% 50%, rgba(164,216,222,.16) 0%, transparent 55%),
    #101819;
}
.veil.is-on { opacity: 1; }
.veil span {
  font-size: clamp(1rem, .8rem + 1vw, 1.5rem); font-weight: 300; color: var(--c-white);
  letter-spacing: .02em; text-align: center; padding: 0 1.5rem;
}
.veil span::before {
  content: "› "; color: var(--c-turquoise);
}

/* ------------------------------------------------------------------ FATAL */
.fatal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 2rem; text-align: center;
  background: linear-gradient(165deg, #1E2A2C, #141E20);
}
.fatal > div { display: grid; gap: 1rem; justify-items: center; max-width: 34rem; }
.fatal h2 { font-size: 1.6rem; }
.fatal p { font-size: .9375rem; }

/* ------------------------------------------------------------ KALIBRIERUNG */
/* Nur mit ?kalibrieren in der Adresse sichtbar – ein Werkzeug, kein Feature. */
.calib {
  position: fixed; z-index: 55;
  left: calc(var(--safe-l) + .75rem); top: calc(var(--safe-t) + 3.6rem);
  width: min(23rem, calc(100vw - 1.5rem));
  padding: .9rem 1rem 1rem;
  display: grid; gap: .6rem;
  background: var(--glass-strong); backdrop-filter: blur(14px);
  border: 1px solid var(--c-line); border-left: 2px solid var(--c-red);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  font-size: .8125rem;
}
.calib dl {
  display: grid; grid-template-columns: 5.2rem 1fr; gap: .2rem .6rem;
  font-variant-numeric: tabular-nums;
}
.calib dt { color: var(--c-text-muted); font-size: .75rem; }
.calib dd { color: var(--c-white); font-size: .75rem; overflow-wrap: anywhere; }
.calib__row { display: flex; gap: .4rem; }
.calib button {
  flex: 1 1 0; padding: .45rem .5rem;
  background: rgba(164,216,222,.07); border: 1px solid var(--c-line-strong);
  border-radius: var(--radius); color: var(--c-white);
  font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.calib button:hover { background: rgba(164,216,222,.16); border-color: var(--c-turquoise); }
.calib textarea {
  width: 100%; resize: vertical;
  padding: .5rem .6rem;
  background: rgba(8,12,13,.75); border: 1px solid var(--c-line);
  border-radius: var(--radius); color: var(--c-turquoise);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .75rem; line-height: 1.5;
}
.calib__note { font-size: .6875rem; color: var(--c-text-muted); line-height: 1.45; }
.calib__note kbd {
  display: inline-block; padding: 0 .25rem;
  border: 1px solid var(--c-line-strong); border-radius: 2px;
  color: var(--c-white); background: rgba(164,216,222,.08);
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
