/* 場景選單、聲音按鈕、時間與天氣面板、轉場布幕。深色玻璃在夜空和白天的天空上都看得清楚，所以只用一套配色 */
:root {
  --ui-glass: rgba(13, 14, 30, 0.72);
  --ui-glass-hover: rgba(24, 26, 50, 0.82);
  --ui-line: rgba(214, 220, 255, 0.14);
  --ui-line-strong: rgba(214, 220, 255, 0.28);
  --ui-ink: #eef0f8;
  --ui-mute: #a9aec6;
  --ui-dim: #7d8299;
  --ui-font: "Huninn", "Zen Maru Gothic", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --ui-font-jp: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --ui-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---- 等角方塊圖示：六角形用 conic-gradient 分出頂、右、左三面，像一塊微縮底座 ---- */
.cube {
  --c: var(--accent, #9aa6ff);
  display: inline-block; flex: none;
  width: calc(var(--s, 20px) * 0.866); height: var(--s, 20px);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: conic-gradient(from -60deg,
    color-mix(in srgb, var(--c) 45%, #fff) 0 120deg,
    color-mix(in srgb, var(--c) 55%, #000) 0 240deg,
    var(--c) 0);
}
@keyframes cube-float { 50% { translate: 0 -2px; } }
@keyframes cube-tumble {
  0%, 18% { rotate: 0deg; }
  33%, 51% { rotate: 120deg; }
  66%, 84% { rotate: 240deg; }
  100% { rotate: 360deg; }
}

/* ---- 選單本體 ---- */
.sm {
  position: fixed; z-index: 20;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  font-family: var(--ui-font); color: var(--ui-ink);
  opacity: 0; transform: translateX(-14px); pointer-events: none;
  transition: opacity .5s ease .25s, transform .7s var(--ui-ease) .25s;
}
.sm.is-ready { opacity: 1; transform: none; pointer-events: auto; }
.sm.is-instant { transition: none; }

.sm-toggle {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; box-sizing: border-box; padding: 6px 16px 6px 15px;
  border: 1px solid var(--ui-line); border-radius: 999px;
  background: var(--ui-glass); color: inherit; font: inherit; cursor: pointer;
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 32px -14px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: background .25s, border-color .25s, transform .2s var(--ui-ease);
}
.sm-toggle:hover { background: var(--ui-glass-hover); border-color: var(--ui-line-strong); }
.sm-toggle:active { transform: scale(.97); }
.sm-toggle.is-bump { animation: sm-pop .6s var(--ui-ease); }
@keyframes sm-pop { 0% { scale: .88; } 45% { scale: 1.06; } 100% { scale: 1; } }

.sm-toggle .cube { --s: 22px; animation: cube-float 3.4s ease-in-out infinite; transition: rotate .7s var(--ui-ease); }
.sm-toggle:hover .cube { rotate: 120deg; }
.sm.is-open .sm-toggle .cube { rotate: 240deg; }

.sm-now { display: grid; text-align: left; line-height: 1.25; }
.sm-no {
  font-family: var(--ui-font-jp); font-size: 10.5px; font-weight: 700;
  letter-spacing: .18em; color: var(--accent); font-variant-numeric: tabular-nums;
}
.sm-name { font-family: var(--ui-font-jp); font-size: 15px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.sm-chev {
  width: 7px; height: 7px; margin: -3px 0 0 2px;
  border: solid var(--ui-mute); border-width: 0 1.5px 1.5px 0; rotate: 45deg;
  transition: rotate .4s var(--ui-ease), margin .4s var(--ui-ease);
}
.sm.is-open .sm-chev { rotate: 225deg; margin-top: 4px; }

:is(.sm-toggle, .sm-card):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- 展開的面板 ---- */
.sm-panel {
  position: absolute; top: calc(100% + 10px); left: 0;
  width: min(340px, calc(100vw - 32px)); box-sizing: border-box;
  max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px - env(safe-area-inset-top, 0px));
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 14px;
  border: 1px solid var(--ui-line); border-radius: 20px;
  background: var(--ui-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 28px 60px -22px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97); transform-origin: 28px 0;
  transition: opacity .2s, transform .3s var(--ui-ease), visibility 0s .3s;
}
.sm.is-open .sm-panel {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .22s, transform .45s var(--ui-ease), visibility 0s;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sm-toggle, .sm-panel { background: rgba(13, 14, 30, 0.94); }
}

.sm-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 2px 4px 10px; font-size: 12px; letter-spacing: .14em; color: var(--ui-mute);
}
.sm-head span + span { color: var(--ui-dim); letter-spacing: .08em; }

.sm-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sm-list > li { opacity: 0; translate: 0 12px; transition: opacity .2s, translate .3s var(--ui-ease); }
.sm.is-open .sm-list > li {
  opacity: 1; translate: 0 0;
  transition: opacity .4s ease, translate .6s var(--ui-ease);
  transition-delay: calc(90ms + var(--i) * 80ms);
}

/* ---- 場景卡片 ---- */
.sm-card {
  display: grid; gap: 9px; padding: 8px 8px 11px;
  border: 1px solid transparent; border-radius: 14px;
  background: rgba(255, 255, 255, .035); color: inherit; text-decoration: none;
  transition: background .25s, border-color .25s, transform .35s var(--ui-ease), box-shadow .35s;
}
.sm-card:hover {
  background: rgba(255, 255, 255, .07);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 16px 32px -20px var(--accent);
  transform: translateY(-2px);
}
.sm-card[aria-current="page"] { border-color: color-mix(in srgb, var(--accent) 32%, transparent); }

.sm-thumb {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 9; max-width: 100%; border-radius: 9px; background: #0b0c18;
}
.sm-thumb img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: scale .9s var(--ui-ease), filter .4s;
}
.sm-card:not([aria-current]) .sm-thumb img { filter: saturate(.85) brightness(.9); }
.sm-card:is(:hover, :focus-visible) .sm-thumb img { scale: 1.07; filter: none; }
/* 滑過時一道光掃過縮圖 */
.sm-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%);
  translate: -110% 0;
}
.sm-card:hover .sm-thumb::after { translate: 110% 0; transition: translate .9s var(--ui-ease); }

