

#gradient-display > [data-guise-part="surface"] {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--guise-radius-md, 12px);
  background: #010101;
}

#gradient-display canvas[data-part="screen"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #010101;
}

#gradient-instrument:not([data-display="on"]):not([data-animation-fullscreen="true"]) #gradient-display {
  display: none;
}

#gradient-instrument[data-animation-fullscreen="true"] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  visibility: hidden;
}

#gradient-instrument[data-animation-fullscreen="true"] #gradient-display,
#gradient-instrument[data-animation-fullscreen="true"]::after {
  visibility: visible;
}

#gradient-instrument[data-animation-fullscreen="true"] #gradient-display > [data-guise-part="surface"] {
  position: fixed;
  inset: 0;
  z-index: 1;
  aspect-ratio: auto;
  border-radius: 0;
}

#gradient-instrument[data-blackout="true"] #gradient-display > [data-guise-part="surface"] {
  background: #000;
}

#gradient-instrument[data-blackout="true"] #gradient-display canvas[data-part="screen"] {
  visibility: hidden;
}

#gradient-instrument[data-animation-fullscreen="true"],
#gradient-instrument[data-animation-fullscreen="true"] * {
  cursor: none;
}

@keyframes gi-exit-hint {
  0%   { opacity: 0;   transform: translateY(6px);  }
  20%  { opacity: 0.7; transform: translateY(0);    }
  75%  { opacity: 0.7; transform: translateY(0);    }
  100% { opacity: 0;   transform: translateY(-4px); }
}

#gradient-instrument[data-animation-fullscreen="true"]::after {
  content: 'Tap anywhere to exit';
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(1.2rem, 5vh, 3rem));
  left: 0;
  right: 0;
  padding-inline: 1.5rem;
  text-align: center;
  z-index: 2;
  pointer-events: none;

  font-family: var(--font-body, ui-sans-serif, system-ui, sans-serif);
  font-size: clamp(0.70rem, 2.2vw, 0.85rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.55),
    0 0 12px rgba(0, 0, 0, 0.35);

  animation: gi-exit-hint 4s ease-in-out 0.8s both;
}

@keyframes gi-blackout-hint {
  0%   { opacity: 0;   }
  100% { opacity: 0.7; }
}

@keyframes gi-blackout-wander {
  0%   { translate: 0 0; }
  20%  { translate: 14px -6px; }
  40%  { translate: 4px -12px; }
  60%  { translate: -12px -8px; }
  80%  { translate: -16px 2px; }
  100% { translate: 0 0; }
}

#gradient-instrument[data-blackout="true"]::after {
  content: 'Blackout mode \2014  tap anywhere to exit\A Enjoy your rest';
  white-space: pre-line;
  line-height: 1.9;
  animation:
    gi-blackout-hint 0.8s ease-in-out 0.8s both,
    gi-blackout-wander 300s ease-in-out 1.6s infinite;
}

:root:has(#gradient-instrument[data-animation-fullscreen="true"]) {
  overflow: hidden;
  overscroll-behavior: none;
}
