/* Golden Temple spatial model — self-contained addition to the legacy game. */
.gt3d-card {
  padding: clamp(12px, 2vw, 22px) !important;
  overflow: hidden;
}

.gt3d-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 14px;
}

.gt3d-head > div:first-child {
  max-width: 710px;
}

.gt3d-kicker {
  display: block;
  margin-bottom: 4px;
  color: #ddb84e;
  font: 800 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
}

.gt3d-head h2 {
  margin: 0 0 4px;
  color: #fff4ca;
  font-size: clamp(19px, 3vw, 28px) !important;
}

.gt3d-head .cap {
  margin: 0;
  line-height: 1.5;
}

.gt3d-head-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(239, 198, 83, 0.2);
  border-radius: 14px;
  background: rgba(255, 245, 209, 0.035);
}

.gt3d-head-stats span {
  display: flex;
  min-width: 72px;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px;
  color: #978961;
  border-right: 1px solid rgba(239, 198, 83, 0.14);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gt3d-head-stats span:last-child {
  border-right: 0;
}

.gt3d-head-stats b {
  color: #ffe692;
  font: 800 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.gt3d-stage {
  position: relative;
  width: 100%;
  min-height: 690px;
  overflow: hidden;
  border: 1px solid rgba(242, 205, 102, 0.26);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 43%, rgba(228, 178, 54, 0.09), transparent 24%),
    radial-gradient(circle at 50% 90%, rgba(69, 149, 155, 0.09), transparent 48%),
    linear-gradient(180deg, #090a0c, #050506);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.68), 0 28px 70px rgba(0, 0, 0, 0.3);
  isolation: isolate;
}

.gt3d-stage::before,
.gt3d-stage::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.gt3d-stage::before {
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 226, 139, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 226, 139, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 55%, #000 0, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 55%, #000 0, transparent 70%);
}

.gt3d-stage::after {
  background: linear-gradient(180deg, rgba(7, 7, 8, 0.58), transparent 18%, transparent 80%, rgba(5, 5, 6, 0.7));
}

#gt3dCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  cursor: grab;
}

#gt3dCanvas.is-dragging {
  cursor: grabbing;
}

#gt3dCanvas:focus-visible {
  outline: 3px solid #ffe58c;
  outline-offset: -5px;
}

.gt3d-hud,
.gt3d-legend,
.gt3d-cellinfo,
.gt3d-help {
  position: absolute;
  z-index: 3;
}

.gt3d-hud--top {
  top: 12px;
  right: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.gt3d-mode,
.gt3d-actions,
.gt3d-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.gt3d-mode,
.gt3d-actions {
  pointer-events: auto;
}

.gt3d-mode button,
.gt3d-actions button,
.gt3d-legend button {
  min-height: 32px;
  padding: 0 10px;
  color: #c7b98c;
  border: 1px solid rgba(247, 211, 117, 0.17);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.76);
  box-shadow: inset 0 1px rgba(255, 245, 205, 0.05);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font: 720 9px/1 system-ui, sans-serif;
  cursor: pointer;
}

.gt3d-mode button.is-on,
.gt3d-actions button.is-on,
.gt3d-legend button.is-on {
  color: #1b1405;
  border-color: #d6a83c;
  background: linear-gradient(135deg, #ffe99b, #c8902b);
}

.gt3d-legend {
  top: 58px;
  left: 12px;
  max-width: calc(100% - 24px);
}

.gt3d-legend button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gt3d-legend button:not(.is-on) {
  opacity: 0.46;
}

.gt3d-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
}

