/* Winter workshop HUD. The world stays clear; tools form one anchored belt. */
:root {
  color-scheme: light;
  color: #292c33;
  background: var(--game-backdrop-day);
  --game-backdrop-day: #f0f2f5;
  --game-backdrop-night: #181a1e;
  --green: #e7e9ef;
  --muted: #b8bec9;
  --line: #e7e9ef26;
  --game-heading: #292c33;
  --game-hud-muted: #777e8a;
  --game-guide-text: #6c7481;
  --game-text: #e7e9ef;
  --game-muted: #b8bec9;
  --game-glass: #292c33f7;
  --game-solid: #292c33;
  --game-surface: #30343c;
  --game-line: #e7e9ef26;
  --game-accent: var(--game-text);
  --game-accent-wash: #e7e9ef12;
  --game-primary: #e7e9ef;
  --game-primary-hover: #f1f3f7;
  --game-primary-text: #292c33;
  --game-selection: #e7e9ef;
  --game-shadow: 0 14px 40px #00000024, 0 2px 7px #00000014;
}
body[data-game-lighting="night"] {
  color-scheme: dark;
  background: var(--game-backdrop-night);
  --game-heading: #e7e9ef;
  --game-hud-muted: #b8bec9;
  --game-guide-text: #b8bec9;
  --game-shadow: 0 14px 40px #00000040, 0 2px 7px #00000025;
}
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { color: var(--game-text); }
.branch-study.bulb-study {
  --game-safe-top: 104px;
  --game-safe-bottom: 248px;
  --game-safe-left: 0px;
  --game-safe-right: 0px;
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; margin: 0; padding: 0; overflow: hidden;
}
.bulb-study .stage { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; background: transparent; }
#bulb-viewer { position: absolute; inset: 0; }
#bulb-viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.bulb-study .stage-label { display: none; }
.bulb-study .stage-hint, .bulb-study .game-world-guide { position: absolute; z-index: 2; left: var(--game-guide-left, 50%); right: auto; bottom: var(--game-guide-bottom, calc(var(--game-safe-bottom) - 48px)); display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 5px; width: max-content; max-width: calc(100% - 32px); height: 28px; min-height: 28px; padding: 6px 0; margin: 0; transform: translateX(-50%); border: 0; border-radius: 0; background: transparent; color: var(--game-guide-text); font-size:11px; font-weight: 400; line-height: 16px; letter-spacing: 0; white-space: nowrap; box-shadow: none; pointer-events: none; }
.bulb-study:has(#edit-region-legend:not([hidden])) .stage-hint { visibility: hidden; }
.bulb-study .load-status { z-index: 40; background: var(--game-backdrop-day); color: #777e8a; }
body[data-game-lighting="night"] .load-status { background: var(--game-backdrop-night); color: var(--game-text); }
.bulb-study .load-status.error { color: var(--game-heading); }
#outdoor-loading { display: none; }
html[data-outdoor-entry] :is(.game-hud, .stage-hint, .scene-ambient) { display: none; }
html[data-outdoor-entry] {
  background: var(--outdoor-stage-background, #1b1728);
}
html[data-outdoor-entry] .bulb-study .stage {
  background: var(--outdoor-stage-background, #1b1728);
}
html:not([data-outdoor-entry="ready"])[data-outdoor-entry] #load-status { display: none; }
html:not([data-outdoor-entry="ready"])[data-outdoor-entry] #outdoor-loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: block;
  background: var(--outdoor-stage-background, #1b1728);
}
html:not([data-outdoor-entry="ready"])[data-outdoor-entry] #outdoor-tree-controls:not([hidden]) {
  opacity: 0;
  visibility: hidden;
}
.outdoor-loader-cover, .outdoor-loader-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.outdoor-loader-cover {
  background: radial-gradient(ellipse at 50% 51%, #3a3248, #251f32 64%, #1a1727);
}
.outdoor-loader-poster { visibility: hidden; }
html:is([data-outdoor-entry="reveal"],[data-outdoor-entry="handoff"],[data-outdoor-entry="fallback"]) .outdoor-loader-poster[data-rendered] { visibility: visible; }
html[data-outdoor-entry="fallback"] #outdoor-loading:has(.outdoor-loader-poster[data-rendered]) .outdoor-loader-cover { visibility: hidden; }
html:is([data-outdoor-entry="error"],[data-outdoor-entry="fallback"]) .outdoor-loader-cover[data-still] :is(.outdoor-loader-glass, .outdoor-loader-base, .outdoor-loader-snow) { visibility: hidden; }
html:is([data-outdoor-entry="error"],[data-outdoor-entry="fallback"]) .outdoor-loader-cover[data-still] .outdoor-loader-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/snow-globe-preview.jpg") 92.15% 48.15% / 208.33% auto no-repeat;
  mask-image: radial-gradient(ellipse closest-side, #000 94%, transparent);
}
.outdoor-loader-scene {
  position: absolute;
  left: var(--entry-x);
  top: var(--entry-y);
  width: var(--entry-width);
  height: var(--entry-height);
}
.outdoor-loader-glass, .outdoor-loader-base, .outdoor-loader-snow, .outdoor-loader-progress {
  position: absolute;
  border-radius: 50%;
}
.outdoor-loader-glass, .outdoor-loader-progress {
  left: var(--entry-glass-x);
  top: var(--entry-glass-y);
  width: var(--entry-glass-width);
  height: var(--entry-glass-height);
  clip-path: var(--entry-glass-clip);
}
.outdoor-loader-glass {
  background: radial-gradient(ellipse at 29% 19%, #e4dcff24, transparent 41%),
    radial-gradient(ellipse at 50% 46%, #3c344d1c 53%, #b4adc54a 91%, #d5cce969);
  box-shadow: inset 0 2px 2px #e4ddf25e, inset 0 0 14px #d7d3ef36;
}
.outdoor-loader-base {
  left: var(--entry-base-x);
  top: var(--entry-base-y);
  width: var(--entry-base-width);
  height: var(--entry-base-height);
  border-radius: 0;
  clip-path: var(--entry-base-clip);
  background: linear-gradient(158deg, #504760, #252c42 68%, #151b2b);
  box-shadow: inset 0 0 0 1px #a5a6ba50;
}
.outdoor-loader-snow {
  left: var(--entry-floor-x);
  top: var(--entry-floor-y);
  width: var(--entry-floor-width);
  height: var(--entry-floor-height);
  background: radial-gradient(ellipse at 48% 42%, #8b849b, #746c84 64%, #5f5872);
  box-shadow: inset 0 1px 1px #dfd2ed55, 0 1px 1px #c3b7d460;
}
.outdoor-loader-fill {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 32% 18%, #fff, #f7f6ff 43%, #dfe2f4);
  opacity: .9;
  transform: scaleY(.06);
  transform-origin: 50% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .outdoor-loader-fill {
    transform: scaleY(.13);
    transition: transform var(--entry-fill-duration, 3400ms) cubic-bezier(.18,.65,.4,1);
  }
  @starting-style {
    .outdoor-loader-fill { transform: scaleY(.06); }
  }
}
html:is([data-outdoor-entry="error"],[data-outdoor-entry="fallback"]) .outdoor-loader-progress,
html[data-outdoor-entry="error"] .outdoor-loader-unavailable,
html[data-outdoor-entry="fallback"] .outdoor-loader-error { display: none; }
.outdoor-loader-fallback { display: none; }
html:is([data-outdoor-entry="error"],[data-outdoor-entry="fallback"]) .outdoor-loader-fallback {
  position: absolute;
  left: 50%;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  translate: -50% 0;
  width: max-content;
  max-width: calc(100% - 24px);
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: #fff5e2;
  background: #211c32e8;
  border-radius: 16px;
  font-size: 13px;
}
.outdoor-loader-fallback p { margin: 0; }
#outdoor-loader-retry {
  min-height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: #f0d4a0;
  color: #281e27;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.game-hud { position: absolute; z-index: 50; top: max(18px, calc(env(safe-area-inset-top) + 10px)); left: max(24px, calc(env(safe-area-inset-left) + 14px)); right: max(24px, calc(env(safe-area-inset-right) + 14px)); display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none; }
.game-brand { display: flex; align-items: center; gap: 11px; user-select: none; }
.game-emblem { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--game-line); border-radius: 12px; background: var(--game-solid); box-shadow: 0 4px 12px #00000012; }
.game-emblem svg { width: 23px; height: 23px; fill: var(--game-accent); }
.game-brand .eyebrow { margin: 0 0 4px; color: var(--game-hud-muted); font-size:8px; font-weight: 650; letter-spacing: .18em; }
.game-brand h1 { margin: 0; color: var(--game-heading); font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.04em; }
.game-hud-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.bulb-study button { min-height: 44px; border: 1px solid var(--game-line); border-radius: 10px; color: var(--game-text); background: var(--game-glass); font-size:12px; line-height: 1.35; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) { .bulb-study button:hover { color: var(--game-text); background: var(--game-solid); border-color: var(--game-accent); } }
.bulb-study button[aria-pressed="true"] { color: var(--game-accent); border-color: var(--game-accent); background: var(--game-accent-wash); }
.bulb-study button:disabled { cursor: default; opacity: .4; }
.bulb-study button:focus-visible, .bulb-study a:focus-visible, .bulb-study select:focus-visible, .bulb-study input:focus-visible, .bulb-study summary:focus-visible, .custom-select-popup:focus-visible, .custom-select-option:focus-visible { outline: 2px solid var(--game-text); outline-offset: 3px; }
.bulb-study canvas:focus-visible { outline: 2px solid var(--game-accent); outline-offset: -4px; }
#outdoor-view-toggle:focus-visible + #bulb-viewer canvas { outline: 2px solid var(--game-accent); outline-offset: -4px; }
.bulb-study .game-icon-button { display: inline-flex; min-width: 44px; align-items: center; justify-content: center; gap: 7px; padding: 10px 13px; border-radius: 11px; box-shadow: 0 4px 12px #00000012; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.game-icon-button svg, .tool-button svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.game-icon-button circle { fill: var(--game-solid); }
.game-icon-button span { font-size:11px; }
.bulb-study .mobile-settings-toggle { display:none; }
.game-toast { position: absolute; z-index: 75; top: max(80px, calc(env(safe-area-inset-top) + 70px)); left: 50%; display: flex; align-items: center; gap: 9px; width: max-content; max-width: min(360px, calc(100% - 32px)); min-height: 44px; padding: 11px 14px; transform: translateX(-50%); border: 1px solid var(--game-line); border-radius: 11px; color: var(--game-text); background: var(--game-solid); box-shadow: var(--game-shadow); font-size:12px; line-height: 1.5; word-break: keep-all; pointer-events: none; }
.game-toast[data-state="shown"] { animation: game-toast-in .18s ease-out both; }
.game-toast svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.game-toast .toast-icon-undo, .game-toast[data-kind="undo"] .toast-icon-success, .game-toast[data-kind="invalid"] .toast-icon-success { display: none; }
.game-toast[data-kind="undo"] .toast-icon-undo { display: block; }
#game-toast-message { min-width: 0; }
.bauble-editor { --editor-action-height: 48px; position: absolute; z-index: 60; left: 50%; bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; width: min(500px, calc(100% - 32px)); margin: 0; padding: 12px; transform: translateX(-50%); border: 1px solid var(--game-line); border-radius: 16px; background: var(--game-glass); color: var(--game-text); box-shadow: var(--game-shadow); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.bauble-editor[data-mode]:not([data-mode="view"]) { grid-template-rows: auto auto calc(var(--editor-action-height) + 19px); }
.editor-heading { grid-row: 1; }
.editor-tool-row { grid-row: 2; }
.editor-actions, .dock-feedback { grid-column: 1; grid-row: 3; }
.bauble-editor, .game-settings { color-scheme: dark; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.editor-heading h2 { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--game-accent); font-size:11px; font-weight: 650; letter-spacing: .01em; }
.editor-heading h2 span { display: inline-block; margin: 0; padding: 2px 5px; border: 1px solid var(--game-line); border-radius: 4px; color: var(--game-muted); font-size:9px; font-weight: 500; }
#edit-save-state { display: flex; align-items: center; gap: 5px; color: var(--game-muted); font-size:9px; }
#edit-save-state::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--game-accent); }
.editor-tool-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px; align-items: stretch; gap: 10px; }
.bulb-study .ornament-picker { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; min-height: 62px; padding: 8px 10px; border: 1px solid var(--game-line); border-radius: 10px; background: var(--game-surface); text-align: left; transition: background .14s, box-shadow .14s; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) { .bulb-study .ornament-picker:hover { border-color: var(--game-line); background: #363a43; } }
.bulb-study .ornament-picker:disabled { opacity: .5; }
.bulb-study .ornament-picker:focus-visible { outline: 2px solid var(--game-selection); outline-offset: 3px; }
.bulb-study .ornament-picker[data-pointer-focus="true"]:focus-visible, .bulb-study .custom-select-trigger[data-pointer-focus="true"]:focus-visible { outline: none; }
.bulb-study .ornament-picker[aria-expanded="true"] { border-color: var(--game-line); background: #3b3f49; }
.ornament-thumbnail { position: relative; flex: 0 0 44px; width: 44px; height: 44px; overflow: hidden; border-radius: 8px; background: #d8dce2; }
.ornament-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.ornament-picker-copy { display: grid; gap: 5px; flex: 1; min-width: 0; }
.ornament-picker-copy strong { overflow: hidden; color: var(--game-text); font-size: 14px; font-weight: 650; line-height: 1.2; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.ornament-picker-copy > span { overflow: hidden; color: var(--game-muted); font-size:10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.picker-chevron { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: var(--game-muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bauble-editor[data-has-selection="true"] .ornament-picker { border-color: var(--game-line); background: #3b3f49; box-shadow: 0 1px 2px #00000026; }
.bauble-editor[data-has-selection="true"] .ornament-thumbnail::after { content: '✓'; position: absolute; right: 2px; bottom: 2px; display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--game-solid); border-radius: 50%; color: var(--game-solid); background: var(--game-text); font-size:11px; font-weight: 800; line-height: 1; }
.bauble-editor[data-has-selection="true"] #edit-selected-index { color: var(--game-muted); }
.editor-actions, .preview-actions { height: calc(var(--editor-action-height) + 9px); padding-top: 8px; margin-top: 10px; border-top: 1px solid var(--game-line); }
.editor-actions { display: flex; align-items: stretch; gap: 5px; }
.editor-actions:not(:has(button:not(:disabled))) { display: none; }
.editor-actions button:disabled { display: none; }
.bauble-editor:has(#edit-preview-actions:not([hidden])) .editor-actions { display: none; }
.bulb-study .tool-button { display: flex; flex: 1; min-width: 44px; flex-direction: row; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 7px 5px; border-color: transparent; border-radius: 8px; background: transparent; box-shadow: none; }
.bulb-study .editor-actions .tool-button { height: var(--editor-action-height); min-height: var(--editor-action-height); padding: 4px 5px; }
.tool-button svg { width: 17px; height: 17px; flex: 0 0 17px; }
.tool-button span:last-child { font-size:11px; line-height: 1.3; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) { .bulb-study .editor-actions .tool-button:hover { border-color: #ffffff22; background: #ffffff0a; } }
.bulb-study #edit-delete { color: var(--game-text); }
.bulb-study #edit-add { display: flex; flex-direction: column; gap: 4px; color: var(--game-primary-text); background: var(--game-primary); border-color: #ffffff12; border-radius: 10px; font-weight: 700; }
.bulb-study #edit-add svg { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) { .bulb-study #edit-add:hover { color: var(--game-primary-text); background: var(--game-primary-hover); } }
.bulb-study #edit-add[aria-pressed="true"] { color: var(--game-text); border-color: var(--game-muted); background: var(--game-surface); }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) { .bulb-study #edit-add[aria-pressed="true"]:hover { background: #3b3f49; } }
#edit-add-icon { transition: transform .14s; }
#edit-add[aria-pressed="true"] #edit-add-icon { transform: rotate(45deg); }
.dock-feedback { display: grid; gap: 0; margin-top: 0; pointer-events: none; }
.editor-message { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.region-legend { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; margin: 0; color: var(--game-muted); font-size:10px; line-height: 1.4; }
.region-swatch { display: inline-block; width: 13px; height: 6px; border-radius: 3px; }
.region-green { background: #36c970; }.region-red { background: #e96059; margin-left: 7px; }
.preview-actions { display: grid; grid-template-columns: minmax(0, 1fr) 78px; gap: 8px; pointer-events: auto; }
.preview-action-hint { display: flex; align-items: center; min-width: 0; height: var(--editor-action-height); margin: 0; color: var(--game-muted); font-size:11px; line-height: 1.5; }
.bulb-study .preview-actions button { display: flex; align-items: center; justify-content: center; gap: 7px; height: var(--editor-action-height); min-height: var(--editor-action-height); border-radius: 9px; box-shadow: none; font-size:12px; }
.preview-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bauble-keyboard-target { position: absolute; z-index: 3; width: 14px; height: 14px; transform: translate(-50%, -50%); pointer-events: none; }
.bauble-keyboard-target::before, .bauble-keyboard-target::after { content: ''; position: absolute; background: var(--game-accent); box-shadow: 0 0 0 1px var(--game-solid); }
.bauble-keyboard-target::before { left: 0; top: 6px; width: 14px; height: 2px; }
.bauble-keyboard-target::after { left: 6px; top: 0; width: 2px; height: 14px; }
.bulb-study .game-settings { position:absolute; z-index:90; top:max(14px, env(safe-area-inset-top)); bottom:max(14px, env(safe-area-inset-bottom)); right:max(14px, env(safe-area-inset-right)); display:flex; flex-direction:column; width:min(380px, calc(100% - 28px)); margin:0; padding:0; overflow:hidden; border:1px solid var(--game-line); border-radius:20px; background:var(--game-solid); box-shadow:0 12px 40px #00000026; animation:none; }
.bulb-study .settings-close { flex: 0 0 44px; min-width: 44px; min-height: 44px; padding: 0; font-size: 27px; font-weight: 350; line-height: 1; background: transparent; }
.settings-content { padding: 20px; }
.bulb-study .control-section { margin: 0 0 20px; padding-bottom: 20px; border-color: var(--game-line); }
.bulb-study .control-section h2 { margin: 0 0 12px; color: var(--game-text); font-size:12px; }
.two-buttons, .color-buttons, .bulb-study .angle-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.two-buttons { grid-template-columns: 1fr 1fr; }
.color-buttons button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.color-buttons span { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; border: 1px solid #88888830; background: var(--swatch); }
.bulb-study .control-note { margin: 9px 0 0; color: var(--game-muted); font-size:10px; line-height: 1.7; }
.brightness-control { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--game-muted); font-size:11px; }
.brightness-slider { display: block; width: 100%; margin: 10px 0 0; accent-color: var(--game-accent); }
.route-label { display: block; margin: 12px 0 6px; color: var(--game-muted); font-size:11px; }
.route-select { width: 100%; padding: 10px; border: 1px solid var(--game-line); border-radius: 10px; background: var(--game-solid); color: var(--game-text); font: inherit; font-size:11px; }
.bulb-study .custom-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--game-line); border-radius: 10px; color: var(--game-text); background: #ffffff06; font: inherit; font-size:12px; text-align: left; }
.bulb-study .custom-select-trigger[aria-expanded="true"] { border-color: var(--game-accent); background: #ffffff0a; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) { .bulb-study .custom-select-trigger:hover { border-color: var(--game-accent); background: #ffffff0a; } }
.custom-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-chevron { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: var(--game-muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .14s; }
[aria-expanded="true"] > .custom-select-chevron, [aria-expanded="true"] > .picker-chevron { transform: rotate(180deg); }
.custom-select-popup { position: fixed; z-index: 110; display: flex; flex-direction: column; max-width: calc(100vw - 24px); overflow: hidden; padding: 5px; border: 1px solid var(--game-line); border-radius: 12px; background: var(--game-solid); color: var(--game-text); box-shadow: 0 14px 40px #0000003d, 0 2px 8px #00000026; color-scheme: dark; }
.custom-select-heading { flex: 0 0 auto; padding: 10px 10px 11px; margin-bottom: 4px; border-bottom: 1px solid var(--game-line); color: var(--game-accent); font-size:11px; font-weight: 650; line-height: 1.4; }
.custom-select-list { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: #b8bec955 transparent; }
.custom-select-option { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; color: var(--game-text); background: transparent; font: inherit; font-size:12px; line-height: 1.4; text-align: left; cursor: pointer; user-select: none; }
.custom-select-option + .custom-select-option { margin-top: 3px; }
.custom-select-option[data-active="true"] { border-color: #e7e9ef55; background: #363a43; }
.custom-select-option[aria-selected="true"] { border-color: transparent; background: #3b3f49; }
.custom-select-option[aria-selected="true"][data-active="true"] { border-color: #e7e9ef55; background: #454a55; }
.custom-select-option[aria-disabled="true"] { opacity: .4; cursor: default; }
.custom-select-thumb { flex: 0 0 34px; width: 34px; height: 34px; overflow: hidden; border-radius: 6px; background: #d8dce2; }
.custom-select-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.custom-select-option-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-check { flex: 0 0 17px; width: 17px; height: 17px; margin-left: auto; opacity: 0; fill: none; stroke: var(--game-selection); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.custom-select-option[aria-selected="true"] .custom-select-check { opacity: 1; }
.local-tree-label { display: block; margin-top: 12px; color: var(--game-muted); font-size:11px; }
#tree-file { width: 100%; margin-top: 7px; color: var(--game-muted); font-size:10px; }
#tree-file::file-selector-button { padding: 6px 10px; margin-right: 8px; border: 1px solid var(--game-line); border-radius: 7px; color: var(--game-text); background: var(--game-surface); font: inherit; cursor: pointer; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) { #tree-file::file-selector-button:hover { background: #3b3f49; } }
.route-detail { margin: 14px 0; font-size:11px; }
.route-detail summary { cursor: pointer; color: var(--game-text); }
#rebuild-route { width: 100%; margin-top: 12px; }
.bauble-toggle { display: flex; gap: 8px; align-items: center; color: var(--game-text); font-size:11px; }
.bauble-toggle input { width: 17px; height: 17px; accent-color: var(--game-accent); }
.advanced-controls > summary { padding: 4px 0 8px; color: var(--game-muted); font-size:11px; cursor: pointer; }
.advanced-content { padding-top: 14px; }
.bulb-study .reference-card { margin: 0 0 20px; }
.bulb-study .reference-card figcaption { color: var(--game-muted); font-size:10px; }
.bulb-study .reference-open, .bulb-study .reference-hint { color: var(--game-muted); }
.bulb-study .reference-card a { min-height: 100px; border-color: var(--game-line); border-radius: 12px; background: var(--game-backdrop-day); }
.bulb-study .reference-card img { height: 130px; padding: 8px; }
.reference-status { color: var(--game-muted); }
.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; }
@keyframes game-drawer-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes game-toast-in { from { opacity: 0; transform: translate(-50%, -5px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 720px) {
  .branch-study.bulb-study { --game-safe-top: 88px; --game-safe-bottom: 254px; }
  .game-hud { top: max(14px, calc(env(safe-area-inset-top) + 8px)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); gap: 10px; }
  .game-brand { gap: 9px; }.game-emblem { width: 39px; height: 39px; border-radius: 10px; }.game-brand h1 { font-size: 19px; }.game-brand .eyebrow { font-size: 7px; }
  .bulb-study .game-icon-button { width: 44px; min-width: 44px; padding: 10px; border-radius: 10px; }
  .game-icon-button > span { display: none; }
  .game-toast { top: max(78px, calc(env(safe-area-inset-top) + 70px)); }
  .bauble-editor { width: calc(100% - 24px); max-width: 480px; bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px)); border-radius: 14px; }
}
@media (max-width:720px), (hover:none) and (pointer:coarse) {
  .game-hud-actions { display:none; }
  .bulb-study #game-settings-mobile-toggle { position:absolute; right:0; top:-54px; display:inline-flex; width:auto; min-width:88px; height:44px; padding:10px 13px; background:var(--game-solid); }
  #game-settings-mobile-toggle > span { display:inline; }
}
@media (max-width: 360px) {
  .editor-tool-row { grid-template-columns: minmax(0, 1fr) 62px; gap: 8px; }
  .bulb-study .ornament-picker { padding: 7px; gap: 7px; }
  .ornament-thumbnail { flex-basis: 38px; width: 38px; height: 38px; }
  .ornament-picker-copy strong { font-size:13px; }
  .ornament-picker-copy > span { font-size:9px; }
  .bulb-study .editor-actions .tool-button { flex-direction: column; gap: 3px; }
  .tool-button span:last-child { font-size:10px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .branch-study.bulb-study { --game-safe-top: 72px; --game-safe-bottom: 20px; --game-safe-right: 340px; }
  .game-hud { top: max(12px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); }
  .game-brand h1 { font-size: 18px; }.game-brand .eyebrow { font-size: 7px; }
  .bauble-editor { left: auto; right: max(14px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: 300px; max-width: calc(100% - 28px); transform: none; }
  .editor-tool-row { grid-template-columns: minmax(0, 1fr) 60px; gap: 8px; }
  .bulb-study .ornament-picker { min-height: 58px; padding: 7px; gap: 7px; }
  .ornament-thumbnail { flex-basis: 38px; width: 38px; height: 38px; }
  .ornament-picker-copy strong { font-size:13px; }
  .ornament-picker-copy > span { font-size:9px; }
  .editor-actions .tool-button { flex-direction: column; gap: 3px; padding: 4px; }
  .editor-actions .tool-button span:last-child { font-size:10px; }
}
@media (prefers-reduced-motion: reduce) { .bulb-study button, .custom-select-chevron, #edit-add-icon { transition: none; }.game-settings, .game-toast { animation: none !important; } }

.ornament-types { display:flex; grid-column:1; grid-row:3; align-self:start; gap:8px; height:calc(var(--editor-action-height) + 9px); margin:10px 0 0; padding-top:8px; border-top:1px solid var(--game-line); }
.ornament-types[hidden] { display:none; }
.bauble-editor[data-mode="add"] .editor-actions, .bauble-editor[data-has-preview="true"] .ornament-types { display:none; }
.bulb-study .ornament-types button { display:flex; align-items:center; justify-content:center; gap:7px; flex:1; min-height:44px; padding:5px 10px; border:1px solid var(--game-line); border-radius:9px; background:var(--game-surface); color:var(--game-text); font:inherit; font-size:12px; }
.bulb-study .ornament-types button[aria-pressed="true"] { border-color:var(--game-selection); background:#414650; }
.ornament-types img { width:32px; height:32px; border-radius:5px; object-fit:cover; }

/* Settings leave a clear, live view of the tree. */
body[data-game-settings-open="true"] .bauble-editor,
body[data-game-settings-open="true"] .stage-hint,
body[data-game-settings-open="true"] .game-world-guide { visibility:hidden; }
.settings-content { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; scroll-padding-top:44px; scrollbar-width:thin; scrollbar-color:#b8bec955 transparent; }
@media(max-height:560px) and (orientation:landscape) {
  .bulb-study .game-settings { width:290px; top:8px; right:8px; bottom:8px; border-radius:16px; }
  .settings-content { padding:12px 14px; }
}

/* Consumer controls: compact spacing and styled native range semantics. */
.bulb-study .settings-content .control-section { margin-bottom:14px; padding-bottom:14px; }
.bulb-study .settings-content .control-section:last-child { margin-bottom:0; padding-bottom:0; border-bottom:0; }
.bulb-study .settings-content .control-section h2 { margin-bottom:8px; }
.settings-content .brightness-slider + .angle-buttons { margin-top:8px; }
.bulb-study .game-settings { gap:0; overflow:hidden; }
.settings-content .control-section > .brightness-control:first-child { margin-top:0; }
.settings-content { padding:4px 18px 18px; border-radius:0; }

/* Vertical settings pans must remain native even when they start on a control. */
#game-settings .settings-content,
#game-settings button,
#game-settings input[type=range] { touch-action:pan-y; }
#game-settings input[type=range]::-webkit-slider-thumb { touch-action:pan-y; }
#game-settings input[type=range]::-moz-range-thumb { touch-action:pan-y; }
#game-settings input[type=range] { --settings-range-thumb-size:18px; }
#room-walk-controls { position:absolute; z-index:45; left:max(24px,env(safe-area-inset-left)); bottom:max(28px,env(safe-area-inset-bottom)); display:flex; align-items:end; gap:18px; pointer-events:none; }
#room-walk-controls[hidden] { display:none; }
#room-walk-controls p { margin:0 0 14px; color:#f5efdf; text-shadow:0 1px 5px #000; font-size:12px; line-height:1.8; }
#room-walk-joystick { position:relative; width:120px; height:120px; flex:0 0 auto; border:1px solid #f2e6ce70; border-radius:50%; background:#25282e80; box-shadow:inset 0 0 25px #0004; pointer-events:auto; touch-action:none; user-select:none; }
#room-walk-knob { display:block; position:absolute; left:36px; top:36px; width:48px; height:48px; border:1px solid #fff6; border-radius:50%; background:#e1e5eddc; box-shadow:0 3px 10px #0004; }
.walk-touch-hint { display:none; }
body[data-room-walk=true] #bauble-editor,
body[data-room-walk=true] .stage-hint { display:none; }
body[data-game-settings-open=true] #room-walk-controls { visibility:hidden; }
body[data-room-walk=true] .game-hud-actions { display:flex; }
@media (max-width:720px) {
  .game-hud-actions { display:flex; }
  body:not([data-room-walk=true]) #game-settings-toggle { display:none; }
  .bulb-study #room-walk-toggle { width:auto; min-width:44px; padding:10px; }
  #room-walk-toggle > span { display:inline; font-size:11px; }
  #room-walk-controls { left:max(22px,env(safe-area-inset-left)); bottom:max(24px,env(safe-area-inset-bottom)); gap:14px; }
  #room-walk-controls p { font-size:11px; }
  .walk-touch-hint { display:inline; }
  .walk-key-hint { display:none; }
}
.settings-topbar { display:flex; align-items:center; justify-content:flex-end; flex:0 0 48px; padding:8px 12px 4px; }
.color-heading { display:flex; align-items:center; gap:4px; margin-bottom:6px; }
.bulb-study .settings-content .color-heading h2 { margin:0 4px 0 0; }
.bulb-study .color-off { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; padding:0; border-color:transparent; background:transparent; }
.color-off svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.color-pattern-row { margin-bottom:10px; }
.bulb-study .color-pattern-buttons { grid-template-columns:repeat(3,minmax(0,1fr)); margin:0; }
.bulb-study .color-pattern-row button { min-width:0; min-height:44px; padding:7px 4px; font-size:12px; white-space:nowrap; }
.bulb-study .color-buttons { grid-template-columns:repeat(7,minmax(0,1fr)); gap:2px; }
.bulb-study .color-buttons button { min-width:0; height:44px; padding:0; border-color:transparent; background:transparent; }
.bulb-study .color-buttons span { width:clamp(30px,9vw,38px); height:clamp(30px,9vw,38px); flex:0 0 auto; border:1px solid #ffffff30; transition:box-shadow .12s; }
.bulb-study .color-buttons button[aria-pressed="true"] { border-color:transparent; background:transparent; }
.bulb-study .color-buttons button[aria-pressed="true"] span { box-shadow:0 0 0 2px var(--game-solid),0 0 0 3px var(--game-text); }
.bulb-study .color-random { display:block; width:auto; min-height:36px; margin:8px 0 0 auto; padding:7px 14px; font-size:12px; }
.bulb-study .color-random[hidden] { display:none; }
@media(prefers-reduced-motion:reduce) { .bulb-study .color-buttons span { transition:none; } }
.bulb-study .color-buttons[hidden] { display:none; }
.brightness-control { margin-top:10px; font-size:12px; }
.bulb-study input[type="range"].brightness-slider { --range-fill:50%; display:block; width:100%; height:32px; margin:2px 0 0; padding:0; appearance:none; -webkit-appearance:none; border:0; border-radius:0; outline:none; background:transparent; cursor:pointer; }
.brightness-slider::-webkit-slider-runnable-track { height:4px; border-radius:999px; background:linear-gradient(to right,var(--game-text) 0%,var(--game-text) var(--range-fill),#ffffff24 var(--range-fill),#ffffff24 100%); }
.brightness-slider::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:18px; height:18px; margin-top:-7px; border:2px solid var(--game-solid); border-radius:50%; background:var(--game-text); box-shadow:0 0 0 1px #ffffff3b,0 2px 5px #00000026; cursor:grab; transition:box-shadow .12s,background .12s; }
.brightness-slider::-moz-range-track { height:4px; border-radius:999px; background:#ffffff24; }
.brightness-slider::-moz-range-progress { height:4px; border-radius:999px; background:var(--game-text); }
.brightness-slider::-moz-range-thumb { width:14px; height:14px; border:2px solid var(--game-solid); border-radius:50%; background:var(--game-text); box-shadow:0 0 0 1px #ffffff3b,0 2px 5px #00000026; cursor:grab; }
.brightness-slider:focus-visible::-webkit-slider-thumb { box-shadow:0 0 0 1px var(--game-text),0 0 0 5px #e7e9ef2b; }
.brightness-slider:focus-visible::-moz-range-thumb { box-shadow:0 0 0 1px var(--game-text),0 0 0 5px #e7e9ef2b; }
.brightness-slider:active::-webkit-slider-thumb { background:#fff9ee; box-shadow:0 0 0 1px var(--game-text),0 0 0 5px #e7e9ef26; cursor:grabbing; }
.brightness-slider:active::-moz-range-thumb { background:#fff9ee; cursor:grabbing; }
@media(max-width:720px) and (orientation:portrait) {
  .bulb-study .game-settings { top:auto; left:0; right:0; bottom:0; width:100%; height:min(42dvh,380px); min-height:280px; max-height:calc(100dvh - 120px); border-left:0; border-right:0; border-bottom:0; border-radius:20px 20px 0 0; }
  .settings-content { padding:4px 16px max(14px,env(safe-area-inset-bottom)); }
}

/* One continuous control list, with a small close action kept within reach. */
.bulb-study .settings-topbar .settings-close { flex:0 0 36px; width:36px; min-width:36px; height:36px; min-height:36px; padding:0; border:0; border-radius:8px; color:var(--game-muted); background:transparent; font-size:25px; line-height:1; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) { .bulb-study .settings-topbar .settings-close:hover { color:var(--game-text); background:#ffffff0c; } }

/* Pointer taps are quiet; keyboard focus stays visible inside each control. */
.game-page, .game-page * { -webkit-tap-highlight-color:transparent; }
body .bulb-study :is(button,a,input,select,summary):focus-visible,
body .bulb-study .ornament-picker:focus-visible,
body .custom-select-popup:focus-visible,
body .custom-select-option:focus-visible { outline-offset:-3px; }
body[data-input-method="pointer"] .bulb-study :is(button,a,input,select,summary,canvas):focus-visible,
body[data-input-method="pointer"] .bulb-study .ornament-picker:focus-visible,
body[data-input-method="pointer"] .custom-select-popup:focus-visible,
body[data-input-method="pointer"] .custom-select-option:focus-visible { outline:none; }
body[data-input-method="pointer"] .brightness-slider:focus-visible::-webkit-slider-thumb { box-shadow:0 0 0 1px #ffffff3b,0 2px 5px #00000026; }
body[data-input-method="pointer"] .brightness-slider:focus-visible::-moz-range-thumb { box-shadow:0 0 0 1px #ffffff3b,0 2px 5px #00000026; }
@media(max-width:720px),(hover:none),(pointer:coarse) {
  .game-page, .game-page * { scrollbar-width:none; }
  .game-page::-webkit-scrollbar, .game-page *::-webkit-scrollbar { display:none; width:0; height:0; }
}

.room-light-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.room-light-heading h2 { margin:0; }
.room-light-toggle { min-height:36px; min-width:64px; padding:6px 14px; border:1px solid var(--game-line); border-radius:18px; background:transparent; color:var(--game-muted); font:inherit; cursor:pointer; }
.room-light-toggle[aria-checked="true"] { color:var(--game-backdrop-night); background:var(--game-selection); border-color:var(--game-selection); }
.room-light-toggle:disabled { opacity:.45; cursor:default; }

/* Full-page object editing: see object-editor.css. */

.bulb-study .game-hud[hidden], .bulb-study .scene-ambient[hidden] { display: none; }
