@charset "UTF-8";

:root {
  color-scheme: dark;
  --ink: #f3f5f0;
  --muted: rgba(230, 235, 237, 0.58);
  --faint: rgba(230, 235, 237, 0.52);
  --line: rgba(255, 255, 255, 0.34);
  --glass: rgba(12, 16, 25, 0.56);
  --accent: #d7ff72;
  --accent-rgb: 215, 255, 114;
  --secondary: #9de7d1;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

body[data-palette="solar"] { --accent: #ffc36b; --accent-rgb: 255, 195, 107; --secondary: #ff8d70; }
body[data-palette="abyss"] { --accent: #88c8ff; --accent-rgb: 136, 200, 255; --secondary: #c0a7ff; }

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #070910; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button { border: 0; cursor: pointer; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: #11150d; }

#universe { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#universe:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
body[data-tool="seed"] #universe { cursor: cell; }
.atmosphere { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 45%, transparent 20%, rgba(0, 0, 0, 0.18) 65%, rgba(0, 0, 0, 0.56) 120%), linear-gradient(90deg, rgba(4, 6, 10, 0.36), transparent 55%); }
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: 0.16; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.26'/%3E%3C/svg%3E"); }
.interface { position: relative; z-index: 5; transition: opacity 500ms ease, visibility 500ms; }
.studio-only { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 650ms ease, visibility 650ms; }
body.is-entered .studio-only { opacity: 1; visibility: visible; pointer-events: auto; }
body.ui-hidden .interface { opacity: 0 !important; visibility: hidden; pointer-events: none !important; }

.topbar { position: fixed; z-index: 8; top: 0; left: 0; right: 0; padding: max(28px, var(--safe-top)) max(38px, var(--safe-right)) max(28px, var(--safe-bottom)) max(38px, var(--safe-left)); display: flex; align-items: center; justify-content: space-between; }
.space-brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-galaxy { width: 38px; height: 38px; position: relative; display: block; border: 1px solid rgba(var(--accent-rgb), 0.6); border-radius: 50%; transform: rotate(-25deg); }
.brand-galaxy::before { content: ""; position: absolute; inset: 6px -5px; border: 1px solid rgba(var(--accent-rgb), 0.38); border-radius: 50%; }
.brand-galaxy i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); top: 1px; right: 3px; box-shadow: 0 0 14px var(--accent); }
.brand-galaxy b { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); top: 14px; left: 14px; }
.brand-type { font-size: 14px; font-weight: 650; letter-spacing: 3px; line-height: 1.1; }
.brand-type small { display: block; margin-top: 6px; font-size: 7px; font-weight: 500; letter-spacing: 2.6px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.glass-button { height: 38px; background: rgba(12, 16, 24, 0.36); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.palette-button { display: inline-flex; align-items: center; gap: 9px; padding: 0 14px; border-radius: 30px; font-size: 11px; color: var(--muted); }
.palette-swatch { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--secondary)); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.4); }
.help-button { width: 38px; border-radius: 50%; font-family: Georgia, serif; font-size: 15px; color: var(--muted); }
.glass-button:hover { border-color: rgba(var(--accent-rgb), 0.45); color: var(--ink); }
.home-link { display: inline-flex; align-items: center; gap: 8px; margin-inline: 10px; font-size: 11px; color: var(--muted); }
.home-link svg { width: 15px; height: 15px; transition: transform 180ms ease; }
.home-link:hover { color: var(--ink); }
.home-link:hover svg { transform: translate(2px, -2px); }

