/* 城堡版的介面：曲名只在換房間時出現；操作提示動過就消失 */
#meta { transition: opacity 1.2s; }
.ready #meta { opacity: 0; }
.ready.meta #meta { opacity: 1; }
body:has(#settings[open]) #meta { opacity: 0; transition-duration: .2s; }   /* 設定開著時曲名不透過玻璃字卡 */

#stick { position: fixed; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: opacity .2s; }
#stick.on { opacity: 1; }
#stick i { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: rgba(255,255,255,.2); border: 1px solid var(--line); transform: translate(var(--dx, 0), var(--dy, 0)); }

#keys { position: fixed; left: 50%; bottom: calc(9% + var(--safe-b)); transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .6s; }
.ready #keys { opacity: .8; }
.used #keys { opacity: 0 !important; }
#keys svg { display: block; fill: none; stroke: var(--line); stroke-width: 1.2; }
#keys .kb { width: 84px; }
#keys .kb path { fill: var(--ink); stroke: none; }
#keys .thumb { width: 60px; display: none; }
#keys .knob { fill: rgba(255,255,255,.25); animation: nudge 1.8s cubic-bezier(.5,0,.5,1) infinite alternate; }
@keyframes nudge { from { transform: translateY(6px); } to { transform: translateY(-10px); } }
@media (pointer: coarse) { #keys { left: 25%; } #keys .kb { display: none; } #keys .thumb { display: block; } }
@media (prefers-reduced-motion: reduce) { #keys .knob { animation: none; } }

/* 跳：觸控裝置才顯示按鈕；桌機用空白鍵 */
#jump { position: fixed; right: calc(22px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 68px; height: 68px; border-radius: 50%; background: var(--pane); border: 1px solid var(--line); display: none; place-items: center; touch-action: none; transition: transform .12s; }
#jump:active { transform: scale(.92); }
#jump svg { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (pointer: coarse) { .ready #jump { display: grid; } }
#keys { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#keys .sp { width: 84px; }
#keys .sp path { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (pointer: coarse) { #keys .sp { display: none; } }

/* 片頭字標：黑底，淡入、停一下、淡出，之後介面才出現 */
#intro { position: fixed; inset: 0; background: #000; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .9s; z-index: 10; }
.intro #intro { opacity: 1; transition: none; }
#intro img { width: min(46vw, 420px); opacity: 0; }
.intro #intro img { animation: logo 3.2s cubic-bezier(.4,0,.2,1) both; }
@keyframes logo { 0% { opacity: 0; transform: scale(.985); } 28% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; } }

/* 施放：觸控裝置才顯示按鈕；桌機用 E */
#cast { position: fixed; right: calc(30px + var(--safe-r)); bottom: calc(108px + var(--safe-b)); width: 52px; height: 52px; border-radius: 50%; background: var(--pane); border: 1px solid var(--line); display: none; place-items: center; touch-action: none; transition: transform .12s; }
#cast:active { transform: scale(.92); }
#cast svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.4; }
@media (pointer: coarse) { .ready #cast { display: grid; } }
#keys .row { display: flex; gap: 8px; align-items: center; }
#keys .ek { width: 26px; }
#keys .ek circle { stroke: var(--ink); stroke-width: 1.3; }
@media (pointer: coarse) { #keys .row { display: none; } }

/* 飛行提示：起飛後才出現，淡淡的；按過那個鍵就消失 */
#flyhint { position: fixed; left: 50%; bottom: calc(7% + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 18px; opacity: 0; pointer-events: none; transition: opacity .7s; }
.fly #flyhint { opacity: .62; }
#flyhint span { display: flex; align-items: center; gap: 5px; transition: opacity .5s, transform .5s; }
#flyhint span.done { opacity: 0; transform: translateY(6px); }
#flyhint b { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border: 1px solid var(--line); border-radius: 6px; font: 600 11px/1 -apple-system, "SF Pro Text", system-ui, sans-serif; color: var(--ink); }
#flyhint b.wide { min-width: 52px; }
#flyhint svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (pointer: coarse) { #flyhint b { display: none; } #flyhint [data-h=turn] { display: none; } }

#skyWash { position: fixed; inset: 0; pointer-events: none; opacity: 0; }
.in-sky #keys { display: none; }
.in-sky #flyhint { bottom: calc(12px + var(--safe-b)); }
.ready.in-sky #meta { opacity: 0; }
/* 天際：靠近「其他玩家的世界」時的下載引導。小的夜空玻璃字卡，不擋畫面中央，離開就收起 */
#skyDoor {
  --gold: #e8c98a;
  position: fixed; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); bottom: calc(52px + var(--safe-b)); z-index: 2;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100% - 24px - var(--safe-l) - var(--safe-r)); margin-inline: auto;
  padding: 6px 6px 6px 16px; border-radius: 12px;
  background: linear-gradient(180deg, rgb(40 56 104 / .36), rgb(14 22 50 / .5));
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgb(176 196 255 / .15);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .07), 0 16px 30px -14px rgb(0 0 12 / .7);
  color: rgb(238 242 252 / .95);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(6px);
  transition: opacity .35s cubic-bezier(.16,1,.3,1), transform .35s cubic-bezier(.16,1,.3,1), visibility 0s linear .35s;
}
#skyDoor.on { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
#skyDoor p { margin: 0; font-size: 13.5px; line-height: 1.4; color: rgb(226 232 248 / .86); white-space: nowrap; }
#skyDoor a {
  display: inline-grid; place-items: center; min-height: 36px; padding: 0 14px; border-radius: 8px; flex: none;
  border: 1px solid rgb(176 196 255 / .3); background: rgb(176 196 255 / .1); color: rgb(238 242 252 / .95);
  font-size: 13px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; transition: background .15s, transform .12s;
}
#skyDoor a[href] { cursor: pointer; }
#skyDoor a[href]:hover { background: rgb(176 196 255 / .18); }
#skyDoor a[href]:active { transform: scale(.98); }
#skyDoor a[aria-disabled=true] { background: transparent; border-color: rgb(176 196 255 / .1); color: rgb(200 210 236 / .52); cursor: default; }
#skyDoor a:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { #skyDoor, #skyDoor.on { transform: none; } }
@media (pointer: coarse) { #skyDoor { top: calc(68px + var(--safe-t)); bottom: auto; transform: translateY(-6px); } }
@media (max-width: 360px) { #skyDoor p { white-space: normal; word-break: keep-all; } }

#skyKeyboard { position: fixed; bottom: 0; left: 50%; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; caret-color: transparent; color: transparent; font-size: 16px; }
#skyKeyboard::selection { background: transparent; color: transparent; }

#boost {
  position: fixed; right: calc(30px + var(--safe-r)); bottom: calc(172px + var(--safe-b));
  width: 52px; height: 52px; display: none; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--pane); touch-action: none; transition: transform .12s;
}
#boost svg { width: 24px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#boost:active { transform: scale(.98); }
@media (any-pointer: coarse) { .ready #boost { display: grid; } }

#hover {
  position: fixed; right: calc(100px + var(--safe-r)); bottom: calc(34px + var(--safe-b));
  width: 52px; height: 52px; display: none; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--pane); touch-action: none; opacity: .4;
  transition: transform .12s, opacity .2s, background .2s, border-color .2s;
}
#hover svg { width: 24px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fly #hover { opacity: 1; }
#hover:active { transform: scale(.98); }
#hover[aria-pressed="true"] { background: rgba(232,201,138,.22); border-color: #e8c98a; }
#hover[aria-pressed="true"] svg { fill: var(--ink); }
#hover:focus-visible { outline: 1px solid #e8c98a; outline-offset: 2px; }
@media (pointer: coarse) { .ready #hover { display: grid; } }

/* 星圖 */
#atlasToggle { position: fixed; top: calc(12px + var(--safe-t)); right: calc(62px + var(--safe-r)); width: 44px; height: 44px; display: none; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #151515; }
.ready #atlasToggle { display: grid; }
#atlasToggle svg { width: 19px; fill: none; stroke: var(--ink); stroke-width: 1.4; }
#atlasToggle circle { fill: var(--ink); }
#atlasToggle:active { transform: scale(.98); }
#atlas {
  --gold: #e8c98a; --edge: clamp(14px, 2.4vmin, 28px); --stroke: rgb(255 255 255 / .22);
  position: fixed; inset: 0; margin: 0; padding: 0; width: 100%; height: 100%;
  max-width: none; max-height: none; border: 0; overflow: hidden; overscroll-behavior: none;
  color: white; color-scheme: dark; background: rgb(7 7 7 / .89);
}
#atlas::backdrop { background: transparent; }
#atlas canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#atlas canvas:active { cursor: grabbing; }
#atlas button, #atlas .atlas-search {
  border: 1px solid var(--stroke); background: #171717; border-radius: 10px;
}
#atlas button { display: grid; place-items: center; min-width: 44px; min-height: 44px; transition: transform .12s; }
#atlas button:active { transform: scale(.98); }
#atlas button:disabled { color: rgb(255 255 255 / .38); cursor: default; }
#atlas svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#atlas .atlas-search, #atlas [data-close] { position: absolute; top: calc(var(--edge) + var(--safe-t)); }
#atlas .atlas-search {
  left: calc(var(--edge) + var(--safe-l)); display: flex; align-items: center; padding-inline: 13px;
  width: min(272px, calc(100% - 88px - var(--safe-l) - var(--safe-r))); height: 44px; gap: 10px;
}
#atlas .atlas-search svg { width: 16px; color: rgb(255 255 255 / .66); }
#atlas input {
  appearance: none; -webkit-appearance: none; min-width: 0; flex: 1; height: 100%; padding: 0;
  border: 0; outline: 0; background: transparent; color: white; font: inherit;
  user-select: text; -webkit-user-select: text; caret-color: var(--gold);
}
#atlas input::placeholder, #atlas small { color: rgb(255 255 255 / .62); }
#atlas input::-webkit-search-cancel-button { display: none; }
#atlas ::selection { background: #e8c98a; color: #111; }
#atlas button:focus-visible, #atlas .atlas-search:focus-within, #atlasToggle:focus-visible, #boost:focus-visible { outline: 1px solid #e8c98a; outline-offset: 2px; }
#atlas canvas:focus { outline: none; }
#atlas canvas:focus-visible { outline: 1px solid rgb(232 201 138 / .55); outline-offset: -2px; }
#atlas [data-close], #atlas [data-center] { right: calc(var(--edge) + var(--safe-r)); }
#atlas [data-center] { position: absolute; bottom: calc(var(--edge) + var(--safe-b)); }
#atlas section {
  position: absolute; left: 50%; bottom: calc(var(--edge) + var(--safe-b)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 13px; max-width: calc(100% - 144px);
  padding: 5px 5px 5px 16px; background: #101010; border: 1px solid var(--stroke); border-radius: 12px;
}
#atlas section svg { width: 24px; height: 24px; }
#atlas section div { min-width: 0; }
#atlas b, #atlas small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#atlas b { font-size: 13px; font-weight: 500; }
#atlas small { margin-top: 2px; font-size: 11px; }
#atlas [data-go] { padding-inline: 14px; white-space: nowrap; }
#atlas [hidden] { display: none; }
@media (max-width: 600px) {
  #atlas input { font-size: 16px; }
  #atlas section { left: calc(var(--edge) + var(--safe-l)); right: calc(var(--edge) + var(--safe-r)); max-width: none; transform: none; }
  #atlas [data-go] { margin-left: auto; }
  #atlas section:not([hidden]) ~ [data-center] { bottom: calc(var(--edge) + var(--safe-b) + 66px); }
}