.gt3d-cellinfo {
  bottom: 14px;
  left: 14px;
  width: min(390px, calc(100% - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(247, 211, 117, 0.22);
  border-radius: 15px;
  background: rgba(7, 7, 7, 0.82);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  pointer-events: none;
}

.gt3d-cellinfo span,
.gt3d-cellinfo b,
.gt3d-cellinfo small {
  display: block;
}

.gt3d-cellinfo span {
  color: #d8ae43;
  font: 800 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
}

.gt3d-cellinfo b {
  margin-top: 3px;
  color: #fff2bd;
  font-size: 13px;
}

.gt3d-cellinfo small {
  margin-top: 3px;
  color: #a99b73;
  font-size: 9px;
  line-height: 1.35;
}

.gt3d-help {
  right: 14px;
  bottom: 15px;
  color: rgba(223, 209, 166, 0.56);
  font: 600 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  pointer-events: none;
}

.gt3d-model-note {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.gt3d-model-note > div {
  padding: 11px 12px;
  border: 1px solid rgba(244, 205, 105, 0.14);
  border-radius: 13px;
  background: rgba(255, 248, 218, 0.025);
}

.gt3d-model-note b,
.gt3d-model-note span {
  display: block;
}

.gt3d-model-note b {
  color: #d5b655;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gt3d-model-note span {
  margin-top: 3px;
  color: #b8aa82;
  font-size: 10px;
  line-height: 1.45;
}

.gt3d-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

/* v8: the spatial model is now the primary game surface. */
body.gt3d-primary {
  overflow: hidden;
}

body.gt3d-primary .wrap {
  width: 100vw;
  max-width: none;
  padding: 0;
}

body.gt3d-primary header.hero,
body.gt3d-primary .gt3d-head,
body.gt3d-primary .gt3d-model-note,
body.gt3d-primary .v6-toolbar {
  display: none;
}

body.gt3d-primary nav.tabs {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  left: 12px;
  z-index: 120;
  width: auto;
  max-width: none;
  margin: 0;
  border-color: rgba(244, 205, 105, 0.28);
  background: rgba(9, 8, 6, 0.78);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.44);
}

body.gt3d-primary #tab-model3d,
body.gt3d-primary #tab-model3d .gt3d-card {
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.gt3d-primary .gt3d-stage {
  height: 100dvh;
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
}

body.gt3d-primary .gt3d-hud--top {
  top: 66px;
  right: 372px;
}

body.gt3d-primary .gt3d-legend {
  top: 108px;
  max-width: calc(100% - 390px);
}

body.gt3d-primary .gt3d-cellinfo {
  bottom: 16px;
  width: min(430px, calc(100% - 390px));
}

body.gt3d-primary .gt3d-help {
  right: 374px;
}

.gt3d-gamepanel-toggle {
  position: absolute;
  top: 66px;
  right: 12px;
  z-index: 7;
  display: none;
  min-height: 34px;
  padding: 0 12px;
  color: #191205;
  border: 1px solid #e0b64c;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffeb9b, #c88f27);
  font: 800 9px/1 system-ui, sans-serif;
}

.gt3d-gamepanel {
  position: absolute;
  top: 66px;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  width: 344px;
  padding: 13px;
  overflow: auto;
  flex-direction: column;
  gap: 9px;
  color: #fff5ce;
  border: 1px solid rgba(247, 211, 117, 0.27);
  border-radius: 20px;
  background:
    radial-gradient(circle at 60% 0, rgba(231, 182, 55, 0.11), transparent 35%),
    rgba(8, 7, 6, 0.9);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), inset 0 1px rgba(255, 246, 207, 0.07);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
}

.gt3d-gamepanel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.gt3d-gamepanel > header span {
  color: #caa94f;
  font: 750 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.11em;
}

.gt3d-gamepanel > header h3 {
  margin: 2px 0 0;
  color: #fff1bd;
  font-size: 17px;
}

.gt3d-gamepanel > header button {
  display: none;
  width: 28px;
  height: 28px;
  color: #decf9b;
  border: 1px solid rgba(247, 211, 117, 0.18);
  border-radius: 50%;
  background: rgba(255, 248, 218, 0.05);
  font-size: 18px;
}

.gt3d-intention,
.gt3d-selectrow label,
.gt3d-quickrow label {
  display: grid;
  gap: 4px;
}

.gt3d-intention span,
.gt3d-selectrow label span,
.gt3d-quickrow label span {
  color: #9f926c;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.gt3d-intention input,
.gt3d-selectrow select,
.gt3d-quickrow input {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  color: #fff4ce;
  border: 1px solid rgba(247, 211, 117, 0.17);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 248, 218, 0.05);
  font: 650 10px/1.2 system-ui, sans-serif;
}

.gt3d-intention input:focus,
.gt3d-selectrow select:focus,
.gt3d-quickrow input:focus {
  border-color: #e0b64c;
  box-shadow: 0 0 0 3px rgba(224, 182, 76, 0.12);
}

.gt3d-selectrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.gt3d-stategrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.gt3d-stategrid > div {
  padding: 7px 8px;
  border: 1px solid rgba(247, 211, 117, 0.12);
  border-radius: 10px;
  background: rgba(255, 248, 218, 0.025);
}

.gt3d-stategrid span,
.gt3d-stategrid b {
  display: block;
}

.gt3d-stategrid span {
  color: #8f835f;
  font-size: 7px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gt3d-stategrid b {
  margin-top: 2px;
  color: #ffe99c;
  font: 800 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.gt3d-dice {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.gt3d-dice > div {
  display: grid;
  min-height: 55px;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(247, 211, 117, 0.18);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 244, 202, 0.075), rgba(255, 244, 202, 0.02));
}

.gt3d-dice b {
  color: #fff0b5;
  font: 850 19px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.gt3d-dice span {
  margin-top: 4px;
  color: #8f835f;
  font-size: 7px;
  text-transform: uppercase;
}

.gt3d-dice.is-rolling > div {
  animation: gt3d-die-pulse 0.55s ease;
}

@keyframes gt3d-die-pulse {
  0%, 100% { transform: none; }
  40% { transform: translateY(-4px) rotate(2deg); border-color: #e1b54a; }
}

.gt3d-turn {
  min-height: 42px;
  color: #1b1305;
  border: 1px solid #e3b748;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffeb9d, #c78c24);
  box-shadow: 0 10px 28px rgba(214, 165, 49, 0.18);
  font: 850 11px/1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.gt3d-turn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.75);
  opacity: 0.45;
}

.gt3d-phase {
  padding: 9px 10px;
  border: 1px solid rgba(106, 183, 255, 0.2);
  border-radius: 11px;
  background: rgba(56, 133, 209, 0.07);
}

.gt3d-phase span {
  color: #74b8ff;
  font: 800 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

.gt3d-phase p {
  margin: 4px 0 0;
  color: #b5c9db;
  font-size: 9px;
  line-height: 1.38;
}

.gt3d-responses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.gt3d-responses button {
  min-height: 55px;
  padding: 6px;
  color: #a89b73;
  border: 1px solid rgba(247, 211, 117, 0.13);
  border-radius: 10px;
  background: rgba(255, 248, 218, 0.025);
  cursor: not-allowed;
  opacity: 0.45;
}

.gt3d-responses.is-awaiting button {
  cursor: pointer;
  opacity: 1;
}

.gt3d-responses button b,
.gt3d-responses button span {
  display: block;
}

.gt3d-responses button b {
  color: #ead797;
  font-size: 8.5px;
}

.gt3d-responses button span {
  margin-top: 3px;
  font-size: 7px;
  line-height: 1.25;
}

.gt3d-responses.is-awaiting button:hover {
  border-color: #d4aa42;
  background: rgba(232, 187, 66, 0.09);
  transform: translateY(-1px);
}

.gt3d-quickrow {
  display: grid;
  grid-template-columns: 60px 1fr 1.35fr;
  align-items: end;
  gap: 5px;
}

.gt3d-quickrow button {
  min-height: 34px;
  color: #d9c998;
  border: 1px solid rgba(247, 211, 117, 0.16);
  border-radius: 10px;
  background: rgba(255, 248, 218, 0.045);
  font: 750 8px/1 system-ui, sans-serif;
}

.gt3d-turnlog {
  max-height: 68px;
  padding: 8px 9px;
  overflow: auto;
  color: #aa9d77;
  border-left: 2px solid #d2a742;
  background: rgba(255, 248, 218, 0.025);
  font-size: 8.5px;
  line-height: 1.4;
}

@media (max-width: 980px) {
  body.gt3d-primary .gt3d-hud--top {
    right: 12px;
  }

  body.gt3d-primary .gt3d-legend {
    max-width: calc(100% - 24px);
  }

  body.gt3d-primary .gt3d-cellinfo {
    width: min(430px, calc(100% - 28px));
    bottom: 58px;
  }

  body.gt3d-primary .gt3d-help {
    display: none;
  }

  .gt3d-gamepanel-toggle {
    display: block;
  }

  .gt3d-gamepanel {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    max-height: min(62vh, 590px);
    transform: translateY(calc(100% + 18px));
    transition: transform 0.28s ease;
  }

  .gt3d-gamepanel.is-open {
    transform: none;
  }

  .gt3d-gamepanel > header button {
    display: block;
  }
}

@media (max-width: 620px) {
  body.gt3d-primary nav.tabs {
    right: 8px;
    left: 8px;
  }

  body.gt3d-primary .gt3d-hud--top {
    top: 60px;
  }

  body.gt3d-primary .gt3d-legend {
    top: 131px;
  }

  .gt3d-gamepanel-toggle {
    top: 61px;
    right: 8px;
  }

  .gt3d-stategrid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gt3d-selectrow,
  .gt3d-responses {
    grid-template-columns: 1fr;
  }

  .gt3d-responses button {
    min-height: 39px;
  }

  .gt3d-quickrow {
    grid-template-columns: 54px 1fr 1fr;
  }
}

/* v9 · Light laboratory theme for the consciousness polyhedron. */
body.gt3d-primary {
  color-scheme: light;
  background: #f2f2f7;
}

body.gt3d-primary nav.tabs {
  border: 1px solid rgba(62, 71, 83, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 40px rgba(39, 48, 61, 0.12);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

body.gt3d-primary nav.tabs button {
  color: #667080;
}

body.gt3d-primary nav.tabs button.on {
  color: #fff;
  background: linear-gradient(135deg, #7463d8, #458fda);
}

.gt3d-stage {
  border-color: rgba(75, 88, 104, 0.12);
  background:
    radial-gradient(circle at 47% 38%, rgba(255, 219, 117, 0.22), transparent 21%),
    radial-gradient(circle at 47% 62%, rgba(112, 181, 232, 0.12), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fb 58%, #eef1f5 100%);
  box-shadow: inset 0 0 100px rgba(80, 96, 120, 0.07), 0 28px 70px rgba(55, 67, 84, 0.13);
}

.gt3d-stage::before {
  opacity: 0.72;
  background-image:
    linear-gradient(rgba(70, 84, 103, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 84, 103, 0.055) 1px, transparent 1px);
}

.gt3d-stage::after {
  background: linear-gradient(180deg, rgba(255,255,255,.48), transparent 16%, transparent 82%, rgba(223,229,237,.42));
}

.gt3d-mode button,
.gt3d-actions button,
.gt3d-legend button {
  color: #586474;
  border-color: rgba(73, 87, 105, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 5px 17px rgba(52, 65, 82, 0.08), inset 0 1px #fff;
}

.gt3d-mode button.is-on,
.gt3d-actions button.is-on,
.gt3d-legend button.is-on {
  color: #27313d;
  border-color: rgba(177, 128, 23, 0.35);
  background: linear-gradient(135deg, #fff7cf, #f3d783);
}

.gt3d-cellinfo {
  color: #26313d;
  border-color: rgba(69, 83, 101, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 46px rgba(47, 60, 78, 0.14);
}

.gt3d-cellinfo span { color: #9b6800; }
.gt3d-cellinfo b { color: #27313d; }
.gt3d-cellinfo small { color: #6d7886; }
.gt3d-help { color: rgba(55, 67, 82, 0.62); }

.gt3d-gamepanel {
  color: #26313d;
  border-color: rgba(65, 79, 98, 0.14);
  background:
    radial-gradient(circle at 65% 0, rgba(255, 214, 92, 0.16), transparent 34%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 75px rgba(42, 54, 72, 0.18), inset 0 1px #fff;
}

.gt3d-gamepanel > header span { color: #8d650b; }
.gt3d-gamepanel > header h3 { color: #25303c; }
.gt3d-gamepanel > header button { color: #5f6b79; border-color: rgba(61,75,93,.15); background: #f7f8fa; }
.gt3d-intention span,
.gt3d-selectrow label span,
.gt3d-quickrow label span { color: #778291; }

.gt3d-intention input,
.gt3d-selectrow select,
.gt3d-quickrow input {
  color: #26313d;
  border-color: rgba(66, 81, 100, 0.16);
  background: rgba(246, 248, 251, 0.94);
}

.gt3d-stategrid > div,
.gt3d-dice > div,
.gt3d-responses button {
  border-color: rgba(71, 85, 103, 0.12);
  background: rgba(244, 247, 250, 0.88);
}

.gt3d-stategrid span,
.gt3d-dice span { color: #788391; }
.gt3d-stategrid b,
.gt3d-dice b { color: #344150; }
.gt3d-levelstate { grid-column: 1 / -1; }
.gt3d-levelstate b { color: #805b08; }
.gt3d-phase { border-color: rgba(56, 132, 204, 0.18); background: rgba(84, 158, 222, 0.08); }
.gt3d-phase span { color: #317dbd; }
.gt3d-phase p { color: #526579; }
.gt3d-responses button { color: #6c7785; }
.gt3d-responses button b { color: #354354; }
.gt3d-quickrow button { color: #536171; border-color: rgba(67,81,99,.15); background: #f5f7fa; }
.gt3d-turnlog { color: #65717f; background: rgba(247,249,251,.88); }

.gt3d-levelrail {
  position: absolute;
  top: 170px;
  bottom: 108px;
  left: 12px;
  z-index: 5;
  display: flex;
  width: 182px;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
}

.gt3d-levelrail button {
  display: grid;
  min-height: 0;
  padding: 5px 7px;
  flex: 1 1 0;
  grid-template-columns: 27px 1fr;
  align-items: center;
  gap: 7px;
  text-align: left;
  color: #344050;
  border: 1px solid rgba(64, 78, 96, 0.12);
  border-left: 4px solid var(--level);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 5px 16px rgba(48, 61, 79, 0.06);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.gt3d-levelrail button:hover,
.gt3d-levelrail button.is-active {
  transform: translateX(4px);
  background: color-mix(in srgb, var(--level) 25%, white);
  box-shadow: 0 8px 24px rgba(48, 61, 79, 0.14);
}

.gt3d-levelrail button.is-active { outline: 2px solid color-mix(in srgb, var(--level) 70%, #876000); }
.gt3d-levelrail b { color: #687483; font: 800 9px/1 ui-monospace, monospace; }
.gt3d-levelrail span { display: block; font-size: 9px; font-weight: 800; }
.gt3d-levelrail small { display: block; margin-top: 1px; color: #737f8d; font-size: 7px; font-weight: 550; line-height: 1.15; }

@media (max-width: 1180px) {
  .gt3d-levelrail { display: none; }
}

@media (max-width: 820px) {
  .gt3d-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .gt3d-head-stats {
    width: 100%;
  }

  .gt3d-head-stats span {
    min-width: 0;
    flex: 1 1 0;
  }

  .gt3d-stage {
    min-height: 650px;
  }

  .gt3d-hud--top {
    align-items: flex-start;
    flex-direction: column;
  }

  .gt3d-legend {
    top: 94px;
  }

  .gt3d-model-note {
    grid-template-columns: 1fr;
  }

  .gt3d-help {
    display: none;
  }
}

@media (max-width: 520px) {
  .gt3d-card {
    padding: 9px !important;
  }

  .gt3d-stage {
    min-height: 590px;
    border-radius: 16px;
  }

  .gt3d-mode button,
  .gt3d-actions button,
  .gt3d-legend button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 8px;
  }

  .gt3d-actions button[data-gt3d-action="fullscreen"] {
    display: none;
  }

  .gt3d-legend {
    top: 121px;
  }

  .gt3d-cellinfo {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #gt3dCanvas {
    scroll-behavior: auto;
  }
}