.intro { position: fixed; left: max(clamp(38px, 8vw, 138px), var(--safe-left)); top: 50%; transform: translateY(-48%); max-width: 850px; transition: opacity 600ms ease, transform 700ms cubic-bezier(.2,.7,.2,1), visibility 600ms; }
body.is-entered .intro { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-53%); }
.overline { display: flex; align-items: center; gap: 12px; margin: 0 0 28px; font-size: 10px; font-weight: 550; letter-spacing: 3.6px; color: var(--secondary); }
.overline > span { width: 28px; height: 1px; background: currentColor; }
.intro h1 { font-family: var(--serif); font-size: clamp(70px, 8.5vw, 132px); font-weight: 500; line-height: 1.08; letter-spacing: -0.07em; margin: 0; text-shadow: 0 3px 35px rgba(0, 0, 0, 0.35); }
.intro h1 em { font-style: normal; color: transparent; background: linear-gradient(100deg, #f4f5ef 8%, var(--secondary) 58%, var(--accent)); -webkit-background-clip: text; background-clip: text; }
.intro-copy { margin: 32px 0 0; font-size: 15px; line-height: 2; letter-spacing: 0.08em; color: var(--muted); }
.enter-button { margin-top: 34px; padding: 7px 8px 7px 24px; min-height: 58px; display: inline-flex; align-items: center; gap: 30px; border: 1px solid rgba(var(--accent-rgb), 0.4); border-radius: 50px; background: rgba(12, 17, 22, 0.48); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 13px; letter-spacing: 0.08em; transition: background 200ms ease, border-color 200ms ease, transform 200ms ease; }
.enter-button i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #11150d; }
.enter-button svg { width: 20px; height: 20px; transition: transform 200ms ease; }
.enter-button:hover { background: rgba(var(--accent-rgb), 0.1); border-color: var(--accent); transform: translateY(-2px); }
.enter-button:hover svg { transform: translateX(3px); }
.entry-hint { margin: 18px 0 0 4px; font-size: 9px; letter-spacing: 1.1px; color: var(--faint); }

.scene-narrative { position: fixed; left: max(42px, var(--safe-left)); top: max(142px, calc(var(--safe-top) + 104px)); }
.scene-narrative > p:first-child { margin: 0 0 12px; font-size: 8px; letter-spacing: 2.5px; color: var(--accent); }
.scene-narrative h2 { margin: 0; font-family: var(--serif); font-size: 40px; font-weight: 500; letter-spacing: 0.08em; }
.scene-narrative > p:last-child { margin: 13px 0 0; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.whisper { position: fixed; left: max(44px, var(--safe-left)); bottom: max(130px, calc(var(--safe-bottom) + 96px)); padding-left: 16px; border-left: 1px solid rgba(var(--accent-rgb), 0.45); }
.whisper > span { font-size: 7px; letter-spacing: 2px; color: var(--faint); }
.whisper p { margin: 8px 0 0; font-family: var(--serif); font-size: 14px; line-height: 1.8; color: var(--muted); }
.scene-switcher { position: fixed; right: max(34px, var(--safe-right)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.scene-button { width: 86px; padding: 12px 10px; display: flex; align-items: center; gap: 12px; background: transparent; border-right: 1px solid var(--line); color: var(--faint); font-size: 11px; letter-spacing: 0.12em; text-align: left; transition: color 180ms ease, border-color 180ms ease, background 180ms ease; }
.scene-button span { font-size: 8px; letter-spacing: 0; }
.scene-button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.scene-button.active { color: var(--accent); border-color: var(--accent); }

.bottom-ui { position: fixed; z-index: 8; left: max(34px, var(--safe-left)); right: max(34px, var(--safe-right)); bottom: max(24px, var(--safe-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; }
.live-stats { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 9px; letter-spacing: 0.8px; color: var(--muted); }
.live-indicator { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: breathe 3s ease-in-out infinite; }
.live-stats > i { width: 1px; height: 10px; background: var(--line); }
.live-stats button { padding: 5px 0; background: transparent; color: inherit; font-size: inherit; }
.live-stats button:hover { color: var(--accent); }
.creation-dock { display: flex; gap: 3px; padding: 6px; border: 1px solid var(--line); border-radius: 20px; background: var(--glass); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.dock-button { min-width: 76px; min-height: 62px; padding: 9px 12px 8px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border-radius: 14px; background: transparent; color: var(--muted); transition: background 180ms ease, color 180ms ease, transform 180ms ease; }
.dock-button > svg { width: 21px; height: 21px; }
.dock-button > span { font-size: 10px; letter-spacing: 0.12em; }
.dock-button kbd { position: absolute; top: 6px; right: 7px; font-size: 7px; color: var(--faint); font-family: inherit; }
.dock-button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); transform: translateY(-2px); }
.dock-button.active { color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.dock-button[aria-pressed="true"]#soundButton { color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.sound-on-icon { display: none; }
#soundButton[aria-pressed="true"] .sound-on-icon { display: block; }
#soundButton[aria-pressed="true"] .sound-off-icon { display: none; }
.right-tools { justify-self: end; display: flex; align-items: center; gap: 14px; }
.record-button { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border: 1px solid transparent; border-radius: 22px; background: transparent; color: var(--muted); font-size: 9px; letter-spacing: 1px; transition: color 180ms ease, border-color 180ms ease, background 180ms ease; }
.record-button > svg { width: 17px; height: 17px; }
#recordTimer { min-width: 5ch; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; text-align: end; }
#recordTimer:empty { display: none; }
.record-button:hover { color: var(--ink); border-color: var(--line); }
#recordButton[aria-pressed="true"] { color: #ff9c92; border-color: rgba(255, 156, 146, 0.65); background: rgba(255, 156, 146, 0.08); }
#recordButton[aria-pressed="true"] kbd { border-color: rgba(255, 156, 146, 0.65); }
.immersive-button { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; background: transparent; color: var(--muted); font-size: 9px; letter-spacing: 1px; }
kbd { font-family: var(--sans); font-weight: 400; }
.immersive-button kbd, .record-button kbd, .show-ui-button kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; font-size: 8px; }
.immersive-button:hover { color: var(--ink); }
.show-ui-button { display: none; position: fixed; z-index: 20; bottom: max(22px, var(--safe-bottom)); left: 50%; transform: translateX(-50%); align-items: center; gap: 10px; max-width: calc(100vw - var(--safe-left) - var(--safe-right) - 24px); padding: 10px 16px; border: 1px solid var(--line); border-radius: 30px; background: rgba(10, 14, 21, 0.45); backdrop-filter: blur(14px); color: var(--muted); font-size: 10px; opacity: 1; transition: color 180ms ease, border-color 180ms ease; }
.show-ui-button:hover { color: var(--ink); border-color: var(--accent); }
body.ui-hidden .show-ui-button { display: flex; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 116px; transform: translate(-50%, 12px); max-width: min(88vw, 520px); padding: 11px 18px; border: 1px solid var(--line); border-radius: 30px; background: rgba(10, 14, 22, 0.82); backdrop-filter: blur(20px); color: var(--ink); font-size: 11px; letter-spacing: 0.04em; text-align: center; opacity: 0; visibility: hidden; transition: opacity 220ms ease, transform 220ms ease, visibility 220ms; pointer-events: none; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 24px; background: rgba(13, 17, 26, 0.94); box-shadow: 0 35px 100px rgba(0, 0, 0, 0.45); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); margin: max(24px, var(--safe-top)) max(16px, var(--safe-right)) max(24px, var(--safe-bottom)) max(16px, var(--safe-left)); padding: 30px; overflow-y: auto; overscroll-behavior: contain; }
dialog::backdrop { background: rgba(3, 5, 9, 0.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
dialog[open] { animation: dialog-in 260ms cubic-bezier(.2,.7,.2,1); }
.thought-dialog { width: min(620px, calc(100vw - var(--safe-left) - var(--safe-right) - 32px)); max-height: min(820px, calc(100svh - var(--safe-top) - var(--safe-bottom) - 48px)); }
.help-dialog { width: min(680px, calc(100vw - var(--safe-left) - var(--safe-right) - 32px)); max-height: calc(100svh - var(--safe-top) - var(--safe-bottom) - 48px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-kicker { margin: 0 0 12px; font-size: 8px; letter-spacing: 2.4px; color: var(--accent); }
.dialog-header h2 { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: -0.03em; }
.dialog-close { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; font-weight: 300; line-height: 1; }
.dialog-close:hover { color: var(--ink); border-color: var(--accent); }
#thoughtForm { margin-top: 28px; }
#thoughtInput { width: 100%; resize: vertical; min-height: 110px; max-height: 220px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.035); color: var(--ink); font-size: 15px; line-height: 1.8; }
#thoughtInput::placeholder { color: var(--faint); }
#thoughtInput:focus { border-color: rgba(var(--accent-rgb), 0.55); }
#thoughtInput:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.composer-bottom > span { font-size: 9px; color: var(--faint); }
.composer-bottom > span b { font-weight: 400; }
.primary-dialog-button { display: inline-flex; align-items: center; gap: 10px; padding: 11px 17px; border-radius: 30px; background: var(--accent); color: #12160e; font-size: 11px; font-weight: 600; }
.primary-dialog-button svg { width: 16px; height: 16px; }
.primary-dialog-button:hover { filter: brightness(1.08); }
.library-heading { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.library-heading h3 { margin: 0; font-size: 12px; font-weight: 500; }
.library-heading > span { font-size: 9px; color: var(--faint); }
.thought-list { margin-top: 12px; max-height: 260px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.empty-thoughts { padding: 28px 10px; text-align: center; color: var(--faint); font-family: var(--serif); font-size: 14px; line-height: 1.8; }
.thought-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: start; padding: 15px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.thought-item:last-child { border-bottom: 0; }
.thought-star { width: 5px; height: 5px; margin-top: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.thought-item p { margin: 0; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.thought-item time { display: block; margin-top: 6px; font-size: 8px; letter-spacing: 0.5px; color: var(--faint); }
.delete-thought { width: 28px; height: 28px; background: transparent; color: var(--faint); font-size: 16px; }
.delete-thought:hover { color: #ff9c92; }

.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 32px; margin-top: 34px; }
.guide-grid > div > span { font-size: 9px; color: var(--accent); }
.guide-grid h3 { margin: 8px 0; font-size: 14px; font-weight: 550; }
.guide-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.shortcut-list { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.shortcut-list > span { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; color: var(--muted); }
.shortcut-list kbd { min-width: 20px; padding: 3px 5px; text-align: center; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font-size: 8px; }
.shortcut-setting { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.shortcut-setting label { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--ink); cursor: pointer; }
.shortcut-setting input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.shortcut-setting > span { color: var(--faint); font-size: 10px; }
.help-note { margin: 26px 0 0; text-align: center; font-family: var(--serif); color: var(--faint); font-size: 13px; }
.noscript-message { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 40px; background: #070910; text-align: center; }
.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 breathe { 0%, 100% { opacity: 0.45; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 900px) {
  .intro { left: max(42px, var(--safe-left)); right: max(42px, var(--safe-right)); }
  .intro h1 { font-size: clamp(66px, 10.5vw, 96px); }
  .whisper { display: none; }
  .live-stats { visibility: hidden; }
  .bottom-ui { grid-template-columns: 1fr auto 1fr; }
}

@media (max-width: 640px) {
  .topbar { padding: max(20px, var(--safe-top)) max(20px, var(--safe-right)) max(20px, var(--safe-bottom)) max(20px, var(--safe-left)); }
  .brand-galaxy { width: 32px; height: 32px; }
  .brand-galaxy b { top: 11px; left: 11px; }
  .brand-type { font-size: 11px; letter-spacing: 2.4px; }
  .brand-type small { font-size: 6px; letter-spacing: 1.8px; }
  .space-brand { gap: 10px; }
  .top-actions { gap: 8px; }
  .home-link { display: none; }
  .palette-button { padding: 0 11px; }
  .glass-button { height: 34px; }
  .help-button { width: 34px; }
  .intro { left: max(24px, var(--safe-left)); right: max(24px, var(--safe-right)); top: 47%; }
  .overline { margin-bottom: 24px; font-size: 8px; letter-spacing: 2.5px; }
  .intro h1 { font-size: clamp(52px, 15vw, 78px); line-height: 1.13; }
  .intro-copy { margin-top: 26px; font-size: 13px; }
  .enter-button { margin-top: 28px; min-height: 54px; padding-left: 21px; gap: 22px; font-size: 12px; }
  .enter-button i { width: 38px; height: 38px; }
  .entry-hint { max-width: 290px; line-height: 1.8; font-size: 8px; }
  .scene-narrative { display: none; }
  .scene-switcher { top: calc(var(--safe-top) + 92px); left: max(20px, var(--safe-left)); right: max(20px, var(--safe-right)); transform: none; flex-direction: row; justify-content: center; gap: 4px; }
  .scene-button { width: auto; min-width: 0; flex: 0 1 80px; justify-content: center; gap: 6px; padding: 9px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .scene-button.active { border-color: var(--accent); }
  .bottom-ui { left: max(12px, var(--safe-left)); right: max(12px, var(--safe-right)); bottom: max(14px, var(--safe-bottom)); display: flex; justify-content: center; }
  .live-stats, .immersive-button { display: none; }
  .right-tools { position: absolute; right: 0; bottom: calc(100% + 12px); }
  .record-button { min-height: 44px; padding: 0 12px; border-color: var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .record-button kbd { display: none; }
  .creation-dock { gap: 1px; padding: 5px; border-radius: 18px; }
  .dock-button { min-width: 60px; min-height: 58px; padding: 8px 10px; border-radius: 13px; }
  .dock-button > svg { width: 20px; height: 20px; }
  .dock-button > span { font-size: 9px; }
  .dock-button kbd { display: none; }
  .toast { bottom: max(152px, calc(var(--safe-bottom) + 138px)); font-size: 10px; }
  dialog { margin: max(16px, var(--safe-top)) max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left)); padding: 24px 20px; border-radius: 20px; }
  .dialog-header h2 { font-size: 24px; }
  .guide-grid { gap: 22px; }
  .guide-grid p { font-size: 11px; }
  .thought-dialog, .help-dialog { max-height: calc(100svh - var(--safe-top) - var(--safe-bottom) - 32px); }
}

@media (max-width: 370px) {
  .brand-type small { display: none; }
  .palette-button #paletteName { display: none; }
  .dock-button { min-width: 55px; padding-inline: 8px; }
  .intro h1 { font-size: 52px; }
}

@media (max-height: 560px) {
  html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  body { min-height: 100svh; }
  .topbar { position: absolute; }
  .scene-switcher { gap: 4px; }
  .intro { position: relative; left: auto; right: auto; top: auto; transform: none; width: 100%; max-width: 850px; min-height: 100svh; margin: 0; padding: max(112px, calc(var(--safe-top) + 88px)) max(clamp(24px, 8vw, 138px), var(--safe-right)) max(56px, calc(var(--safe-bottom) + 32px)) max(clamp(24px, 8vw, 138px), var(--safe-left)); }
  body.is-entered .intro { display: none; }
}

@media (max-width: 370px) and (max-height: 280px) {
  .topbar { padding: var(--safe-top) max(12px, var(--safe-right)) 0 max(12px, var(--safe-left)); }
  .scene-switcher { top: calc(var(--safe-top) + 48px); left: max(12px, var(--safe-left)); right: max(12px, var(--safe-right)); }
  .scene-button { gap: 4px; padding-inline: 4px; font-size: 10px; }
  .bottom-ui { bottom: max(8px, var(--safe-bottom)); }
  .record-button { gap: 6px; padding-inline: 8px; }
  .toast { left: max(12px, var(--safe-left)); right: auto; bottom: max(97px, calc(var(--safe-bottom) + 89px)); transform: translate(0, 12px); max-width: calc(100vw - var(--safe-left) - var(--safe-right) - 132px); padding: 6px 10px; font-size: 10px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toast.show { transform: translate(0, 0); }
}

@media (max-width: 640px), (pointer: coarse) {
  .palette-button { min-width: 44px; }
  .glass-button { height: 44px; min-height: 44px; }
  .help-button { width: 44px; min-width: 44px; flex: 0 0 44px; }
  .scene-button { min-width: 44px; min-height: 44px; }
  .record-button { min-width: 44px; min-height: 44px; }
  .dialog-close { width: 44px; height: 44px; }
  .primary-dialog-button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
