/* 万年時計（ブラウザ版）の画面: 全画面の canvas と、その後ろの撮影台の地（暗い灰の光だまり）だけ。
   地の色は時計の天象儀の太陽の高さで少しだけ変わる（main.js が --bg-a・--bg-b を入れる）。 */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b0b0d;
}
body {
  --bg-a: #2b2b2f;
  --bg-b: #0a0a0c;
  background:
    radial-gradient(120% 85% at 50% 38%, var(--bg-a) 0%, var(--bg-b) 72%),
    #0a0a0c;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(.22,.61,.36,1);
}
html.ready #stage { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  #stage { transition: none; }
}

/* 仕掛けのボタン（発注者 2026-10-18 の依頼・実験室の決まりの例外）。短冊と同じ和紙の小さな札を下の真ん中に並べる。
   押している間（aria-pressed）は少し沈んで醤油色の字。読み込みが終わるまでと、和紙のフォールバックの時は出さない */
#gimmicks {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  width: max-content;
  max-width: calc(100vw - 28px);
  transition: opacity .8s cubic-bezier(.22,.61,.36,1) .3s;
}
html:not(.ready) #gimmicks { opacity: 0; pointer-events: none; }
html[data-gpu="no"] #gimmicks { display: none; }
#gimmicks button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 8px 15px 9px;
  font: 500 13.5px/1.2 'Kiwi Maru', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  letter-spacing: .06em;
  color: #2a211a;
  background:
    radial-gradient(120% 70% at 18% 0%, #fdf7e7, rgba(255,255,255,0) 64%),
    linear-gradient(172deg, #fbf5e8 0%, #f1e7d2 100%);
  border: 0;
  border-radius: 7px 11px 6px 10px / 10px 6px 12px 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.55),
    inset 0 -10px 16px -14px rgba(120,90,45,.5),
    0 2px 5px rgba(4,6,11,.55),
    0 12px 22px -14px rgba(4,6,11,.85);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform .18s cubic-bezier(.22,.61,.36,1), background .25s, color .25s;
}
#gimmicks button:hover { transform: translateY(-1px); }
#gimmicks button[aria-pressed="true"] {
  color: #8a4a14;
  background: linear-gradient(172deg, #efe2c4 0%, #e3d2ae 100%);
  box-shadow:
    inset 0 2px 5px rgba(120,90,45,.45),
    inset 0 0 0 1px rgba(255,255,255,.35),
    0 1px 3px rgba(4,6,11,.5);
  transform: translateY(1px);
}
#gimmicks button:focus-visible { outline: 3px dashed #b0631d; outline-offset: 3px; }
/* 狭い画面では 2 つずつ 2 段（3＋1 にならないように） */
@media (max-width: 460px) {
  #gimmicks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 8px;
              bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  #gimmicks button { padding: 8px 12px 9px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  #gimmicks, #gimmicks button { transition: none; }
}
