/* KOOZ АЙЫЛ · site UI. Brand: Kooz Studio tokens (brand/tokens.css) + style 11+3+1 (gold ornament on cobalt, used lightly).
   Panels are solid navy surfaces one lightness step above each other: no glass, no gradients, no glows. */
:root {
  --cobalt: #0f2f78;        /* brand field */
  --navy-900: #0b1220;      /* panel ground */
  --navy-800: #16203a;      /* raised: field, row hover */
  --navy-700: #24304d;      /* nested: chips, pressed */
  --gold: #f2bb4a;          /* the one accent: primary action, ornament, highlight */
  --gold-press: #d9a43a;
  --ink: #ffffff;           /* text on navy: 17:1 */
  --muted: #a9b4cc;         /* secondary text on navy-900: 8.6:1 */
  --on-gold: #0b1220;       /* text on gold: 10.7:1 */
  --line: #24304d;

  --f-display: "Sofia Sans Extra Condensed", "Bahnschrift", "Arial Narrow", sans-serif;
  --f-text: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r-panel: 20px; --r-ctl: 999px; --r-field: 14px;
  --gap: 16px; --edge: 16px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-exit: cubic-bezier(.55, .055, .675, .19);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --t-pop: 280ms; --t-move: 450ms; --t-exit: 200ms;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--navy-900); color: var(--ink); }