.sm-badge {
  position: absolute; left: 8px; top: 8px;
  display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px;
  border-radius: 999px; background: rgba(8, 9, 20, .72);
  font-size: 11px; letter-spacing: .1em;
}
.sm-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); animation: sm-pulse 2s ease-out infinite;
}
@keyframes sm-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
  100% { box-shadow: 0 0 0 7px transparent; }
}

.sm-info { display: grid; gap: 2px; padding: 0 4px; }
.sm-cardno {
  font-family: var(--ui-font-jp); font-size: 10.5px; font-weight: 700;
  letter-spacing: .18em; color: var(--accent); font-variant-numeric: tabular-nums;
}
.sm-title { font-family: var(--ui-font-jp); font-size: 17px; font-weight: 700; letter-spacing: .06em; text-wrap: balance; }
.sm-desc { font-size: 13px; line-height: 1.55; color: var(--ui-mute); }
.sm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sm-tags span {
  padding: 2px 9px; border: 1px solid var(--ui-line); border-radius: 999px;
  font-size: 11px; letter-spacing: .06em; color: var(--ui-mute);
}
.sm-tags span:first-child { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.sm-keys {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin: 12px 4px 2px; font-size: 11.5px; color: var(--ui-dim);
}
.sm-keys kbd {
  display: inline-block; min-width: 1.1em; padding: 0 5px; text-align: center;
  border: 1px solid var(--ui-line-strong); border-bottom-width: 2px; border-radius: 5px;
  font: 700 10.5px/1.5 var(--ui-font-jp); color: var(--ui-mute);
}
@media (hover: none) { .sm-keys { display: none; } }

/* 矮螢幕（筆電、手機橫放）：縮圖放左邊，卡片變成橫排 */
@media (max-height: 740px) {
  .sm-card { grid-template-columns: 104px 1fr; align-items: center; gap: 12px; padding: 8px; }
  .sm-title { font-size: 15px; letter-spacing: .04em; }
  .sm-desc { font-size: 12px; line-height: 1.45; }
  .sm-tags { display: none; }
}
@media (max-height: 460px) { .sm-desc { display: none; } }

/* ---- 右上角的聲音按鈕：播放時四根音量條跳動，關閉時縮成點並劃一條斜線；點一下展開開關與音量面板 ---- */
.snd {
  position: fixed; z-index: 20;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  font-family: var(--ui-font); color: var(--ui-ink);
  opacity: 0; translate: 14px 0; pointer-events: none;
  transition: opacity .5s ease .35s, translate .7s var(--ui-ease) .35s;
}
.snd[hidden] { display: none; }
.snd.is-ready { opacity: 1; translate: 0 0; pointer-events: auto; }
.snd.is-instant { transition: none; }

.snd-btn {
  position: relative; display: grid; place-items: center;
  width: 48px; height: 48px; padding: 0; box-sizing: border-box;
  border: 1px solid var(--ui-line); border-radius: 50%;
  background: var(--ui-glass); color: var(--ui-mute); cursor: pointer;
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 32px -14px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: background .25s, border-color .25s, scale .2s var(--ui-ease);
}
.snd-btn:hover, .snd.is-open .snd-btn { background: var(--ui-glass-hover); border-color: var(--ui-line-strong); }
.snd-btn:active { scale: .94; }
:is(.snd-btn, .snd-switch):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.snd-bars { display: flex; align-items: center; gap: 3px; height: 18px; }
.snd-bars i {
  width: 3px; height: 100%; border-radius: 2px; background: currentColor;
  scale: 1 .5; transition: scale .45s var(--ui-ease), background .3s;
}
.snd-bars i:nth-child(2), .snd-bars i:nth-child(3) { scale: 1 .8; }
.snd[data-state="on"] .snd-btn { color: var(--accent); }
.snd[data-state="on"] .snd-bars i { animation: snd-eq 1.2s ease-in-out infinite; }
.snd[data-state="on"] .snd-bars i:nth-child(2) { animation-duration: .9s; animation-delay: -.4s; }
.snd[data-state="on"] .snd-bars i:nth-child(3) { animation-duration: 1.4s; animation-delay: -.9s; }
.snd[data-state="on"] .snd-bars i:nth-child(4) { animation-duration: 1s; animation-delay: -.2s; }
@keyframes snd-eq { 0%, 100% { scale: 1 .3; } 50% { scale: 1 1; } }
.snd[data-state="off"] .snd-bars i { scale: 1 .17; }
.snd-btn::after {
  content: ""; position: absolute; width: 24px; height: 1.5px; border-radius: 1px;
  background: currentColor; rotate: -45deg; scale: 0 1; transition: scale .35s var(--ui-ease);
}
.snd[data-state="off"] .snd-btn::after { scale: 1 1; }
/* 開著但還沒出聲（瀏覽器要等使用者互動）：外圈輕輕脈動，下方提示 */
.snd[data-state="wait"]:not(.is-open) .snd-btn { animation: snd-ping 2.4s ease-out infinite 1s; }
@keyframes snd-ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent), 0 12px 32px -14px rgba(0, 0, 0, .75); }
  70%, 100% { box-shadow: 0 0 0 10px transparent, 0 12px 32px -14px rgba(0, 0, 0, .75); }
}
.snd-tip {
  position: absolute; top: calc(100% + 10px); right: 0;
  padding: 5px 12px; border: 1px solid var(--ui-line); border-radius: 999px;
  background: var(--ui-glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-size: 12px; letter-spacing: .06em; color: var(--ui-mute); white-space: nowrap;
  font-variant-numeric: tabular-nums;
  opacity: 0; translate: 0 -4px; pointer-events: none;
  transition: opacity .3s, translate .4s var(--ui-ease);
}
.snd[data-state="wait"]:not(.is-open) .snd-tip { opacity: 1; translate: 0 0; transition-delay: 1.4s; }
.snd.is-flash:not(.is-open) .snd-tip { opacity: 1; translate: 0 0; transition-delay: 0s; color: var(--ui-ink); }

/* 展開的面板：開關一列、音量一列 */
.snd-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  display: grid; gap: 12px;
  width: 232px; box-sizing: border-box; padding: 14px 16px 12px;
  border: 1px solid var(--ui-line); border-radius: 18px;
  background: var(--ui-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 28px 60px -22px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97); transform-origin: calc(100% - 24px) 0;
  transition: opacity .2s, transform .3s var(--ui-ease), visibility 0s .3s;
}
.snd.is-open .snd-panel {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .22s, transform .45s var(--ui-ease), visibility 0s;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .snd-btn, .snd-tip, .snd-panel { background: rgba(13, 14, 30, 0.94); }
}
.snd-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.snd-label { font-size: 13px; letter-spacing: .12em; color: var(--ui-mute); }

