:root {
  color-scheme: dark;
  font-family: "Geist", "Segoe UI", sans-serif;
  background: #080f1b;
  color: #f5f3e6;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
h1, p { margin: 0; }

.preview {
  width: min(100%, 1560px);
  margin: 0 auto;
  min-height: 100svh;
  padding: 27px clamp(14px, 4vw, 54px) 20px;
  display: grid;
  grid-template-rows: auto minmax(370px, 1fr) auto;
  gap: 17px;
}

.heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 20px; }
.heading h1 { font-size: clamp(30px, 4.2vw, 51px); line-height: 1.05; letter-spacing: -.055em; font-weight: 680; }
.heading p, .footer p { color: #a8bdc6; font-size: 14px; line-height: 1.5; }

.stage {
  position: relative;
  min-width: 0;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #294c5a;
  border-radius: 21px;
  background:
    radial-gradient(ellipse at 48% 28%, #16534f 0%, transparent 65%),
    radial-gradient(ellipse at 62% 55%, #193957, #0b1a2e 66%, #0a1321);
}

.model { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.model:active { cursor: grabbing; }
.model canvas { display: block; width: 100%; height: 100%; }
.model:focus-visible { outline-offset: -5px; }
.star-burst { position: absolute; inset: 0; pointer-events: none; }
.star-burst-origin, .star-burst-ring, .star-burst-particle { position: absolute; }
.star-burst-ring { width: 54px; height: 54px; border: 2px solid #ffda78; border-radius: 50%; box-shadow: 0 0 16px #ffbf55; }
.star-burst-particle { line-height: 1; text-shadow: 0 0 10px currentColor; }
.status { position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: min(85%, 420px); text-align: center; }
.status[hidden] { display: none; }
.orientation {
  position: absolute;
  right: clamp(10px, 2.4vw, 26px);
  bottom: clamp(12px, 2.4vw, 26px);
  display: grid;
  justify-items: center;
  color: #f6d688;
  font: 500 12px "IBM Plex Mono", Consolas, monospace;
  letter-spacing: .12em;
  pointer-events: none;
}
.orientation canvas { display: block; width: 88px; height: 88px; border-radius: 50%; }

.footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
button {
  min-height: 40px;
  cursor: pointer;
  border: 1px solid #506166;
  padding: 7px 14px;
  border-radius: 8px;
  color: #f5e5b8;
  background: #112835;
  font-size: 13px;
}
button:hover:enabled { border-color: #dfb762; }
button[aria-pressed="true"] { border-color: #f4cd76; color: #222010; background: #f4cd76; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #f4cd76; outline-offset: 3px; }

@media (max-width: 520px) {
  .preview { padding-top: 18px; gap: 12px; }
  .stage { border-radius: 15px; }
  .orientation canvas { width: 64px; height: 64px; }
}
