/* Макет города на столе архитектора: гипсовые дома, песчаная земля, бирюза для нового. */
:root {
  --paper: #f7f5f0; --ground: #e9e5dc; --ink: #23211d; --soft: #5d584e; --line: rgba(35, 33, 29, .13);
  --accent: #0b746b; --accent-ink: #fff; --lack: #c9683a; --raise: #eeeae1;
  --gap: 16px; --r: 14px; --rc: 9px;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: var(--ground); color: var(--ink); font: 400 15px/1.45 'Golos Text', 'Segoe UI', Roboto, system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

#map { position: absolute; inset: 0; }
.maplibregl-ctrl-attrib { display: none; }
.maplibregl-ctrl-bottom-right { bottom: 112px; right: calc(var(--gap) - 10px); }
.maplibregl-ctrl-group { background: var(--paper) !important; box-shadow: 0 1px 2px rgba(35, 33, 29, .12), 0 6px 16px rgba(35, 33, 29, .1) !important; border-radius: 11px !important; }
#head, #side, #reach, #card, #time, #tip { position: absolute; background: var(--paper); border-radius: var(--r); box-shadow: 0 1px 2px rgba(35, 33, 29, .08), 0 10px 28px rgba(35, 33, 29, .10); z-index: 2; }

#head { top: var(--gap); left: var(--gap); width: 372px; padding: 20px; display: grid; grid-template-columns: 1fr auto; gap: 16px 12px; }
h1 { font-size: 24px; white-space: nowrap; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }
.brand p { color: var(--soft); margin-top: 4px; font-size: 14px; }
.lang { display: flex; align-self: start; background: var(--raise); border-radius: var(--rc); padding: 3px; }
.lang button { padding: 5px 9px; border-radius: 6px; font-size: 13px; color: var(--soft); }
.lang button[aria-pressed=true] { background: var(--paper); color: var(--ink); }
#goal { grid-column: 1 / -1; }
#goal label { display: block; font-weight: 500; margin-bottom: 8px; }
.ask { display: grid; gap: 8px; }
.ask input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid rgba(35, 33, 29, .32); border-radius: var(--rc); background: #fff; font-size: 16px; }
.ask input::placeholder { color: #77716a; }
.primary { height: 46px; padding: 0 18px; border-radius: var(--rc); background: var(--accent); color: var(--accent-ink); font-weight: 500; transition: background-color .15s, opacity .15s; }
.primary:hover { background: #095f58; }
.primary:disabled { opacity: .65; cursor: progress; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips button { padding: 6px 10px; border-radius: 7px; background: var(--raise); font-size: 13px; color: var(--soft); transition: background-color .15s, color .15s; }
.chips button:hover { background: #e2ddd1; color: var(--ink); }
#note { grid-column: 1 / -1; font-size: 13.5px; color: var(--soft); border-top: 1px solid var(--line); padding-top: 12px; }
#note.on { color: var(--accent); }

#reach { left: var(--gap); bottom: 122px; width: 372px; padding: 16px 20px; }
#reach h2 { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.bar { display: grid; grid-template-columns: 138px 1fr 44px; align-items: center; gap: 10px; width: 100%; padding: 5px 0; text-align: left; font-size: 14px; border-radius: 6px; }
.bar i { height: 8px; border-radius: 4px; background: var(--raise); overflow: hidden; position: relative; }
.bar i b { position: absolute; inset: 0 auto 0 0; border-radius: 4px; transform-origin: left; transition: width .5s cubic-bezier(.22, 1, .36, 1); }
.bar i u { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--paper); box-shadow: 0 0 0 .5px var(--ink); }
.bar em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.bar[aria-pressed=true] span { font-weight: 600; }
.bar[aria-pressed=false].dim { opacity: .45; }
.legend { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--soft); }
.legend::before { content: ''; width: 14px; height: 14px; border-radius: 3px; background: var(--lack); opacity: .75; flex: none; }

#side { top: var(--gap); right: var(--gap); width: 348px; max-height: calc(100% - 260px); overflow: auto; padding: 20px; }
#side h2 { font-size: 20px; line-height: 1.25; font-weight: 600; }
#side p { color: var(--soft); margin-top: 8px; }
#side .say { color: var(--ink); }
#side ul { list-style: none; padding: 0; margin-top: 14px; }
#side li + li { border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 34px 1fr; gap: 2px 12px; width: 100%; text-align: left; padding: 12px 0; }
.item .ic { grid-row: 1 / 4; }
.ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.item strong { font-weight: 500; }
.item small { font-size: 13.5px; color: var(--soft); }
.item .g { color: var(--accent); font-weight: 500; font-size: 14px; }
.item:hover strong { text-decoration: underline; text-underline-offset: 3px; }

#card { left: 50%; transform: translateX(-50%); bottom: 116px; width: 384px; max-width: calc(100vw - 32px); padding: 20px; z-index: 4; }
#card header { display: grid; grid-template-columns: 34px 1fr 32px; gap: 12px; align-items: center; }
#card h3 { font-size: 18px; font-weight: 600; line-height: 1.25; }
#card h3 small { display: block; font-size: 13.5px; font-weight: 400; color: var(--soft); }
#card h4 { font-size: 14px; font-weight: 500; margin: 16px 0 4px; }
#card .big { font-size: 28px; font-weight: 500; color: var(--accent); margin-top: 14px; line-height: 1; font-variant-numeric: tabular-nums; }
#card p { margin-top: 4px; }
#card .by { font-size: 13px; color: var(--soft); margin-top: 10px; }
#card .act { display: block; width: 100%; height: 44px; margin-top: 16px; border-radius: var(--rc); background: var(--raise); font-weight: 500; transition: background-color .15s; }
#card .act:hover { background: #e2ddd1; }
.x { width: 32px; height: 32px; border-radius: 8px; font-size: 22px; line-height: 1; color: var(--soft); }
.x:hover { background: var(--raise); }
#tip { left: 50%; top: var(--gap); transform: translateX(-50%); padding: 12px 16px; z-index: 5; display: flex; gap: 14px; align-items: center; max-width: calc(100vw - 32px); }
#tip button { color: var(--accent); font-weight: 500; white-space: nowrap; }

#time { left: var(--gap); right: var(--gap); bottom: 42px; height: 68px; display: grid; grid-template-columns: 48px 1fr; gap: 34px; align-items: center; padding: 0 34px 0 10px; }
#play { width: 48px; height: 48px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; }
#play svg { width: 24px; fill: currentColor; }
.track { position: relative; height: 48px; }
#year { -webkit-appearance: none; appearance: none; position: absolute; left: -11px; width: calc(100% + 22px); top: 0; height: 26px; background: none; cursor: grab; }
#year::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), #d9d3c6 var(--p, 0%)); }
#year::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), #d9d3c6 var(--p, 0%)); }
#year::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; border: 5px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
#year::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 5px solid var(--accent); }
#ticks button { position: absolute; top: 24px; transform: translateX(-50%); font-size: 14px; color: var(--soft); padding: 2px 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#ticks button[aria-current=true] { color: var(--ink); font-weight: 600; }
#credit { position: absolute; left: var(--gap); right: var(--gap); bottom: 5px; font-size: 11.5px; line-height: 1.3; color: #5d584e; text-align: center; text-wrap: balance; z-index: 2; max-height: 32px; overflow: hidden; text-shadow: 0 0 4px var(--ground), 0 0 4px var(--ground); }

.pl { font-size: 13px; font-weight: 500; color: #4c483f; text-shadow: 0 0 3px #f7f5f0, 0 0 3px #f7f5f0, 0 0 5px #f7f5f0; pointer-events: none; white-space: nowrap; }
.pin { cursor: pointer; }
.pin .ic { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg) translate(10px, -10px); box-shadow: 0 2px 6px rgba(35, 33, 29, .3); transition: scale .25s cubic-bezier(.22, 1, .36, 1), opacity .25s; }
.pin .ic svg { transform: rotate(45deg); width: 17px; }
.pin.off { pointer-events: none; } .pin.off .ic { scale: 0; opacity: 0; }
.pin.sel .ic { scale: 1.35; }

#loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 9; background: var(--ground); transition: opacity .5s; font-size: 17px; text-align: center; padding: 24px; }
#loading.done { opacity: 0; pointer-events: none; }

@media (max-width: 1100px) { #side { width: 300px; } #head, #reach { width: 330px; } .bar { grid-template-columns: 118px 1fr 42px; } }
@media (max-height: 800px) and (min-width: 821px) { #reach { padding: 12px 20px; } .chips { display: none; } #head { padding: 16px 20px; gap: 10px 12px; } .bar { padding: 3px 0; } }
@media (max-width: 820px) {
  .maplibregl-ctrl-bottom-right { display: none; }
  :root { --gap: 10px; }
  #head { width: auto; right: var(--gap); padding: 12px 14px; gap: 8px 12px; }
  h1 { font-size: 20px; } .brand p { display: none; }
  #goal label { display: none; }
  .ask { grid-template-columns: 1fr auto; } .ask input { height: 44px; } .primary { height: 44px; padding: 0 14px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-top: 8px; } .chips button { white-space: nowrap; padding: 8px 10px; }
  #note { padding-top: 8px; font-size: 13px; }
  #reach { display: none; }
  #side { top: auto; right: var(--gap); left: var(--gap); bottom: 108px; width: auto; max-height: 27vh; padding: 14px 16px; }
  #side h2 { font-size: 17px; } #side p { margin-top: 4px; font-size: 14px; } #side ul { margin-top: 6px; }
  #card { bottom: 108px; padding: 16px; max-height: 56vh; overflow: auto; }
  #time { padding: 0 26px 0 8px; gap: 28px; bottom: 34px; height: 64px; }
  #ticks button { font-size: 13px; padding: 2px 3px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 820px) {
  #credit { white-space: normal; font-size: 10.5px; line-height: 1.25; bottom: 4px; max-height: 39px; }
  #tip { width: calc(100vw - 20px); top: 10px; justify-content: space-between; }
  #time { bottom: 48px; } #side, #card { bottom: 122px; }
}