/* 齒輪＝設定：和星圖鈕同一套尺寸與線寬。按下就暫停並打開設定 */
#gear, #settings .set-gear {
  position: fixed; top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r));
  width: 44px; height: 44px; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: #151515; color: var(--ink);
}
#gear { display: none; }
.ready #gear { display: grid; }
#gear svg, #settings .set-gear svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
#gear:active, #settings .set-gear:active { transform: scale(.98); }
#gear:focus-visible { outline: 1px solid #e8c98a; outline-offset: 2px; }

/* 設定：夜空色的半透明玻璃字卡，蓋在暫停的畫面上，場景仍看得到 */
#settings {
  --gold: #e8c98a;
  --s-ink: rgb(238 242 252 / .95);
  --s-ink-2: rgb(200 210 236 / .72);
  --s-line: rgb(176 196 255 / .15);
  --s-line-2: rgb(176 196 255 / .3);
  --s-well: rgb(6 10 26 / .42);
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden;
  color: var(--s-ink); color-scheme: dark; interpolate-size: allow-keywords;
}
#settings::backdrop { background: rgb(2 5 16 / .32); }
#settings .set-gear { display: grid; background: rgb(28 40 76 / .78); border-color: var(--s-line-2); }
#settings[open] .set-gear svg { animation: set-turn .6s cubic-bezier(.16,1,.3,1); }
@keyframes set-turn { from { transform: rotate(-75deg); } }

