:root {
  color-scheme: dark;
  font-family: Inter, "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: #ebe9de;
  background: #0b1224;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 270px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #18243e 0%, #101b32 40%, #0b1429 70%, #080f20 100%);
}
header, footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-inline: clamp(18px, 3vw, 48px);
}
header { padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: 4px; }
footer { padding-top: 4px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
h1 {
  margin: 0;
  font: 500 clamp(19px, 2.15vw, 30px)/1.3 "Nanum Myeongjo", "Batang", "Songti SC", Georgia, serif;
  letter-spacing: -.045em;
}
a, button { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
.download, #open-model {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 6px 14px;
  color: #eee9d9;
  background: #18243a;
  border: 1px solid #435064;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.download-icon { color: #e6c78f; font-size: 17px; line-height: .82; border-bottom: 1px solid; }
#stage { position: relative; min-width: 0; min-height: 0; isolation: isolate; }
#scene, #poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#poster { object-fit: contain; user-select: none; pointer-events: none; }
#scene { touch-action: none; cursor: grab; visibility: hidden; }
#scene:active { cursor: grabbing; }
body.ready #scene { visibility: visible; }
body.ready #poster { visibility: hidden; }
.notice {
  position: absolute; bottom: 2%; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 92%; display: flex; gap: 10px; align-items: center;
  padding: 7px 13px; border-radius: 12px; background: #10192eeb;
  color: #e4e7ea; font-size: 13px; line-height: 1.5;
}
[hidden], .notice:empty { display: none !important; }
#gesture { margin: 0; color: #acb6c5; font-size: 12px; letter-spacing: .01em; }
.touch-hint { display: none; }
.controls { display: flex; align-items: center; padding: 1px 4px; border: 1px solid #3a475c; border-radius: 25px; background: #162137; }
.controls button { width: 41px; height: 37px; border: 0; background: transparent; border-radius: 20px; line-height: 1; font-size: 23px; }
.controls button:disabled { opacity: .3; cursor: default; }
.divider { height: 16px; width: 1px; margin: 0 3px; background: #414d60; }
.controls button:hover:enabled, .download:hover, #open-model:hover { background: #29374e; }
:focus-visible { outline: 2px solid #e2b975; outline-offset: 3px; }
#scene:focus-visible { outline-offset: -4px; }
@media (max-width: 560px) {
  header { padding-top: max(14px, env(safe-area-inset-top)); }
  footer { align-items: center; }
  #gesture { max-width: 59%; font-size: 11px; line-height: 1.6; }
  .pointer-hint { display: none; }
  .touch-hint { display: inline; }
  .controls button { width: 35px; height: 39px; }
  .notice { text-align: center; flex-direction: column; }
}
@media (max-height: 470px) {
  header, footer { padding-block: 3px; }
  h1 { font-size: 18px; }
  .download, .controls button { min-height: 30px; height: 30px; }
}