body { font-family: var(--f-text); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none; touch-action: manipulation; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.ru { color: var(--muted); font-size: 14px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; background: #0f2f78; }

/* ------------------------------------------------------------------ top bar */
.bar { position: fixed; left: 0; right: 0; top: 0; z-index: 20; height: calc(56px + var(--safe-t)); padding: var(--safe-t) var(--edge) 0;
  display: flex; align-items: center; justify-content: space-between; background: var(--navy-900); }
.bar-title { margin: 0; font-size: 28px; line-height: 1; font-weight: 800; }
.mark { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; color: var(--ink); height: 44px; }
.mark-k { font-family: var(--f-display); font-weight: 800; font-size: 30px; line-height: 1; letter-spacing: 0.01em; }
.ring { width: 19px; height: 19px; border: 4px solid var(--gold); border-radius: 50%; margin: 0 1px; position: relative; top: 1px; }
.ring-dot::after { content: ""; position: absolute; inset: 0; margin: auto; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.mark-word { font-family: var(--f-display); font-weight: 800; font-size: 30px; line-height: 1; margin-left: 10px; letter-spacing: 0.02em; }
.bar-right { display: flex; align-items: center; gap: 8px; }
.count { font-size: 14px; color: var(--muted); white-space: nowrap; }
.count b { color: var(--ink); font-weight: 600; font-size: 16px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn:hover { background: var(--navy-800); }
.icon-btn:active { background: var(--navy-700); }

/* ------------------------------------------------------------------ search */
.search { position: fixed; z-index: 15; left: 0; right: 0; top: calc(56px + var(--safe-t)); padding: 0 var(--edge) 12px; background: var(--navy-900);
  border-radius: 0 0 var(--r-panel) var(--r-panel); }
.field { position: relative; height: 52px; background: var(--navy-800); border-radius: var(--r-field); display: flex; align-items: center; }
.field:focus-within { box-shadow: 0 0 0 2px var(--gold) inset; } /* taste-skill-ignore: floating sheet over the 3D map / focus ring / debug overlay */
.field-ico { width: 22px; height: 22px; margin: 0 6px 0 14px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 18px; font-weight: 500; padding: 0 6px; caret-color: var(--gold); }
.field input::placeholder { color: var(--muted); opacity: 1; font-weight: 400; }
.field input::-webkit-search-cancel-button { display: none; }
.field-clear { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; margin-right: 4px; border-radius: 50%; }
.field-clear svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.hint { margin: 8px 4px 0; font-size: 13px; color: var(--muted); }
.sugg { list-style: none; margin: 8px 0 0; padding: 0; max-height: min(52vh, 340px); overflow-y: auto; overscroll-behavior: contain; }
.sugg li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 12px; cursor: pointer; }
.sugg li[aria-selected="true"], .sugg li:hover { background: var(--navy-800); }
.sugg .s-nick { font-weight: 500; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sugg .s-nick mark { background: none; color: var(--gold); font-weight: 600; }
.sugg .s-type { flex: none; font-size: 13px; color: var(--muted); }
.sugg .s-more { color: var(--muted); font-size: 14px; cursor: default; min-height: 40px; }
.sugg .s-more:hover { background: none; }
.nores { padding: 12px 4px 4px; }
.nores-t { margin: 0 0 4px; font-weight: 600; font-size: 17px; }
.nores-t span { color: var(--gold); }
.nores-s { margin: 0 0 6px; font-size: 15px; }
.nores .ru { margin: 0 0 12px; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r-ctl);
  border: 0; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: scale(0.97); }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: #f6c962; }
.btn-gold:active { background: var(--gold-press); }
.btn-ghost { background: var(--navy-700); color: var(--ink); }
.btn-ghost:hover { background: #2e3b5c; }
.btn-lg { min-height: 54px; font-size: 18px; }

/* ------------------------------------------------------------------ ornament strip (style 11: gold kochkor muyuz chain on cobalt) */
.orn { height: 22px; background: var(--cobalt) url("../assets/border_kochkor.svg") repeat-x center / auto 14px; }

/* ------------------------------------------------------------------ house card (bottom sheet on the phone) */
.card { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; background: var(--navy-900); border-radius: var(--r-panel) var(--r-panel) 0 0;
  overflow: hidden; padding-bottom: var(--safe-b); box-shadow: 0 -12px 32px rgba(3, 8, 20, .35); /* taste-skill-ignore: floating sheet over the 3D map / focus ring / debug overlay */
  transform: translateY(0); transition: transform var(--t-move) var(--ease-out); }
.card.is-off { transform: translateY(105%); transition-duration: var(--t-exit); transition-timing-function: var(--ease-exit); }
.card-x { position: absolute; right: 6px; top: 26px; }
.card-body { padding: 12px 18px 14px; }
.c-owner { margin: 0; font-size: 13px; color: var(--muted); }
.c-nick { margin: 0 48px 4px 0; font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1.02; letter-spacing: -0.005em;
  overflow-wrap: anywhere; }
.c-nick-free { font-size: 30px; }
.c-type { margin: 0 0 10px; font-size: 17px; font-weight: 600; color: var(--gold); }
.c-type .ru { font-weight: 400; margin-left: 4px; }
.c-quote { margin: 0 0 10px; padding: 9px 12px; background: var(--navy-800); border-radius: 12px; font-size: 15px; line-height: 1.35; }
.c-qlabel { display: block; font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.c-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.c-meta b { color: var(--ink); font-weight: 600; }
.c-actions { display: flex; gap: 10px; }
.c-actions .btn { flex: 1 1 0; min-width: 0; padding: 0 12px; }
.c-copy { margin: 10px 0 0; }
.c-copy label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.c-copy input { width: 100%; height: 44px; border: 0; border-radius: 12px; background: var(--navy-800); padding: 0 12px; font-size: 15px; color: var(--ink); }
.c-cta { margin: 10px 0 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.c-cta a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.c-text { margin: 0 0 6px; font-size: 16px; }
.card .ru { margin: 0 0 14px; }

/* ------------------------------------------------------------------ intro */
.intro { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
body.intro-open .search { display: none; }
.intro-panel { width: 100%; background: var(--cobalt); border-radius: var(--r-panel) var(--r-panel) 0 0; overflow: hidden;
  padding-bottom: calc(14px + var(--safe-b)); transition: transform var(--t-move) var(--ease-out); box-shadow: 0 -12px 32px rgba(3, 8, 20, .3); } /* taste-skill-ignore: floating sheet over the 3D map / focus ring / debug overlay */
.intro.is-off .intro-panel { transform: translateY(105%); transition-duration: var(--t-exit); transition-timing-function: var(--ease-exit); }
.intro .orn { height: 22px; background-size: auto 14px; }
.intro-t { margin: 16px 20px 8px; font-family: var(--f-display); font-weight: 800; font-size: 40px; line-height: 0.98; letter-spacing: 0; text-wrap: balance; }
.intro-ru { margin: 0 20px 6px; color: #c9d3ee; font-size: 15px; line-height: 1.4; }
.intro-stats { margin: 0 20px 14px; font-size: 15px; color: #c9d3ee; }
.intro-stats b { color: var(--ink); font-weight: 600; font-size: 16px; }
.intro-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; padding: 0 20px; }
.intro-actions .btn { padding: 0 14px; }
.intro .btn-ghost { background: rgba(255, 255, 255, 0.13); }
.intro .btn-ghost:hover { background: rgba(255, 255, 255, 0.19); }
.intro-foot { margin: 12px 20px 0; }
.intro-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 16px; border-radius: 16px;
  background: var(--navy-900); text-decoration: none; font-weight: 600; font-size: 16px; line-height: 1.25; }
.intro-cta svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.intro-links { margin: 6px 2px 0; font-size: 15px; color: #c9d3ee; }
.intro-links a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--gold); display: inline-block; padding: 10px 0; }

/* ------------------------------------------------------------------ nick tags over the 3D village */
#tags { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 7px;
  border-radius: 999px; background: var(--navy-900); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap;
  pointer-events: none; border: 0; will-change: transform, opacity; transform-origin: 50% 100%; }
.tag svg { width: 14px; height: 14px; fill: var(--gold); flex: none; }
.tag.is-sel { background: var(--gold); color: var(--on-gold); height: 34px; font-size: 16px; font-weight: 600; padding: 0 14px 0 10px; z-index: 2; }
.tag.is-sel svg { fill: var(--on-gold); width: 16px; height: 16px; }
.tag.is-sel::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--gold); }
.tag.is-free { background: var(--gold); color: var(--on-gold); font-weight: 600; }
.tag.is-free svg { fill: var(--on-gold); }

/* ------------------------------------------------------------------ loading, toast, perf */
.loading { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--cobalt); transition: opacity 400ms var(--ease-out); }
.loading.is-off { opacity: 0; pointer-events: none; }
.loading-in { text-align: center; padding: 24px; }
.loading p { margin: 18px 0 0; color: #c9d3ee; font-size: 16px; }
.mark-lg .mark-k, .mark-lg .mark-word { font-size: 46px; }
.mark-lg .ring { width: 30px; height: 30px; border-width: 6px; }
.mark-lg .ring-dot::after { width: 8px; height: 8px; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--navy-900);
  padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); } /* taste-skill-ignore: floating sheet over the 3D map / focus ring / debug overlay */
.perf { position: fixed; z-index: 80; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .72); color: #fff; font: 12px/1.35 ui-monospace, Consolas, monospace; /* taste-skill-ignore: floating sheet over the 3D map / focus ring / debug overlay */
  padding: 6px 8px; border-radius: 6px; pointer-events: none; white-space: pre; }