.snd-switch {
  position: relative; flex: none; width: 40px; height: 22px; padding: 0;
  border: 1px solid var(--ui-line-strong); border-radius: 999px;
  background: rgba(255, 255, 255, .06); cursor: pointer;
  transition: background .25s, border-color .25s;
}
.snd-switch span {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ui-mute); transition: translate .35s var(--ui-ease), background .25s;
}
.snd-switch[aria-checked="true"] {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}
.snd-switch[aria-checked="true"] span { translate: 18px 0; background: var(--accent); }

/* 音量滑桿：已填的部分用強調色 */
.snd-range {
  --v: 80%;
  flex: 1; min-width: 0; height: 22px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.snd-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--v), rgba(214, 220, 255, .16) var(--v));
}
.snd-range::-moz-range-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--v), rgba(214, 220, 255, .16) var(--v));
}
.snd-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent);
  transition: box-shadow .2s;
}
.snd-range::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent);
}
.snd-range:is(:hover, :focus-visible)::-webkit-slider-thumb { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 32%, transparent); }
.snd-range:is(:hover, :focus-visible)::-moz-range-thumb { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 32%, transparent); }
.snd-range:focus-visible { outline: none; }
.snd-pct {
  flex: none; width: 3.1em; text-align: right;
  font-family: var(--ui-font-jp); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.snd[data-state="off"] :is(.snd-range, .snd-pct) { opacity: .45; }

.snd-keys {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0;
  font-size: 11.5px; color: var(--ui-dim);
}
.snd-keys kbd {
  display: inline-block; min-width: 1.1em; padding: 0 5px; text-align: center;
  border: 1px solid var(--ui-line-strong); border-bottom-width: 2px; border-radius: 5px;
  font: 700 10.5px/1.5 var(--ui-font-jp); color: var(--ui-mute);
}
@media (hover: none) { .snd-keys { display: none; } }

/* ---- 下方的時間與天氣面板：天氣按鈕一組、時間滑桿一條；窄螢幕分成兩列 ---- */
.env {
  position: fixed; z-index: 20; left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 14px;
  width: min(560px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 6px 18px 6px 6px;
  border: 1px solid var(--ui-line); border-radius: 999px;
  background: var(--ui-glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 32px -14px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .06);
  font-family: var(--ui-font); color: var(--ui-ink);
  opacity: 0; translate: -50% 14px; pointer-events: none;
  transition: opacity .5s ease .45s, translate .7s var(--ui-ease) .45s;
}
.env[hidden] { display: none; }
.env.is-ready { opacity: 1; translate: -50% 0; pointer-events: auto; }
.env.is-instant { transition: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .env { background: rgba(13, 14, 30, 0.94); }
}

.env-weather {
  display: flex; flex: none; gap: 2px; padding: 3px;
  border-radius: 999px; background: rgba(255, 255, 255, .05);
}
.env-w {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px 0 11px; box-sizing: border-box;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--ui-mute); font: inherit; font-size: 13.5px; letter-spacing: .1em; cursor: pointer;
  transition: background .25s, color .25s, border-color .25s, scale .2s var(--ui-ease);
}
.env-w svg { width: 18px; height: 18px; flex: none; }
.env-w:hover { color: var(--ui-ink); background: rgba(255, 255, 255, .07); }
.env-w:active { scale: .95; }
.env-w[aria-pressed="true"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
:is(.env-w, .env-range):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.env-time { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; }
.env-icon { display: grid; flex: none; width: 20px; height: 20px; color: var(--accent); }
.env-icon > span { grid-area: 1 / 1; transition: opacity .35s, rotate .5s var(--ui-ease); }
.env-icon svg { display: block; width: 20px; height: 20px; }
.env-moon, .env.is-night .env-sun { opacity: 0; rotate: -40deg; }
.env.is-night .env-moon { opacity: 1; rotate: 0deg; }

/* 時間滑桿：軌道畫成一天的天色，深夜 → 日出 → 白天 → 日落 → 深夜 */
.env-range {
  flex: 1; min-width: 0; height: 26px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.env-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, #161c3e 0%, #1f2552 19%, #b8688a 23.5%, #f2b27a 27%, #8cc0ec 33%, #9ccbf0 50%, #8cc0ec 67%, #f2a46e 73%, #a45a88 76.5%, #262650 81%, #161c3e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.env-range::-moz-range-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, #161c3e 0%, #1f2552 19%, #b8688a 23.5%, #f2b27a 27%, #8cc0ec 33%, #9ccbf0 50%, #8cc0ec 67%, #f2a46e 73%, #a45a88 76.5%, #262650 81%, #161c3e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.env-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent), 0 2px 6px rgba(0, 0, 0, .5);
  transition: box-shadow .2s;
}
.env-range::-moz-range-thumb {
  width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent), 0 2px 6px rgba(0, 0, 0, .5);
}
.env-range:is(:hover, :focus-visible)::-webkit-slider-thumb { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 38%, transparent), 0 2px 6px rgba(0, 0, 0, .5); }
.env-range:is(:hover, :focus-visible)::-moz-range-thumb { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 38%, transparent), 0 2px 6px rgba(0, 0, 0, .5); }
.env-range:focus-visible { outline: none; }