#settings .set-stack {
  position: absolute; top: calc(64px + var(--safe-t)); right: calc(12px + var(--safe-r));
  width: min(360px, calc(100% - 24px - var(--safe-l) - var(--safe-r)));
  max-height: calc(100% - 76px - var(--safe-t) - var(--safe-b));
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  scrollbar-width: thin; scrollbar-color: rgb(176 196 255 / .25) transparent;
}
#settings[open] .set-stack > * { animation: set-in .34s cubic-bezier(.16,1,.3,1) both; }
#settings[open] .set-stack > :nth-child(2) { animation-delay: .03s; }
#settings[open] .set-stack > :nth-child(3) { animation-delay: .06s; }
#settings[open] .set-stack > :nth-child(4) { animation-delay: .09s; }
@keyframes set-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  #settings[open] .set-stack > *, #settings[open] .set-gear svg { animation: none; }
}

#settings .set-card, #settings .set-actions .set-btn {
  background: linear-gradient(180deg, rgb(40 56 104 / .36), rgb(14 22 50 / .5));
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--s-line);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .07), 0 16px 30px -14px rgb(0 0 12 / .7);
}
#settings .set-card { flex: none; border-radius: 14px; }
#settings .set-sound { padding: 12px 16px 6px; }
#settings h2, #settings summary span { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: .02em; }
#settings h2 { margin-bottom: 2px; }

