:root {
  --cyan: #4df3ff;
  --amber: #ffb84d;
  --ink: #04070a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Share Tech Mono', monospace;
  color: var(--cyan);
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  touch-action: none;
}

/* ---------- Video hinter dem Canvas ---------- */

#videoLayer {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  overflow: hidden;
  background: #000;
}

#videoFrame {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  transform-origin: 0 0;
  background: #000;
  will-change: transform;
}

#videoFrame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.placeholder {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(120deg, #06222a, #0b3d46 35%, #2a1a08 70%, #06131a);
  background-size: 300% 300%;
  animation: ph-drift 9s ease-in-out infinite;
  text-align: center;
}

.placeholder::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(100deg, transparent 0 46px, rgba(77, 243, 255, 0.07) 46px 50px);
  animation: ph-slide 2.4s linear infinite;
}

.placeholder .ph-title {
  position: relative;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 84px;
  letter-spacing: 0.08em;
  color: var(--amber);
  text-shadow: 0 0 30px rgba(255, 184, 77, 0.5);
}

.placeholder .ph-sub {
  position: relative;
  font-size: 30px;
  color: #a9dfe6;
}

@keyframes ph-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes ph-slide {
  from { transform: translateX(0); }
  to { transform: translateX(50px); }
}

/* ---------- Keyboard-Seite im Laptop ---------- */

#osFrame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  background: #04070a;
  transition: opacity 0.35s ease;
}

#osFrame.on {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- HUD ---------- */

#hud {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

#tip {
  position: absolute;
  left: 0;
  top: 0;
  padding: 6px 12px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--cyan);
  border-radius: 2px;
  opacity: 0;
  transform: translate(-50%, -230%);
  transition: opacity 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(77, 243, 255, 0.45);
}

#tip.on { opacity: 1; }

#hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(190, 240, 245, 0.75);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.8s ease;
}

#hint.on { opacity: 1; }

#bar {
  position: absolute;
  left: 18px;
  top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#bar.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

#bar button, #bar a {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  background: rgba(4, 10, 13, 0.82);
  border: 1px solid rgba(77, 243, 255, 0.4);
  border-radius: 3px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

#bar button:hover, #bar a:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(77, 243, 255, 0.4);
}

#soundBtn.on {
  color: var(--amber);
  border-color: rgba(255, 184, 77, 0.6);
}

#barTitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  padding: 0 6px;
}

#bar .hide { display: none; }

/* ---------- Loader ---------- */

#loader {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: #020405;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity 0.9s ease;
}

#loader.done {
  opacity: 0;
  pointer-events: none;
}

#loaderBar {
  width: 180px;
  height: 2px;
  background: rgba(77, 243, 255, 0.15);
  position: relative;
  overflow: hidden;
}

#loaderBar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cyan);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 0 12px var(--cyan);
}

#loaderText {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(77, 243, 255, 0.6);
}

@media (max-width: 640px) {
  #barTitle { display: none; }
  #bar { left: 10px; top: 10px; gap: 6px; }
  #bar button, #bar a { padding: 8px 10px; font-size: 12px; }
}