.noscript { position: fixed; inset: 0; margin: 0; padding: 40px 24px; background: var(--cobalt); color: #fff; font-size: 18px; z-index: 100; }

body.card-open .hint { display: none; }
/* when the search has focus or results, the page keeps the 3D visible under the list */
.search.is-open { box-shadow: 0 12px 32px rgba(3, 8, 20, .35); } /* taste-skill-ignore: floating sheet over the 3D map / focus ring / debug overlay */

/* ------------------------------------------------------------------ desktop and tablets: panels on the left */
@media (min-width: 900px) {
  :root { --edge: 24px; }
  .search { left: var(--edge); right: auto; top: calc(56px + 12px); width: 400px; padding: 12px; border-radius: var(--r-panel); }
  .bar { background: transparent; pointer-events: none; }
  .bar > * { pointer-events: auto; }
  .bar .mark, .bar .bar-right { background: var(--navy-900); border-radius: 999px; padding: 4px 16px; height: 52px; }
  .bar .bar-right { padding: 4px 6px 4px 16px; }
  .card { left: var(--edge); right: auto; bottom: var(--edge); width: 400px; border-radius: var(--r-panel); padding-bottom: 0; box-shadow: 0 12px 32px rgba(3, 8, 20, .4); } /* taste-skill-ignore: floating sheet over the 3D map / focus ring / debug overlay */
  .card.is-off { transform: translateX(calc(-100% - 40px)); }
  .intro { align-items: center; justify-content: flex-start; padding-left: var(--edge); }
  .intro-panel { width: 460px; border-radius: 24px; padding-bottom: 24px; }
  .intro.is-off .intro-panel { transform: translateX(-24px); opacity: 0; transition: transform var(--t-exit) var(--ease-exit), opacity var(--t-exit) var(--ease-exit); }
  .intro-t { font-size: 54px; margin: 28px 28px 12px; }
  .intro-ru, .intro-stats { margin-left: 28px; margin-right: 28px; }
  .intro-actions { grid-template-columns: 1fr 1fr; padding: 0 28px; }
  .intro-foot { margin: 18px 28px 0; }
}

@media (max-height: 640px) and (max-width: 899px) {
  .intro-t { font-size: 36px; margin-top: 16px; }
  .c-nick { font-size: 32px; }
}

.qa-still *, .qa-still *::before, .qa-still *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
