/* A city grows (/gifts/city-growth/): on top of the shared maker look (/gifts/globes/maker.css). The 3D town with
   its timeline under it on the left, the landscape, villages, rules and print on the right. */

.cg [hidden] { display: none !important; }

/* the stage bar: grow, speed, the year, the cameras */
.cg .cg-bar { gap: 10px; }
.cg .wm-stagebar .cg-grow { background: var(--accent); color: #0f1614; font-weight: 600; }
.cg .wm-stagebar .cg-grow:hover:not(:disabled) { background: #3dbcab; color: #0f1614; }
.cg .cg-grow { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; font-size: 0.92rem; min-width: 128px; justify-content: center; }
.cg .cg-grow .bx { font-size: 1.15rem; margin: 0; }
.cg .cg-speed button, .cg .cg-cams button { padding: 5px 9px; font-size: 0.8rem; }
.cg-year { font-size: 1.55rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); min-width: 3.2em; font-variant-numeric: tabular-nums; }
.cg .cg-cams { margin-left: auto; }
.cg .cg-cams button { display: inline-flex; align-items: center; gap: 5px; }
.cg .cg-cams .bx { font-size: 1rem; }

/* over the view */
.cg-caption {
    position: absolute; left: 12px; top: 12px; z-index: 2; max-width: min(70%, 420px); pointer-events: none;
    background: rgba(20, 23, 22, 0.82); color: var(--ink); padding: 7px 12px; border-radius: 10px; font-size: 0.86rem; line-height: 1.35;
}
.cg-caption b { color: var(--accent); font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
.cg-pop {
    position: absolute; right: 12px; bottom: 10px; z-index: 2; pointer-events: none;
    background: rgba(20, 23, 22, 0.7); color: rgba(236, 238, 233, 0.85); padding: 4px 10px; border-radius: 999px; font-size: 0.78rem;
}

/* the timeline */
.cg-time { padding: 10px 14px 0; }
.cg-scrub { position: relative; height: 26px; }
.cg-scrub input {
    position: absolute; inset: 0; width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; z-index: 2;
    --done: 0%;
}
.cg-scrub input::-webkit-slider-runnable-track {
    height: 6px; border-radius: 3px;
    background: linear-gradient(90deg, rgba(47, 165, 150, 0.45) 0 var(--done), rgba(255, 255, 255, 0.12) var(--done));
}
.cg-scrub input::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
.cg-scrub input::-moz-range-progress { height: 6px; border-radius: 3px; background: rgba(47, 165, 150, 0.45); }
.cg-scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); margin-top: -6px; box-shadow: 0 0 0 3px rgba(47, 165, 150, 0.6); }
.cg-scrub input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px rgba(47, 165, 150, 0.6); }
.cg-ticks { position: absolute; left: 9px; right: 9px; top: 0; bottom: 0; pointer-events: none; }
.cg-ticks i { position: absolute; top: 3px; width: 2px; height: 20px; margin-left: -1px; background: rgba(236, 238, 233, 0.35); border-radius: 1px; }
.cg-scale { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted); padding: 0 2px; font-variant-numeric: tabular-nums; }
.cg-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.78rem; color: var(--muted); }
.cg-legend li { display: flex; align-items: center; gap: 6px; }
.cg-legend i { width: 13px; height: 13px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }

/* the map */
.cg .cg-mapwrap { max-width: none; margin-top: 10px; }
.cg .cg-map { aspect-ratio: 4 / 3; }
.cg-frame {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
    border: 2px solid var(--accent); border-radius: 3px; box-shadow: 0 0 0 9999px rgba(20, 23, 22, 0.22);
}
.cg-search { margin-top: 12px; }

/* panel */
.cg .cg-label { display: block; font-size: 0.8rem; color: var(--muted); margin: 14px 0 6px; }
.cg .wm-sec > .cg-label:first-of-type { margin-top: 12px; }
.cg .wm-seg button { white-space: normal; line-height: 1.2; }
.cg-villages { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cg-villages li { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; background: var(--field); border-radius: 8px; padding: 5px 6px 5px 10px; }
.cg-villages li .bx-map-pin { color: var(--accent); font-size: 1.1rem; }
.cg-villages li span { flex: 1; }
.cg-villages li.cg-none { color: var(--muted); background: none; padding-left: 0; }
.cg .cg-x { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; font-size: 1.1rem; padding: 0; }
.cg .cg-x:hover { background: #2a302d; color: var(--ink); }
.cg .cg-suggest { font-size: 0.84rem; font-weight: 500; }
.cg-rules { margin-top: 12px; }
.cg-rules small { color: var(--muted); }
.cg-seed { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 0.86rem; }
.cg-seed .wm-btn, .cg-name .wm-btn { font-weight: 500; font-size: 0.84rem; }
.cg-name { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-bottom: 6px; }
.cg-name .wm-btn { white-space: nowrap; }
.cg .wm-colors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cg .wm-colors label[hidden] { display: none; }
.cg .wm-sec-out h3 { margin-top: 14px; }

@media (max-width: 900px) {
    .cg .wm-stage { height: auto; min-height: 0; }
    .cg .wm-view { height: 56vh; min-height: 320px; flex: none; }
}
@media (max-width: 560px) {
    .cg .cg-cams span { display: none; }
    .cg .cg-cams { margin-left: 0; }
    .cg .cg-grow { min-width: 0; padding: 8px 12px; }
    .cg-year { font-size: 1.3rem; }
    .cg .wm-colors { grid-template-columns: minmax(0, 1fr); }
    .cg-caption { max-width: calc(100% - 24px); font-size: 0.8rem; }
}
