/* World: the map, zones, scenario points, population, ambient zones. */

/* the map page: the map, and its side panel */
.mapwrap { position: relative; }
.mapbox { height: calc(100vh - 230px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--r-3); background: #0b1a26; overflow: hidden; }
.mapbox[hidden] { display: none; }
.mapside { position: sticky; top: 20px; }
.mapside .check { min-height: 32px; }
.mapside .fset { margin-top: var(--s-3); }
.mapside .codeblock + .codeblock, .mapside .fset + .codeblock { margin-top: var(--s-3); }
@media (max-width: 900px) { .mapbox { height: 60vh; min-height: 360px; } }

/* zones and streets */
.zmap { height: 360px; }

/* scenario points: the points to pick */
.sprows { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.sprows button { display: flex; justify-content: space-between; gap: var(--s-3); width: 100%; padding: 7px 12px; border: 1px solid transparent; border-radius: var(--r-1); background: var(--sunken); color: var(--muted); font: var(--t-small); text-align: left; transition: border-color var(--d-2) var(--ease), background var(--d-2) var(--ease); }
.sprows button code { font: var(--t-code-small); color: var(--text); }
.sprows button:hover { border-color: var(--line-2); }
.sprows button.on { border-color: var(--accent-line); background: var(--accent-bg); }

/* who lives in a zone: its schedules, their ped and car groups */
.poph { margin: var(--s-4) 0 var(--s-2); font: 600 14px var(--display); color: var(--text); }
.poph small { margin-left: 6px; color: var(--faint); font: var(--t-small); }
.popcols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.popcols h5 { margin: 0 0 6px; font: var(--t-small); font-weight: 600; color: var(--muted); }
.popg { margin-bottom: 4px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--sunken); }
.popg summary { position: relative; display: flex; justify-content: space-between; gap: var(--s-2); padding: 7px 10px; overflow: hidden; list-style: none; cursor: pointer; font: 500 12.5px var(--body); }
.popg summary::-webkit-details-marker { display: none; }
.popg summary i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); }
.popg summary span { color: var(--muted); font: var(--t-code-small); }
.popg .lchips { padding: 0 10px 10px; }
@media (max-width: 900px) { .popcols { grid-template-columns: 1fr; } }

/* ambient zones: what each rule plays */
.arule { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; align-items: center; margin-bottom: 2px; padding: 7px 12px; border-radius: var(--r-1); background: var(--sunken); }
.arule code { display: block; overflow: hidden; text-overflow: ellipsis; font: var(--t-code-small); color: var(--text); }
.arule span { color: var(--dim); font: var(--t-small); }
.arule audio { width: 100%; height: 32px; }
@media (max-width: 900px) { .arule { grid-template-columns: 1fr; } }

/* the map page: map + side panel; the weather drawn over the 3D map */
.mapview { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.mapview[hidden] { display: none; }
.maptoggle { position: absolute; top: 14px; right: 14px; z-index: 500; }
.wxfx { position: absolute; inset: 0; pointer-events: none; z-index: 2; border-radius: inherit; }
.wxfx.rain { background-image: repeating-linear-gradient(105deg, rgba(200, 215, 235, .0) 0 6px, rgba(200, 215, 235, .16) 6px 7px, rgba(200, 215, 235, 0) 7px 22px); background-size: 140px 140px; animation: rain .35s linear infinite; }
.wxfx.snow { background-image: radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(2px 2px at 80px 120px, #fff, transparent), radial-gradient(1.5px 1.5px at 140px 60px, #fff, transparent), radial-gradient(2px 2px at 200px 160px, #fff, transparent); background-size: 240px 240px; animation: snow 6s linear infinite; opacity: .8; }
.wxfx.thunder { animation: rain .35s linear infinite, flash 7s infinite; }
@keyframes rain { to { background-position: -40px 140px; } }
@keyframes snow { to { background-position: 40px 240px; } }
@keyframes flash { 0%, 91%, 94%, 100% { background-color: transparent; } 92%, 95% { background-color: rgba(255, 255, 255, .28); } }
@media (max-width: 1100px) { .mapview { grid-template-columns: 1fr; } }
