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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050607;
  color: #c8c4bc;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.stage {
  position: fixed;
  inset: 0;
}

.stage canvas.webgl {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: pointer;
}

#powerCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: auto;
  transition: opacity 900ms cubic-bezier(0.25, 0.85, 0.3, 1);
}

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

.chrome {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.label {
  position: absolute;
  top: 20px;
  left: 22px;
  opacity: 0.72;
}

.label b {
  font-weight: 600;
  opacity: 1;
}

.telemetry {
  position: absolute;
  top: 20px;
  right: 22px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: rgba(200, 196, 188, 0.42);
}

.hint {
  position: absolute;
  bottom: 22px;
  left: 22px;
  color: rgba(200, 196, 188, 0.42);
  line-height: 1.55;
  transition: opacity 400ms cubic-bezier(0.25, 0.85, 0.3, 1);
}

.hint.is-hidden {
  opacity: 0;
}

.osd-channel {
  position: absolute;
  top: 18%;
  right: 12%;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: clamp(11px, 1.4vw, 14px);
  letter-spacing: 0.12em;
  color: rgba(210, 240, 225, 0);
  text-shadow: 0 0 12px rgba(120, 255, 210, 0.35);
  transition: opacity 120ms steps(2, end);
  pointer-events: none;
}

.osd-channel.visible {
  color: rgba(210, 240, 225, 0.92);
}

.osd-channel.searching {
  animation: osd-flicker 80ms steps(2, end) infinite;
}

@keyframes osd-flicker {
  50% { opacity: 0.55; }
}

/* hidden-Attribut muss `display: grid` schlagen, sonst liegt die Detail-Ebene
   dauerhaft über der Bühne und fängt alle Klicks ab. */
.detail[hidden] {
  display: none;
}

.detail {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  justify-items: center;
  padding: clamp(20px, 4vw, 56px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.25, 0.85, 0.3, 1);
}

.detail.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 22%, color-mix(in srgb, var(--werk, #3bdab6) 16%, transparent), transparent 68%),
    linear-gradient(180deg, rgba(5, 6, 7, 0.35) 0%, rgba(5, 6, 7, 0.88) 55%, #0d0d0f 100%);
  pointer-events: none;
}

.detail-meta {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  text-align: center;
  padding-bottom: clamp(24px, 5vh, 48px);
  transform: translateY(12px);
  transition: transform 600ms cubic-bezier(0.25, 0.85, 0.3, 1);
}

.detail.is-visible .detail-meta {
  transform: translateY(0);
}

.detail-title {
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #e8e6e0;
  margin-bottom: 0.55em;
}

.detail-role {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: clamp(0.68rem, 1.4vw, 0.78rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6a6862;
}

.detail-role span {
  color: #a8a6a0;
}

.fallback {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #050607;
  color: rgba(200, 196, 188, 0.7);
  text-align: center;
}

.fallback[hidden] {
  display: none;
}

kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  border: 1px solid rgba(200, 196, 188, 0.28);
  border-radius: 3px;
  padding: 1px 5px;
  color: #c8c4bc;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .label,
  .telemetry,
  .hint {
    font-size: 10px;
  }

  .hint {
    max-width: 72%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #powerCanvas,
  .detail,
  .detail-meta,
  .hint {
    transition-duration: 0.01ms !important;
  }
}
