@charset "UTF-8";

/* Original dark rose theme; the light theme uses softer, warmer surfaces. */
:root {
  color-scheme: dark;
  --bg-0: #181419;
  --bg-1: #211821;
  --text: #fff6fa;
  --muted: #c5bfc9;
  --muted-strong: #e2d9e1;
  --card: #231d24;
  --card-strong: #231d24;
  --card-inner: #1b171d;
  --card-inner-hover: #382631;
  --soft: #32232c;
  --soft-strong: #422b37;
  --line: #463440;
  --line-strong: #725060;
  --pink: #ffa2b7;
  --cyan: #f9b0c0;
  --violet: #eba4bd;
  --mint: #eca0b5;
  --gold: #eca0b5;
  --focus: #ff9ab2;
  --action-red: #be2046;
  --action-red-hover: #a7193a;
  --action-text: #ffffff;
  --status-online: #22c55e;
  --status-online-border: #15803d;
  --font: "Cascadia Mono", "Cascadia Code", "JetBrains Mono", Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
  font-family: var(--font);
  font-size: clamp(17px, 1.15vw, 20px);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg-0: #ded4d3;
  --bg-1: #e8dddb;
  --text: #30292f;
  --muted: #665661;
  --muted-strong: #493d47;
  --card: #e8dddb;
  --card-strong: #e8dddb;
  --card-inner: #d8cacc;
  --card-inner-hover: #cfbbc1;
  --soft: #d6c4c9;
  --soft-strong: #c9b0ba;
  --line: #c4afb6;
  --line-strong: #a57f8f;
  --pink: #9e3152;
  --cyan: #94334f;
  --violet: #86415b;
  --mint: #94334f;
  --gold: #8d4057;
  --focus: #a62d51;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { color: var(--text); background: var(--bg-0); line-height: 1.85; }
button, input { font: inherit; color: inherit; border: 0; background: none; border-radius: 0; }
button { padding: 0; cursor: pointer; touch-action: manipulation; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 4px; }
button:hover { color: var(--pink); }
button:disabled { opacity: .35; cursor: default; }
:where(a, button, input, select, [tabindex]):focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }
::selection { color: var(--bg-0); background: var(--pink); }
[hidden] { display: none !important; }
.boot-loading { display: none; }
html[data-boot="loading"] .boot-loading { position: fixed; inset: 0; display: grid; place-items: center; }
html[data-boot="loading"] #desktop { visibility: hidden; }
.dim { color: var(--muted); }
.key, .accent { color: var(--pink); }
.value { color: var(--text); }
.note { color: var(--gold); }
.error { color: var(--pink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 30; padding: 6px 12px; background: var(--bg-0); }
.skip-link:focus { top: 12px; }
#desktop { --terminal-inset: clamp(24px, 4vw, 120px); --terminal-width: min(50ch, 36vw); --scene-space: 92px; position: fixed; inset: 0; isolation: isolate; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; touch-action: pinch-zoom; cursor: crosshair; }
.topbar { position: absolute; z-index: 5; top: 0; left: 0; right: 0; padding: 14px 4.2vw; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 17px; }
.brand { text-decoration: none; white-space: nowrap; color: var(--text); background: var(--bg-0); background: color-mix(in srgb, var(--bg-0) 85%, transparent); }
.brand b { letter-spacing: .03em; }
.brand .dim { font-size: 14px; margin-left: 10px; opacity: .85; }
.topbar nav { display: flex; align-items: center; gap: 10px; background: var(--bg-0); background: color-mix(in srgb, var(--bg-0) 85%, transparent); padding: 0 4px; color: var(--muted-strong); }
.topbar nav :is(button, select, a) { font-size: 16px; min-height: 48px; padding: 4px 8px; white-space: nowrap; }
.topbar nav a { display: inline-flex; align-items: center; justify-content: center; color: inherit; text-decoration: none; }
.topbar nav a:hover { color: var(--pink); }
#theme-mode { font-family: inherit; color: inherit; background: var(--bg-0); border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.terminal { position: absolute; z-index: 3; top: 49.5%; left: var(--terminal-inset); width: var(--terminal-width); height: min(calc(100vh - 176px), 780px); height: min(calc(100dvh - 176px), 780px); transform: translateY(-50%); display: flex; flex-direction: column; background: var(--bg-0); background: color-mix(in srgb, var(--bg-0) 94%, transparent); padding: 14px 20px 10px; margin-left: -20px; }
.terminal { border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: inset 0 1px color-mix(in srgb, var(--pink) 14%, transparent), 0 12px 36px color-mix(in srgb, var(--bg-0) 32%, transparent); }
.terminal:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); box-shadow: inset 0 0 16px color-mix(in srgb, var(--focus) 8%, transparent), 0 0 0 1px color-mix(in srgb, var(--focus) 24%, transparent), 0 0 20px color-mix(in srgb, var(--focus) 18%, transparent); }
.terminal-path { display: flex; flex: none; gap: .8ch; align-items: center; font-size: 14px; line-height: 1.5; color: var(--muted); margin-bottom: 10px; letter-spacing: .05em; }
.terminal-path > span:first-child { color: var(--pink); }
.path-mark { margin-left: auto; font-size: 12px; }
.profile-head { flex: none; margin-bottom: 12px; }
.profile-name { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.profile-name h1 { font: 700 36px/1.25 var(--font); margin: 0; letter-spacing: -.035em; }
.profile-name h1 small { font-size: 15px; font-weight: 400; color: var(--pink); margin-left: 6px; letter-spacing: 0; }
.profile-tag { font-size: 13px; color: var(--muted); }
.profile-meta { font-size: 15px; line-height: 1.6; margin: 5px 0 8px; color: var(--muted-strong); }
.profile-meta > span { margin: 0 4px; color: var(--pink); }
.friend-invite { border-left: 3px solid var(--pink); padding-left: 12px; }
.friend-invite > p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; line-height: 1.5; }
.friend-invite strong { font-size: 18px; color: var(--pink); }
.friend-invite > p > span { font-size: 14px; color: var(--muted-strong); }
.friend-invite nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.friend-invite nav a, .friend-invite nav button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 4px 8px; font-size: 16px; text-decoration: none; white-space: nowrap; }
.friend-primary { color: var(--pink); font-weight: 700; }
.friend-primary:hover { background: var(--soft); }
.friend-number { color: var(--muted); font-size: 13px; }
.terminal-output { flex: 1; max-height: none; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding-right: 6px; font-size: 1em; line-height: 1.65; overflow-wrap: anywhere; }
.terminal-output:focus-visible { outline-offset: 2px; }
.terminal-output p { margin: 0 0 1em; }
.terminal-output .links-foot { margin-top: 1.4em; }
.terminal-output h1 { font: 700 clamp(30px, 2.6vw, 42px)/1.4 var(--font); letter-spacing: -.035em; margin: 0 0 .65em; }
.terminal-output h1 small { font-size: 14px; color: var(--pink); letter-spacing: 0; font-weight: 400; margin-left: 10px; white-space: nowrap; }
.terminal-output .profile-title { font-size: 1.25em; }
.gura-emote { display: inline-block; width: 18px; height: 18px; margin-left: 5px; vertical-align: -.2em; object-fit: contain; }
.terminal-output pre { font: inherit; white-space: pre-wrap; margin: 0; overflow-wrap: anywhere; }
.terminal-output .command-line { color: var(--muted); font-size: .85em; margin-bottom: .6em; }
.terminal-output .output-links { display: grid; grid-template-columns: 11ch 1fr; gap: .5em 1ch; margin-top: .5em; font-size: .9em; }
.terminal-output .output-links a { width: fit-content; }
.terminal-output .inline-button { color: var(--pink); border-bottom: 1px dashed var(--line-strong); }
.terminal-output .ascii-art { color: var(--pink); font-size: .9em; line-height: 1.5; white-space: pre; }
.help-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; gap: 12px; margin: 0; font-size: .94em; }
.help-list dt { color: var(--pink); overflow-wrap: anywhere; }
.help-list code { font: inherit; }
.help-list dd { margin: 0; color: var(--muted-strong); }
.help-hint { font-size: .9em; margin-top: 20px !important; }
.terminal-hint { flex: none; margin: 8px 0 0; font-size: 15px; color: var(--muted-strong); }
#command-form { display: flex; flex: none; align-items: center; gap: 1ch; border-top: 1px solid var(--line); padding-top: 7px; margin-top: 7px; font-size: 17px; }
#command-form label { color: var(--pink); white-space: nowrap; }
.command-entry { position: relative; display: flex; flex: 1; min-width: 0; overflow: hidden; border-bottom: 2px solid transparent; }
.command-entry:focus-within { border-bottom-color: var(--pink); background: var(--soft); background: color-mix(in srgb, var(--soft) 35%, transparent); }
#command { width: 100%; min-width: 0; min-height: 48px; padding: 8px 1ch 8px 4px; outline: 0; caret-color: var(--pink); }
#command[data-block-caret="true"] { caret-color: transparent; }
#command::placeholder { color: var(--muted); opacity: .8; }
.terminal-caret { position: absolute; top: 50%; transform: translateY(-50%); width: 1ch; height: 1.2em; background: var(--pink); opacity: .8; pointer-events: none; animation: terminal-blink 1.1s step-end infinite; }
@keyframes terminal-blink { 0%, 48%, 100% { opacity: .8; } 49%, 99% { opacity: 0; } }
#command-form > button { color: var(--pink); font-size: 26px; min-width: 48px; min-height: 48px; }
.quick-commands { display: flex; flex: none; flex-wrap: wrap; justify-content: space-between; gap: 2px 4px; font-size: 16px; color: var(--muted-strong); margin-top: 3px; }
.quick-commands button { min-height: 48px; padding: 4px; }
.quick-commands button::before { content: "["; color: var(--line-strong); margin-right: 4px; }
.quick-commands button::after { content: "]"; color: var(--line-strong); margin-left: 4px; }
.portrait { position: absolute; z-index: 1; left: calc(var(--terminal-inset) + var(--terminal-width) + 12px); right: var(--scene-space); top: 86px; bottom: 92px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.album-showcase {
  --album-height-limit: calc(100vh - 210px);
  --album-height-limit: calc(100dvh - 210px);
  position: absolute;
  z-index: 1;
  inset: 86px var(--scene-space) 92px calc(var(--terminal-inset) + var(--terminal-width) + 20px);
  display: grid;
  place-items: center;
  padding-inline: 10px clamp(44px, 7vw, 104px);
}
.album-release {
  grid-area: 1 / 1;
  display: grid;
  width: min(100%, 700px, var(--album-height-limit));
  min-width: 0;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
}
.album-artwork { position: relative; isolation: isolate; aspect-ratio: 1; }
.album-print { position: absolute; inset: 0; }
.album-artwork::before, .album-artwork::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4%;
  left: 23%;
  width: 92%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
}
.album-artwork::before {
  top: -1.75%;
  left: 17.25%;
  width: 103.5%;
  background: url("assets/album-record-desktop-v1.webp") center / 100% 100% no-repeat;
}
.album-artwork::after { display: none; }
.album-scan-image, .album-scan-glyphs {
  /* The 640px sleeve has 48px of transparent space on each side for the ink. */
  position: absolute;
  left: -7.5%;
  top: -7.5%;
  display: block;
  width: 115%;
  height: 115%;
  overflow: hidden;
  pointer-events: none;
}
.album-scan-image > img, .album-moving-ink, .album-glyphs { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.album-moving-ink, .album-scan-glyphs { display: none; }
.album-showcase:not([data-loading="false"]) .album-release { visibility: hidden; }
.album-showcase[data-loading="true"] .photo-loading { display: grid; }
.album-load-error { grid-area: 1 / 1; }
@media (hover: hover) and (pointer: fine) {
  html[data-motion="playing"] .album-artwork::before, html[data-motion="playing"] .album-artwork::after { transition: transform .28s ease-out; }
  html[data-motion="playing"] .album-release:hover .album-artwork::before, html[data-motion="playing"] .album-release:hover .album-artwork::after { transform: translateX(5px); }
}
.photo-grid { --photo-gap: 18px; position: relative; flex: 1; min-height: 0; isolation: isolate; touch-action: pan-y pinch-zoom; }
.photo-tile { position: absolute; min-width: 0; min-height: 0; text-align: left; cursor: zoom-in; }
.photo-tile[href] { cursor: pointer; text-decoration: none; }
.photo-tile:focus-visible { outline-offset: 3px; outline-style: dashed; }
.photo-visual { position: absolute; inset: 0; display: block; overflow: hidden; overflow: clip; }
.photo-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.photo-layer--glyphs { transform: translateY(100%); }
[data-photo-mode="ascii"] .photo-layer--image { visibility: hidden; }
[data-photo-mode="ascii"] .photo-layer--glyphs { transform: none; }
.photo-visual canvas, .photo-fallback { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-fallback { -webkit-mask-image: url("assets/photo-edge-mask.svg"); mask-image: url("assets/photo-edge-mask.svg"); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.photo-tile-label { position: absolute; bottom: 4%; left: 8%; right: 8%; display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.5; color: var(--muted-strong); opacity: 0; text-shadow: 0 0 5px var(--bg-0), 0 0 10px var(--bg-0); pointer-events: none; }
@media (min-width: 801px) and (hover: hover) and (pointer: fine) {
  .photo-tile:hover .photo-tile-label, .photo-tile:focus-visible .photo-tile-label { opacity: 1; }
}
.tile-number, .tile-open { color: var(--pink); flex: none; }
.tile-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-open { margin-left: auto; }
.portrait[data-loading="true"] .photo-tile { opacity: .3; }
.photo-loading { position: absolute; inset: 0; z-index: 4; display: none; place-items: center; pointer-events: none; }
.portrait[data-loading="true"] .photo-loading { display: grid; }
.photo-loading-label { position: relative; display: flex; align-items: center; gap: .65em; padding: .5em 0; color: var(--pink); font-size: clamp(18px, 1.2vw, 24px); text-shadow: 0 0 12px var(--bg-0), 0 0 24px var(--bg-0); }
.photo-loading-cursor { width: .65em; height: 1em; background: currentColor; animation: photo-loading-blink .7s step-end infinite; }
.photo-loading-label::after { content: ""; position: absolute; left: 0; bottom: 0; width: 35%; height: 2px; background: currentColor; animation: photo-loading-scan 1s ease-in-out infinite alternate; }
@keyframes photo-loading-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .2; } }
@keyframes photo-loading-scan { from { transform: translateX(0); opacity: .3; } to { transform: translateX(185%); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .photo-loading-cursor, .photo-loading-label::after { animation: none; } }
.portrait figcaption { position: relative; isolation: isolate; order: 1; flex: none; z-index: 2; font-size: 13px; color: var(--muted-strong); text-shadow: 0 0 5px var(--bg-0), 0 0 10px var(--bg-0); }
.portrait figcaption::before { content: ""; position: absolute; z-index: -1; inset: -10px -18px; background: var(--bg-0); opacity: .94; -webkit-mask-image: radial-gradient(ellipse, #000 52%, transparent 88%); mask-image: radial-gradient(ellipse, #000 52%, transparent 88%); pointer-events: none; }
.photo-file { display: flex; align-items: center; gap: 7px; padding: 3px 5px; }
.file-cross { color: var(--pink); font-size: 16px; }
#photo-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#photo-counter { margin-left: auto; white-space: nowrap; color: var(--pink); }
.photo-tools { display: flex; justify-content: center; gap: 8px; align-items: center; font-size: 15px; margin-top: 0; }
.photo-tools button { color: var(--pink); font-size: 26px; min-width: 48px; min-height: 48px; }
.photo-step-label, .photo-swipe-hint { display: none; }
#photo-caption { min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-toggle { display: block; font-size: 16px; min-height: 48px; padding: 6px; color: var(--muted-strong); }
.mode-toggle span { color: var(--pink); }
.mode-toggle[aria-pressed=true] { color: var(--pink); }
.photo-playback { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0 8px; margin-top: 0; }
.photo-playback .mode-toggle { margin: 0; }
#autoplay-toggle { font-size: 16px; min-width: 208px; min-height: 48px; padding: 6px 10px; color: var(--pink); white-space: nowrap; }
#autoplay-toggle[aria-pressed=false] { color: var(--muted); }
.scene-rail { position: absolute; z-index: 5; right: 12px; top: 47%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.scene-rail button { color: var(--muted); opacity: .7; min-width: 48px; min-height: 48px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 8px 0 8px 8px; font-size: 24px; line-height: 1.2; }
.scene-rail button small { font-size: 11px; display: none; width: 4.5ch; }
.scene-rail button[aria-current=true] { color: var(--pink); opacity: 1; }
.scene-rail button[aria-current=true] small { display: block; }
.bottom-bar { position: absolute; z-index: 5; bottom: 16px; left: 4.2vw; right: 4.2vw; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.interaction-hint, .session-info { background: var(--bg-0); background: color-mix(in srgb, var(--bg-0) 90%, transparent); padding: 0 5px; }
.interaction-hint { display: flex; flex-direction: column; gap: 4px; }
.interaction-hint button { text-align: left; color: var(--pink); font-size: 14px; min-height: 36px; }
.interaction-hint button::before { content: "> "; }
.session-info { display: flex; gap: 16px; font-size: 12px; align-items: center; }
.session-info button { min-height: 44px; padding: 4px; }
#scene-label { color: var(--pink); }
dialog { color: var(--text); background: var(--bg-0); border: 1px solid var(--line-strong); padding: 0; width: min(850px, calc(100% - 40px)); max-height: 84vh; max-height: 84dvh; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--bg-0); }
dialog::backdrop { background: var(--bg-0); background: color-mix(in srgb, var(--bg-0) 87%, transparent); }
.dialog-bar { position: sticky; top: 0; background: var(--bg-1); border-bottom: 1px solid var(--line); padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--pink); font-size: 14px; z-index: 5; }
.dialog-bar > span { min-width: 0; overflow-wrap: anywhere; }
.dialog-bar button { color: var(--muted-strong); min-height: 44px; padding: 4px; white-space: nowrap; }
#dialog-content { padding: 24px 27px 30px; }
#dialog-title { font: 400 22px/1.6 var(--font); color: var(--text); margin: 0 0 15px; }
.file-note { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0 0 20px; }
.file-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 20px; color: var(--muted-strong); font-size: 14px; }
.file-filters button { min-height: 40px; padding: 4px; }
.file-filters button::before { content: "["; margin-right: 4px; }
.file-filters button::after { content: "]"; margin-left: 4px; }
.file-filters button[aria-pressed=true] { color: var(--action-text); background: var(--action-red); }
.directory-head, .file-row { display: grid; grid-template-columns: 10ch 14ch 1fr 6ch; gap: 15px; align-items: center; font-size: 14px; }
.directory-head { color: var(--muted); border-bottom: 1px dashed var(--line); padding: 0 7px 12px; margin-bottom: 6px; }
.file-row { width: 100%; text-align: left; padding: 10px 7px; border-bottom: 1px solid var(--line); border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.file-row > span:first-child { color: var(--muted); font-size: 12px; }
.file-row > span:nth-child(2) { color: var(--cyan); }
.file-row > span:nth-child(3) { color: var(--muted-strong); }
.file-row > span:last-child { color: var(--pink); text-align: right; font-size: 12px; }
.file-row:hover { background: var(--soft); }
.file-status { color: var(--muted); font-size: 13px; margin: 20px 0 0; }
#lightbox { width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none; border: 0; overflow: hidden; }
#lightbox[open] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
#lightbox .dialog-bar { background: var(--bg-0); }
#lightbox-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#lightbox-viewport { margin: 8px clamp(8px, 2vw, 24px) 0; min-width: 0; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; cursor: zoom-in; }
#lightbox-viewport:focus-visible { outline-offset: -2px; }
#lightbox-viewport[data-pannable="true"] { cursor: grab; }
#lightbox-viewport[data-dragging="true"] { cursor: grabbing; }
#lightbox-image { display: block; flex: none; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: contain; transform-origin: center; }
.lightbox-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 24px; padding: 6px 12px 10px; }
.lightbox-controls { display: flex; align-items: center; gap: 24px; justify-content: center; font-size: 16px; }
.lightbox-controls button { color: var(--pink); min-height: 44px; min-width: 96px; }
.lightbox-controls span { color: var(--muted); font-size: 14px; }
.lightbox-zoom { display: flex; align-items: center; gap: 6px; }
.lightbox-zoom button { min-width: 44px; min-height: 44px; color: var(--pink); font-size: 20px; }
#lightbox-zoom-reset { min-width: 60px; font-size: 15px; }
#lightbox-zoom-reset:disabled { color: var(--muted); opacity: 1; }
#lightbox-hint { flex: 0 0 100%; margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.copy-fallback { color: var(--text); border: 1px solid var(--line); width: 100%; padding: 10px; margin-top: 20px; font: 11px var(--font); resize: none; }
.synth-layout { display: grid; grid-template-columns: 130px 1fr; gap: 28px; align-items: center; margin: 20px 0 25px; }
.synth-layout img { width: 130px; }
.synth-layout h3 { font-size: 23px; margin: 0 0 7px; font-weight: 400; }
.synth-layout p { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.synth-layout a { font-size: 14px; }
.synth-pads { display: flex; border-top: 1px dashed var(--line); padding-top: 20px; gap: 12px; }
.synth-pads button { flex: 1; min-height: 44px; padding: 14px 10px; border: 1px solid var(--line-strong); color: var(--pink); font-size: 16px; }
.synth-pads button small { display: block; font-size: 12px; color: var(--muted); margin-top: 7px; }
.synth-pads button:hover, .synth-pads button.is-playing { background: var(--action-red); color: var(--action-text); }
.synth-status { color: var(--pink); font-size: 14px; margin-top: 18px; }
#toast { position: fixed; z-index: 50; max-width: calc(100vw - 40px); bottom: 80px; left: 50%; transform: translate(-50%, 6px); opacity: 0; background: var(--bg-1); color: var(--pink); border: 1px solid var(--line-strong); padding: 9px 17px; font-size: 14px; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
.no-script { position: fixed; z-index: 20; background: var(--bg-0); padding: 30px; inset: 0; }

@media (min-width: 1101px) {
  .portrait figcaption { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.7fr); column-gap: 16px; align-items: center; }
  .photo-playback { grid-column: 1 / -1; }
}
@media (min-width: 1600px) {
  .photo-grid { --photo-gap: 22px; }
  .portrait figcaption, .photo-tools { font-size: 14px; }
}
@media (min-width: 801px) and (max-width: 1100px) {
  .brand .dim { display: none; }
  .topbar nav { gap: 4px; }
  .topbar nav :is(button, select, a) { padding-inline: 4px; }
  #desktop { --scene-space: 70px; }
  .terminal { padding-left: 16px; padding-right: 16px; margin-left: -16px; }
  .friend-number { display: none; }
  .profile-tag { display: none; }
  #command-form label { display: none; }
  #command-form::before { content: "$"; color: var(--pink); }
  .photo-playback { gap: 0 4px; }
  #autoplay-toggle { min-width: 0; padding-inline: 4px; }
  .scene-rail { right: 10px; }
  .scene-rail button small { display: none !important; }
}
@media (max-width: 800px) {
  html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: auto; }
  #desktop { position: relative; inset: auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  #world { position: fixed; touch-action: pan-y pinch-zoom; }
  .topbar { position: relative; order: 0; padding: 10px 16px; flex-wrap: wrap; gap: 2px 12px; }
  .brand .dim { display: none; }
  .topbar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; width: 100%; min-width: 0; gap: 4px 8px; padding: 0; }
  .topbar nav :is(button, select, a) { width: 100%; min-width: 0; min-height: 48px; padding: 4px; font-size: 16px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
  .topbar nav a { grid-column: 1 / -1; }
  .scene-rail { position: relative; order: 1; top: auto; right: auto; transform: none; flex-direction: row; justify-content: space-between; align-items: center; gap: 8px; margin: 0 16px 6px; }
  .scene-rail button { flex: 1 1 0; min-width: 0; justify-content: center; gap: 6px; padding: 6px; font-size: 20px; opacity: 1; border: 1px solid var(--line); background: var(--bg-0); }
  .scene-rail button small { display: inline; font-size: 12px; width: auto; }
  .scene-rail button[aria-current=true] { border-color: var(--pink); background: var(--soft); }
  .album-showcase { --album-height-limit: 620px; position: relative; inset: auto; order: 2; padding: 0; margin: 24px 16px 32px; }
  .album-artwork { width: 93%; margin-left: 1%; }
  .album-artwork::before { top: -6.2222%; left: 3.7778%; width: 112.4444%; background-image: url("assets/album-record-mobile-v1.webp"); }
  :root[data-scene="music"] .terminal { order: 3; }
  .portrait { position: relative; order: 3; inset: auto; width: calc(100% - 32px); height: clamp(580px, 80vh, 780px); height: clamp(580px, 80dvh, 780px); transform: none; margin: 8px 16px 20px; }
  .portrait figcaption { order: -1; }
  .photo-grid { --photo-gap: 10px; }
  .photo-file { font-size: 12px; padding: 3px 0; }
  .photo-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; font-size: 13px; }
  .photo-tools button { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--card-inner); font-size: 22px; }
  .photo-step-label { display: inline; color: var(--text); font-size: 16px; }
  .photo-swipe-hint { display: inline; white-space: nowrap; color: var(--muted); }
  .portrait[data-autoplay="single"] .photo-tools button, .portrait[data-autoplay="single"] .photo-swipe-hint { display: none; }
  #photo-caption { grid-column: 1 / -1; order: 1; white-space: normal; }
  .photo-playback { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0 6px; }
  .mode-toggle, #autoplay-toggle { min-width: 0; padding: 4px; font-size: 14px; line-height: 1.4; white-space: normal; }
  /* Keep text on an opaque surface in mobile browsers, including older WebViews. */
  .terminal { position: relative; order: 2; inset: auto; width: auto; height: auto; transform: none; margin: 8px 16px 20px; padding: 12px 8px; background: var(--bg-0); }
  .terminal-path { margin-bottom: 8px; }
  .profile-head { margin-bottom: 10px; }
  .profile-name h1 { font-size: 32px; }
  .profile-tag, .friend-number { display: none; }
  .profile-meta { font-size: 14px; margin: 4px 0 7px; }
  .friend-invite { padding-left: 8px; }
  .friend-invite nav { gap: 0 4px; }
  .friend-invite nav a, .friend-invite nav button { font-size: 15px; padding: 4px; }
  .terminal-output { flex: 0 1 auto; min-height: 0; max-height: 28vh; max-height: 28dvh; padding-right: 5px; font-size: 17px; line-height: 1.65; }
  .terminal-output h1 { font-size: 30px; }
  #command-form { gap: 10px; }
  #command-form label { display: none; }
  #command-form::before { content: "$"; color: var(--pink); }
  .quick-commands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 4px 8px; font-size: 16px; }
  .quick-commands button { width: 100%; min-width: 0; min-height: 48px; padding: 4px 2px; line-height: 1.5; overflow-wrap: anywhere; }
  .quick-commands button::before { margin-right: 1px; }
  .quick-commands button::after { margin-left: 1px; }
  .bottom-bar { position: relative; order: 4; inset: auto; flex-wrap: wrap; align-items: center; margin: 12px 16px calc(20px + env(safe-area-inset-bottom)); gap: 8px 20px; }
  .interaction-hint, .session-info { padding: 0; }
  .session-info { flex-wrap: wrap; }
  dialog { width: calc(100% - 24px); max-height: 88vh; max-height: 88dvh; }
  .dialog-bar { padding: 8px 12px; gap: 12px; font-size: 13px; }
  #dialog-content { padding: 20px 16px 24px; }
  #dialog-title { font-size: 20px; }
  .directory-head, .file-row { grid-template-columns: 11ch minmax(0, 1fr) 5ch; gap: 8px; font-size: 12px; }
  .directory-head > span:first-child, .file-row > span:first-child { display: none; }
  .file-row { min-height: 48px; padding: 12px 3px; }
  .file-row > span { overflow-wrap: anywhere; }
  .lightbox-controls { gap: 8px; font-size: 14px; }
  .lightbox-controls button { min-width: 88px; }
  .synth-layout { grid-template-columns: 90px 1fr; gap: 16px; }
  .synth-layout img { width: 90px; }
  .synth-pads { gap: 6px; }
  .synth-pads button { padding: 12px 4px; }
}
@media (max-width: 360px) {
  .topbar nav :is(button, select, a) { font-size: 15px; }
  .friend-invite > p > span { display: none; }
  .profile-name h1 small { font-size: 14px; }
  .help-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .help-list dd { margin: 2px 0 14px; }
}
@media (min-width: 801px) and (max-height: 640px) {
  html, body { height: auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: auto; }
  #desktop { position: relative; height: 800px; min-height: 100vh; min-height: 100dvh; }
  #world { position: fixed; }
  .terminal, .portrait { top: 90px; height: 620px; bottom: auto; transform: none; }
  .album-showcase {
    --album-height-limit: max(245px, calc(100vh - 146px));
    --album-height-limit: max(245px, calc(100dvh - 146px));
    top: 90px;
    bottom: auto;
    height: max(365px, calc(100vh - 110px));
    height: max(365px, calc(100dvh - 110px));
  }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
html[data-motion="paused"] :not(.terminal-caret), html[data-motion="paused"] *::before, html[data-motion="paused"] *::after { animation: none !important; transition: none !important; }
