/* Each die has six individually lit faces. Face 1 is the cube's local +Z normal. */
.nd-flight-stage {
  position: fixed;
  pointer-events: none;
  z-index: 80;
  overflow: visible;
  user-select: none;
  isolation: isolate;
}
:is(.nd-flight-stage,.nd-rest) .nd-die-space,
:is(.nd-flight-stage,.nd-rest) .nd-shadow {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
}
:is(.nd-flight-stage,.nd-rest) .nd-die-space {
  perspective: 480px;
  perspective-origin: center;
}
:is(.nd-flight-stage,.nd-rest) .nd-camera,
:is(.nd-flight-stage,.nd-rest) .nd-body {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
:is(.nd-flight-stage,.nd-rest) .nd-camera { transform: rotateX(24deg) rotateY(-12deg); }
:is(.nd-flight-stage,.nd-rest) .nd-body { will-change: transform; }
:is(.nd-flight-stage,.nd-rest) .nd-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template:repeat(3,1fr)/repeat(3,1fr);
  place-items: center;
  box-sizing: border-box;
  padding: 13%;
  border-radius: 12%;
  transform: var(--nd-side) translateZ(var(--nd-half));
  backface-visibility: hidden;
  border: 1px solid var(--nd-edge);
  background: linear-gradient(140deg, var(--nd-light) 0%, var(--nd-main) 55%, var(--nd-low) 100%);
  box-shadow: inset 0 0 0 .45px var(--nd-light), inset 0 -1px 2px var(--nd-edge);
}
:is(.nd-flight-stage,.nd-rest) .nd-ivory {
  --nd-main:#eddfbd; --nd-light:#fff5df; --nd-low:#d2b88a; --nd-edge:#9f8968;
  --nd-pip:#502630; --nd-pip-edge:#341e24;
}
:is(.nd-flight-stage,.nd-rest) .nd-garnet {
  --nd-main:#6c2531; --nd-light:#9b4c52; --nd-low:#511f29; --nd-edge:#361923;
  --nd-pip:#fff0d4; --nd-pip-edge:#cdae83;
}
:is(.nd-flight-stage,.nd-rest) .nd-pip {
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(ellipse at 68% 80%,var(--nd-pip) 40%,var(--nd-pip-edge) 100%);
  box-shadow: inset 0 .55px 1px #20131985, 0 .45px .4px #fff3;
}
:is(.nd-flight-stage,.nd-rest) .nd-shadow {
  border-radius: 50%;
  background: radial-gradient(ellipse, #180d0ae0 0, #21120daf 36%, transparent 76%);
  transform-origin: center;
}
@media (prefers-reduced-motion: reduce) {
  .nd-flight-stage { display: none; }
}

.nd-rest { position:absolute; inset:0; display:block; container-type:inline-size; pointer-events:none; }
.nd-rest .nd-die-space { width:100%; height:100%; --nd-half:50cqw; will-change:auto; }
.nd-rest .nd-body { will-change:auto; }
.nd-rest .nd-shadow {
  width:152%; height:85%; left:-26%; top:72%;
  opacity:.55; filter:blur(.8px); will-change:auto;
}
