/* Laid out for a TV across the room: big type, high contrast, nothing to click. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* logo, weather, circle key switched off in config.js */
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; }
body {
  display: grid;
  grid-template-columns: 1fr auto;  /* panel: only as wide as its writing */
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #f2f2f2;
}
#map { height: 100vh; }

#panel {
  display: flex; flex-direction: column;
  height: 100vh; padding: 1.2vw 1vw; gap: 1vw; max-width: 24vw;
  /* colors from config.js (panel) */
  background: var(--panel-bg); color: var(--panel-text); border-left: 4px solid var(--panel-edge);
  font-size: clamp(14px, 1.05vw, 26px);
}
/* Logo (copied from the PM job documents); fills the panel width without making it wider. */
#logo { display: block; width: 0; min-width: 100%; height: auto; margin-bottom: .6em; }  /* width 0 + min-width: fits the panel, never widens it */
#clock { color: var(--panel-sub); margin-top: .2em; font-size: 1.05em; }

/* Weather (weather.js): now on one line, then the week as 7 small columns. width 0 +
   min-width 100% keeps it inside the panel's width instead of widening the panel. */
#weather { margin-top: .6em; width: 0; min-width: 100%; }
.wnow { display: flex; align-items: center; gap: .4em; }
.wbig { width: 2.4em; height: 2.4em; flex: none; }
.wnow .temp { font-size: 1.8em; font-weight: 700; }
.wnow .sky { color: var(--panel-sub); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: .4em; text-align: center; font-size: .78em; line-height: 1.15; }
.wicon { width: 1.9em; height: 1.9em; display: block; margin: .15em auto; }
.wday .hi { font-weight: 700; }
.wday .lo { color: var(--panel-sub); }

/* Stage key: each stage is a bar in its own color (config.js stages, stageBarText). */
.legend-row {
  display: flex; align-items: center; gap: 1em; padding: .2em .6em; margin: .2em 0;
  font-size: 1.1em; font-weight: 600; border-radius: 6px;
  background: var(--c); color: var(--bar-text); border: 2px solid var(--c);
}
.legend-row.up { background: #fff; color: var(--c); border: 2px dashed var(--c); }
.legend-row .lname { flex: 1; }
.legend-row .count { font-weight: 700; min-width: 1.5em; text-align: right; }

#legend { border-bottom: 1px solid var(--panel-edge); padding-bottom: .8em; }
#list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: .45em; }
#list .job { flex: none; }  /* rows keep their height, so app.js fitList() can tell when the list is too long */
.job { display: flex; gap: .6em; align-items: flex-start; line-height: 1.25; }
.num {
  flex: none; min-width: 1.6em; height: 1.6em; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .85em;
  background: var(--c); color: #fff; border: 2px solid #fff;
}
.num.up { background: #fff; color: #222; border: 2px dashed var(--c); }
.job .sub { color: var(--panel-sub); font-size: .9em; }
.job.missing .sub i { color: #b35c00; }

footer { color: var(--panel-sub); font-size: .85em; display: flex; flex-direction: column; gap: .4em; }
/* A long status message wraps instead of making the panel wider. */
#status { width: 0; min-width: 100%; }
#status.bad { color: #b35c00; font-weight: 600; }  /* orange, dark enough for the light panel */

/* Pin labels on the map: the tooltip box is bare, the inner .lbl carries the look. */
.leaflet-tooltip.pin-label {
  background: none; border: 0; box-shadow: none; padding: 0;
  font-size: clamp(15px, 1.05vw, 26px); line-height: 1.25;
}
/* A pill in the stage color, filled from the left up to the job's Percent (--p):
   config.js labelFill (done part), labelRestFill (still to do), labelTextColor, labelCornerRadius. */
.pin-label .lbl {
  padding: 5px 18px; border-radius: var(--label-radius, 6px);
  background: linear-gradient(to right,
    color-mix(in srgb, var(--c) var(--label-fill, 70%), transparent) var(--p, 100%),
    color-mix(in srgb, var(--c) var(--label-rest, 28%), transparent) var(--p, 100%));
  color: var(--label-text, #fff);
  border: var(--label-edge-width, 1.5px) solid var(--label-edge, #000);  /* config.js labelEdgeColor/Width */
  /* glow (config.js labelTextOutline) keeps the writing readable over the lighter part */
  text-shadow: 0 0 3px var(--label-outline, transparent), 0 0 1px var(--label-outline, transparent);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.pin-label .lbl span { font-weight: 600; }
.pin-label .lbl .txt { position: relative; z-index: 1; }  /* writing stays above the confetti */
/* "Recently completed" (config.js completed): the MHG mark at the left, confetti falling
   through the label and looping. The mark has a fixed size so labels are placed right. */
.pin-label .lbl.done { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding-left: 12px; }
.pin-label .lbl .mark { position: relative; z-index: 1; height: 2.2em; width: auto; aspect-ratio: 251 / 120; flex: none; filter: drop-shadow(0 0 2px rgba(0,0,0,.6)); }
.confetti i {  /* moved by app.js moveParts() */
  position: absolute; top: 0; width: 6px; height: 10px; border-radius: 1px; opacity: .9;
  transform: translateY(-14px); will-change: transform;  /* moved, never redrawn */
}
.pin-label .lbl.up { background: rgba(255,255,255,.93); color: #111; border: var(--label-edge-width, 1.5px) dashed var(--label-edge, #000); text-shadow: none; }
.leaflet-tooltip.pin-label::before { display: none; }
.leaflet-tooltip.pin-label.off { display: none; }
.leaflet-tooltip.shop-label {
  background: #1b1b1b; color: #fff; font-weight: 700; padding: 5px 12px;
  border-radius: var(--label-radius, 6px); box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.job-pin, .shop-icon { background: none; border: 0; }
.job-pin svg, .shop-icon svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.leaflet-control-attribution { font-size: 10px; }
/* Map background (config.js mapBrightness, mapSaturation). */
.map-base { filter: var(--map-filter, none); }
#ring-key { display: flex; align-items: center; gap: .5em; }
.ring { display: inline-block; width: 1.8em; height: 0; border-top: 3px solid; /* color from config.js (driveCircle.fillColor) */ }

/* Line from a label to its pin (app.js placeLabels): a thin bar turned toward the pin, in
   the stage color (config.js leaderLineColor/Width). With config.js tracer, white dashes
   (6 px dash, 18 px gap) run along it from label to pin, moved by app.js moveParts(). */
.leader {
  position: absolute; left: 0; top: 0; height: var(--leader-width, 2.5px); margin-top: calc(var(--leader-width, 2.5px) / -2);
  transform-origin: 0 50%; background: color-mix(in srgb, var(--c) 90%, transparent); overflow: hidden;
}
/* The dashes are one strip, a pattern longer than the line, slid along it (only moved, never
   redrawn: redrawing them each step kept the Pi's graphics busy). */
.tracer {
  position: absolute; inset: 0 0 0 -24px; will-change: transform;
  background: linear-gradient(to right, var(--tracer-color, #fff) 6px, transparent 6px) 0 0 / 24px 100%;
}

/* Big town names (config.js townNames): centered on the town, white glow to read on any map. */
.town-name { background: none; border: 0; }
.town-name span {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap;
  font-size: var(--town-size, 22px); font-weight: 800; color: var(--town-color, #1b1b1b);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff;
}
