:root {
  --bg: #0d0f12;
  --glass: rgba(14, 16, 20, 0.86);
  --panel: #151920;
  --panel-2: #1c2129;
  --line: #2a303a;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #eef0f3;
  --muted: #8d95a3;
  --gold: #e8c170;
  --gold-deep: #c99a3e;
  --gold-glow: rgba(232, 193, 112, 0.22);
  --steel: #9fb3cc;
  --warn: #e39a5b;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --gutter: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
/* The app never scrolls as a page: the map and panels scroll themselves. Pinning the page stops iOS from
   rubber-banding or nudging the top bar up under the notch. */
html, body { position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
/* iOS zooms the whole page into text fields under 16px; keep them at 16px so it never does. */
input, select, textarea { font-size: 16px; }
body {
  background: var(--bg); color: var(--text); overflow: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }

#map { position: fixed; inset: 0; background: #0a0c0f; }
.leaflet-container { font-family: inherit; background: #0a0c0f; }

/* ---------- top HUD ---------- */
.hud {
  position: fixed; z-index: 1000; left: var(--gutter); right: var(--gutter);
  top: calc(var(--safe-top) + var(--gutter));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.hud > * { pointer-events: auto; }
.bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 16px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-soft); box-shadow: 0 8px 24px -12px rgba(0,0,0,.7);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 0.01em; font-size: 16px; white-space: nowrap; flex: none;
  background: none; border: 0; padding: 0; color: inherit; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand span { color: var(--gold); }
.status {
  margin-left: auto; display: flex; align-items: center; gap: 7px; min-width: 0;
  font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
#statusText { overflow: hidden; text-overflow: ellipsis; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: #4a515c; flex: none; }
.status.on .dot { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.status.busy .dot { animation: pulse 1s infinite; }
.status.err .dot { background: var(--warn); }
@keyframes pulse { 50% { opacity: 0.35; } }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.04); display: grid; place-items: center; flex: none;
}
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .solid { fill: var(--muted); stroke: none; }
.icon-btn .waves { opacity: 0.25; }
.icon-btn[aria-pressed="true"] { border-color: var(--gold-deep); background: rgba(232,193,112,.12); }
.icon-btn[aria-pressed="true"] svg { stroke: var(--gold); }
.icon-btn[aria-pressed="true"] svg .solid { fill: var(--gold); }
.icon-btn[aria-pressed="true"] .waves { opacity: 1; }

/* Left | Right strip */
.strip {
  display: grid; grid-template-columns: 1fr 1fr; padding: 0; border-radius: 16px; overflow: hidden; text-align: left;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-soft); box-shadow: 0 8px 24px -12px rgba(0,0,0,.7);
}
.strip.single { grid-template-columns: 1fr; }
.side-cell { padding: 10px 14px 11px; min-width: 0; position: relative; }
.side-cell + .side-cell { border-left: 1px solid var(--line-soft); }
.side-cell.tier-live { background: linear-gradient(180deg, rgba(232,193,112,.16), rgba(232,193,112,.04)); box-shadow: inset 0 -2px 0 var(--gold); }
.side-cell .lbl {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.side-cell .name {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
  font-size: clamp(19px, 5.4vw, 30px); font-weight: 800; letter-spacing: -0.015em; line-height: 1.1;
}
.side-cell .name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.side-cell.pending .name { color: var(--muted); }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

.tag { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; padding: 2px 6px; border-radius: 6px; }
.tag.live { background: var(--gold); color: #1a1408; }
.tag.annual { color: var(--steel); border: 1px solid #3a4a60; }
.tag.mixed, .tag.soft { color: var(--muted); border: 1px solid var(--line); }
.tag.changed { color: var(--warn); border: 1px solid var(--warn); }

/* ---------- welcome ---------- */
.welcome {
  position: fixed; z-index: 1000; left: var(--gutter); right: var(--gutter);
  bottom: calc(var(--safe-bottom) + var(--gutter)); max-width: 460px; margin: 0 auto;
  padding: 18px; border-radius: 20px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-soft); box-shadow: 0 16px 40px -16px rgba(0,0,0,.8);
}
.welcome h1 { font-size: 22px; line-height: 1.2; margin: 0 0 6px; font-weight: 800; letter-spacing: -0.01em; }
.welcome p { color: #b7bdc7; margin: 0 0 14px; line-height: 1.45; font-size: 14.5px; }
.welcome-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.welcome .fine { margin: 12px 0 0; }
.primary {
  display: block; width: 100%; padding: 14px; border: 0; border-radius: 13px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #1a1408;
  font-weight: 800; font-size: 16px;
}
.ghost {
  display: block; width: 100%; padding: 14px; border-radius: 13px; font-weight: 700;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text);
}
.fine { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ---------- map controls ---------- */
.map-ctl {
  position: fixed; z-index: 900; left: var(--gutter); bottom: calc(var(--safe-bottom) + var(--gutter) + 18px);
  display: flex; gap: 8px; align-items: center;
}
body.welcoming .map-ctl, body.sheet-open .map-ctl, body.sheet-open .recenter { display: none; }
.seg {
  display: flex; padding: 3px; border-radius: 13px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-soft);
}
.seg button { border: 0; background: transparent; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--gold); color: #1a1408; }
.map-ctl .icon-btn, .recenter { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); width: 44px; height: 44px; border-radius: 13px; }
.recenter { position: fixed; z-index: 900; right: var(--gutter); bottom: calc(var(--safe-bottom) + var(--gutter) + 18px); }
.recenter svg .solid { fill: var(--gold); }
.map-hint {
  position: fixed; z-index: 900; left: 50%; transform: translateX(-50%);
  top: calc(var(--safe-top) + var(--gutter) + 62px);
  background: var(--glass); border: 1px solid var(--line-soft); color: #c4c9d2;
  font-size: 12.5px; padding: 7px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none;
}
body.welcoming .map-hint, body.sheet-open .map-hint, body.driving .map-hint { display: none; }

.leaflet-control-attribution { background: rgba(13,15,18,.7) !important; color: #6f7784 !important; font-size: 9.5px; }
.leaflet-control-attribution a { color: #9aa1ab !important; }

/* field labels drawn on the map */
.field-label-anchor { width: 0; height: 0; overflow: visible; }
.me-arrow svg { width: 30px; height: 30px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.7)); }
.tap-pin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--gold); background: rgba(13,15,18,.6); box-shadow: 0 0 0 3px rgba(0,0,0,.35); }

/* ---------- detail sheet ---------- */
.sheet {
  position: fixed; z-index: 1100; left: var(--gutter); right: var(--gutter);
  bottom: calc(var(--safe-bottom) + var(--gutter)); max-width: 520px; margin: 0 auto;
  max-height: min(62vh, 560px); display: flex; flex-direction: column;
  background: rgba(17, 20, 25, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-soft); border-radius: 22px; box-shadow: 0 20px 50px -18px rgba(0,0,0,.9);
  animation: rise .22s ease-out;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { position: relative; height: 22px; flex: none; }
.grab { position: absolute; left: 50%; top: 8px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: #3a414c; }
.close {
  position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 10px; z-index: 2;
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.05); display: grid; place-items: center;
}
.close svg { width: 16px; height: 16px; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; }
.sheet-body { overflow-y: auto; padding: 0 18px 18px; display: grid; gap: 16px; }
.sheet-body.two { grid-template-columns: 1fr 1fr; gap: 0; }
.sheet-body.two .detail { padding-right: 12px; min-width: 0; }
.sheet-body.two .detail + .detail { border-left: 1px solid var(--line-soft); padding-left: 14px; }

.detail .lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-right: 40px; }
.detail .crop { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.detail .crop .swatch { width: 18px; height: 18px; border-radius: 5px; }
.detail .crop-name { font-size: clamp(24px, 7vw, 34px); font-weight: 800; line-height: 1.05; letter-spacing: -0.015em; }
.sheet-body.two .crop-name { font-size: clamp(19px, 5.2vw, 28px); }
.runner { font-size: 14px; color: var(--muted); margin: -4px 0 10px; }
.runner b { color: var(--text); font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 4px 9px; border-radius: 999px; letter-spacing: 0.02em; white-space: nowrap;
}
.badge.live { background: var(--gold); color: #1a1408; }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #1a1408; animation: pulse 2s infinite; }
.badge.changed { border: 1px solid var(--warn); color: var(--warn); }
.badge.mixed { border: 1px solid var(--line); color: var(--text); background: var(--panel-2); }
.badge.annual { border: 1px solid #3a4a60; color: var(--steel); background: #151c26; }
.badge.soft { border: 1px solid var(--line); color: var(--muted); }
.badge.agree { border: 1px solid var(--gold-deep); color: var(--gold); }
.note, .predict { font-size: 14px; line-height: 1.45; margin: 0 0 12px; color: #c4c9d2; }
.predict { color: var(--muted); }

.err { color: var(--warn); font-size: 14px; margin: 4px 0 0; }

/* ---------- about ---------- */
dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 0;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 20px;
}
dialog form { padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { margin: 0 0 14px; font-size: 20px; }
.tier-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: start; margin-bottom: 14px; }
.tier-row .badge { justify-self: start; margin-top: 2px; }
.tier-row p { margin: 0; font-size: 14px; line-height: 1.45; color: #c4c9d2; }
dialog .fine { margin: 6px 0 16px; }

/* Wider screens / phone in landscape: HUD and sheet become side panels. */
@media (min-width: 760px) {
  .hud { right: auto; width: 460px; }
  .welcome { left: var(--gutter); right: auto; margin: 0; width: 440px; }
  .sheet {
    left: auto; right: var(--gutter); margin: 0; width: 420px;
    top: calc(var(--safe-top) + var(--gutter)); bottom: auto; max-height: calc(100vh - 2 * var(--gutter));
  }
}

/* ---------- drive strip: what's coming up ---------- */
.side-cell .then { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; }
.side-cell .then .swatch { width: 9px; height: 9px; border-radius: 3px; }

/* ---------- crop progress ---------- */
.progress:empty { display: none; }
.progress { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); display: grid; gap: 7px; }
.ptitle { font-size: 13px; font-weight: 700; text-transform: capitalize; }
.ptitle span { font-weight: 500; color: var(--muted); text-transform: none; }
.prow { display: grid; grid-template-columns: 84px 1fr 64px; gap: 10px; align-items: center; font-size: 12.5px; color: #c4c9d2; text-transform: capitalize; }
.prow i { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.prow i b { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.prow span:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.prow em { font-style: normal; color: var(--gold); font-weight: 600; }
.pcond { font-size: 12.5px; color: var(--muted); }
.pcond b { color: var(--text); }

/* ---------- menu & tool panels ---------- */
.menu { display: grid; gap: 6px; padding-top: 4px; }
.menu button {
  display: grid; gap: 2px; text-align: left; padding: 13px 14px; border-radius: 14px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line-soft);
}
.menu button b { font-size: 15.5px; }
.menu button span { font-size: 12.5px; color: var(--muted); }
.menu button:hover { border-color: var(--gold-deep); }
.menu .menu-drive { background: linear-gradient(135deg, rgba(232,193,112,.2), rgba(201,154,62,.1)); border-color: rgba(232,193,112,.35); }
.menu .menu-drive b { color: var(--gold); }
.menu .menu-drive.end { background: rgba(227,154,91,.1); border-color: rgba(227,154,91,.35); }
.menu .menu-drive.end b { color: var(--warn); }
.menu-foot { margin: 8px 0 2px; text-align: center; font-size: 13px; color: var(--muted); }
.menu-foot a { color: var(--muted); text-decoration: none; padding: 6px 4px; }
.menu-foot a:hover { color: var(--gold); }
.menu .menu-drive { padding: 14px 16px; }
.mtiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.menu .mtile { display: grid; justify-items: center; gap: 4px; padding: 12px 4px 10px; text-align: center; }
.menu .mtile span { font-size: 24px; line-height: 1; color: inherit; } .menu .mtile b { font-size: 13px; font-weight: 700; white-space: nowrap; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.sheet-actions .ghost { padding: 11px; font-size: 14px; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--gold-deep); background: rgba(232,193,112,.1); color: var(--gold); font-weight: 700; font-size: 12.5px; }
.chip.warn { border-color: #5a4030; background: transparent; color: var(--warn); }

.route-form { display: grid; gap: 10px; margin: 4px 0 12px; }
.route-form label { display: grid; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.route-form input {
  font: inherit; font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--text);
  background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; outline: none;
}
.route-form input:focus { border-color: var(--gold-deep); }
.plan { display: grid; gap: 3px; margin-bottom: 12px; }
.plan span { font-size: 13px; color: var(--muted); }
.dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.dl i { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.dl i b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .2s; }
.dl span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.routes { display: grid; gap: 8px; }
.route { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line-soft); }
.route b { display: block; font-size: 14px; }
.route span { font-size: 12px; color: var(--muted); }

/* ---------- trip log ---------- */
.trip-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.trip-sum div { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line-soft); display: grid; }
.trip-sum b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.trip-sum span { font-size: 12px; color: var(--muted); }
.tbars { display: grid; gap: 8px; }
.tbar { display: grid; grid-template-columns: 12px 108px 1fr 58px; gap: 8px; align-items: center; font-size: 13px; }
.tbar .swatch { width: 12px; height: 12px; }
.tbar .bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbar i { height: 8px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; }
.tbar i b { display: block; height: 100%; border-radius: 4px; }
.tbar .bval { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ================= map: fields, labels, legend ================= */
.field-label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 3px 10px 3px 4px; border-radius: 999px;
  background: rgba(12, 14, 18, 0.86); color: #fff; font-size: 12.5px; font-weight: 700;
  border: 1.5px solid var(--c); box-shadow: 0 3px 10px rgba(0,0,0,.45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.field-label .emo {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--c); font-size: 12px; line-height: 1;
}
.field-label.sel { border-color: #fff; box-shadow: 0 0 0 3px var(--c), 0 4px 14px rgba(0,0,0,.6); }
.leaflet-tooltip.field-tip {
  background: rgba(12,14,18,.92); color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  font: 700 12.5px Inter, sans-serif; padding: 5px 9px; box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
.leaflet-tooltip.field-tip::before { display: none; }

.legend {
  position: fixed; z-index: 900; left: var(--gutter); right: var(--gutter);
  bottom: calc(var(--safe-bottom) + var(--gutter) + 72px);
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.legend::-webkit-scrollbar { display: none; }
body.welcoming .legend, body.sheet-open .legend { display: none; }
.legend button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255,255,255,.1); font-size: 12.5px; font-weight: 700; color: var(--text);
  transition: transform .15s, border-color .15s, background .15s;
}
.legend button .emo { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c); font-size: 12px; }
.legend button em { font-style: normal; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend button:active { transform: scale(.96); }
.legend button.on { border-color: var(--c); background: rgba(20,22,27,.95); box-shadow: 0 0 0 2px var(--c) inset; }
.legend button.on em { color: var(--text); }

/* thin progress shimmer while fields load */
.loadbar { position: fixed; z-index: 1001; left: 0; right: 0; top: 0; height: 3px; pointer-events: none; opacity: 0; transition: opacity .3s; }
body.loading .loadbar {
  opacity: 1;
  background: linear-gradient(90deg, transparent, var(--gold), #ff8fc7, #3fd98b, transparent);
  background-size: 50% 100%; background-repeat: no-repeat; animation: sweep 1.1s linear infinite;
}
@keyframes sweep { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* ================= strip & detail ================= */
.chipdot {
  display: grid; place-items: center; flex: none; width: 1.25em; height: 1.25em; border-radius: 50%;
  background: var(--c); font-size: .8em; line-height: 1;
}
.side-cell .then { gap: 4px; }
.big-emo {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px;
  background: var(--c); font-size: 26px; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 6px 18px -6px var(--c);
}
.sheet-body.two .big-emo { width: 36px; height: 36px; font-size: 20px; border-radius: 11px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; margin: 2px 0 12px; }
.stats div { padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.045); border: 1px solid var(--line-soft); display: grid; gap: 1px; }
.stats b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats span { font-size: 11px; color: var(--muted); line-height: 1.25; }

.seasons-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin: 4px 0 7px; }
.seasons-head span:first-child { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.seasons-head span:last-child { font-size: 12px; color: #c4c9d2; font-weight: 600; text-align: right; }
.seasons { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.season {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 7px 2px 6px; border-radius: 11px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-soft); min-width: 0;
  box-shadow: inset 0 3px 0 var(--c);
}
.season .yr { font-size: 10.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.season b { font-size: 20px; line-height: 1.15; }
.season .nm { font-size: 9.5px; color: #c4c9d2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; }
.season.now { border-color: var(--gold-deep); background: rgba(232,193,112,.08); }
.season.now .yr { color: var(--gold); }
.season.guess { border-style: dashed; }
.sheet-body.two .season b { font-size: 16px; }
.sheet-body.two .season .nm { display: none; }

/* ================= trip: crops spotted ================= */
.spotted-head { display: flex; justify-content: space-between; margin: 16px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.spotted { display: flex; flex-wrap: wrap; gap: 6px; }
.spotted span {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; font-size: 18px;
  background: rgba(255,255,255,.045); border: 1.5px solid var(--c);
}
.spotted i { font-style: normal; font-size: 12px; font-weight: 700; }

/* ================= zoomed-out bubbles ================= */
.region-bubble {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 3px 9px 3px 3px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: #fff;
  background: rgba(12, 14, 18, 0.88); border: 1.5px solid var(--c); box-shadow: 0 3px 10px rgba(0,0,0,.5);
  font-variant-numeric: tabular-nums; transition: transform .12s;
}
.region-bubble:hover { transform: translate(-50%, -50%) scale(1.08); }
.region-bubble i { font-style: normal; font-weight: 800; font-size: 11px; letter-spacing: .04em; color: #cfd3da; padding: 0 3px 0 6px; }
.region-bubble .emo { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--c); font-size: 12px; }
.emo-sm { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--c); font-size: 12px; }
.tbar:has(.emo-sm) { grid-template-columns: 20px 108px 1fr 62px; }
.region-bubble.compact { padding: 3px; }

/* ================= share ================= */
.sheet-actions.one { grid-template-columns: 1fr; padding: 0 18px 4px; margin-top: 0; }
.share-btn { background: linear-gradient(90deg, #ffc53d, #ff8fc7 55%, #a98bff); color: #1a1022; }
.card-preview { width: 100%; border-radius: 16px; display: block; box-shadow: 0 12px 30px -10px rgba(0,0,0,.7); }

/* ================= crop cards album ================= */
.album-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 10px; }
.album-head div { padding: 10px; border-radius: 12px; background: rgba(255,255,255,.045); border: 1px solid var(--line-soft); display: grid; }
.album-head b { font-size: 22px; font-weight: 900; }
.album-head span { font-size: 11px; color: var(--muted); }
.cset { margin-top: 14px; }
.cset header { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.cset header b { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cprog { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.cprog i { display: block; height: 100%; background: linear-gradient(90deg, #ffc53d, #ff8fc7); border-radius: 3px; }
.cset.done header span:first-child::after { content: ' ✓'; color: var(--gold); }
.cgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.ccard {
  position: relative; aspect-ratio: 4 / 5; border-radius: 14px; padding: 8px 4px 6px;
  display: grid; grid-template-rows: 1fr auto auto; justify-items: center; align-items: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #fff), color-mix(in srgb, var(--c) 70%, #000));
  border: 2.5px solid var(--r); box-shadow: 0 4px 14px -6px var(--r), inset 0 1px 0 rgba(255,255,255,.4);
  overflow: hidden;
}
.ccard .art { font-size: 30px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.ccard .nm { font-size: 10px; font-weight: 800; color: #14110a; text-align: center; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard .stars { font-size: 9px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.4); letter-spacing: 1px; }
.ccard .stars em { font-style: normal; opacity: .3; }
.ccard .gem { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--r); box-shadow: 0 0 6px var(--r); }
.ccard.r-epic, .ccard.r-legendary { animation: shimmer 3s ease-in-out infinite; }
.ccard.r-legendary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 45%, transparent 60%); background-size: 250% 100%; animation: sheen 2.6s linear infinite; }
@keyframes sheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes shimmer { 50% { box-shadow: 0 4px 22px -2px var(--r), inset 0 1px 0 rgba(255,255,255,.4); } }
.ccard.locked { background: rgba(255,255,255,.025); border: 1px solid var(--line-soft); box-shadow: none; }
.ccard.locked .q { font-size: 18px; font-weight: 800; color: rgba(255,255,255,.12); }
.ccard.locked .nm { color: rgba(255,255,255,.25); }
.stamps { display: flex; flex-wrap: wrap; gap: 5px; }
.stamp { font-size: 11px; font-weight: 800; padding: 5px 7px; border-radius: 7px; border: 1.5px dashed rgba(255,255,255,.15); color: rgba(255,255,255,.3); letter-spacing: .04em; }
.stamp.got { border: 1.5px solid var(--gold); color: #1a1408; background: var(--gold); transform: rotate(-3deg); }

/* new card pop */
.card-drop { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(5,6,9,.55); animation: fadein .2s; }
.card-drop.out { animation: fadeout .45s forwards; }
.card-drop .burst { position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 8deg, color-mix(in srgb, var(--r) 70%, transparent) 8deg 14deg, transparent 14deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); mask: radial-gradient(circle, #000 20%, transparent 65%);
  animation: spin 6s linear infinite; }
.drop-card { position: relative; width: 190px; aspect-ratio: 4 / 5; border-radius: 22px; display: grid; grid-template-rows: 1fr auto auto auto; justify-items: center; padding: 14px 8px 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #fff), color-mix(in srgb, var(--c) 70%, #000));
  border: 4px solid var(--r); box-shadow: 0 0 40px var(--r), 0 20px 50px rgba(0,0,0,.6);
  animation: flipin .6s cubic-bezier(.2,1.4,.4,1) both; }
.drop-card .art { font-size: 84px; align-self: center; }
.drop-card .nm { font-size: 20px; font-weight: 900; color: #14110a; }
.drop-card .rar { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #14110a; opacity: .75; }
.drop-card .stars { color: #fff; font-size: 16px; letter-spacing: 2px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.drop-card .stars em { font-style: normal; opacity: .3; }
.drop-title { position: absolute; top: calc(50% - 190px); font-size: 30px; font-weight: 900; color: #fff; text-shadow: 0 2px 12px var(--r); animation: pop .5s .2s both; }
@keyframes flipin { from { transform: rotateY(90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }

.toast { position: fixed; z-index: 2500; left: 50%; top: calc(var(--safe-top) + 150px); transform: translateX(-50%);
  background: rgba(14,16,20,.94); border: 1.5px solid var(--gold); color: #fff; font-weight: 800; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: pop .35s both; white-space: nowrap; }
.toast.out { animation: fadeout .45s forwards; }

/* ================= what's ahead ================= */
.coming { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-top: 1px solid var(--line-soft); font-size: 12.5px; font-weight: 700; color: #c4c9d2; }
.coming span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.coming b { font-variant-numeric: tabular-nums; }
.fc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.fc-chips span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1.5px solid var(--c); font-size: 12.5px; font-weight: 700; }
.fc-chips b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c); font-size: 12px; }
.fc-chips em { font-style: normal; color: var(--muted); }
.ribbon { display: grid; grid-template-columns: 14px 1fr; gap: 6px; align-items: center; margin: 3px 0; }
.ribbon span { font-size: 10px; font-weight: 800; color: var(--muted); }
.ribbon div { display: flex; height: 14px; border-radius: 4px; overflow: hidden; }
.ribbon i { flex: 1; min-width: 0; }
.ribbon-axis { display: flex; justify-content: space-between; padding-left: 20px; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.legend button s.cut { text-decoration: none; font-size: 11px; font-weight: 700; color: #fff; background: #8a6a48; padding: 1px 6px; border-radius: 999px; margin-left: 2px; }

/* ================= parcels ================= */
.parcel { margin: 12px 18px 4px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.045); border: 1px solid var(--line-soft); }
.parcel .owner { font-size: 17px; font-weight: 800; margin: 4px 0 6px; }
.parcel .owner.muted { color: var(--muted); font-weight: 600; font-size: 14px; }
.pfacts { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.pfacts b { color: var(--text); }
#parcelOut > .predict, #parcelOut > .err { margin: 10px 18px 0; }
.sheet-body > .sheet-actions { padding: 0 2px; margin-top: 4px; }
.parcel .lbl { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ================= color key ================= */
.key {
  position: fixed; z-index: 950; right: var(--gutter); bottom: calc(var(--safe-bottom) + var(--gutter) + 120px);
  width: 268px; padding: 12px 12px 12px; border-radius: 18px; display: none;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-soft); box-shadow: 0 10px 28px -12px rgba(0,0,0,.8);
}
.key.open { display: block; animation: pop .2s both; }
body.welcoming .key, body.sheet-open .key { display: none; }
.key header { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.key header button { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }
#keyBtn svg circle { fill: var(--muted); stroke: none; }
#keyBtn[aria-pressed="true"] svg circle { fill: var(--gold); }
@media (min-width: 760px) { .key { bottom: auto; top: calc(var(--safe-top) + var(--gutter) + 72px); } }
/* zoomed-out summaries are painted solid and faded as one layer (no seams between counties) */
.leaflet-regions-pane { opacity: .8; }
.key-note { margin: 6px 0 0; display: grid; gap: 4px; font-size: 11px; color: var(--muted); line-height: 1.35; }
.key-note .ramp { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #3c3a33, #8a7340, #ffc53d); }

/* ---- fun color key ---- */
.key header span::before { content: '🌱 '; }
.key-body { display: grid; gap: 5px; }
.key-body button {
  display: grid; grid-template-columns: 28px 1fr 38px 30px; align-items: center; gap: 7px;
  padding: 4px 8px 4px 4px; border-radius: 999px; text-align: left;
  background: rgba(255,255,255,.04); border: 1.5px solid transparent; color: var(--text);
  transition: transform .15s, border-color .15s, background .15s;
}
.key-body button:hover { transform: translateX(-2px) scale(1.02); border-color: var(--c); }
.key-body button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); }
.key-body .kemo {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 15px;
  background: var(--c); box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 3px 10px -2px var(--c);
}
.key-body button:hover .kemo { animation: wiggle .5s ease; }
.key-body .kname { font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-body .kbar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.key-body .kbar i { display: block; height: 100%; border-radius: 3px; background: var(--c); }
.key-body em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
@keyframes wiggle { 25% { transform: rotate(-14deg); } 75% { transform: rotate(12deg); } }

/* ---- famous farm regions ---- */
.belt {
  position: absolute; left: 0; top: 0; cursor: pointer; white-space: nowrap;
  transform: translate(-50%, -50%) scale(var(--s));
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 3px; border-radius: 999px;
  background: rgba(12, 14, 18, 0.78); border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 4px 14px -6px rgba(0,0,0,.6);
}
.belt .be { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); font-size: 14px; }
.belt .bn { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #eef0f3; }
.belt:hover { filter: brightness(1.15); }
@keyframes bob { 50% { transform: translate(-50%, calc(-50% - 3px)) rotate(var(--rot)) scale(var(--s)); } }
.belt-sheet .belt-sub { font-size: 13px; color: #c4c9d2; font-weight: 600; margin: -2px 0 10px; }
.belt-fact { font-size: 15.5px; line-height: 1.5; margin: 0 0 6px; padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.belt-fact::before { content: '💡 '; }
@media (max-width: 759px) {
  .key { width: 222px; padding: 10px; bottom: calc(var(--safe-bottom) + var(--gutter) + 122px); max-height: calc(100vh - 260px); overflow-y: auto; }
  .key-body { gap: 3px; }
  .key-body button { grid-template-columns: 24px 1fr 26px; padding: 3px 7px 3px 3px; }
  .key-body .kemo { width: 24px; height: 24px; font-size: 13px; }
  .key-body .kname { font-size: 12px; }
  .key-body .kbar { display: none; }
}

/* pill wiggles while its fact card is open */
.belt.active { animation: jiggle 1.1s ease-in-out infinite; filter: brightness(1.2); z-index: 5; }
@keyframes jiggle {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(calc(var(--s) * 1.08)); }
  20% { transform: translate(-50%, -50%) rotate(calc(var(--rot) - 4deg)) scale(calc(var(--s) * 1.1)); }
  40% { transform: translate(-50%, -50%) rotate(calc(var(--rot) + 3deg)) scale(calc(var(--s) * 1.08)); }
  60% { transform: translate(-50%, -50%) rotate(calc(var(--rot) - 2deg)) scale(calc(var(--s) * 1.1)); }
  80% { transform: translate(-50%, -50%) rotate(calc(var(--rot) + 1deg)) scale(calc(var(--s) * 1.08)); }
}
.fact-row { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 10px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.belt-fact.flip { animation: factflip .35s ease; }
@keyframes factflip { from { transform: rotateX(70deg); opacity: 0; } }
.dyk { font-size: 13.5px !important; line-height: 1.45; padding: 10px 12px; border-radius: 12px; margin: 0 0 12px !important;
  background: rgba(232,193,112,.08); border: 1px solid rgba(232,193,112,.25); color: #d6dae1 !important; }
.dyk b { color: var(--gold); }

/* ================= Kernel the mascot ================= */
.kernel { position: fixed; z-index: 2600; right: var(--gutter); bottom: calc(var(--safe-bottom) + 132px); display: flex; align-items: flex-end; gap: 8px;
  pointer-events: none; opacity: 0; transform: translateY(30px) scale(.8); transition: opacity .3s, transform .4s cubic-bezier(.2,1.5,.4,1); max-width: calc(100vw - 24px); }
.kernel.show { opacity: 1; transform: none; pointer-events: auto; }
.kbody { width: 64px; flex: none; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5)); animation: kbob 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.kernel.excited .kbody { animation: khop .6s ease-in-out 3, kbob 2.4s ease-in-out 1.8s infinite; }
.kbub { position: relative; background: #fff; color: #1a1408; font-size: 13.5px; font-weight: 600; line-height: 1.4; padding: 10px 13px; border-radius: 16px 16px 4px 16px;
  max-width: 250px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.kbub b { font-weight: 800; }
@keyframes kbob { 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes khop { 30% { transform: translateY(-16px) rotate(6deg); } 60% { transform: translateY(0) rotate(-4deg); } }

/* ================= seasons ================= */
.season-fx { position: fixed; inset: 0; z-index: 800; pointer-events: none; overflow: hidden; }
.season-fx span { position: absolute; top: -30px; opacity: .55; animation: drift linear infinite; }
body.welcoming .season-fx span { opacity: .4; }
@keyframes drift { from { transform: translate(0, -5vh) rotate(0); } 50% { transform: translate(30px, 50vh) rotate(160deg); } to { transform: translate(-20px, 105vh) rotate(320deg); } }
.tractor { position: absolute; left: 0; top: 22px; font-size: 22px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); animation: plow var(--d) ease-in-out infinite; }
@keyframes plow { 0% { transform: translate(-60px, -50%) scaleX(-1); } 48% { transform: translate(40px, -50%) scaleX(-1); } 50% { transform: translate(40px, -50%) scaleX(1); } 98% { transform: translate(-60px, -50%) scaleX(1); } 100% { transform: translate(-60px, -50%) scaleX(-1); } }

/* ================= welcome chips ================= */
.wchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.wchip { font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 999px; border: 1.5px solid var(--gold-deep); background: rgba(232,193,112,.1); color: var(--gold); }
.wchip.plain { border-color: var(--line); background: rgba(255,255,255,.04); color: #c4c9d2; }

/* ================= menu toggles ================= */
.toggles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.menu .toggles button { display: inline-flex; padding: 7px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: transparent; border: 1px solid var(--line-soft); color: var(--muted); }
.menu .toggles button.on { color: #e9dcc0; background: rgba(232,193,112,.08); border-color: rgba(232,193,112,.3); }

/* ================= bingo ================= */
.bingo-head { font-size: 13px; color: #c4c9d2; margin: 2px 0 10px; }
.bingo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 10px; }
.bcell { position: relative; aspect-ratio: 1; border-radius: 16px; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 6px;
  background: rgba(255,255,255,.04); border: 2px dashed rgba(255,255,255,.15); text-align: center; }
.bcell span { font-size: 30px; }
.bcell small { font-size: 11px; font-weight: 800; line-height: 1.15; color: #c4c9d2; }
.bcell.on { border: 2px solid var(--c, var(--gold)); background: color-mix(in srgb, var(--c, #e8c170) 28%, transparent); }
.bcell.on small { color: #fff; }
.bcell i { position: absolute; top: 6px; right: 8px; font-style: normal; font-weight: 900; color: #fff; background: var(--c, var(--gold)); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; transform: rotate(-12deg); }
.bcell.free { --c: #e8c170; }

/* ================= guess the crop ================= */
.guess-score { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.guess-score b { color: var(--text); }
.sat { position: relative; height: 230px; border-radius: 16px; overflow: hidden; background: #1a1e25; margin-bottom: 8px; }
.sat-loading { display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.sat-loading span { animation: pulse 1.2s infinite; }
.sat-tiles { position: absolute; left: 50%; top: 50%; width: 768px; height: 768px; transform: translate(calc(-1 * var(--ox)), calc(-1 * var(--oy))); }
.sat-tiles img { position: absolute; width: 256px; height: 256px; }
.sat-ring { position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.35), inset 0 0 0 2px rgba(0,0,0,.25); animation: pulse 2s infinite; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.choices button { display: flex; align-items: center; gap: 8px; padding: 11px 10px; border-radius: 14px; font-weight: 800; font-size: 14px; text-align: left;
  background: rgba(255,255,255,.05); border: 2px solid rgba(255,255,255,.1); color: var(--text); transition: transform .12s; }
.choices button:active { transform: scale(.96); }
.choices button span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c); font-size: 16px; flex: none; }
.choices button.right { border-color: #22c55e; background: rgba(34,197,94,.18); animation: pop .4s; }
.choices button.wrong { border-color: #ef4444; background: rgba(239,68,68,.15); animation: shake .4s; }
.choices button:disabled { opacity: 1; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.guess-result { margin: 10px 0 2px; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.guess-result.yes { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.4); }
.guess-result.no { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35); }
.guess-result b { font-size: 16px; }
.guess-result p { margin: 6px 0 0; color: #c4c9d2; }

/* ================= county facts, badges, crop of the day ================= */
.cfacts { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.cfacts li { font-size: 13.5px; line-height: 1.4; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line-soft); color: #d6dae1; }
.cfacts li b { color: var(--gold); }
.badges-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.badge-tile { display: grid; justify-items: center; text-align: center; gap: 3px; padding: 10px 6px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1.5px dashed rgba(255,255,255,.12); }
.badge-tile .bemo { font-size: 26px; filter: grayscale(1); opacity: .5; }
.badge-tile b { font-size: 11.5px; font-weight: 800; color: var(--muted); }
.badge-tile small { font-size: 9.5px; color: var(--muted); line-height: 1.25; }
.badge-tile.got { border: 1.5px solid var(--gold-deep); background: rgba(232,193,112,.08); }
.badge-tile.got .bemo { filter: none; opacity: 1; animation: pop .4s; }
.badge-tile.got b { color: var(--gold); }
.cotd .big-emo { animation: kbob 2.4s ease-in-out infinite; }

/* ================= first-launch walkthrough ================= */
.onboard { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 70% 10%, rgba(232,193,112,.18), transparent 50%), rgba(6,8,11,.82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fadein .3s; }
.onboard.out { animation: fadeout .3s forwards; }
.ob-card-wrap { position: relative; width: min(420px, 100%); background: #151920; border: 1px solid var(--line-soft); border-radius: 26px;
  padding: 22px 20px 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9); overflow: hidden; }
.ob-skip { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--muted);
  font-weight: 700; font-size: 13px; padding: 7px 13px; border-radius: 999px; }
.ob-stage { min-height: 400px; display: grid; }
.ob-step { display: grid; align-content: start; }
.ob-step.in-right { animation: obin .35s ease both; }
.ob-step.in-left { animation: obinl .35s ease both; }
@keyframes obin { from { transform: translateX(40px); opacity: 0; } }
@keyframes obinl { from { transform: translateX(-40px); opacity: 0; } }
.ob-step h2 { font-size: 26px; font-weight: 900; letter-spacing: -.01em; margin: 6px 0 8px; }
.ob-step p { font-size: 15.5px; line-height: 1.5; color: #c4c9d2; margin: 0; }
.ob-step p b { color: #fff; }
.ob-art { position: relative; height: 210px; display: grid; place-items: center; margin-bottom: 10px; }
.ob-kernel { position: absolute; left: 50%; top: 18px; width: 110px; margin-left: -55px; z-index: 2; animation: kbob 2.4s ease-in-out infinite; filter: drop-shadow(0 10px 18px rgba(0,0,0,.6)); }
.ob-patch { position: absolute; bottom: 4px; display: grid; grid-template-columns: repeat(6, 44px); gap: 6px; transform: perspective(400px) rotateX(35deg); }
.ob-patch i, .ob-cards i { display: grid; place-items: center; font-style: normal; border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.ob-patch i { height: 44px; font-size: 20px; }
.ob-strip { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-soft); background: rgba(14,16,20,.9); }
.ob-strip > div { padding: 12px 12px 14px; display: grid; gap: 6px; background: linear-gradient(180deg, rgba(232,193,112,.16), rgba(232,193,112,.03)); box-shadow: inset 0 -2px 0 var(--gold); }
.ob-strip > div + div { border-left: 1px solid var(--line-soft); }
.ob-strip small { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--muted); }
.ob-strip b { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 900; min-width: 0; white-space: nowrap; }
.ob-strip > div { min-width: 0; }
.ob-strip b i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-style: normal; font-size: 13px; }
.ob-strip em { justify-self: start; font-style: normal; font-size: 10px; font-weight: 800; background: var(--gold); color: #1a1408; padding: 2px 6px; border-radius: 6px; }
.ob-car { position: absolute; bottom: 6px; font-size: 44px; animation: drive 3s ease-in-out infinite; }
@keyframes drive { 50% { transform: translateY(-6px); } }
.ob-zoom { display: grid; gap: 10px; justify-items: center; }
.ob-zoom span { padding: 8px 14px; border-radius: 999px; border: 2px solid var(--c); background: rgba(12,14,18,.85); font-weight: 800; font-size: 15px;
  box-shadow: 0 0 20px color-mix(in srgb, var(--c) 45%, transparent); }
.ob-zoom span:nth-child(2) { transform: rotate(-4deg) scale(1.08); }
.ob-cards { display: flex; gap: 8px; }
.ob-cards i { width: 74px; height: 94px; font-size: 38px; transform: rotate(var(--r)); border: 3px solid #ffc53d; }
.ob-games { position: absolute; bottom: 0; display: flex; gap: 6px; }
.ob-games span { font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.ob-share { position: relative; }
.ob-card { width: 170px; height: 210px; border-radius: 20px; display: grid; justify-items: center; align-content: center; gap: 6px;
  background: radial-gradient(circle at 70% 15%, rgba(255,201,40,.7), #1b1e24 70%); border: 1px solid rgba(255,255,255,.15); transform: rotate(-5deg); box-shadow: 0 16px 36px rgba(0,0,0,.6); }
.ob-card b { font-size: 64px; }
.ob-card span { font-size: 26px; font-weight: 900; }
.ob-card small { font-size: 11px; color: #c4c9d2; }
.ob-spark { position: absolute; right: -20px; top: -10px; font-size: 34px; animation: pop 1s infinite alternate; }
.ob-dots { display: flex; justify-content: center; gap: 7px; margin: 14px 0 12px; }
.ob-dots i { width: 7px; height: 7px; border-radius: 4px; background: #3a414c; transition: width .25s, background .25s; }
.ob-dots i.on { width: 22px; background: var(--gold); }
.ob-nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.ob-nav .ghost, .ob-nav .primary { margin: 0; }

/* ================= leaderboard ================= */
.lb-me { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; margin: 4px 0 8px;
  background: linear-gradient(135deg, rgba(232,193,112,.16), rgba(232,193,112,.04)); border: 1px solid var(--gold-deep); }
.lb-me small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lb-me b { font-size: 18px; font-weight: 900; margin-right: 8px; }
.lb-score { text-align: right; }
.lb-score b { font-size: 28px; color: var(--gold); font-variant-numeric: tabular-nums; margin: 0; }
.lb-break { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lb-break span { font-size: 11.5px; font-weight: 700; color: #c4c9d2; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.05); }
.lb { list-style: none; padding: 0; margin: 6px 0 8px; display: grid; gap: 5px; }
.lb li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line-soft); font-size: 14px; }
.lb li.me { border-color: var(--gold); background: rgba(232,193,112,.1); }
.lb .rk { font-weight: 900; text-align: center; color: var(--muted); }
.lb .nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .mini { font-size: 11.5px; color: var(--muted); }
.lb b { font-variant-numeric: tabular-nums; }
/* Kernel steps up out of the way when a panel is open */
body.sheet-open .kernel { bottom: auto; top: calc(var(--safe-top) + 74px); }
body.sheet-open .kbub { border-radius: 16px 16px 16px 4px; }

/* ---------- voice & style ---------- */
.voice-sheet { display: grid; gap: 10px; }
.vtop { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.vswitch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-soft); font-weight: 700; }
.vswitch b { padding: 3px 10px; border-radius: 999px; background: #2a303a; color: var(--muted); font-size: 12.5px; transition: background .2s, color .2s; }
.vswitch.on b { background: var(--gold); color: #1a1408; }
.vtest { padding: 12px 16px; border-radius: 14px; font-weight: 800; color: #1a1408;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep)); }
.vtest.talk { animation: talk .5s ease-in-out 3; }
@keyframes talk { 50% { transform: scale(1.06) rotate(-2deg); } }
.vchips { display: flex; flex-wrap: wrap; gap: 6px; }
.vchip { padding: 8px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-soft); color: #d8dce3; transition: transform .15s, background .2s; }
.vchip.picked { background: rgba(232,193,112,.16); border-color: var(--gold); color: var(--gold); }
.vgroup { display: grid; gap: 6px; margin-top: 4px; }
.vlist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vrow { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line-soft); min-width: 0; }
.vrow .vemo { grid-row: span 2; font-size: 22px; }
.vrow b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow.picked { border-color: var(--gold); background: rgba(232,193,112,.1); box-shadow: 0 0 0 1px var(--gold) inset; }
.vrow.picked b::after { content: ' ✓'; color: var(--gold); }
.vrow.picked .vemo { animation: wiggle .5s ease-in-out; }

/* ---------- motion: small, springy, and only where something actually changes ---------- */
button { transition: transform .12s ease; }
button:active:not(:disabled) { transform: scale(.95); }
.sheet { animation: sheetin .34s cubic-bezier(.2, 1.3, .4, 1); }
.sheet.closing { animation: sheetout .17s ease-in forwards; }
@keyframes sheetin { from { transform: translateY(40px) scale(.97); opacity: 0; } }
@keyframes sheetout { to { transform: translateY(30px) scale(.98); opacity: 0; } }
.menu > button, .menu > .mtiles, .menu > .toggles, .menu > .menu-foot { animation: rise .32s cubic-bezier(.2, 1.2, .4, 1) both; }
.menu > :nth-child(2) { animation-delay: .03s; } .menu > :nth-child(3) { animation-delay: .06s; }
.menu > :nth-child(4) { animation-delay: .09s; } .menu > :nth-child(5) { animation-delay: .12s; }
.menu > :nth-child(6) { animation-delay: .15s; } .menu > :nth-child(7) { animation-delay: .18s; }
.menu > :nth-child(n+8) { animation-delay: .21s; }
.side-cell.changed .name { animation: cropin .45s cubic-bezier(.2, 1.4, .4, 1); }
.side-cell.changed .chipdot { animation: chipspin .55s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes cropin { from { transform: translateY(12px); opacity: 0; } }
@keyframes chipspin { from { transform: scale(.3) rotate(-120deg); } }
.toast { animation: toastin .45s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes toastin { from { transform: translate(-50%, -24px) scale(.7); opacity: 0; } }
.ripple { position: absolute; z-index: 650; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  border: 2px solid var(--gold); pointer-events: none; animation: ripple .65s ease-out forwards; }
@keyframes ripple { to { transform: scale(4.5); opacity: 0; } }
.tap-pin { animation: pindrop .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pindrop { from { transform: translateY(-18px) scale(.5); opacity: 0; } }
.field-label.fresh { animation: labelpop .35s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes labelpop { from { transform: translate(-50%, -50%) scale(.5); opacity: 0; } }
body.booting .hud { animation: dropin .55s cubic-bezier(.2, 1.3, .4, 1) both; }
body.booting .map-ctl, body.booting .legend { animation: rise .55s .12s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes dropin { from { transform: translateY(-30px); opacity: 0; } }
.kernel .kbody { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- voice cast ---------- */
.vcast { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vcard { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 8px; text-align: left;
  padding: 10px 10px 12px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line-soft); min-width: 0; overflow: hidden; }
.vcard .vemo { grid-row: span 3; font-size: 26px; align-self: center; }
.vcard b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .vget { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--muted); margin-top: 3px; }
.vcard.have .vget { color: #cfd4dc; }
.vcard.picked { border-color: var(--gold); background: rgba(232,193,112,.1); box-shadow: 0 0 0 1px var(--gold) inset; }
.vcard.picked .vget { color: var(--gold); }
.vcard.picked .vemo { animation: wiggle .5s ease-in-out; }
.vcard .vbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.vcard .vbar b { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.vcard.loading { opacity: .85; }
.vwrap { position: relative; min-width: 0; display: grid; }
.vprev { position: absolute; bottom: 7px; right: 7px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; color: var(--gold); background: rgba(232,193,112,.1); border: 1px solid rgba(232,193,112,.35); }
.vprev.talk { background: var(--gold); color: #1a1408; animation: wiggle .5s ease-in-out infinite; }
.recap-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.recap-top span { padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.04); border: 1px solid var(--line-soft); box-shadow: inset 3px 0 0 var(--c); }
.clip-list { display: grid; gap: 6px; }
.clip-row { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; padding: 10px 12px;
  border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line-soft); }
.clip-row span { grid-row: span 2; font-size: 24px; align-self: center; }
.clip-row b { font-size: 14px; line-height: 1.3; } .clip-row i { font-style: normal; font-size: 12px; color: var(--muted); }
.vchip:disabled { opacity: .4; }

/* ---------- collapsible top bar: tap the icon to tuck it to the side ---------- */
.bar { transition: padding .2s ease; }
body.bar-min .hud .bar { position: fixed; left: 0; top: calc(var(--safe-top) + 34vh); padding: 7px 7px 7px 5px; gap: 0;
  border-radius: 0 14px 14px 0; border-left: 0; animation: tuck .35s cubic-bezier(.2, 1.3, .4, 1); }
body.bar-min .bar > :not(.brand), body.bar-min .brand span { display: none; }
body.bar-min .brand img { width: 30px; height: 30px; border-radius: 9px; }
body.bar-min.driving .brand img { box-shadow: 0 0 0 2px var(--gold); }   /* still driving: gold ring */
body:not(.bar-min) .hud .bar { animation: untuck .3s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes tuck { from { transform: translateX(-100%); } }
@keyframes untuck { from { transform: translateY(-30px); opacity: 0; } }
/* Collapsed, the map hint slides up into the bar's old spot. */
body.bar-min .map-hint { top: calc(var(--safe-top) + var(--gutter)); }
.vhello { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(232,193,112,.2), rgba(201,154,62,.08)); border: 1px solid rgba(232,193,112,.4); }
.vhello b { font-size: 17px; color: var(--gold); } .vhello span { font-size: 13.5px; color: #d8dce3; }
.vhave { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vhave span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); width: 100%; }
.vhave button { padding: 6px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,.04); border: 1px solid var(--line-soft); color: #cfd4dc; }
.vhave button i { font-style: normal; color: var(--muted); margin-left: 3px; }

/* ---------- driving mode: big simple controls, nothing extra ---------- */
.drivebar { position: fixed; z-index: 900; left: var(--gutter); right: var(--gutter); bottom: calc(var(--safe-bottom) + var(--gutter) + 8px);
  display: grid; grid-template-columns: 1fr auto auto 1fr; gap: 8px; max-width: 520px; margin: 0 auto; animation: rise .35s cubic-bezier(.2, 1.2, .4, 1) both; }
.drivebar button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 14px; border-radius: 16px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-soft);
  font-size: 15.5px; font-weight: 800; box-shadow: 0 8px 24px -12px rgba(0,0,0,.7); min-width: 0; }
.drivebar button b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drivebar .dbi { font-size: 19px; }
.drivebar #dbVoice.off { color: var(--muted); } .drivebar #dbVoice.off .dbi { filter: grayscale(1); opacity: .6; }
.drivebar #dbHead, .drivebar #dbMeh { min-width: 54px; } .drivebar #dbMeh[hidden] { display: none; }
.drivebar:has(#dbMeh[hidden]) { grid-template-columns: 1fr auto 1fr; } .drivebar #dbHead[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.drivebar .end { border-color: rgba(227,154,91,.45); color: var(--warn); }
body.driving .map-ctl, body.driving .legend, body.driving .key { display: none !important; }
body.sheet-open .drivebar { display: none; }
body.driving .recenter { bottom: calc(var(--safe-bottom) + var(--gutter) + 74px); }
body.driving .kernel { bottom: calc(var(--safe-bottom) + 150px); }

.ob-cast { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ob-cast span { display: grid; justify-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: #d8dce3; animation: rise .4s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(var(--i) * 60ms); }
.ob-cast i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(232,193,112,.14); border: 1.5px solid rgba(232,193,112,.5); font-size: 24px; font-style: normal; }
.ob-say { margin-top: 12px; padding: 8px 14px; border-radius: 14px 14px 14px 4px; background: #fff; color: #1a1408; font-weight: 700; font-size: 14px; }
body.sheet-open .welcome { display: none; }
.ob-strip + .ob-cast { margin-top: 14px; }
.recap .trip-sum { grid-template-columns: repeat(3, 1fr); }
.ccard.locked .gem { display: none; }
