/* Делогород 3D: город во весь экран, поверх — панель, подписи домов, кнопки. */
:root { --tekst: #1d2433; --tekst2: #5b6475; --zelen: #2e7d4f; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tekst); background: #bfe3f5; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }

.plashka-proba { position: fixed; top: 0; left: 0; right: 0; z-index: 15; background: #ffd166; color: #3a2c00; text-align: center; font-size: 12.5px; font-weight: 600; padding: calc(5px + env(safe-area-inset-top)) 10px 5px; }

#scena { position: fixed; inset: 0; touch-action: none; }
#scena canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }

/* Подписи над домами: ник и дело видны без нажатия */
#metki { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.metka { position: absolute; left: 0; top: 0; transform: translate(-9999px, 0); will-change: transform; max-width: 118px; padding: 3px 7px 4px; border-radius: 8px; background: rgba(255, 255, 255, .93); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); text-align: center; line-height: 1.15; }
.metka::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: rgba(255, 255, 255, .93); }
.metka b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; font-weight: 700; }
.metka span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--tekst2); }
.metka.nashel { background: #ff006e; color: #fff; z-index: 1; }
.metka.nashel span { color: #ffe0ef; }
.metka.nashel::after { border-top-color: #ff006e; }
.metka.svob { background: rgba(255, 255, 255, .75); color: var(--tekst2); font-size: 11px; font-weight: 700; padding: 3px 8px; }
.metka-rayon { max-width: none; white-space: nowrap; background: var(--zelen); color: #fff; font-weight: 800; font-size: 14px; padding: 4px 10px; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--zelen), 0 3px 8px rgba(0, 0, 0, .2); }
.metka-rayon::after { display: none; }
.metka-zd { max-width: none; white-space: nowrap; background: #fff; color: var(--a); border: 2px solid var(--a); font-weight: 800; font-size: 11.5px; padding: 2px 8px; }
.metka-zd::after { border-top-color: var(--a); }
.metka-rayon b, .metka-zd b, .metka-kvartal b, .metka.svob b { display: inline; font: inherit; -webkit-line-clamp: none; }
.metka-kvartal { max-width: none; white-space: nowrap; background: rgba(46, 125, 79, .88); color: #fff; font-weight: 800; font-size: 11.5px; padding: 2px 8px; }
.metka-kvartal::after { display: none; }
/* участок гостя: ник и «здесь вырастет дом» */
.metka.gost { max-width: none; white-space: nowrap; background: #ff006e; color: #fff; padding: 5px 9px 6px; box-shadow: 0 0 0 3px rgba(255, 0, 110, .25), 0 3px 10px rgba(0, 0, 0, .25); z-index: 2; }
.metka.gost span { color: #ffe0ef; }
.metka.gost::after { border-top-color: #ff006e; }

/* Панель сверху */
.panel { position: fixed; z-index: 10; left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top)); max-width: 560px; margin: 0 auto; padding: 10px 10px 6px; border-radius: 16px; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 4px 18px rgba(0, 0, 0, .12); }
body.proba .panel { top: calc(34px + env(safe-area-inset-top)); }
.panel-verh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
h1 { margin: 0; font-size: 22px; line-height: 1.1; }
.schetchik { font-size: 13px; color: var(--tekst2); white-space: nowrap; margin-left: auto; }
.panel-verh h1 { white-space: nowrap; }
@media (max-width: 359px) { .panel-verh h1 { font-size: 19px; } .schetchik { font-size: 12px; } }
.knopka-kak { flex: none; align-self: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: #1d3557; color: #fff; font: 700 16px/28px system-ui, sans-serif; cursor: pointer; padding: 0; }
.instrukciya { margin: 4px 0 8px; padding: 0; list-style: none; }
.instrukciya li { margin: 0 0 10px; padding-left: 30px; position: relative; line-height: 1.4; }
.instrukciya li b { display: block; font-weight: 700; }
.instrukciya li::before { content: attr(data-z); position: absolute; left: 0; top: 0; font-size: 20px; }
.poisk { display: flex; gap: 6px; }
.poisk input { flex: 1; min-width: 0; border: 1.5px solid #dde2ea; border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 16px; background: #fff; }
.poisk input:focus { outline: none; border-color: var(--tekst); }
.knopka-mal { flex: none; border: 0; border-radius: 10px; background: #eef1f5; padding: 0 12px; min-height: 40px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
#nashlos { padding-top: 5px; font-size: 13px; color: var(--tekst2); }
#nashlos:empty { display: none; }
.rayony { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.rayony::-webkit-scrollbar { display: none; }
.rayony button { flex: none; border: 0; border-radius: 999px; background: #eef1f5; padding: 6px 11px; font-size: 13px; cursor: pointer; }
.rayony button b { color: var(--tekst2); font-weight: 600; margin-left: 3px; }

/* Кнопки на карте */
.upravlenie { position: fixed; z-index: 10; right: 10px; bottom: calc(86px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.upravlenie button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .93); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); font-size: 22px; font-weight: 600; line-height: 1; cursor: pointer; }
.knopka-vstupit { position: fixed; z-index: 10; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); border: 0; border-radius: 14px; background: var(--tekst); color: #fff; font-weight: 700; font-size: 16px; padding: 14px 26px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); white-space: nowrap; cursor: pointer; }
.podskazka { position: fixed; z-index: 9; left: 50%; top: 58%; transform: translate(-50%, -50%); max-width: 270px; padding: 10px 14px; border-radius: 12px; background: rgba(29, 36, 51, .85); color: #fff; font-size: 14px; text-align: center; pointer-events: none; transition: opacity .6s; }
.podskazka.skryt { opacity: 0; }

/* Список жителей */
.spisok { position: fixed; inset: 0; z-index: 20; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #f6f1e6; }
.spisok-verh { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; background: #f6f1e6; border-bottom: 1px solid #e6dcc8; }
.spisok-verh h2 { margin: 0; font-size: 19px; }
#spisokTelo { max-width: 640px; margin: 0 auto; padding: 6px 12px 20px; }
.s-rayon { margin: 18px 0 6px; font-size: 16px; color: var(--zelen); }
.s-zhitel { display: block; width: 100%; text-align: left; border: 0; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.s-zhitel b { display: block; font-size: 15px; }
.s-zhitel span { font-size: 13px; color: var(--tekst2); }
.s-zhitel.ne-to { display: none; }
.podval { background: #4a4e5a; color: #d9dce3; font-size: 14px; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.podval p { max-width: 560px; margin: 0 auto 8px; }
.podval a { color: #fff; }

/* Карточка жителя и подсказки — шторка снизу */
.shtorka { position: fixed; inset: 0; z-index: 50; }
.shtorka-fon { position: absolute; inset: 0; background: rgba(20, 24, 35, .45); }
.shtorka-okno { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; max-height: 85vh; overflow: auto; margin: 0 auto; background: #fff; border-radius: 20px 20px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: vverh .22s ease-out; }
@keyframes vverh { from { transform: translateY(40px); opacity: .4; } }
.zakryt:focus:not(:focus-visible) { outline: none; }
.zakryt { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 30px; line-height: 1; color: #8a93a3; padding: 6px 10px; cursor: pointer; }
.k-shapka { display: flex; align-items: center; gap: 12px; margin: 0 30px 10px 0; }
.k-znak { flex: none; width: 54px; height: 54px; border-radius: 12px; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.k-delo { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 800; }
.k-nik { color: var(--tekst2); font-size: 15px; }
.k-opisanie { margin: 6px 0 10px; }
.k-meta { margin: 0 0 16px; font-size: 14px; color: var(--tekst2); }
.k-knopka { display: block; width: 100%; border: 0; text-align: center; background: #2aabee; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; border-radius: 12px; padding: 14px; cursor: pointer; }
.k-knopka.insta { background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888); margin-top: 8px; }
.vhod input { display: block; width: 100%; border: 1.5px solid #dde2ea; border-radius: 12px; padding: 13px 14px; font: inherit; font-size: 17px; margin: 4px 0 6px; }
.vhod input:focus { outline: none; border-color: var(--tekst); }
.oshibka-nika { color: #c0392b; min-height: 1em; margin: 0 0 8px; }
.oshibka-nika:empty { min-height: 0; margin: 0; }
.vybor-rayona { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.vybor-rayona button { border: 1.5px solid #dde2ea; background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 14px; cursor: pointer; }
.vybor-rayona button.vybran { background: var(--tekst); border-color: var(--tekst); color: #fff; }
.forma-dela input { margin: 6px 0; }
.gotovyj-tekst { margin: 8px 0 10px; padding: 11px 12px; border-radius: 12px; background: #f3f5f8; border: 1.5px dashed #c9d1dc; font-size: 15px; user-select: all; -webkit-user-select: all; }
.k-knopka:disabled { background: #b8c2cf; cursor: default; }
.spisok-otmetok { max-height: 40vh; overflow-y: auto; margin: 6px 0 4px; }
a.s-zhitel { color: inherit; text-decoration: none; }
.s-esche { margin: 4px 0 10px; font-size: 13px; color: var(--tekst2); text-align: center; }
.k-knopka.seraya { background: #e7ebf0; color: var(--tekst); margin-top: 8px; }
.k-knopka[aria-disabled="true"] { background: #b8c2cf; pointer-events: none; }
.k-melko { margin: 10px 0 0; font-size: 12.5px; color: var(--tekst2); }
.shagi { padding-left: 22px; margin: 8px 0 14px; }
.shagi li { margin-bottom: 8px; }
.oshibka { position: fixed; inset: 40% 20px auto; text-align: center; }

@media (prefers-reduced-motion: reduce) { .shtorka-okno { animation: none; } }
/* значки сетей (файлами: CSP сайта не пускает картинки data:): у подписи дома — кружок в углу (не меняет размер подписи), в карточке и списке — перед текстом */
[data-set="instagram"] { --ikonka: url("ikonki/instagram.svg"); }
[data-set="youtube"] { --ikonka: url("ikonki/youtube.svg"); }
[data-set="vk"] { --ikonka: url("ikonki/vk.svg"); }
.metka[data-set]::before { content: ""; position: absolute; left: -6px; top: -6px; width: 14px; height: 14px; border-radius: 50%; background: #fff var(--ikonka) center / 10px no-repeat; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.k-nik[data-set]::before, .s-zhitel[data-set] b::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: 6px; vertical-align: -0.15em; background: var(--ikonka) center / contain no-repeat; }
.k-knopka.yt { background: #ff0000; margin-top: 8px; }
.vybor-seti { display: flex; gap: 6px; margin: 4px 0 8px; }
.vybor-seti button { flex: 1; border: 2px solid #e3e6ea; background: #fff; border-radius: 12px; padding: 9px 6px; font: inherit; font-size: 15px; font-weight: 600; color: var(--tekst2); cursor: pointer; }
.vybor-seti button::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: 6px; vertical-align: -0.15em; background: var(--ikonka) center / contain no-repeat; }
.vybor-seti button.vybran { border-color: #ff006e; color: #111; }
/* забавы города: лодки с новичками, дом недели, ночь */
.metka.lodka { background: #e0f2ff; box-shadow: 0 0 0 2px #4ea8de, 0 2px 6px rgba(0, 0, 0, .2); }
.metka.lodka::after { border-top-color: #e0f2ff; }
.metka.dom-nedeli { background: #ffc300; color: #3d2c00; box-shadow: 0 0 0 2px #fff, 0 3px 10px rgba(0, 0, 0, .3); z-index: 1; }
.metka.dom-nedeli span { color: #3d2c00; font-weight: 700; }
.metka.dom-nedeli::after { border-top-color: #ffc300; }
#rayony button.dom-nedeli { background: #ffc300; color: #3d2c00; font-weight: 700; }
.k-nedeli { background: #fff4cc; border-radius: 10px; padding: 8px 10px; font-weight: 600; color: #5c4400; }
body.noch .metka-kvartal { background: rgba(30, 60, 110, .9); }

/* режим съёмки роликов (?kino=1): без кнопок, свой слой с надписями. Шрифт — Montserrat Black (OFL), только для роликов */
@font-face { font-family: "GorodB"; font-weight: 900; font-display: block; src: url("shrifty/montserrat-900-cyrillic.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "GorodB"; font-weight: 900; font-display: block; src: url("shrifty/montserrat-900-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: "GorodB"; font-weight: 800; font-display: block; src: url("shrifty/montserrat-800-cyrillic.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "GorodB"; font-weight: 800; font-display: block; src: url("shrifty/montserrat-800-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
body.kino .panel, body.kino .upravlenie, body.kino #vstupit, body.kino .podskazka, body.kino .plashka-proba, body.kino #shtorka, body.kino #spisok { display: none !important; }
#kino { position: fixed; inset: 0; z-index: 30; pointer-events: none; font-family: "GorodB", "Manrope", system-ui, sans-serif; }
#kino .k-seriya { position: absolute; left: 16px; top: 22px; padding: 6px 11px; border-radius: 8px; background: #ffd166; color: #0d1b2a; font-weight: 900; font-size: 13px; letter-spacing: .04em; box-shadow: 0 3px 0 #0d1b2a; }
#kino .k-schet { position: absolute; right: 16px; top: 16px; min-width: 78px; padding: 6px 12px 8px; border-radius: 14px; background: #0d1b2a; color: #fff; text-align: center; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
#kino .k-schet small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; color: #ffd166; }
#kino .k-schet b { display: block; font-size: 32px; line-height: 1.05; font-weight: 900; }
#kino .k-titul { position: absolute; left: 0; right: 0; top: 15%; text-align: center; color: #fff; font-weight: 900; font-size: 56px; line-height: .98; text-transform: uppercase; letter-spacing: -.01em;
  -webkit-text-stroke: 10px #0d1b2a; paint-order: stroke fill; text-shadow: 0 6px 0 #0d1b2a, 0 10px 24px rgba(0,0,0,.45); }
#kino .k-titul em { display: inline-block; font-style: normal; color: #0d1b2a; background: #ffd166; -webkit-text-stroke: 0; text-shadow: none; font-size: 30px; padding: 6px 14px; margin-top: 12px; border-radius: 10px; box-shadow: 0 5px 0 #0d1b2a; transform: rotate(-2deg); }
#kino .k-konec { position: absolute; left: 22px; right: 22px; top: 15%; padding: 18px 16px; border-radius: 20px; background: #0d1b2a; color: #fff; text-align: center; font-weight: 900; font-size: 26px; line-height: 1.15; opacity: 0; box-shadow: 0 6px 0 rgba(0,0,0,.35); }
#kino .k-konec.vidno { opacity: 1; }
#kino .k-konec b { display: block; color: #ffd166; font-size: 28px; margin-top: 10px; }
.metka.kino-tvoj { background: #ffb000; color: #1b1b1b; font-weight: 800; }