.env-clock { display: grid; flex: none; justify-items: end; line-height: 1.15; min-width: 3.4em; }
.env-hm { font-family: var(--ui-font-jp); font-size: 16px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.env-period { font-size: 11px; letter-spacing: .14em; color: var(--ui-mute); }

@media (max-width: 520px) {
  .env { flex-wrap: wrap; gap: 6px 12px; padding: 6px 6px 4px; border-radius: 22px; }
  .env-weather { flex: 1; }
  .env-w { flex: 1; }
  .env-time { flex-basis: 100%; padding: 0 12px 0 10px; }
}

/* ---- 轉場布幕 ---- */
.veil {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 24px; text-align: center;
  background: radial-gradient(120% 90% at 50% 44%, var(--veil-b), var(--veil-a) 72%);
  color: var(--ui-ink); font-family: var(--ui-font);
}
.veil p { margin: 0; }
.veil-mark {
  display: block; margin-bottom: 12px;
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 55%, transparent));
}
.veil .cube { --s: 46px; display: block; animation: cube-tumble 2.6s var(--ui-ease) infinite; }
.veil-no {
  font-family: var(--ui-font-jp); font-size: 12px; font-weight: 700;
  letter-spacing: .32em; color: var(--accent);
}
.veil-title {
  font-family: var(--ui-font-jp); font-weight: 900; line-height: 1.25;
  font-size: clamp(30px, 6.4vw, 60px); letter-spacing: .1em; text-wrap: balance;
}
.veil-title span { display: inline-block; }
.veil-sub { font-size: 15px; letter-spacing: .08em; color: var(--ui-mute); }

.veil.is-cover .veil-title span { animation: veil-char .75s var(--ui-ease) both; animation-delay: calc(260ms + var(--i) * 45ms); }
.veil.is-cover :is(.veil-mark, .veil-no, .veil-sub) { animation: veil-rise .7s var(--ui-ease) both .45s; }
.veil.is-leaving > * { opacity: 0; translate: 0 -12px; transition: opacity .3s, translate .45s var(--ui-ease); }
@keyframes veil-char { from { opacity: 0; translate: 0 .45em; filter: blur(6px); } }
@keyframes veil-rise { from { opacity: 0; translate: 0 10px; } }

@media (prefers-reduced-motion: reduce) {
  .sm, .sm *, .veil, .veil *, .snd, .snd *, .env, .env * { animation: none !important; }
  .snd, .snd-panel { translate: none !important; transform: none !important; }
  .env { translate: -50% 0 !important; }
  .sm, .sm-panel, .sm-list > li, .sm-card, .sm-thumb img, .veil > * {
    transform: none !important; translate: none !important; scale: none !important;
  }
  .sm-toggle .cube { rotate: none !important; }
}