#settings .set-row {
  display: grid; grid-template-columns: 4.4em 1fr 2.2em; align-items: center; gap: 14px; min-height: 46px;
  font-size: 14px; font-weight: 400; color: var(--s-ink-2);
}
#settings .set-row + .set-row { border-top: 1px solid rgb(176 196 255 / .07); }
#settings output { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; color: var(--s-ink-2); }

#settings input[type=range] {
  --p: 100%; appearance: none; -webkit-appearance: none; width: 100%; height: 40px; margin: 0;
  background: transparent; cursor: pointer; touch-action: pan-x;
}
#settings input[type=range]::-webkit-slider-runnable-track {
  height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--gold) var(--p), rgb(176 196 255 / .22) var(--p));
}
#settings input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px; border: 0; border-radius: 50%;
  background: #eef1fb; box-shadow: 0 1px 3px rgb(0 0 10 / .55);
}
#settings input[type=range]::-moz-range-track { height: 2px; border-radius: 1px; background: rgb(176 196 255 / .22); }
#settings input[type=range]::-moz-range-progress { height: 2px; border-radius: 1px; background: var(--gold); }
#settings input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #eef1fb; box-shadow: 0 1px 3px rgb(0 0 10 / .55); }
#settings input[type=range]:focus-visible { outline: none; }
#settings input[type=range]:focus-visible::-webkit-slider-thumb { outline: 1px solid var(--gold); outline-offset: 3px; }
#settings input[type=range]:focus-visible::-moz-range-thumb { outline: 1px solid var(--gold); outline-offset: 3px; }

