/* aisketch city: glass panels over a golden-hour city; the ai sketch palette of night blue, gold, cyan and magenta */
:root {
  --ink: #0b1430;
  --ink-2: #121c42;
  --panel: rgba(11, 18, 44, .9);
  --panel-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .13);
  --text: #f4f0e6;
  --muted: #aab1c8;
  --gold: #ffcf4a;
  --gold-2: #f2b441;
  --cyan: #3fe0ea;
  --pink: #ff4fc8;
  --green: #5fd38a;
  --red: #ff6b6b;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --label: "Unbounded", "Manrope", system-ui, sans-serif;
  --r: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; background: #f2b08a; }
body { font: 500 16px/1.5 var(--sans); color: var(--text); -webkit-font-smoothing: antialiased; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* the page waits for its language before showing text (CSS fallback after 2.5 s) */
html.wait .top, html.wait .wcard, html.wait .search { visibility: hidden; animation: reveal 0s 2.5s forwards; }
@keyframes reveal { to { visibility: visible; } }

#city, #labels { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
#city { touch-action: none; outline: none; }
#labels { pointer-events: none; }

/* ── buttons ── */
.primary, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 14px; font-weight: 800; font-size: 15px; text-decoration: none; text-align: center; line-height: 1.2;
  transition: transform .15s var(--ease), background .2s, opacity .2s;
}
.primary { background: var(--gold); color: #17122c; box-shadow: 0 6px 22px rgba(255, 207, 74, .25); }
.primary:hover { background: #ffd968; }
.btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.btn:hover { background: rgba(255, 255, 255, .1); }
.primary:active, .btn:active { transform: scale(.97); }
.primary:disabled { opacity: .6; cursor: progress; }
.wide { width: 100%; }
.sm { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.link { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; font-size: 14px; padding: 8px; }

/* ── top bar ── */
.top {
  position: fixed; z-index: 20; top: calc(10px + var(--safe-t)); left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 9px; padding: 5px 14px 5px 5px; border-radius: 99px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand b { font: 700 13px/1 var(--label); letter-spacing: .04em; }
.brand i { font: 700 9.5px/1.3 var(--label); font-style: normal; color: var(--gold); letter-spacing: .32em; }
.tr { display: flex; gap: 8px; align-items: stretch; }
.langbtn, .pop {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.langbtn { padding: 0 13px; font: 700 12px var(--label); min-width: 48px; min-height: 44px; }
.pop { padding: 5px 13px 6px; text-align: center; min-width: 84px; }
.pop small { display: block; font: 600 9px/1.4 var(--label); letter-spacing: .18em; color: var(--gold); }
.pop b { font: 700 19px/1.1 var(--label); }

/* ── map controls ── */
.ctl {
  position: fixed; z-index: 15; right: 12px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px;
}
.ctl button {
  width: 46px; height: 46px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  display: grid; place-items: center; font: 600 22px/1 var(--sans); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.ctl svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctl .build { height: 64px; background: var(--gold); color: #17122c; border-color: transparent; gap: 2px; box-shadow: 0 8px 24px rgba(255, 207, 74, .35); }
.ctl .build span { font: 700 9.5px/1 var(--label); }
#tour .pause { display: none; fill: currentColor; stroke: none; }
#tour .play { fill: currentColor; stroke: none; }
#tour.on .pause { display: block; }
#tour.on .play { display: none; }
#tour.on { background: var(--gold); color: #17122c; }

/* ── search ── */
.search {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b));
  width: min(480px, calc(100% - 24px)); display: flex; gap: 8px;
}
.search input {
  flex: 1; min-width: 0; height: 50px; padding: 0 18px; border-radius: 15px; font-size: 16px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.search input::placeholder { color: var(--muted); }
.search > button { height: 50px; padding: 0 20px; border-radius: 15px; background: var(--gold); color: #17122c; font-weight: 800; }
.sugg {
  position: absolute; left: 0; right: 0; bottom: 58px; list-style: none; padding: 6px; border-radius: 15px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.sugg button { width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; font-weight: 700; }
.sugg button:hover { background: var(--panel-2); }
body.sheet-on .search, body.picking .search, body.intro .search, body.intro .ctl { opacity: 0; pointer-events: none; }
.search, .ctl { transition: opacity .25s; }

/* ── welcome ── */
.welcome {
  position: fixed; inset: 0; z-index: 30; display: flex; overflow-y: auto; padding: calc(64px + var(--safe-t)) 14px calc(14px + var(--safe-b));
  background: radial-gradient(120% 80% at 50% 70%, rgba(9, 14, 38, .78), rgba(9, 14, 38, .35) 70%, rgba(9, 14, 38, .1));
  transition: opacity .25s;
}
.welcome.out { opacity: 0; pointer-events: none; }
.wcard { width: min(520px, 100%); margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
body.intro #labels { opacity: 0; }
#labels { transition: opacity .3s; }
.wlang { display: flex; gap: 6px; }
.wlang button {
  padding: 7px 14px; border-radius: 99px; font-weight: 800; font-size: 13px; background: var(--panel); border: 1px solid var(--line);
}
.wlang button[aria-pressed="true"] { background: var(--gold); color: #17122c; border-color: transparent; }
.kicker { font: 700 11px/1.4 var(--label); letter-spacing: .2em; text-transform: uppercase; color: #17122c; background: var(--gold); padding: 6px 12px; border-radius: 99px; }
.wcard h1 { font: 700 clamp(30px, 8vw, 50px)/1.08 var(--label); letter-spacing: -.01em; text-shadow: 0 4px 30px rgba(0, 0, 0, .45); }
.wcard p { max-width: 440px; color: #e8e4f0; font-size: 16px; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.wnote { font-weight: 800; color: #17122c; background: var(--cyan); padding: 8px 14px; border-radius: 12px; }
#wform { width: 100%; display: flex; flex-direction: column; gap: 10px; }
#wform .go { min-height: 56px; font-size: 17px; }
.wsteps { display: flex; gap: 6px; list-style: none; align-items: center; }
.wsteps li { display: flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 14px; }
.wsteps li b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #17122c; font-size: 14px; }

.wworlds { display: flex; flex-direction: column; gap: 7px; align-items: center; width: 100%; }
.wworlds small { color: #e8e4f0; font-weight: 700; font-size: 13px; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
#wchips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 300px; }
#wchips button { width: 44px; height: 44px; border-radius: 50%; font-size: 21px; line-height: 1; padding: 0; background: var(--panel); border: 1px solid var(--line); transition: transform .15s var(--ease), border-color .15s; }
#wchips button:hover { transform: translateY(-2px) scale(1.06); border-color: var(--gold); }
.at { display: flex; align-items: center; background: var(--panel); border: 1.5px solid rgba(255, 207, 74, .55); border-radius: 15px; padding-left: 16px; }
.at span { color: var(--gold); font-weight: 800; font-size: 18px; }
.at input { flex: 1; min-width: 0; height: 52px; background: none; border: 0; padding: 0 14px 0 6px; font-size: 17px; font-weight: 700; outline: none; }
.at input::placeholder { color: var(--muted); font-weight: 600; }
.at:focus-within { border-color: var(--gold); }
.wbtns { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.wbtns .primary, .wbtns .btn { min-height: 52px; }
.wbtns .btn { background: var(--panel); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }

.wpop { color: var(--muted); font-size: 14px; }
.wpop b { color: var(--gold); font-family: var(--label); }

/* ── bottom sheet (phones) / side panel (desktop) ── */
.sheet {
  position: fixed; z-index: 25; left: 8px; right: 8px; bottom: 0; max-height: min(68vh, 68dvh); overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 18px calc(18px + var(--safe-b)); border-radius: 22px 22px 0 0;
  background: var(--panel); border: 1px solid var(--line); border-bottom: 0; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); animation: up .28s var(--ease);
}
.sheet[data-mode="editor"] { max-height: min(60vh, 60dvh); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet > * + * { margin-top: 12px; }
.sheet .x {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 12px; font-size: 24px; line-height: 1;
  background: var(--panel-2); margin: 0;
}
.sheet h2 { font: 700 21px/1.25 var(--label); padding-right: 44px; word-break: break-word; }
.sheet h2 a { text-decoration: none; }
.sheet h2 a:hover { text-decoration: underline; }
.hd { display: flex; align-items: center; gap: 10px; }
.hd h2 { padding-right: 44px; }
.dot { flex: none; width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); }
.t-uy { background: var(--green); } .t-osmonopar { background: #5cc8ff; } .t-biznes { background: #ffb648; }
.t-free { background: var(--green); } .t-vip { background: var(--gold); } .t-park { background: #7fc66b; }
.ava { width: 40px; height: 40px; border-radius: 50%; }
.addr { font-weight: 800; color: var(--gold); font-size: 16px; }
.meta { color: var(--muted); font-size: 14.5px; }
.gold { color: var(--gold); }
.p { color: #dcdbe6; }
.hint { display: block; color: var(--muted); font-size: 13px; }
.hint.bad { color: var(--red); font-weight: 700; }
.center { text-align: center; }
.nbs, .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.row1 { display: grid; }
.nb { text-align: left; padding: 9px 12px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line); min-width: 0; }
.nb small { display: block; color: var(--muted); font-size: 12px; }
.nb b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.nb:disabled { opacity: .55; cursor: default; }
.friends { padding: 14px; border-radius: 15px; background: rgba(63, 224, 234, .08); border: 1px solid rgba(63, 224, 234, .25); }
.friends > * + * { margin-top: 8px; }
.friends p { color: var(--muted); font-size: 13.5px; }
.bar { height: 8px; border-radius: 9px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.bar i { display: block; height: 100%; min-width: 6px; background: linear-gradient(90deg, var(--cyan), var(--gold)); border-radius: 9px; }
.hero { display: flex; gap: 14px; align-items: flex-end; }
.hero img { width: 92px; height: 120px; object-fit: contain; object-position: bottom; flex: none; }
.hero h2 { padding-right: 30px; }
blockquote { margin-top: 6px; font-weight: 700; font-size: 15px; color: #fff; border-left: 3px solid var(--gold); padding-left: 10px; }
.done { text-align: center; }
.done .burst { font-size: 44px; line-height: 1; }
.done h2 { padding: 6px 0 0; }
.done > * + * { margin-top: 8px; }

/* editor */
.steps { display: flex; gap: 6px; list-style: none; margin-bottom: 4px; }
.steps li { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; color: var(--muted); padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--panel-2); }
.steps li b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(255,255,255,.12); color: var(--text); }
.steps li.on { color: var(--text); background: rgba(255, 207, 74, .16); }
.steps li.on b { background: var(--gold); color: #17122c; }
.steps li.done b { background: var(--green); color: #0c1228; }
.worlds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.world { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 11px 12px; border-radius: 15px; text-align: left; background: var(--panel-2); border: 1.5px solid var(--line); transition: border-color .15s, transform .15s var(--ease); }
.world:hover { border-color: var(--gold); }
.world:active { transform: scale(.98); }
.world .we { font-size: 28px; line-height: 1.1; }
.world b { font-size: 15px; }
.world small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.world i { font-style: normal; font-size: 11px; font-weight: 800; color: var(--green); margin-top: 3px; }
.remoji { font-size: 26px; line-height: 1; flex: none; }
.pbtns { display: flex; gap: 6px; flex: none; }
.free { font: 700 10px/1 var(--label); color: #17122c; background: var(--green); padding: 5px 8px; border-radius: 99px; vertical-align: middle; letter-spacing: .06em; }
.who { color: var(--gold); font-weight: 800; margin-top: 4px !important; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px; border-radius: 14px; font-weight: 800; font-size: 13px;
  background: var(--panel-2); border: 1.5px solid var(--line); line-height: 1.2;
}
.tab.on { border-color: var(--gold); background: rgba(255, 207, 74, .14); }
.ti { font-style: normal; font-size: 22px; line-height: 1.1; }
.ti-uy::before { content: "🏠"; } .ti-osmonopar::before { content: "🏙️"; } .ti-biznes::before { content: "🏪"; }
.opts { display: flex; flex-direction: column; gap: 14px; }
.opt > span, .opt > label { display: block; font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .06em; }
.sw { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.sw button { aspect-ratio: 1; border-radius: 50%; background: var(--c); border: 2px solid rgba(255, 255, 255, .18); max-width: 40px; }
.sw button[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--gold); }
.chips .chip { padding: 8px 12px; border-radius: 11px; font-weight: 700; font-size: 13.5px; background: var(--panel-2); border: 1.5px solid var(--line); }
.chips .chip.on { border-color: var(--gold); background: rgba(255, 207, 74, .16); color: #fff; }
.opt .chips { justify-content: flex-start; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 13px; padding: 4px; }
.stepper button { width: 42px; height: 40px; border-radius: 10px; font-size: 22px; font-weight: 700; background: rgba(255, 255, 255, .07); }
.stepper output { min-width: 44px; text-align: center; font: 700 18px var(--label); }
.slider { display: flex; align-items: center; gap: 12px; }
.slider input { flex: 1; accent-color: var(--gold); height: 32px; }
.slider output { min-width: 48px; text-align: right; font: 700 20px var(--label); color: var(--gold); }
.txt { width: 100%; height: 48px; padding: 0 14px; border-radius: 13px; background: var(--panel-2); border: 1.5px solid var(--line); font-weight: 700; font-size: 16px; }
.txt:focus { outline: none; border-color: var(--gold); }
.place { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; border-radius: 14px; background: var(--panel-2); border: 1px dashed rgba(255, 207, 74, .45); }
.place > div:not(.pbtns) { flex: 1; min-width: 0; }
.pbtns { width: 100%; }
.pbtns .btn { flex: 1; }
.place small { display: block; color: var(--muted); font-size: 12px; }
.place b { display: block; }
.msg { color: var(--red); font-weight: 700; font-size: 14px; }
.sheet .go { position: sticky; bottom: 0; min-height: 54px; font-size: 16px; box-shadow: 0 -8px 20px rgba(11, 18, 44, .9), 0 6px 22px rgba(255, 207, 74, .25); }
.nickform { display: flex; flex-direction: column; gap: 10px; }
.nickform label { font-weight: 800; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }

/* choosing a plot on the map */
.pickbar {
  position: fixed; z-index: 22; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); width: min(460px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 16px;
  background: var(--panel); border: 1px solid rgba(95, 211, 138, .6); font-weight: 800; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pickbar button { padding: 10px 14px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 800; flex: none; }

/* ── stories modal, toast, confetti ── */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(6, 10, 26, .82); }
.mcard { position: relative; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.mcard img { max-height: min(74vh, 74dvh); max-width: 100%; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.sbtns { width: min(360px, 100%); }
.sbtns .share[hidden] + .dl { grid-column: 1 / -1; }
.mcard .x { position: absolute; top: -8px; right: -8px; width: 40px; height: 40px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); font-size: 24px; }
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translate(-50%, 12px); opacity: 0;
  max-width: calc(100% - 32px); width: max-content; padding: 11px 16px; border-radius: 13px; font-weight: 700; font-size: 14.5px; text-align: center;
  background: rgba(11, 18, 44, .94); border: 1px solid var(--line); transition: opacity .2s, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.sheet-on .toast { bottom: auto; top: calc(70px + var(--safe-t)); }
.confetti { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.noscript { position: fixed; inset: auto 16px 16px; padding: 14px; border-radius: 14px; background: var(--ink); text-align: center; }

/* ── wide screens: the sheet becomes a side panel ── */
@media (min-width: 760px) {
  .sheet, .sheet[data-mode="editor"] {
    left: 16px; right: auto; top: calc(74px + var(--safe-t)); bottom: 16px; width: 390px; max-height: none; height: auto;
    border-radius: 22px; border-bottom: 1px solid var(--line); animation-name: side;
  }
  .sheet:not([data-mode="editor"]) { bottom: auto; max-height: calc(100vh - 90px); }
  @keyframes side { from { transform: translateX(-20px); opacity: 0; } }
  body.sheet-on .search { opacity: 1; pointer-events: auto; left: calc(50% + 205px); width: min(420px, calc(100% - 470px)); }
  .welcome { place-items: center; }
  .wcard p { font-size: 17px; }
  .toast { bottom: calc(84px + var(--safe-b)); }
  body.sheet-on .toast { top: auto; bottom: calc(84px + var(--safe-b)); left: calc(50% + 205px); }
}
@media (min-width: 760px) { .worlds { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) {
  .wsteps li { font-size: 12px; padding-right: 9px; }
  #wchips button { width: 40px; height: 40px; font-size: 19px; }
  .sw { gap: 5px; }
  .brand b { font-size: 12px; }
  .pop { min-width: 72px; padding: 5px 9px; }
}
@media (max-height: 760px) and (max-width: 760px) {
  .wcard { gap: 11px; }
  .wcard p { display: none; }
  .wcard h1 { font-size: 34px; }
}
@media (max-height: 560px) and (max-width: 900px) {
  .wcard { gap: 9px; }
  .wcard h1 { font-size: 26px; }
  .wcard p { display: none; }
  .ctl { gap: 5px; }
  .ctl button { width: 40px; height: 40px; }
  .ctl .build { height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
