/* Портал пам'яті — интерфейс поверх 3D-мира.
   Две темы управляются body[data-theme="dusk"|"light"]. */

:root {
  --serif: 'Alegreya', 'Georgia', 'Times New Roman', serif;
  --sans: 'Golos Text', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* Сутінки (по умолчанию) */
  --ground: #232A45;
  --ink: #EDE7DA;
  --ink-2: rgba(237, 231, 218, 0.74);
  --ink-3: rgba(237, 231, 218, 0.5);
  --amber: #E8A853;
  --amber-ink: #F2C57C;
  --amber-soft: rgba(232, 168, 83, 0.38);
  --glass: rgba(22, 26, 46, 0.46);
  --glass-strong: rgba(22, 26, 46, 0.72);
  --glass-edge: rgba(237, 231, 218, 0.16);
  --glass-edge-2: rgba(237, 231, 218, 0.08);
  --field: rgba(237, 231, 218, 0.06);
  --shadow: 0 30px 80px rgba(6, 8, 20, 0.55);
  --text-glow: 0 1px 14px rgba(8, 10, 24, 0.55);
  --halo: rgba(14, 18, 36, 0.75);
  --moss: #3C4A3A;
}

body[data-theme="light"] {
  --ground: #DCE4EE;
  --ink: #1F2540;
  --ink-2: rgba(31, 37, 64, 0.82);
  --ink-3: rgba(31, 37, 64, 0.6);
  --amber: #B98A3C;
  --amber-ink: #8C6524;
  --amber-soft: rgba(185, 138, 60, 0.32);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-edge: rgba(43, 51, 80, 0.16);
  --glass-edge-2: rgba(43, 51, 80, 0.08);
  --field: rgba(43, 51, 80, 0.06);
  --shadow: 0 30px 80px rgba(60, 70, 110, 0.28);
  --text-glow: 0 1px 10px rgba(255, 255, 255, 0.9), 0 0 24px rgba(255, 255, 255, 0.7);
  --halo: rgba(255, 255, 255, 0.92);
  --moss: #7f9a5a;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 1.2s ease, color 0.8s ease;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 1.5px solid var(--amber);
  outline-offset: 3px;
}

#world {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none;
}
#world.pick { cursor: pointer; }

/* ---------- Прелоадер ---------- */
#loader {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: #1a1f36;
  transition: opacity 1.6s ease;
  overflow: hidden;
}
#loader.gone { opacity: 0; pointer-events: none; }
#loader .intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
#loader .veil { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, rgba(20,24,44,0.15) 0%, rgba(20,24,44,0.55) 60%, rgba(20,24,44,0.8) 100%); }
#loader .inner { position: relative; text-align: center; color: #EDE7DA; }
#loader .name { color: #EDE7DA; }
#loader .sub { color: rgba(237,231,218,0.7); }
#loader .enter {
  margin-top: 28px; padding: 12px 26px; border: 1px solid rgba(232,168,83,0.7); border-radius: 2px; color: #EDE7DA; font-size: 15px;
  background: rgba(22,26,46,0.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: enter-in 1.2s ease both; transition: background .3s ease, border-color .3s ease;
}
#loader .enter:hover { background: rgba(232,168,83,0.25); border-color: #E8A853; }
@keyframes enter-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#loader .flame {
  width: 10px; height: 14px; border-radius: 50% 50% 45% 45%;
  background: radial-gradient(ellipse at 50% 70%, #fff3d0 0%, var(--amber) 45%, rgba(232,168,83,0) 75%);
  box-shadow: 0 0 22px 6px var(--amber-soft);
  animation: flame 1.6s ease-in-out infinite;
  margin: 0 auto 26px;
}
@keyframes flame {
  0%, 100% { transform: scaleY(1) translateY(0); opacity: .95; }
  50% { transform: scaleY(1.12) translateY(-1px); opacity: 1; }
}
#loader .name { font-family: var(--serif); font-size: 30px; letter-spacing: .01em; text-align: center; }
#loader .sub { color: var(--ink-3); text-align: center; margin-top: 8px; font-size: 14px; }
#loader .bar { width: 160px; height: 1px; background: var(--glass-edge); margin: 26px auto 0; overflow: hidden; }
#loader .bar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .4s ease; }