#settings .set-switch {
  position: relative; grid-column: 2 / 4; justify-self: end; width: 44px; height: 26px; padding: 0;
  border: 1px solid var(--s-line-2); border-radius: 13px; background: var(--s-well); transition: background .2s, border-color .2s;
}
#settings .set-switch::before { content: ""; position: absolute; inset: -10px -6px; }
#settings .set-switch i {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #c3cbe2; box-shadow: 0 1px 2px rgb(0 0 10 / .5); transition: transform .22s cubic-bezier(.16,1,.3,1), background .2s;
}
#settings .set-switch[aria-checked=true] { background: rgb(232 201 138 / .85); border-color: transparent; }
#settings .set-switch[aria-checked=true] i { transform: translateX(18px); background: #fffaf0; }

#settings summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 12px 0 16px;
  list-style: none; cursor: pointer; border-radius: 13px;
}
#settings summary::-webkit-details-marker { display: none; }
#settings summary svg { width: 20px; height: 20px; fill: none; stroke: var(--s-ink-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .28s cubic-bezier(.16,1,.3,1); }
#settings details[open] summary svg { transform: rotate(180deg); }
#settings details::details-content { block-size: 0; overflow: clip; transition: block-size .3s cubic-bezier(.16,1,.3,1), content-visibility .3s allow-discrete; }
#settings details[open]::details-content { block-size: auto; }
@media (prefers-reduced-motion: reduce) { #settings details::details-content { transition: none; } }
#settings .set-body { padding: 0 16px 14px; }

#settings .set-seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; margin-bottom: 6px; padding: 2px;
  border: 1px solid var(--s-line); border-radius: 10px; background: var(--s-well);
}
#settings .set-seg button { min-height: 38px; border-radius: 8px; font-size: 13px; font-weight: 500; line-height: 1; color: var(--s-ink-2); transition: background .2s, color .2s; }
#settings .set-seg button[aria-pressed=true] { background: rgb(176 196 255 / .17); color: var(--s-ink); }

#settings .set-keys { margin: 0; }
#settings .set-keys[hidden] { display: none; }
#settings .set-keys > div {
  display: grid; grid-template-columns: 5.4em 1fr; align-items: center; gap: 12px; min-height: 36px;
  border-top: 1px solid rgb(176 196 255 / .07); font-size: 13px;
}
#settings .set-keys > div:first-child { border-top: 0; }
#settings dt { color: var(--s-ink-2); font-weight: 400; }
#settings dd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 5px; margin: 0; padding: 5px 0; color: var(--s-ink); font-weight: 400; }
#settings kbd {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border: 1px solid var(--s-line-2); border-radius: 6px; background: var(--s-well);
  box-shadow: 0 1px 0 rgb(176 196 255 / .16); font: 600 11px/1 -apple-system, "SF Pro Text", system-ui, sans-serif; color: var(--s-ink);
}
#settings kbd + kbd { margin-left: -1px; }
#settings dd kbd:not(:first-child):not(kbd + kbd) { margin-left: 5px; }
#settings .set-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 4px; border: 1px solid var(--s-line-2); border-radius: 50%; background: var(--s-well); }
#settings .set-ico svg { width: 13px; height: 13px; fill: none; stroke: var(--s-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#settings p { margin: 0 0 8px; font-size: 13.5px; font-weight: 400; line-height: 1.65; color: rgb(226 232 248 / .84); text-wrap: pretty; word-break: keep-all; overflow-wrap: break-word; }
#settings .set-about p { word-break: normal; overflow-wrap: anywhere; }
#settings .set-btn {
  display: inline-grid; place-items: center; min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--s-line-2); background: rgb(176 196 255 / .1); color: var(--s-ink);
  font-size: 14px; font-weight: 500; line-height: 1; transition: background .15s, transform .12s;
}
#settings .set-body .set-btn { margin-top: 6px; }
#settings dd > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
#settings .set-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; }
#settings .set-links .set-btn { margin-top: 0; }
#settings .set-btn:hover { background: rgb(176 196 255 / .18); }
/* 次要動作（下載完整版）：沒有底色，只有字與細線；還沒有連結時是停用的樣子 */
#settings .set-quiet { background: transparent; border-color: var(--s-line); color: var(--s-ink-2); text-decoration: none; }
#settings a.set-quiet[href] { cursor: pointer; color: var(--s-ink); border-color: var(--s-line-2); }
#settings a.set-quiet[href]:hover { background: rgb(176 196 255 / .1); }
#settings .set-quiet[aria-disabled=true] { border-color: rgb(176 196 255 / .1); color: rgb(200 210 236 / .52); cursor: default; }
#settings .set-quiet[aria-disabled=true]:hover { background: transparent; }
#settings .set-quiet[aria-disabled=true]:active { transform: none; }
#settings .set-btn:active { transform: scale(.98); }
#settings .set-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; flex: none; }
#settings .set-actions .set-btn { border-radius: 12px; min-height: 48px; }
#settings .set-actions .set-primary { background: #e9edf8; border-color: transparent; color: #101a36; font-weight: 600; box-shadow: 0 10px 24px -12px rgb(0 0 12 / .7); }
#settings .set-actions .set-primary:hover { background: #fff; }
#settings :focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
#settings summary:focus-visible { outline-offset: -2px; }
#settings ::selection { background: var(--gold); color: #111; }

