/* The slab assembling itself in the Grade Slam (hybrid_grading/shared/_slab_assembly),
   after the design handoff "Slab Assembly Hero": its 520 x 640 stage, drawn at
   its own size and scaled whole to the frame's width by the
   hybrid-grading--slab-assembly controller. The slab is WebGL on the canvas;
   these are the handoff's flat layers round it, at its sizes and colours,
   positioned from the world pivot at 260, 318 that the scene's camera shares.
   The colours are ucollect's brand variables (app/assets/tailwind/theme.css)
   with their values as fallbacks, so the stage looks the same on a page that
   does not load that theme (the HGA layout). Linked by the page that shows the
   stage. */
/* The finished slab, shown in place of the stage when it cannot be drawn
   (the controller's is-still). Hidden, a lazy image is never fetched. */
.slab-assembly__still {
  display: none;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin-inline: auto;
}

.slab-assembly.is-still .slab-assembly__still {
  display: block;
}

.slab-assembly.is-still .slab-assembly__frame,
.slab-assembly.is-still .slab-assembly__controls {
  display: none;
}

.slab-assembly__frame {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 520 / 640;
  margin-inline: auto;
}

.slab-assembly__stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 520px;
  height: 640px;
  transform-origin: 0 0;
  background: var(--color-primary-dark, #001F3F);
  border-radius: 5px;
  overflow: hidden;
  perspective: 1700px;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.slab-assembly__shadow {
  position: absolute;
  left: 90px;
  top: 585px;
  width: 340px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

.slab-assembly__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.slab-assembly__shake {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.slab-assembly__world {
  position: absolute;
  left: 260px;
  top: 318px;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.slab-assembly__flash,
.slab-assembly__shine {
  position: absolute;
  left: -164px;
  top: -272px;
  width: 328px;
  height: 545px;
  border-radius: 22px;
  opacity: 0;
}

.slab-assembly__flash {
  background: #fff;
  transform: translateZ(9px);
}

.slab-assembly__shine {
  overflow: hidden;
  transform: translateZ(8.5px);
}

.slab-assembly__shine-bar {
  position: absolute;
  left: 0;
  top: -160px;
  width: 120px;
  height: 870px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0));
}

.slab-assembly__ring {
  position: absolute;
  left: -150px;
  top: -150px;
  width: 300px;
  height: 300px;
  box-sizing: border-box;
  border: 3px solid var(--color-primary-light, #699AB0);
  border-radius: 50%;
  opacity: 0;
}

.slab-assembly__particle {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  background: var(--color-primary-lightest, #E1EBEE);
  opacity: 0;
}

.slab-assembly__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  margin: 14px auto 0;
}

.slab-assembly__controls span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-brand-gray, #606060);
}

.slab-assembly__controls input {
  flex: 1 1 120px;
  accent-color: var(--color-primary, #396D8C);
}

.slab-assembly__play {
  height: 35px;
  min-width: 92px;
  padding: 0 18px;
  background: var(--color-primary, #396D8C);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}

.slab-assembly__play:hover {
  background: var(--color-primary-dark, #001F3F);
}

/* Reduced motion shows the assembled slab and never loops, so there is
   nothing to play. */
@media (prefers-reduced-motion: reduce) {
  .slab-assembly__play {
    display: none;
  }
}

/* The reveal page's slam (grading_submissions/reveals/_grade_slam, #4796) and
   the public one (hybrid_grading/slams/show, #4797): on white. The reveal's is
   as large as its overlay makes room for, up to the still's 720 px. The HGA
   home page's showcase keeps the navy stage and its 520 px. */
.grade-slam .slab-assembly__stage,
.slam-stage .slab-assembly__stage {
  background: #fff;
}

.grade-slam .slab-assembly__frame {
  max-width: none;
}

/* The still is the housing's shape (83.31 x 138.6 mm, about 720 x 1198 px),
   far taller than the stage's 520:640, so its height is bounded by the same
   room the overlay leaves, and its width follows. */
.grade-slam .slab-assembly__still {
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 7rem);
}