/* ---------- Верхняя полоса ---------- */
.bar-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  pointer-events: none;
}
.bar-top > * { pointer-events: auto; text-shadow: var(--text-glow); }
.wordmark {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  color: var(--ink); text-decoration: none; letter-spacing: .005em;
}
.wordmark small.where { display: block; font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-2); font-weight: 400; margin-top: 0; white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 26px; position: absolute; left: 50%; top: 22px; transform: translateX(-50%); }
.nav .ctl { font-size: 14.5px; }
.controls { display: flex; align-items: center; gap: 22px; }
.mobile-nav { display: none; }
.ctl {
  color: var(--ink-2); font-size: 14px; position: relative; padding: 4px 0;
  transition: color .3s ease;
}
.ctl::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--amber); transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.ctl:hover { color: var(--ink); }
.ctl:hover::after, .ctl[aria-pressed="true"]::after { transform: scaleX(1); }
.ctl.lang b { color: var(--ink); font-weight: 500; }
.ctl.lang span { color: var(--ink-3); }
.ctl.primary {
  border: 1px solid var(--glass-edge); border-radius: 2px; padding: 8px 16px;
  color: var(--ink); background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  transition: border-color .3s ease, background .3s ease;
}


/* ---------- Подсказка и тост ---------- */
.hint {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%);
  font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink-2);
  text-align: center; max-width: 520px; padding: 0 20px; z-index: 15; text-shadow: var(--text-glow);
  opacity: 0; transition: opacity 1.2s ease; pointer-events: none;
}
.hint.show { opacity: 1; }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 8px);
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 3px;
  padding: 10px 18px; font-size: 14px; z-index: 30; opacity: 0; pointer-events: none;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: opacity .4s ease, transform .4s ease; max-width: min(520px, 90vw); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Родина поруч (мини-граф) ---------- */
.family {
  position: fixed; left: 28px; bottom: 28px; z-index: 15;
  opacity: 0; transition: opacity 1s ease .3s;
}
.family.show { opacity: 1; }
.family .label { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-3); margin-bottom: 6px; text-shadow: var(--text-glow); }
.family svg { display: block; overflow: visible; }
.family .edge { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 4; }
.family .node { cursor: pointer; }
.family .node circle { fill: var(--glass-strong); stroke: var(--ink-3); stroke-width: 1; transition: stroke .3s ease, r .3s ease; }
.family .node text { font-family: var(--sans); font-size: 12.5px; fill: var(--ink-2); stroke: var(--halo); stroke-width: 3px; stroke-linejoin: round; paint-order: stroke; }
.family .node tspan.rel { fill: var(--ink-3); font-size: 11.5px; }
.family .node:hover circle { stroke: var(--amber); }
.family .node.current circle { stroke: var(--amber); fill: var(--amber-soft); }
.family .node.current text { fill: var(--ink); }

/* ---------- Шторка справа ---------- */
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 25;
  width: min(500px, 100vw);
  background: var(--glass-strong); border-left: 1px solid var(--glass-edge);
  backdrop-filter: blur(24px) saturate(1.25); -webkit-backdrop-filter: blur(24px) saturate(1.25);
  transform: translateX(104%); transition: transform .6s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.sheet.open { transform: translateX(0); }
