/* The Patterns page (patterns.html): a full-screen terrain map, the planes drawn over it as spheres, and a bar at the bottom for the replay. */

body.patterns { overflow: hidden; }
#map { position: absolute; inset: 0; }

body.patterns #side { font-size: 14px; }
body.patterns #side label { display: block; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
body.patterns #side label.row { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
body.patterns #side select { display: block; width: 100%; margin-top: 3px; height: 34px; font: inherit; font-size: 14px; color: var(--text); background: var(--field); border: 1px solid var(--edge); border-radius: 8px; padding: 0 8px; }
body.patterns #side input[type=range] { display: block; width: calc(100% - 44px); float: left; margin-top: 6px; accent-color: var(--accent); }
body.patterns #side output { float: right; margin-top: 4px; color: var(--text); font-size: 13px; }
body.patterns #side label:has(input[type=range]) { overflow: hidden; }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 4px 0 10px; }
.chips button, .seg button, #fClear, #pGo { height: 32px; min-width: 0; border: 1px solid var(--edge); background: var(--field); color: var(--text); border-radius: 10px; font: inherit; font-size: 12px; cursor: pointer; padding: 0 4px; white-space: nowrap; overflow: hidden; }
.chips button:hover, .seg button:hover, #fClear:hover, #pGo:hover { border-color: var(--accent); }
.chips button.on, .seg button.on { border: 2px solid var(--accent); background: var(--chosen); padding: 0 3px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.seg.three button { font-size: 11px; }
#fClear { width: 100%; }

#pLegend { clear: both; margin-top: 8px; }
#pLegend .bar { height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgb(42, 109, 244), rgb(31, 211, 232) 25%, rgb(75, 228, 106) 50%, rgb(245, 227, 59) 72%, rgb(255, 154, 31) 88%, rgb(232, 38, 28)); }
#pLegend .ends { display: flex; justify-content: space-between; margin-top: 3px; font-size: 11px; color: var(--muted); }
#pCounts { margin: 0 4px 10px 22px; font-size: 13px; color: var(--muted); }

#pBar { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; border: 1px solid var(--edge); border-radius: 14px; background: rgba(43, 54, 64, 0.94); }
#pRangeRow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#pRangeRow select, #pSpeed, #pRangeRow input[type=datetime-local] { height: 34px; font: inherit; font-size: 14px; color: var(--text); background: var(--field); border: 1px solid var(--edge); border-radius: 8px; padding: 0 8px; }
#pGo { height: 34px; padding: 0 14px; font-size: 14px; }
#pStatus { color: var(--muted); font-size: 13px; }
#pPlayRow { display: flex; align-items: center; gap: 12px; }
#pPlay { width: 48px; height: 40px; flex: none; border: 1px solid var(--edge); border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 18px; cursor: pointer; }
#pTimeline { position: relative; flex: 1; height: 40px; min-width: 0; }
#pSpark { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 28px; }
#pSeek { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; margin: 0; height: 14px; accent-color: var(--accent); }
#pClock { flex: none; min-width: 150px; font-size: 14px; font-variant-numeric: tabular-nums; }
#pSpeed { flex: none; width: 86px; }



/* The layers button is the top one at the top left, above the map's zoom and compass control (which is moved down to make room), and its popover opens beside it. */
#layersPanel { top: 10px; left: 10px; }
#layersPop { top: 10px; left: 76px; width: 290px; }
.maplibregl-ctrl-top-left { margin-top: 66px; }

/* The area to choose before the patterns (the circle itself is drawn on the map), and the bar that opens once it is confirmed. */
#pBar[hidden], #pArea[hidden] { display: none; }
#pArea { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 5; width: min(560px, calc(100% - 24px)); padding: 10px 14px; border: 1px solid var(--edge); border-radius: 14px; background: rgba(43, 54, 64, 0.94); }
#pAreaRow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#pRadiusLabel { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 190px; }
#pRadius { flex: 1; min-width: 80px; accent-color: var(--accent); }
#pRadiusOut { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
#pAreaGo { height: 36px; padding: 0 16px; font-size: 14px; border: 1px solid var(--edge); border-radius: 8px; background: var(--accent); color: var(--on-accent); cursor: pointer; }
#pAreaHint { margin-top: 6px; font-size: 12px; color: var(--muted); }
#pClose { margin-left: auto; width: 34px; height: 34px; font-size: 16px; border: 1px solid var(--edge); border-radius: 8px; background: var(--field); color: var(--text); cursor: pointer; }