@media (pointer: coarse) { #settings .set-seg button { min-height: 44px; } }
@media (max-width: 600px) {
  #settings .set-stack { left: calc(12px + var(--safe-l)); width: auto; bottom: calc(12px + var(--safe-b)); max-height: none; }
}

/* 對戰（battle-view/）：人物標記畫在這張覆蓋層；探索的操作提示在對局中全部收起，不出現任何玩法提示文字 */
#battleHud { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
body.battle #battleHud { display: block; }
body.battle #keys, body.battle #flyhint, body.battle #skyDoor, body.battle #atlasToggle { display: none !important; }
body.battle.ready.meta #meta { opacity: .9; }
/* 結算：整局唯一出現數字的地方。和設定的玻璃字卡同一套材質；每列＝名次、主色的細圈、歌名、很準的比例 */
#battleResult {
  --gold: #e8c98a; --s-ink: rgb(238 242 252 / .95); --s-ink-2: rgb(200 210 236 / .72);
  --s-line: rgb(176 196 255 / .15); --s-line-2: rgb(176 196 255 / .3); --s-well: rgb(6 10 26 / .42);
  position: fixed; left: 50%; bottom: calc(12% + var(--safe-b)); transform: translateX(-50%);
  width: min(320px, calc(100% - 32px)); padding: 10px 10px 10px; border-radius: 14px; display: none;
  background: linear-gradient(180deg, rgb(40 56 104 / .36), rgb(14 22 50 / .5));
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--s-line); box-shadow: 0 18px 40px -24px rgb(0 0 12 / .8);
  color: var(--s-ink); color-scheme: dark;
}
#battleResult.on { display: block; animation: br-in .5s cubic-bezier(.16,1,.3,1) both; }
@keyframes br-in { from { opacity: 0; transform: translate(-50%, 8px); } }
#battleResult ol { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
#battleResult li {
  display: grid; grid-template-columns: 22px 12px 1fr auto; align-items: center; gap: 10px;
  min-height: 34px; padding: 0 10px; border-radius: 9px; font-size: 14px; color: var(--s-ink-2);
}
#battleResult li.me { background: var(--s-well); color: var(--s-ink); }
#battleResult li b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; color: var(--s-ink); }
#battleResult li:first-child b { color: var(--gold); }
#battleResult li i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--c); box-sizing: border-box; }
#battleResult li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#battleResult li em { font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--s-ink-2); }
#battleResult button {
  width: 100%; min-height: 44px; border-radius: 10px; border: 0; cursor: pointer;
  background: #e9edf8; color: #101a36; font: inherit; font-size: 14px; font-weight: 600;
  transition: background .15s, transform .12s;
}
#battleResult button:hover { background: #fff; }
#battleResult button:active { transform: scale(.98); }
#battleResult button:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { #battleResult.on { animation: none; } }
