* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #f8f2e9;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

#sixiViewer {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: grab;
  touch-action: none;
}

#sixiViewer:active {
  cursor: grabbing;
}

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 210, 202, 0.5), transparent 30%),
    linear-gradient(135deg, #fff9f0, #f7efe3 44%, #fff7ec);
  color: #6b7d35;
  font:
    800 clamp(30px, 6.2vw, 76px) / 1.12 "Comic Sans MS",
    "YouYuan", "幼圆", "Microsoft YaHei", system-ui, sans-serif;
  cursor: pointer;
}

.start-screen span {
  transform: translateY(-5vh);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.62);
  text-shadow:
    0 5px 0 rgba(255, 210, 161, 0.36),
    0 14px 34px rgba(216, 139, 118, 0.2);
}

.start-screen.hidden {
  pointer-events: none;
  opacity: 0;
  transition: opacity 440ms ease;
}

.start-screen.gone {
  display: none;
}

.top-tip,
.intro-panel,
.selector {
  position: fixed;
  z-index: 2;
  border: 1px solid rgba(126, 143, 74, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.68);
  color: rgba(79, 92, 48, 0.82);
  box-shadow: 0 16px 40px rgba(120, 93, 65, 0.1);
  backdrop-filter: blur(16px);
}

.top-tip {
  top: 18px;
  right: 18px;
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.2;
  pointer-events: none;
}

.intro-panel {
  left: 18px;
  bottom: 18px;
  width: min(520px, calc(100vw - 138px));
  min-height: 104px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.68;
  pointer-events: none;
}

.intro-panel p {
  margin: 0;
}

.selector {
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(5, 36px);
  gap: 8px;
  padding: 9px;
}

.selector button {
  width: 36px;
  height: 34px;
  border: 1px solid rgba(126, 143, 74, 0.24);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(78, 92, 48, 0.76);
  font: 760 13px/1 system-ui, sans-serif;
  cursor: pointer;
}

.selector button.active {
  border-color: rgba(112, 137, 49, 0.72);
  background: rgba(203, 225, 145, 0.62);
  color: #425522;
}

body:not(.started) .intro-panel,
body:not(.started) .top-tip,
body:not(.started) .selector {
  opacity: 0;
  pointer-events: none;
}

body.started .intro-panel,
body.started .top-tip,
body.started .selector {
  opacity: 1;
  transition: opacity 520ms ease 180ms;
}

@media (max-width: 760px) {
  .intro-panel {
    right: 12px;
    bottom: 68px;
    left: 12px;
    width: auto;
    min-height: 0;
    font-size: 13px;
  }

  .selector {
    right: 12px;
    bottom: 12px;
  }

  .top-tip {
    top: 12px;
    right: 12px;
    left: 12px;
    text-align: center;
  }
}
