:root { color-scheme: dark; }
html, body {
  margin: 0; padding: 0; background: #000; color: #cfc8e8;
  width: 100%; height: 100%; overflow: hidden; position: fixed; inset: 0;
  overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
}
/* iOS 26 standalone：innerHeight 少了頂部安全區，html 和 body 都用 100vh */
@media (display-mode: standalone), (display-mode: fullscreen) {
  html, body { height: 100vh; }
}
#view { position: fixed; left: 0; top: 0; width: 100vw; height: 100%; display: block; touch-action: none; cursor: default; }
body.nocursor #view { cursor: none; }

#start {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35); transition: opacity 1.2s ease;
}
#start span {
  font-size: 15px; letter-spacing: .4em; color: rgba(230,222,255,.38); padding: 1.5em 2.5em;
  animation: breathe 4.5s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
#start.gone { opacity: 0; pointer-events: none; }

#gear {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  width: 42px; height: 42px; border-radius: 50%; border: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,16,36,.45); color: rgba(220,210,255,.7); cursor: pointer;
  opacity: 0; transition: opacity .8s ease; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
#gear.show { opacity: 1; }

#panel {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.97);
  width: min(300px, calc(100vw - 48px)); box-sizing: border-box; padding: 18px 20px 14px;
  border-radius: 20px; background: rgba(14,10,28,.62); border: 1px solid rgba(190,170,255,.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  font-size: 14px; color: rgba(225,218,250,.86);
  opacity: 0; transition: opacity .5s ease, transform .5s ease; touch-action: manipulation;
}
#panel.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#panel .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 42px; }
#panel .row > span { white-space: nowrap; }
#panel input[type=range] { flex: 1; max-width: 150px; accent-color: #a68cff; touch-action: pan-x; }
.tog { width: 44px; height: 26px; border-radius: 13px; border: 0; padding: 0; position: relative; cursor: pointer;
  background: rgba(255,255,255,.14); transition: background .3s; }
.tog::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(240,235,255,.85); transition: transform .3s; }
.tog[aria-checked=true] { background: rgba(150,115,255,.75); }
.tog[aria-checked=true]::after { transform: translateX(18px); }
.seg { display: flex; border-radius: 13px; overflow: hidden; background: rgba(255,255,255,.1); }
.seg button { border: 0; background: transparent; color: inherit; font: inherit; padding: 4px 16px; cursor: pointer; }
.seg button.on { background: rgba(150,115,255,.7); }
#panel .hint { margin: 10px 0 0; font-size: 11.5px; line-height: 1.7; color: rgba(210,200,245,.45); text-align: center; }
#panel .note { margin: -4px 0 6px; font-size: 12px; color: rgba(255,190,200,.75); }
.desk { display: none; }
@media (hover: hover) and (pointer: fine) { .desk { display: inline; } }
[hidden] { display: none !important; }
