/* Город 知道市 (docs/PHASE-2-CITY.md): переключатель режимов, карта района, экран локации.
   Палитра герба: чёрный, красный, золото. Закрытое — тёмные плиты с золотой каймой. */
.home-switch { display: flex; gap: 6px; padding: 4px; margin: 0 0 14px; width: fit-content; max-width: 100%;
  border: 1px solid rgba(255, 207, 90, .35); border-radius: 14px; background: rgba(8, 10, 22, .55); }
.home-switch-btn { min-height: 44px; padding: 8px 18px; border: 0; border-radius: 10px; background: transparent; color: var(--text-dim); font-weight: 600; cursor: pointer; }
.home-switch-btn.active { background: linear-gradient(180deg, #e8262e, #b3171f); color: #fff; box-shadow: 0 0 14px rgba(232, 38, 46, .45); }
.home-switch-btn [lang="zh"] { margin-left: 4px; color: #ffcf5a; }
.home-switch-btn.active [lang="zh"] { color: #fff2c4; }

.city-closed { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; margin-bottom: 14px;
  border-color: rgba(255, 207, 90, .55); background: radial-gradient(120% 140% at 0% 100%, rgba(232, 38, 46, .22), transparent 60%), var(--panel-solid, #111a2c); }
.city-closed h2 { margin: 4px 0 6px; }
.city-closed p { margin: 0; line-height: 1.5; }

.city-head { margin-bottom: 10px; }
.city-head h2 { margin: 2px 0 4px; }
.city-head p { margin: 0; color: var(--text-dim); }
.city-map { position: relative; width: 100%; max-width: 880px; aspect-ratio: 6 / 5; margin: 0 auto 12px; overflow: hidden;
  border: 2px solid rgba(255, 207, 90, .55); border-radius: 18px; box-shadow: 0 0 28px rgba(232, 38, 46, .25), inset 0 0 40px rgba(0, 0, 0, .45); background: #0d1233; }
.city-poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.c-star { fill: #fff6d0; opacity: .7; animation: c-twinkle 3.2s ease-in-out infinite; }
.c-far { fill: #1c1033; }
.c-road-edge { fill: none; stroke: #6b4a1e; stroke-width: 40; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.c-road { fill: none; stroke: #2a2133; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.c-road-mid { fill: none; stroke: #ffcf5a; stroke-width: 2; stroke-dasharray: 7 11; stroke-linecap: round; opacity: .55; }
.c-string { fill: none; stroke: #ffcf5a; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0 15; filter: drop-shadow(0 0 3px #ffb73a); animation: c-glow 2.6s ease-in-out infinite alternate; }

.c-b .c-body { fill: var(--c-body); stroke: rgba(0, 0, 0, .35); stroke-width: 1; }
.c-b .c-roof { fill: var(--c-roof); stroke: var(--c-trim); stroke-width: 1.4; }
.c-b .c-door { fill: #2a1218; stroke: var(--c-trim); stroke-width: 1; }
.c-b .c-sign { fill: #170d12; stroke: var(--c-trim); stroke-width: 1.2; }
.c-b .c-sign-zh { fill: var(--c-trim); font: 700 12px var(--cjk); }
.c-b .c-win { fill: #3a2a3c; stroke: rgba(0, 0, 0, .3); }
.c-b .c-win.lit { fill: #ffcf5a; filter: drop-shadow(0 0 5px #ffb73a); animation: c-glow 3s ease-in-out infinite alternate; }
.c-b .c-lan line { stroke: var(--c-trim); stroke-width: 1; }
.c-b .c-lan ellipse { fill: #e8262e; stroke: #ffcf5a; stroke-width: 1; filter: drop-shadow(0 0 4px #ff6a3a); }
.c-b .c-lan { transform-box: fill-box; transform-origin: 50% 0; animation: c-sway 3.6s ease-in-out infinite alternate; }
.c-b-soon .c-body { fill: #4a3c52; } .c-b-soon .c-roof { fill: #2c2236; stroke-dasharray: 4 3; }
.c-b-soon .c-scaffold { fill: none; stroke: #ffcf5a; stroke-width: 1.5; opacity: .75; stroke-dasharray: 5 3; }
.c-b-locked { opacity: .9; }
.c-b-locked .c-body { fill: #1b1626; } .c-b-locked .c-roof { fill: #0f0b17; stroke: rgba(255, 207, 90, .45); }
.c-b-locked .c-sign-zh { fill: rgba(255, 207, 90, .45); } .c-b-locked .c-sign, .c-b-locked .c-door { stroke: rgba(255, 207, 90, .35); }
.c-b-locked .c-win { fill: #120e1c; }

.city-pin { position: absolute; transform: translate(-50%, -50%); width: 40%; height: 15.5%; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; color: #fff; }
.city-pin:hover, .city-pin:focus-visible { background: rgba(255, 207, 90, .12); outline: 2px solid #ffcf5a; outline-offset: 2px; }
.city-pin-num { position: absolute; left: 2px; top: 2px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #170d12; border: 1.5px solid #ffcf5a; color: #ffcf5a; font: 700 12px/1 var(--sans); }
.city-pin-open .city-pin-num { background: #e8262e; border-color: #ffe9a8; color: #fff; box-shadow: 0 0 10px rgba(255, 106, 58, .8); animation: c-pulse 1.8s ease-in-out infinite; }
.city-pin-label { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 2px; display: grid; gap: 0; width: max-content; max-width: 150%; padding: 3px 8px; border-radius: 8px; background: rgba(10, 8, 20, .82); border: 1px solid rgba(255, 207, 90, .4); text-align: center; line-height: 1.2; }
.city-pin-label b { font-size: .8rem; } .city-pin-label small { font-size: .68rem; color: #ffcf5a; }
.city-pin-locked .city-pin-label b { color: var(--text-dim); }

.city-say { display: flex; gap: 12px; align-items: center; margin: 4px 0 12px; }
.city-say p { margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-solid); }
.city-street { margin-bottom: 12px; }
.city-street small { display: block; margin-top: 10px; color: var(--text-dim); }
.city-street-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 8px; }
.city-lanterns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.lan { position: relative; display: inline-block; width: 16px; height: 22px; border-radius: 8px / 10px; background: #2a2133; border: 1.5px solid #5a4a63; }
.lan::before { content: ""; position: absolute; left: 3px; right: 3px; top: -5px; height: 4px; border-radius: 2px; background: #5a4a63; }
.lan.lit { background: radial-gradient(circle at 50% 40%, #ffd96a, #e8262e 75%); border-color: #ffcf5a; box-shadow: 0 0 10px rgba(255, 150, 60, .8); }
.lan.lit::before { background: #ffcf5a; }
.lan.mine { outline: 2px solid #fff2c4; outline-offset: 2px; }
.lan.big { width: 30px; height: 42px; flex: none; border-radius: 15px / 20px; }
.lan.big::before { top: -8px; height: 6px; left: 6px; right: 6px; }
.city-watch { margin: 6px 0 14px; text-align: center; color: var(--text-dim); font-size: .85rem; }

.city-loc-head { position: relative; display: grid; gap: 8px; margin: 10px 0 12px; overflow: hidden; border: 1px solid rgba(255, 207, 90, .5); border-radius: 18px; background: #120a18; }
.city-hero-img { display: block; width: 100%; max-height: 260px; object-fit: cover; opacity: .9; }
.city-hero-text { padding: 4px 18px 16px; }
.city-hero-text h1 { margin: 2px 0 6px; } .city-hero-text h1 [lang="zh"] { color: #ffcf5a; font-size: .7em; margin-left: 6px; } .city-hero-text p { margin: 0; color: var(--text-dim); }
.city-task, .city-mine, .city-recall, .city-note { margin-bottom: 12px; }
.city-task h2, .city-recall h2, .city-note h2 { margin: 4px 0 6px; }
.city-keepsake { display: flex; gap: 16px; align-items: center; }
.city-keepsake .postcard-line { margin: 4px 0; }

/* Улица ожила (учитель зажёг): окна и фонарики сияют сильнее, вокруг крыш мерцают искры */
.c-spark { fill: #fff2c4; filter: drop-shadow(0 0 4px #ffcf5a); animation: c-twinkle 1.6s ease-in-out infinite; }
.c-alive .c-win.lit { animation-duration: 1.4s; filter: drop-shadow(0 0 8px #ffcf5a); }
.c-alive .c-lan { animation-duration: 2s; }
.city-pin-alive .city-pin-label { border-color: #ffcf5a; box-shadow: 0 0 12px rgba(255, 207, 90, .6); }
.city-alive-banner { margin: 0 0 12px; padding: 12px 16px; border: 1px solid rgba(255, 207, 90, .6); border-radius: 14px; text-align: center; color: #ffe9a8;
  background: radial-gradient(120% 140% at 50% 0%, rgba(232, 38, 46, .3), transparent 70%), rgba(10, 8, 20, .7); }
@keyframes c-twinkle { 50% { opacity: .2; } }
@keyframes c-glow { from { opacity: .72; } to { opacity: 1; } }
@keyframes c-sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes c-pulse { 50% { box-shadow: 0 0 18px rgba(255, 106, 58, 1); } }
.journey-consequence { margin: 6px 0 4px; }
.journey-consequence .say { animation: c-pop .35s ease-out; }
@keyframes c-pop { from { transform: translateY(6px); opacity: 0; } }

@media (max-width: 640px) {
  .city-closed { grid-template-columns: 72px 1fr; } .city-closed .phase2-crest { width: 72px; height: 72px; }
  .city-hero-img { max-height: 180px; }
}
@media (prefers-reduced-motion: reduce) { .c-spark, .c-star, .c-string, .c-win.lit, .c-lan, .city-pin-open .city-pin-num, .c3-pin-open .c3-pin-num, .journey-consequence .say { animation: none; } }
body[data-motion="off"] .c-star, body[data-motion="off"] .c-string, body[data-motion="off"] .c-win.lit, body[data-motion="off"] .c-lan, body[data-motion="off"] .city-pin-open .city-pin-num, body[data-motion="off"] .c3-pin-open .c3-pin-num { animation: none; }

/* Объёмная карта (three.js): canvas и подписи-кнопки поверх него */
.c3-wrap { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; }
.c3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.c3-pins { position: absolute; inset: 0; pointer-events: none; }
.c3-pinbox { position: absolute; left: 0; top: 0; will-change: transform; pointer-events: none; }
.c3-pin { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 3px 10px 3px 4px; border: 1px solid rgba(255, 207, 90, .55); border-radius: 999px; background: rgba(10, 8, 20, .78); color: #fff; font: inherit; cursor: pointer; backdrop-filter: blur(2px); }
.c3-pin:hover, .c3-pin:focus-visible { outline: 2px solid #ffcf5a; outline-offset: 2px; background: rgba(40, 20, 50, .9); }
div.c3-pin { pointer-events: none; min-height: 0; }
.c3-pin-num { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: #170d12; border: 1.5px solid #ffcf5a; color: #ffcf5a; font: 700 13px/1 var(--sans); }
.c3-pin-open .c3-pin-num { background: #e8262e; border-color: #ffe9a8; color: #fff; box-shadow: 0 0 10px rgba(255, 106, 58, .8); animation: c-pulse 1.8s ease-in-out infinite; }
.c3-pin-label { display: grid; line-height: 1.15; text-align: left; white-space: nowrap; }
.c3-pin-label b { font-size: .82rem; } .c3-pin-label small { font-size: .68rem; color: #ffcf5a; }
.c3-pin-locked .c3-pin-label b { color: var(--text-dim); }
.c3-pin-alive { border-color: #ffcf5a; box-shadow: 0 0 14px rgba(255, 207, 90, .6); }
.city-map.is-3d .city-poster, .city-map.is-3d > .city-pin { display: none; }
.city-map .c3-fallback-note { position: absolute; left: 8px; bottom: 6px; font-size: .7rem; color: var(--text-dim); }
@media (max-width: 420px) { .c3-pin-label small { display: none; } .c3-pin { padding-right: 8px; } }

/* The fallback is a geographic diagram with actual supplied storefront scenes. */
.city-pin { width: 25%; max-width: 220px; height: auto; min-height: 48px; padding: 5px; display: grid; gap: 3px;
  border: 1px solid #c4b393; background: #152732; box-shadow: 0 3px 10px #14232b66; border-radius: 10px; }
.city-pin-photo { display: block; position: relative; overflow: hidden; border-radius: 6px; }
.city-pin-photo img { display: block; width: 100%; height: auto; max-height: 90px; aspect-ratio: 16 / 9; object-fit: contain; }
.city-pin-label { position: static; transform: none; margin: 0; padding: 2px; max-width: none; width: 100%; background: none; border: 0; }
.city-pin-label b { font-size: 16px; line-height: 1.2; color: #f0ebdd; }
.city-pin-num { top: 3px; left: 3px; background: #122532; width: 24px; height: 24px; }
.city-pin-state { position: absolute; right: 3px; bottom: 3px; padding: 2px 5px; background: #132633ed; border-radius: 4px; font-size: 12px; color: #dfd5c0; }
.city-pin-open { border-color: #efc279; }
.city-pin-open .city-pin-state { color: #ffe2a2; }
.city-pin-locked .city-pin-photo img { filter: saturate(.45) brightness(.67); }
.city-pin-soon .city-pin-photo img { filter: saturate(.7) brightness(.85); }
.c-map-neighbour { fill: #707a6b; stroke: #a0a38a; stroke-width: 1; }
.c-map-context { fill: #65736a; stroke: #8e9680; stroke-width: 1; opacity: .8; pointer-events: none; }
.c-map-context path { fill: none; }
.c-map-paving { fill: none; stroke: #a89c813d; stroke-width: 1; }
.c-map-waterline { fill: none; stroke: #6995a25e; stroke-width: 2; stroke-dasharray: 32 18; }
.c-map-bank { fill: none; stroke: #aaa792; stroke-width: 5; }
.c-map-bridge { fill: #b8ad94; stroke: #dcceb0; stroke-width: 3; }
.c-map-place { fill: #213640; font: 600 16px var(--sans); }
.c-map-canal { fill: #c1d9db; letter-spacing: 2px; }
.c-map-footprint { fill: #696451; stroke: #b6ab8e; stroke-width: 1.5; }
.c-b-open .c-map-footprint { fill: #ad8754; stroke: #f4cc7b; }
.c-b-soon .c-map-footprint { stroke-dasharray: 5 4; }
.c-b-locked .c-map-footprint { fill: #46524d; }
.city-map .c-win { fill: #42565b; }
.city-map .c-win.lit { fill: #ffd387; }
.c3-pin { min-height: 48px; }
@media (max-width: 640px) {
  .city-map { aspect-ratio: 3 / 5; }
  .city-map.is-3d { aspect-ratio: 1 / 1; }
  .city-pin { width: 40%; padding: 3px; gap: 1px; }
  .city-pin-photo img { max-height: 54px; }
  .city-pin-state { font-size: 10px; padding: 1px 3px; }
  .c3-pin-label { white-space: normal; max-width: 105px; }
  .c3-pin-label b { font-size: 13px; }
  .c3-pin-label small { display: block; font-size: 11px; }
}

/* Time controls sit outside the learning map, with a full touch target. */
.city-time-control{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;margin:10px 0 16px;font-size:16px;color:var(--text,#e3edf3)}
.city-time-control select{min-height:48px;max-width:100%;padding:9px 12px;border-radius:10px;border:1px solid rgba(45,226,230,.36);background:#15242f;color:#e4f3f7;font:inherit}
.city-time-control select:focus-visible{outline:2px solid #2de2e6;outline-offset:3px}

/* First-person street view: intentional movement, no camera bob or forced pointer lock. */
.city-map.is-walk{height:min(72vh,720px);min-height:360px;aspect-ratio:auto}
.city-map.is-walk .c3-canvas{touch-action:none}
.c3-walk-ui{position:absolute;inset:0;pointer-events:none;color:#edf7f6;font:16px/1.35 var(--sans,system-ui)}
.c3-walk-ui[hidden],.c3-walk-ui [hidden]{display:none}
.c3-walk-ui button{pointer-events:auto;min-height:48px;border:1px solid #6abbb9;border-radius:10px;background:#102732;color:#edf7f6;font:inherit;padding:8px 12px;cursor:pointer}
.c3-walk-ui button:focus-visible,.c3-canvas:focus-visible{outline:3px solid #2de2e6;outline-offset:-3px}
.c3-walk-back{position:absolute;left:12px;top:12px}
.c3-walk-minimap{position:absolute;right:12px;top:12px;width:100px;border:1px solid #638c93;border-radius:9px;overflow:hidden}
.c3-walk-minimap svg{display:block;width:100%;height:auto}
.c3-walk-near{position:absolute;left:12px;top:70px;max-width:calc(100% - 136px);width:280px;padding:10px;border:1px solid #4a7b87;border-radius:12px;background:#10232fee;pointer-events:auto}
.c3-walk-place{font-weight:700;margin:0 0 6px}
.c3-walk-note{margin:0 0 8px}
.c3-walk-action{width:100%;background:#1b7077!important}
.c3-walk-action:disabled{opacity:.7;background:#233540!important;cursor:default}
.c3-walk-help{position:absolute;bottom:12px;left:12px;max-width:calc(100% - 176px);margin:0;padding:8px;border-radius:8px;background:#10232fee;font-size:16px}
.c3-walk-pad{position:absolute;right:12px;bottom:12px;display:grid;grid-template-columns:repeat(3,48px);gap:4px;pointer-events:auto;touch-action:none}
.c3-walk-pad button{width:48px;height:48px;padding:0;font-size:26px;touch-action:none;user-select:none}
.c3-walk-pad [data-walk-pad=forward]{grid-column:2}
.c3-walk-pad [data-walk-pad=left]{grid-column:1}
.c3-walk-pad button[aria-pressed=true]{background:#236971}
.city-explore-btn{min-height:48px;margin:0 0 16px}
@media(max-width:640px){.c3-walk-help{max-width:calc(100% - 180px);font-size:16px}.c3-walk-near{max-width:calc(100% - 136px);font-size:16px}}

/* District navigation changes only the map camera, not the saved walking pose. */
.c3-district-control{position:absolute;left:12px;top:12px;max-width:calc(100% - 24px);color:#edf7f6}
.c3-district-control[hidden]{display:none}
.c3-district-control select{min-height:48px;max-width:100%;border:1px solid #6abbb9;border-radius:10px;padding:8px 12px;background:#102732;color:#edf7f6;font:16px var(--sans,system-ui)}
.c3-district-control select:focus-visible{outline:3px solid #2de2e6;outline-offset:2px}
.city-overview{display:block;width:100%;height:auto;max-height:260px;margin:10px 0;border-radius:12px;background:#132b34}
.city-map.is-3d>.city-overview{display:none}

.city-overview-panel{margin:8px 0 16px;background:#132b34;border:1px solid #4a7b87;border-radius:12px;padding:0 12px}
.city-overview-panel summary{min-height:48px;display:flex;align-items:center;gap:8px;cursor:pointer;font-size:16px;color:#eaf5ee}
.city-overview-panel summary::before{content:"＋";color:#6be7dc}
.city-overview-panel[open] summary::before{content:"−"}
.city-overview-panel p{font-size:16px;line-height:1.4}
.city-overview-panel summary:focus-visible{outline:3px solid #2de2e6;outline-offset:2px}

.city-map.is-3d~.city-overview-panel{display:none}
.c3-district-control .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* Прогулка v11: переход по районам, полный экран, джойстик, компактные подсказки. */
.c3-walk-travel{position:absolute;right:12px;top:150px;pointer-events:auto}
.c3-walk-travel select{min-height:48px;max-width:150px;border:1px solid #6abbb9;border-radius:10px;background:#102732;color:#edf7f6;font:inherit;font-size:15px;padding:6px 8px}
.c3-walk-full{position:absolute;left:12px;bottom:12px}
.c3-walk-ui .c3-walk-help{bottom:72px}
.c3-walk-minimap{pointer-events:auto;cursor:pointer}
.c3-walk-ui.is-moving .c3-walk-help{display:none}
.c3-walk-stick{position:absolute;left:18px;bottom:18px;width:132px;height:132px;border-radius:50%;border:2px solid rgba(122,245,238,.55);background:rgba(16,39,50,.45);pointer-events:auto;touch-action:none}
.c3-walk-stick span{position:absolute;left:50%;top:50%;width:56px;height:56px;margin:-28px 0 0 -28px;border-radius:50%;background:rgba(45,226,230,.7);box-shadow:0 0 12px rgba(45,226,230,.6)}
.c3-wrap:fullscreen{width:100vw;height:100vh;background:#0d1b22}
.c3-wrap:fullscreen .c3-canvas{width:100%;height:100%}
@media (max-width:520px){
  .c3-walk-near{top:66px;max-width:calc(100% - 128px);padding:6px 8px;font-size:14px}
  .c3-walk-place{margin:0}
  .c3-walk-near .c3-walk-note{display:none}
  .c3-walk-near:has(.c3-walk-action:not([hidden])) .c3-walk-note{display:block;margin:4px 0 6px}
  .c3-walk-travel{top:146px}
  .c3-walk-travel select{max-width:110px;font-size:14px}
  .c3-walk-ui .c3-walk-help{display:none}
  .c3-walk-full{bottom:auto;top:204px;left:auto;right:12px;max-width:110px;padding:6px 8px;font-size:14px;line-height:1.15}
}
