:root {
  color-scheme: dark;
  --void: #030712;
  --deep: #071a3d;
  --violet: #7868ff;
  --cyan: #55e6ff;
  --gold: #ffd76a;
  --ice: #f4f7ff;
  --muted: #8fa0c1;
  --panel: rgba(6, 14, 35, 0.72);
  --panel-strong: rgba(7, 15, 37, 0.94);
  --line: rgba(146, 176, 255, 0.17);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

/* 基础规则与键盘可访问性 */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { width: 100%; min-height: 100%; margin: 0; overflow: hidden; background: var(--void); }

body { color: var(--ice); }

button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

#spaceCanvas { position: fixed; inset: 0; width: 100%; height: 100%; }

/* 星空氛围层：只承担环境光，不承载交互。 */
.aurora { position: fixed; width: 52vw; height: 52vw; border-radius: 50%; filter: blur(90px); opacity: .16; pointer-events: none; mix-blend-mode: screen; }
.aurora-one { top: -28vw; left: 8vw; background: #3549ff; }
.aurora-two { right: -26vw; bottom: -32vw; background: #7b35ff; }

/* 兼容性检测只负责提示，不隐藏或替换现有功能。 */
.compatibility-notice { position: fixed; top: 18px; left: 50%; z-index: 60; width: min(680px, calc(100vw - 36px)); padding: 13px 17px; border: 1px solid rgba(255,215,106,.46); border-radius: 13px; background: rgba(35,25,10,.94); box-shadow: 0 16px 48px rgba(0,0,0,.42); transform: translateX(-50%); color: #fff1bd; }
.compatibility-notice strong { display: block; margin-bottom: 4px; font-size: .88rem; }
.compatibility-notice p { margin: 0; color: #decf9f; font-size: .78rem; line-height: 1.55; }
.static-notice { margin: 0; }

.app-shell { position: relative; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(18px, 2.2vw, 34px) clamp(20px, 3.2vw, 54px) clamp(22px, 2.8vw, 42px); isolation: isolate; transition: padding-right .45s cubic-bezier(.22,1,.36,1); }
.app-shell.drawer-open { padding-right: min(31vw, 460px); }

.topbar { display: flex; align-items: center; justify-content: space-between; z-index: 10; }
.brand-block { display: flex; align-items: center; gap: 14px; }
.brand-block h1 { margin: 0; font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif; font-size: clamp(1.28rem, 2vw, 1.72rem); font-weight: 520; letter-spacing: .14em; }
.brand-block p { margin: 5px 0 0; color: var(--muted); font-size: .83rem; letter-spacing: .05em; }

.orbit-mark { position: relative; width: 42px; height: 42px; border: 1px solid rgba(85,230,255,.38); border-radius: 50%; box-shadow: inset 0 0 18px rgba(85,230,255,.11), 0 0 24px rgba(85,230,255,.1); }
.orbit-mark::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(139,124,255,.45); border-radius: 50%; transform: rotate(55deg) scaleY(.42); }
.orbit-mark i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); right: 5px; top: 9px; box-shadow: 0 0 12px var(--gold); }

.icon-button, .close-button { border: 1px solid var(--line); background: rgba(8,16,39,.54); cursor: pointer; backdrop-filter: blur(14px); }
.icon-button { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; transition: border-color .2s, background .2s, transform .2s; }
.icon-button:hover { border-color: rgba(85,230,255,.54); background: rgba(20,38,74,.72); transform: translateY(-2px); }
.icon-button svg, .edge-tool svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* 名字球舞台与轨道只负责空间感，文字本身由 Canvas 绘制。 */
.stage { position: relative; min-height: 0; display: grid; place-items: center; transition: transform .45s cubic-bezier(.22,1,.36,1); }
.drawer-open .stage { transform: translateX(-4vw); }
#sphereCanvas { width: min(74vh, 72vw); height: min(74vh, 72vw); max-width: 900px; max-height: 900px; cursor: grab; touch-action: none; filter: drop-shadow(0 0 34px rgba(57,114,255,.13)); }
#sphereCanvas:active { cursor: grabbing; }

.sphere-halo { position: absolute; width: min(62vh, 59vw); aspect-ratio: 1; pointer-events: none; transition: opacity .35s, transform .8s cubic-bezier(.22,1,.36,1); }
.halo-ring, .halo-axis { position: absolute; inset: 5%; border-radius: 50%; border: 1px solid rgba(85,230,255,.17); box-shadow: inset 0 0 28px rgba(85,230,255,.035), 0 0 24px rgba(110,92,255,.04); }
.halo-ring-a { transform: rotate(-14deg) scaleY(.28); }
.halo-ring-b { border-color: rgba(139,124,255,.15); transform: rotate(69deg) scaleY(.36); }
.halo-axis { inset: 14%; border-style: dotted; border-color: rgba(255,215,106,.08); transform: rotate(18deg); }
.stage.spinning .sphere-halo { animation: haloPulse 1.5s ease-in-out infinite; }
.stage.revealed .sphere-halo { opacity: .24; transform: scale(.78); }

.stage-caption { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; color: #9eb1d6; font-family: Bahnschrift, sans-serif; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; opacity: .78; }
.pulse-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: dotPulse 2.4s ease-in-out infinite; }

/* 底部高频抽选控制 */
.control-deck { align-self: end; justify-self: center; position: relative; z-index: 12; display: grid; grid-template-columns: 176px 210px; grid-template-rows: auto auto; align-items: center; gap: 10px 14px; padding: 10px; border: 1px solid var(--line); border-radius: 25px; background: linear-gradient(140deg, rgba(13,28,62,.76), rgba(5,12,29,.72)); backdrop-filter: blur(22px) saturate(130%); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.05); }
.count-control { height: 56px; display: grid; grid-template-columns: 45px 1fr 45px; align-items: center; border: 1px solid rgba(147,176,255,.14); border-radius: 17px; background: rgba(1,8,23,.38); }
.count-control button { height: 100%; border: 0; background: transparent; color: #aebddd; font-size: 1.25rem; cursor: pointer; transition: color .2s, background .2s; }
.count-control button:hover:not(:disabled) { color: var(--cyan); background: rgba(85,230,255,.06); }
.count-control button:disabled { opacity: .25; cursor: not-allowed; }
.count-readout { display: flex; justify-content: center; align-items: baseline; gap: 5px; color: #9fb0d1; font-size: .76rem; white-space: nowrap; }
.count-readout strong { color: var(--ice); font-family: Bahnschrift, sans-serif; font-size: 1.6rem; font-weight: 500; }

.draw-button { position: relative; isolation: isolate; height: 58px; border: 1px solid rgba(85,230,255,.42); border-radius: 17px; overflow: hidden; background: linear-gradient(110deg, rgba(45,85,218,.78), rgba(86,68,207,.76)); box-shadow: inset 0 1px rgba(255,255,255,.13), 0 12px 28px rgba(37,67,184,.22); cursor: pointer; font-weight: 700; letter-spacing: .08em; transition: transform .2s, box-shadow .2s, border-color .2s; }
.draw-button:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--cyan); box-shadow: inset 0 1px rgba(255,255,255,.15), 0 16px 34px rgba(43,80,207,.34); }
.draw-button:active:not(:disabled) { transform: translateY(0) scale(.99); }
.draw-button:disabled { cursor: wait; }
.draw-button-glow { position: absolute; inset: -35% -55%; z-index: -1; opacity: .62; background: linear-gradient(112deg, transparent 38%, rgba(85,230,255,.05) 44%, rgba(113,225,255,.34) 50%, rgba(167,139,255,.12) 56%, transparent 62%); filter: blur(6px); transform: translateX(-42%); animation: buttonSweep 4.2s ease-in-out infinite; }
.draw-button.is-stop { border-color: rgba(255,215,106,.6); background: linear-gradient(110deg, rgba(110,64,178,.82), rgba(184,91,128,.72)); }
.keyboard-hint { grid-column: 1 / -1; margin: 0 0 1px; text-align: center; color: #7586a8; font-size: .68rem; letter-spacing: .07em; }
kbd { padding: 2px 7px; border: 1px solid rgba(143,160,193,.24); border-radius: 5px; background: rgba(255,255,255,.04); color: #aab9d7; font-family: Bahnschrift, sans-serif; font-size: .66rem; margin-right: 7px; }

/* 右侧低频入口 */
.edge-tools { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 8px; transition: opacity .25s; }
.edge-tool { position: relative; width: 56px; min-height: 72px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-right: 0; border-radius: 16px 0 0 16px; background: rgba(7,16,39,.72); backdrop-filter: blur(18px); color: #aebddd; cursor: pointer; font-size: .67rem; letter-spacing: .08em; transition: width .2s, background .2s, color .2s; }
.edge-tool:hover { width: 62px; color: var(--ice); background: rgba(16,31,66,.88); }
.edge-tool b { position: absolute; top: 5px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; background: var(--gold); color: #251b00; font-family: Bahnschrift, sans-serif; font-size: .62rem; }
.edge-tool b:empty, .edge-tool b[data-count="0"] { display: none; }

.result-layer { position: absolute; inset: 8% 4% 9%; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transform: scale(.92); transition: opacity .5s, transform .65s cubic-bezier(.16,1,.3,1); }
.result-layer::before { content: ""; position: absolute; width: min(68vh, 64vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(85,230,255,.12), rgba(96,72,255,.06) 36%, transparent 68%); filter: blur(10px); transform: scale(.7); }
.result-layer.visible { opacity: 1; transform: scale(1); pointer-events: auto; }
.result-kicker { position: relative; margin-bottom: 22px; color: var(--gold); font-family: Bahnschrift, sans-serif; font-size: .78rem; letter-spacing: .36em; }
.winner-grid { position: relative; width: min(820px, 90%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; }
.winner-card { min-width: min(260px, 42%); padding: clamp(18px, 2.4vw, 30px) clamp(24px, 3.4vw, 42px); border: 1px solid rgba(255,215,106,.35); border-radius: 18px; background: linear-gradient(145deg, rgba(17,31,65,.87), rgba(17,13,41,.82)); box-shadow: 0 0 0 1px rgba(255,255,255,.025) inset, 0 18px 50px rgba(0,0,0,.28), 0 0 32px rgba(255,215,106,.08); text-align: center; animation: winnerArrive .65s cubic-bezier(.16,1,.3,1) both; }
.winner-card strong { display: block; font-size: clamp(1.65rem, 3.6vw, 3.5rem); font-weight: 520; letter-spacing: .08em; text-shadow: 0 0 24px rgba(255,215,106,.22); }
.result-next { margin-top: 24px; padding: 11px 18px; border: 1px solid rgba(143,160,193,.22); border-radius: 12px; background: rgba(6,14,35,.7); color: #b6c5e2; cursor: pointer; }

/* 首次进入且没有本地名单时的引导 */
.empty-state { position: absolute; z-index: 9; text-align: center; }
.empty-state h2 { margin: 24px 0 7px; font-size: 1.7rem; font-weight: 500; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }
.empty-orbit { width: 110px; height: 110px; margin: auto; border: 1px solid rgba(85,230,255,.24); border-radius: 50%; box-shadow: inset 0 0 30px rgba(85,230,255,.08); }

/* 设置与记录共用的响应式抽屉 */
.drawer-scrim { position: fixed; inset: 0; z-index: 29; background: rgba(0,4,14,.34); backdrop-filter: blur(2px); }
.side-drawer { position: fixed; top: 0; right: 0; z-index: 30; width: min(430px, 92vw); height: 100dvh; display: flex; flex-direction: column; padding: 28px; background: linear-gradient(170deg, rgba(10,22,51,.98), rgba(4,9,24,.98)); border-left: 1px solid rgba(130,158,232,.18); box-shadow: -24px 0 80px rgba(0,0,0,.38); transform: translateX(102%); transition: transform .45s cubic-bezier(.22,1,.36,1); overflow: hidden; }
.side-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; }
.drawer-eyebrow { color: var(--cyan); font-family: Bahnschrift, sans-serif; font-size: .65rem; letter-spacing: .23em; text-transform: uppercase; }
.drawer-header h2 { margin: 6px 0 0; font-size: 1.7rem; font-weight: 500; letter-spacing: .07em; }
.close-button { width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; color: #9cacc9; }
.drawer-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 24px 0 10px; padding: 4px; border: 1px solid rgba(143,160,193,.12); border-radius: 13px; background: rgba(0,5,17,.3); }
.drawer-tab { padding: 10px; border: 0; border-radius: 9px; background: transparent; color: #8393b1; cursor: pointer; font-size: .84rem; }
.drawer-tab.active { background: rgba(85,230,255,.09); color: var(--ice); box-shadow: inset 0 0 0 1px rgba(85,230,255,.12); }
.drawer-tab span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: .68rem; }
.drawer-panel { display: none; overflow-y: auto; min-height: 0; padding: 6px 3px 36px 0; scrollbar-width: thin; scrollbar-color: rgba(85,230,255,.24) transparent; }
.drawer-panel.active { display: block; }
.setting-section { padding: 22px 0; border-bottom: 1px solid rgba(143,160,193,.11); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading span { color: #566987; font-family: Bahnschrift, sans-serif; font-size: .64rem; }
.section-heading h3 { margin: 0; font-size: .92rem; font-weight: 600; letter-spacing: .07em; }
.section-heading strong { color: var(--cyan); font-size: .8rem; font-weight: 500; }
.save-state { margin: -5px 0 14px; color: #7f90af; font-size: .76rem; line-height: 1.55; }
.secondary-button, .wide-button, .primary-small { border-radius: 11px; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.secondary-button { padding: 11px 14px; border: 1px solid rgba(143,160,193,.18); background: rgba(255,255,255,.035); color: #b5c4df; }
.secondary-button:hover { border-color: rgba(85,230,255,.38); background: rgba(85,230,255,.06); }
.wide-button { width: 100%; margin-top: 9px; padding: 12px; border: 1px solid rgba(85,230,255,.28); background: rgba(85,230,255,.07); color: #d7faff; }
.primary-small { padding: 12px 18px; border: 1px solid rgba(85,230,255,.45); background: linear-gradient(110deg, rgba(54,99,223,.82), rgba(101,75,213,.8)); font-weight: 650; }
.text-button { padding: 7px 0; border: 0; background: transparent; color: var(--cyan); cursor: pointer; font-size: .74rem; }
.danger-text { color: #d78b9c; }
.setting-row { min-height: 62px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; position: relative; cursor: pointer; }
.setting-row + .setting-row { border-top: 1px solid rgba(143,160,193,.08); }
.setting-row b, .segmented-setting b { display: block; font-size: .84rem; font-weight: 550; }
.setting-row small, .segmented-setting small { display: block; margin-top: 4px; color: #7283a3; font-size: .7rem; line-height: 1.4; }
.switch-input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { width: 42px; height: 23px; padding: 3px; border: 1px solid rgba(143,160,193,.26); border-radius: 15px; background: rgba(255,255,255,.05); transition: background .2s, border-color .2s; }
.switch-ui::after { content: ""; display: block; width: 15px; height: 15px; border-radius: 50%; background: #7f8da7; transition: transform .25s, background .2s, box-shadow .2s; }
.switch-input:checked + .switch-ui { background: rgba(85,230,255,.16); border-color: rgba(85,230,255,.48); }
.switch-input:checked + .switch-ui::after { transform: translateX(19px); background: var(--cyan); box-shadow: 0 0 12px rgba(85,230,255,.55); }
.remaining-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; margin-top: 8px; padding: 11px 13px; border: 1px solid rgba(255,215,106,.14); border-radius: 10px; background: rgba(255,215,106,.045); color: #91a1bd; font-size: .75rem; }
.remaining-row strong { color: var(--gold); }
.segmented-setting { padding: 13px 0 17px; border-top: 1px solid rgba(143,160,193,.08); }
.segments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; padding: 3px; border: 1px solid rgba(143,160,193,.12); border-radius: 10px; }
.segments button { padding: 8px; border: 0; border-radius: 7px; background: transparent; color: #7f90af; cursor: pointer; font-size: .74rem; }
.segments button.active { background: rgba(85,230,255,.1); color: var(--ice); }
.volume-row { display: grid; grid-template-columns: auto 1fr 38px; gap: 12px; align-items: center; margin-top: 9px; color: #8798b7; font-size: .73rem; }
.volume-row input { width: 100%; accent-color: var(--cyan); }
.volume-row output { color: #aebddd; font-family: Bahnschrift, sans-serif; }

.history-list { display: grid; gap: 10px; margin-top: 10px; }
.history-item { position: relative; padding: 15px 16px 15px 52px; border: 1px solid rgba(143,160,193,.12); border-radius: 13px; background: rgba(255,255,255,.025); }
.history-index { position: absolute; left: 15px; top: 17px; width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(85,230,255,.22); border-radius: 50%; color: var(--cyan); font-family: Bahnschrift, sans-serif; font-size: .65rem; }
.history-meta { color: #6f809f; font-size: .68rem; }
.history-names { margin-top: 6px; color: #dfe8fa; font-size: .9rem; line-height: 1.55; }
.history-empty { padding: 70px 20px 30px; text-align: center; color: #7c8dab; }
.history-empty h3 { margin: 20px 0 7px; color: #c2cee3; font-size: 1rem; }
.history-empty p { margin: 0; font-size: .75rem; line-height: 1.6; }
.history-orbit { width: 76px; height: 76px; margin: auto; border: 1px solid rgba(85,230,255,.18); border-radius: 50%; box-shadow: inset 0 0 26px rgba(85,230,255,.07); }
.danger-button { margin-top: 16px; border-color: rgba(215,91,120,.22); background: rgba(215,91,120,.07); color: #efa9b8; }

/* 名单粘贴弹窗与轻提示 */
.roster-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid rgba(130,158,232,.22); border-radius: 20px; background: linear-gradient(160deg, #0a1734, #050b1c); color: var(--ice); box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.roster-dialog::backdrop { background: rgba(0,4,14,.66); backdrop-filter: blur(8px); }
.roster-dialog form { padding: 26px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 21px; font-size: 1.18rem; font-weight: 600; }
.roster-dialog label { display: block; margin: 14px 0 7px; color: #8798b7; font-size: .76rem; }
.roster-dialog input[type="text"], .roster-dialog textarea { width: 100%; border: 1px solid rgba(143,160,193,.18); border-radius: 11px; background: rgba(0,5,17,.4); color: var(--ice); resize: vertical; }
.roster-dialog input[type="text"] { padding: 11px 13px; }
.roster-dialog textarea { padding: 13px; line-height: 1.65; }
.recognition-status { color: #7283a3; font-size: .73rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.toast-region { position: fixed; left: 50%; top: 24px; z-index: 80; display: grid; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast { min-width: 240px; padding: 11px 16px; border: 1px solid rgba(85,230,255,.2); border-radius: 11px; background: rgba(7,16,39,.92); box-shadow: 0 14px 40px rgba(0,0,0,.3); color: #d8e3f7; font-size: .78rem; text-align: center; animation: toastIn .3s ease both; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.high-contrast { --muted: #b8c6e0; --line: rgba(174,196,255,.28); }
.high-contrast #sphereCanvas { filter: drop-shadow(0 0 25px rgba(85,230,255,.18)) contrast(1.1); }
.high-contrast .aurora { opacity: .08; }
.app-shell.controls-dimmed .topbar, .app-shell.controls-dimmed .control-deck, .app-shell.controls-dimmed .edge-tools { opacity: .12; transition: opacity .6s; }
.app-shell.controls-dimmed:hover .topbar, .app-shell.controls-dimmed:hover .control-deck, .app-shell.controls-dimmed:hover .edge-tools { opacity: 1; }

/* 动画集中定义，减少组件规则中的重复关键帧。 */
@keyframes buttonSweep {
  0%, 26% { transform: translateX(-42%); opacity: 0; }
  38% { opacity: .58; }
  72% { transform: translateX(42%); opacity: .42; }
  82%, 100% { transform: translateX(42%); opacity: 0; }
}
@keyframes dotPulse { 50% { opacity: .3; transform: scale(.7); } }
@keyframes haloPulse { 50% { transform: scale(1.035); opacity: .7; } }
@keyframes winnerArrive { from { opacity: 0; transform: translateY(20px) scale(.9); filter: blur(7px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* 窄屏改为底部抽屉，避免遮挡名字球。 */
@media (max-width: 760px) {
  .app-shell { padding: 18px 16px 20px; }
  .app-shell.drawer-open { padding-right: 16px; }
  .drawer-open .stage { transform: none; }
  .brand-block h1 { font-size: 1.15rem; }
  .orbit-mark { width: 36px; height: 36px; }
  #sphereCanvas { width: 94vw; height: 94vw; }
  .sphere-halo { width: 82vw; }
  .control-deck { width: min(94vw, 420px); grid-template-columns: 1fr 1.1fr; border-radius: 20px; }
  .edge-tools { top: auto; bottom: 124px; transform: none; }
  .edge-tool { width: 49px; min-height: 62px; }
  .side-drawer { top: auto; bottom: 0; width: 100%; height: min(86dvh, 720px); border-left: 0; border-top: 1px solid rgba(130,158,232,.18); border-radius: 24px 24px 0 0; transform: translateY(102%); }
  .side-drawer.open { transform: translateY(0); }
  .winner-grid { gap: 9px; }
  .winner-card { min-width: 44%; padding: 16px 14px; }
  .winner-card strong { font-size: clamp(1.25rem, 7vw, 2rem); }
  .stage-caption { bottom: 1%; }
}

/* 低高度投影画面优先保证控制区完整可见。 */
@media (max-height: 680px) and (min-width: 761px) {
  .app-shell { padding-top: 16px; padding-bottom: 18px; }
  #sphereCanvas { width: 66vh; height: 66vh; }
  .sphere-halo { width: 56vh; }
  .control-deck { transform: scale(.92); transform-origin: bottom center; }
  .stage-caption { display: none; }
}

/* 尊重系统的减少动态效果偏好。 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .aurora { display: none; }
}