.sheet-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 26px 30px 14px;
}
.sheet-head h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0; }
.sheet-head .who { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 14px; margin-top: 4px; }
.close { color: var(--ink-3); font-size: 22px; line-height: 1; padding: 6px; }
.close:hover { color: var(--ink); }
.tabs { display: flex; gap: 20px; padding: 0 30px; border-bottom: 1px solid var(--glass-edge-2); overflow-x: auto; scrollbar-width: none; }
.tabs:empty { display: none; }
.tabs button { white-space: nowrap; }
.tabs button { padding: 8px 0 12px; color: var(--ink-3); position: relative; font-size: 14px; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--amber);
}
.sheet-body { overflow-y: auto; padding: 22px 30px 40px; flex: 1; }
.sheet-body p { margin: 0 0 14px; color: var(--ink-2); max-width: 62ch; }
.sheet-body p.lead { font-family: var(--serif); font-size: 18px; color: var(--ink); line-height: 1.5; }
.sheet-body h3 { font-family: var(--serif); font-weight: 500; font-size: 18px; margin: 22px 0 8px; }
.sheet-body .by { font-size: 12.5px; color: var(--ink-3); margin: -8px 0 16px; }
.quote { font-family: var(--serif); font-size: 18px; line-height: 1.45; margin: 0 0 16px; padding-left: 14px; border-left: 1px solid var(--amber-soft); }
.quote small { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.story { padding: 14px 0; border-top: 1px solid var(--glass-edge-2); }
.story p { margin-bottom: 6px; }
.story .by { margin: 0; }
.note { font-size: 13px; color: var(--ink-3); }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gallery figure { margin: 0; }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery img { width: 100%; display: block; border-radius: 2px; filter: sepia(.12) contrast(1.02); }
.gallery figcaption { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.frame { position: relative; padding: 6px; background: var(--field); border: 1px solid var(--glass-edge-2); }

.video {
  position: relative; aspect-ratio: 16 / 9; background: #0f1220; border-radius: 2px; overflow: hidden;
  display: grid; place-items: center; border: 1px solid var(--glass-edge-2);
}
.video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.video .play {
  position: relative; width: 58px; height: 58px; border-radius: 50%;
  border: 1px solid rgba(237,231,218,.5); display: grid; place-items: center; color: #EDE7DA;
  background: rgba(20,24,44,.35); backdrop-filter: blur(8px);
}
.video .play svg { margin-left: 3px; }

/* ---------- Формы в модалке ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(10, 12, 24, 0.35); opacity: 0; pointer-events: none; transition: opacity .4s ease;
}
body[data-theme="light"] .modal-wrap { background: rgba(120, 130, 160, 0.25); }
.modal-wrap.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(440px, calc(100vw - 32px));
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 4px;
  backdrop-filter: blur(24px) saturate(1.25); -webkit-backdrop-filter: blur(24px) saturate(1.25);
  padding: 28px 30px 26px; box-shadow: var(--shadow);
  transform: translateY(10px); transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.modal-wrap.open .modal { transform: translateY(0); }
.modal h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 0 0 4px; }
.modal .sub { color: var(--ink-3); font-size: 13.5px; margin: 0 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; background: var(--field); border: 1px solid var(--glass-edge); border-radius: 2px;
  padding: 10px 12px; color: var(--ink); resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice {
  border: 1px solid var(--glass-edge); border-radius: 2px; padding: 8px 12px; color: var(--ink-2); font-size: 14px;
  transition: border-color .25s ease, color .25s ease;
}
.choice[aria-pressed="true"] { border-color: var(--amber); color: var(--ink); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); margin: 6px 0 18px; }
.switch input { appearance: none; width: 34px; height: 18px; border-radius: 10px; border: 1px solid var(--glass-edge); position: relative; background: var(--field); cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); transition: transform .25s ease, background .25s ease; }
.switch input:checked { border-color: var(--amber); }
.switch input:checked::after { transform: translateX(16px); background: var(--amber); }
.actions { display: flex; justify-content: flex-end; gap: 14px; align-items: center; margin-top: 8px; }
.btn { padding: 10px 18px; border-radius: 2px; border: 1px solid var(--amber); color: var(--ink); background: var(--amber-soft); transition: background .3s ease; }
.btn:hover { background: var(--amber); color: #1b1a17; }
body[data-theme="light"] .btn:hover { color: #fff; }
.btn.quiet { border-color: transparent; background: none; color: var(--ink-3); }
.btn.quiet:hover { color: var(--ink); background: none; }

/* ---------- Мобильная ширина ---------- */
@media (max-width: 1100px) { .where { display: none; } }
@media (max-width: 720px) {
  body { font-size: 14px; }
  .bar-top { padding: 14px 16px; }
  .ctl { white-space: nowrap; font-size: 13.5px; }
  .wordmark { font-size: 18px; white-space: nowrap; }
  .wordmark small { display: none; }
  .where { display: none; }
  .controls { gap: 14px; }
  .ctl.primary { display: none; }
  .family { left: 16px; bottom: 18px; }
  .hint { bottom: 120px; font-size: 14px; }
  .toast { bottom: 150px; }
  .sheet-head, .tabs, .sheet-body { padding-left: 20px; padding-right: 20px; }
  .modal { padding: 22px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  #loader .flame { animation: none; }
  .sheet, .modal, .toast { transition-duration: .01s; }
}

/* ---------- v2: пошук ---------- */
.filters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
.filters label { font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; }
select, input[type="search"] { width: 100%; background: var(--field); border: 1px solid var(--glass-edge); border-radius: 2px; padding: 9px 10px; color: var(--ink); }
select option { color: #1b1a17; }
.results { display: flex; flex-direction: column; }
.result { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--glass-edge-2); }
.result.here { opacity: .7; }
.result .avatar { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: var(--field); border: 1px solid var(--glass-edge); display: grid; place-items: center; flex: none; font-family: var(--serif); font-size: 20px; color: var(--ink-2); }
.result .avatar img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.1); }
.result .meta { flex: 1; min-width: 0; }
.result .name { font-family: var(--serif); font-size: 17px; }
.result .sub { font-size: 12.5px; color: var(--ink-3); }
.btn.small { padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.cities { display: flex; flex-direction: column; gap: 10px; }
.country-name { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 14px; margin-bottom: 4px; }
.city-chip { border: 1px solid var(--glass-edge); border-radius: 2px; padding: 5px 10px; margin: 0 6px 6px 0; color: var(--ink-2); font-size: 13.5px; }
.city-chip span { color: var(--amber-ink); margin-left: 4px; }
.city-chip:hover { border-color: var(--amber); color: var(--ink); }

/* ---------- v2: дерево ---------- */
.tree-wrap { overflow-x: auto; margin: 4px 0 12px; }
.tree .tl { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.tree .tl.sp { stroke: var(--amber); stroke-dasharray: 3 3; }
.tree .tn { cursor: pointer; }
.tree .ring { fill: var(--field); stroke: var(--ink-3); stroke-width: 1; transition: stroke .3s; }
.tree .tn:hover .ring, .tree .tn.current .ring { stroke: var(--amber); stroke-width: 1.6; }
.tree .tn.alive .ring { stroke-dasharray: 3 3; }
.tree .init { font-family: var(--serif); font-size: 20px; fill: var(--ink-2); }
.tree .nm { font-family: var(--sans); font-size: 11.5px; fill: var(--ink); }
.tree .yr { font-family: var(--sans); font-size: 10px; fill: var(--ink-3); }
.tree .gl { font-family: var(--serif); font-style: italic; font-size: 11px; fill: var(--ink-3); }

/* ---------- v2: майстер ---------- */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 0 0 18px; }
.steps li { font-size: 12.5px; color: var(--ink-3); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.steps li span { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--glass-edge); display: grid; place-items: center; font-size: 11px; font-family: var(--serif); }
.steps li.on { color: var(--ink); }
.steps li.on span { border-color: var(--amber); color: var(--amber-ink); }
.steps li.done span { background: var(--amber-soft); border-color: transparent; }
.agent { padding: 14px 16px; border: 1px solid var(--amber-soft); border-radius: 3px; margin-bottom: 20px; background: var(--field); }
.agent h3 { margin: 0 0 4px; }
.worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.world { position: relative; border: 1px solid var(--glass-edge); border-radius: 3px; padding: 8px; text-align: left; color: var(--ink-2); font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }
.world i { display: block; height: 44px; border-radius: 2px; }
.world.on { border-color: var(--amber); color: var(--ink); }
.world.soon { opacity: .5; cursor: default; }
.world small { font-size: 11px; color: var(--amber-ink); }
.w-valley { background: linear-gradient(180deg, #d97a44, #4a4350 55%, #2b3126); }
.w-cemetery { background: linear-gradient(180deg, #6a7185, #3c4a3a); }
.w-garden { background: linear-gradient(180deg, #b7c9a0, #6f8f4c); }
.w-sea { background: linear-gradient(180deg, #9fc2d8, #2d5b78); }
.w-stars { background: radial-gradient(circle at 30% 30%, #6a6f9a 0, #14162c 60%); }
.w-mountain { background: linear-gradient(180deg, #c9d6e4, #6c7280 60%, #3a3f4a); }
.w-sky { background: linear-gradient(180deg, #adc7df, #f1e6cf); }
.designs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 8px; }
.design { border: 1px solid var(--glass-edge); border-radius: 3px; padding: 8px; text-align: left; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; background: linear-gradient(180deg, rgba(74,67,80,.35), rgba(30,32,50,.25)); }
.design img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.design .dn { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.design .dd { font-size: 12px; color: var(--ink-3); }
.design .d3 { font-size: 11.5px; color: var(--amber-ink); }
.design.on { border-color: var(--amber); }
.attr { margin: 12px 0; }
.attr > label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.choices.col { flex-direction: column; }
.choices.col .choice { text-align: left; }
.row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.row .field { margin-bottom: 14px; }
.person-fields { padding: 12px 0 2px; border-top: 1px solid var(--glass-edge-2); margin-top: 12px; }
.person-fields .row { grid-template-columns: 1fr 1fr; }
.upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload .thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 2px; border: 1px solid var(--glass-edge); }
.preview { margin: 18px 0 6px; }
.preview-label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
#plateCanvas { width: 100%; max-width: 300px; display: block; border-radius: 3px; border: 1px solid var(--glass-edge); }
.wiz-actions { justify-content: space-between; margin-top: 16px; }
.links { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--glass-edge-2); }
.link-row span:first-child { flex: 1; }
.dup { margin-top: 8px; padding: 12px 14px; border: 1px solid var(--amber-soft); border-radius: 3px; background: var(--field); }
.dup p { margin: 6px 0 10px; font-size: 13.5px; }
video.clip { width: 100%; border-radius: 3px; display: block; background: #000; }

/* ---------- мобільна навігація ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--glass-strong); border-top: 1px solid var(--glass-edge); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .mobile-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink-2); font-size: 11px; padding: 4px 0; }
  .mobile-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .family { bottom: 74px; }
  .hint { bottom: 150px; }
  .toast { bottom: 180px; }
  .sheet { width: 100vw; }
  .filters { grid-template-columns: 1fr; }
  .worlds { grid-template-columns: repeat(2, 1fr); }
}
