/* js/village-path.css - THE UPGRADE PATH (js/village-path.js): the road from level 1 to 50 as a Civilization-style
 * board in SOTC's plum and brass, the Herd in parchment and gold, the Horde in bone, iron and fel green.
 * Words never under 16 px (UI-5), every button 44 px or more (48 on a touch screen), round SVG buttons (UI-35), Back
 * the round arrow in the bottom right (UI-3), the camera's side and the side tabs kept clear (PH-1). */
.vp {
  --vp-min: calc(16px * var(--rui-s, 1));
  --vp-body: calc(18px * var(--rui-s, 1));
  --vp-h1: calc(28px * var(--rui-s, 1));
  --vp-tap: 48px;
  --vp-lab: calc(176px * var(--rui-s, 1));
  --vp-ink: #FBF3E7;
  --vp-soft: #DED4F2;
  --vp-gold: #F5C242;
  --vp-accent: #FF8FC7;
  --vp-panel: rgba(27, 20, 40, 0.94);
  --vp-panel-2: #251C38;
  --vp-line: rgba(245, 194, 66, 0.45);
  --vp-node: linear-gradient(160deg, #3A2C52, #241A36 70%);
  --vp-owned: linear-gradient(160deg, #6B4E16, #3A2A10 75%);
  --vp-glow: 245, 194, 66;
  --vp-tabs: 42px;
  --vp-edge-l: var(--sotc-edge-l, env(safe-area-inset-left, 0px));
  --vp-edge-r: var(--sotc-edge-r, env(safe-area-inset-right, 0px));
  --vp-title-font: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  font-family: var(--font, 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif);
  font-size: var(--vp-body); line-height: 1.35; color: var(--vp-ink);
  background: radial-gradient(120% 80% at 50% 0%, #2E2048 0%, #150E22 55%, #0B0814 100%);
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
.vp[data-side="horde"] {
  --vp-gold: #E8DCC0;
  --vp-accent: #6BE04A;
  --vp-panel: rgba(18, 20, 24, 0.95);
  --vp-panel-2: #1D2328;
  --vp-line: rgba(107, 224, 74, 0.42);
  --vp-node: linear-gradient(160deg, #2A2E36, #16191E 72%);
  --vp-owned: linear-gradient(160deg, #24461C, #12240E 75%);
  --vp-glow: 107, 224, 74;
  background: radial-gradient(120% 80% at 50% 0%, #2A1630 0%, #120C16 55%, #07060A 100%);
}
@media (pointer: fine) { .vp { --vp-tap: 44px; } }
.vp *, .vp *::before, .vp *::after { box-sizing: border-box; }
html[data-rotate] .vp, html[data-loading] .vp { display: none; }
.vp-ic { width: 24px; height: 24px; flex: 0 0 auto; }

/* the painting behind: the Village or the Camp, dimmed and faded into the board */
.vp-paint {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("../assets/backgrounds/painted/web/room-village.jpg") center 70% / cover no-repeat;
  opacity: 0.22; filter: saturate(0.8) blur(1px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 40%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 40%, transparent 85%);
}
.vp[data-side="horde"] .vp-paint { background-image: url("../assets/backgrounds/painted/web/room-village-evil.jpg"); }

/* ---- THE HEADER ---- */
.vp-head {
  position: relative; z-index: 3; flex: 0 0 auto;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  padding: 10px calc(var(--vp-edge-r) + var(--vp-tabs) + 8px) 10px calc(var(--vp-edge-l) + var(--vp-tabs) + 8px);
  background: linear-gradient(180deg, rgba(13, 9, 22, 0.96), rgba(13, 9, 22, 0.78));
  border-bottom: 2px solid var(--vp-line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.vp-crest {
  width: 112px; height: 56px; flex: 0 0 auto; border-radius: 10px; overflow: hidden;
  border: 2px solid var(--vp-gold); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5), 0 0 18px rgba(var(--vp-glow), 0.35);
}
.vp-crest svg { width: 100%; height: 100%; display: block; }
.vp-titles { flex: 1 1 220px; min-width: 0; }
.vp-kicker { margin: 0; font-size: var(--vp-min); letter-spacing: 0.12em; text-transform: uppercase; color: var(--vp-accent); }
.vp-title { margin: 0; font: bold var(--vp-h1)/1.1 var(--vp-title-font); color: var(--vp-gold); letter-spacing: 0.03em; text-shadow: 0 2px 0 #120A1E, 0 0 18px rgba(var(--vp-glow), 0.35); }
.vp-stage { margin: 2px 0 0; font-size: var(--vp-min); color: var(--vp-soft); }
.vp-stats { display: flex; align-items: center; gap: 10px 16px; flex: 0 1 auto; flex-wrap: wrap; }
.vp-xpbox { display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.vp-xp { position: relative; height: 12px; border-radius: 6px; background: rgba(11, 8, 20, 0.9); border: 1px solid var(--vp-line); overflow: hidden; }
.vp-xp__fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(var(--vp-glow), 0.6), rgb(var(--vp-glow))); box-shadow: 0 0 10px rgba(var(--vp-glow), 0.7); }
.vp-xp__words { font-size: var(--vp-min); color: var(--vp-ink); }
.vp-points {
  display: flex; align-items: center; gap: 6px; min-height: var(--vp-tap); padding: 4px 14px 4px 10px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(var(--vp-glow), 0.22), rgba(var(--vp-glow), 0.08)); border: 2px solid var(--vp-gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 14px rgba(var(--vp-glow), 0.3);
}
.vp-gem { color: var(--vp-gold); width: 26px; height: 26px; }
.vp-points__n { font: bold calc(24px * var(--rui-s, 1))/1 var(--vp-title-font); color: var(--vp-gold); }
.vp-points__w { font-size: var(--vp-min); color: var(--vp-soft); }
.vp-tools { display: flex; gap: 8px; flex: 0 0 auto; }
.vp-round {
  width: var(--vp-tap); height: var(--vp-tap); border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  color: var(--vp-gold); cursor: pointer; font: inherit;
  background: radial-gradient(circle at 35% 30%, #3A2C52, #140E20 70%); border: 2px solid var(--vp-gold);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.vp[data-side="horde"] .vp-round { background: radial-gradient(circle at 35% 30%, #2E343C, #0E1014 70%); }
.vp-round:hover { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.55), 0 0 14px rgba(var(--vp-glow), 0.6); }
.vp-round:focus-visible, .vp-node:focus-visible, .vp-scroll:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.vp-note { position: relative; z-index: 3; margin: 0; padding: 0 calc(var(--vp-edge-r) + var(--vp-tabs) + 8px) 0 calc(var(--vp-edge-l) + var(--vp-tabs) + 8px); font-size: var(--vp-min); color: var(--vp-soft); }
.vp-note:empty { display: none; }
.vp-note:not(:empty) { padding-top: 6px; padding-bottom: 6px; background: rgba(13, 9, 22, 0.72); }
.vp-note[data-tone="good"] { color: #8EF07A; }
.vp-note[data-tone="warn"] { color: #FFD27A; }

/* ---- THE BODY: the board, and the chosen node's card ---- */
.vp-body { position: relative; z-index: 2; flex: 1 1 auto; min-height: 0; display: flex; }
.vp-scroll {
  flex: 1 1 auto; min-width: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 0 16px 0;
  scroll-padding-left: 8px;
}
/* the domains' names: their own column, moved up and down with the board's scroll (js/village-path.js) */
.vp-labels {
  position: relative; z-index: 4; flex: 0 0 auto; width: var(--vp-lab); margin-left: var(--vp-edge-l); overflow: hidden;
  background: #0D0916; border-right: 1px solid var(--vp-line); box-shadow: 6px 0 10px -4px rgba(0, 0, 0, 0.7);
}
.vp-labels__in { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.vp-row { display: flex; position: relative; width: max-content; }
.vp-track { position: relative; flex: 0 0 auto; }
.vp-lab {
  box-sizing: border-box; width: 100%; overflow: hidden;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px calc(var(--vp-tabs) + 4px);
  color: var(--vp-gold); font: bold var(--vp-min)/1.2 var(--vp-title-font); letter-spacing: 0.03em;
}
.vp-lab__ic { width: 28px; height: 28px; }
/* the board: the era strip over the scrolling field (js/village-path.js moves the strip with the field's sideways scroll) */
.vp-board { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.vp-board .vp-scroll { flex: 1 1 auto; min-height: 0; }
.vp-eras { position: relative; z-index: 3; flex: 0 0 auto; overflow: hidden; height: calc(150px * var(--rui-s, 1)); background: rgba(11, 8, 20, 0.92); border-bottom: 2px solid var(--vp-line); }
.vp-track--eras { height: 100%; will-change: transform; }
.vp-lab--corner { position: absolute; left: 0; top: 0; z-index: 1; align-items: flex-end; text-transform: uppercase; letter-spacing: 0.14em; background: rgba(11, 8, 20, 0.98); border-bottom: 2px solid var(--vp-line); }
.vp-labels__in .vp-lab:first-child { border-bottom: 1px solid rgba(var(--vp-glow), 0.25); }
.vp-labels__in .vp-lab--band { border-bottom: 1px solid rgba(var(--vp-glow), 0.14); }
.vp-era {
  position: absolute; top: 8px; bottom: 8px; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 12px 12px 6px 6px; border: 2px solid rgba(var(--vp-glow), 0.35); margin: 0 4px;
  background: #120C1C; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.vp-era__art { flex: 1 1 auto; min-height: 0; position: relative; }
.vp-era__art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vp-era__plate { flex: 0 0 auto; padding: 4px 8px 6px; background: linear-gradient(180deg, rgba(20, 14, 32, 0.92), rgba(11, 8, 20, 0.98)); border-top: 1px solid rgba(var(--vp-glow), 0.4); }
.vp-era__name { display: block; font: bold var(--vp-min)/1.15 var(--vp-title-font); color: var(--vp-gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-era__lv { display: block; font-size: var(--vp-min); color: var(--vp-soft); white-space: nowrap; }
.vp-era[data-state="ahead"] .vp-era__art { filter: grayscale(0.85) brightness(0.45) contrast(1.1); }
.vp-era[data-state="ahead"] .vp-era__name { color: #A99CC4; }
.vp-era[data-state="here"] { border-color: rgb(var(--vp-glow)); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6), 0 0 22px rgba(var(--vp-glow), 0.55); }
.vp-era__here {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); padding: 1px 10px; border-radius: 999px; white-space: nowrap;
  font: bold var(--vp-min)/1.4 var(--vp-title-font); color: #1A1026; background: rgb(var(--vp-glow)); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.vp-era__lock { position: absolute; top: 8px; right: 8px; color: #C9BEDF; opacity: 0.85; }

/* ---- WHAT EACH LEVEL OPENS ---- */
.vp-row--mile { min-height: 72px; border-bottom: 1px solid rgba(var(--vp-glow), 0.25); background: rgba(13, 9, 22, 0.35); }
.vp-row--mile .vp-track { min-height: 72px; }
.vp-miles { position: relative; display: inline-flex; flex-direction: column; gap: 6px; margin: 0; padding: 10px 8px; list-style: none; vertical-align: top; }
.vp-row--mile .vp-track { display: block; white-space: nowrap; font-size: 0; }
.vp-row--mile .vp-miles { position: absolute; top: 0; }
.vp-mile { display: flex; align-items: center; gap: 6px; white-space: normal; font-size: var(--vp-min); line-height: 1.2; color: #B7AACF; }
.vp-mile .vp-ic { width: 20px; height: 20px; color: #8E7FB0; }
.vp-mile__lv { flex: 0 0 auto; min-width: 28px; padding: 1px 4px; border-radius: 6px; text-align: center; font-weight: bold; color: #1A1026; background: #6E6288; }
.vp-mile[data-reached] { color: var(--vp-ink); }
.vp-mile[data-reached] .vp-ic { color: var(--vp-gold); }
.vp-mile[data-reached] .vp-mile__lv { background: var(--vp-gold); }
.vp-mile--more { display: none; }
.vp-row--mile[data-all] .vp-mile--more { display: flex; }
.vp-more {
  min-height: var(--vp-tap); padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(var(--vp-glow), 0.55); background: rgba(var(--vp-glow), 0.12); color: var(--vp-ink);
  font-family: inherit; font-weight: bold; font-size: var(--vp-min); line-height: 1;
}
.vp-more:hover, .vp-more:focus-visible { background: rgba(var(--vp-glow), 0.25); outline: 2px solid rgb(var(--vp-glow)); outline-offset: 2px; }

/* ---- THE DOMAINS AND THE NODES ---- */
.vp-field { position: relative; }
.vp-row--band { border-bottom: 1px solid rgba(var(--vp-glow), 0.14); }
.vp-row--band:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.vp-lab--band { align-items: center; }
.vp-track--band { background-repeat: no-repeat; background-position: 0 0; }
.vp-node {
  position: absolute; pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; text-align: left;
  color: var(--vp-ink); font: inherit; cursor: pointer; border-radius: 14px;
  background: var(--vp-node); border: 2px solid rgba(var(--vp-glow), 0.35);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.vp-node:hover { transform: translateY(-2px); box-shadow: 0 10px 18px rgba(0, 0, 0, 0.55), 0 0 16px rgba(var(--vp-glow), 0.35); }
.vp-node[aria-pressed="true"] { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.vp-node__medal {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--vp-gold); background: radial-gradient(circle at 35% 30%, #4A3A66, #1A1226 72%);
  border: 2px solid rgba(var(--vp-glow), 0.55); box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(0, 0, 0, 0.35);
}
.vp[data-side="horde"] .vp-node__medal { background: radial-gradient(circle at 35% 30%, #3A424C, #101216 72%); }
.vp-node__medal .vp-ic { width: 28px; height: 28px; }
.vp-node__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.vp-node__name { font: bold var(--vp-min)/1.15 var(--vp-title-font); overflow-wrap: anywhere; }
.vp-node__meta { display: flex; align-items: center; gap: 8px; font-size: var(--vp-min); color: var(--vp-soft); }
.vp-pips { display: inline-flex; gap: 3px; }
.vp-pips i { width: 9px; height: 9px; transform: rotate(45deg); background: var(--vp-gold); box-shadow: 0 0 4px rgba(var(--vp-glow), 0.8); }
.vp-node__badge { position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; padding: 3px; border-radius: 50%; background: #120C1C; border: 2px solid currentColor; }
.vp-node[data-state="owned"] { background: var(--vp-owned); border-color: rgb(var(--vp-glow)); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--vp-glow), 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.vp-node[data-state="owned"] .vp-node__medal { border-color: rgb(var(--vp-glow)); background: radial-gradient(circle at 35% 30%, rgba(var(--vp-glow), 0.55), #1A1226 75%); }
.vp-node[data-state="owned"] .vp-node__badge { color: rgb(var(--vp-glow)); }
.vp-node[data-state="open"] { border-color: rgb(var(--vp-glow)); animation: vp-ready 2.2s ease-in-out infinite; }
.vp-node[data-state="short"] { border-style: dashed; border-color: rgba(var(--vp-glow), 0.7); }
.vp-node[data-state="level"], .vp-node[data-state="needs"] { filter: saturate(0.55) brightness(0.8); }
.vp-node[data-state="level"] .vp-node__badge, .vp-node[data-state="needs"] .vp-node__badge { color: #B7AACF; }
.vp-node[data-state="excluded"] { filter: grayscale(1) brightness(0.55); border-style: dotted; }
.vp-node[data-state="excluded"] .vp-node__name { text-decoration: line-through; text-decoration-thickness: 2px; }
.vp-node[data-state="excluded"] .vp-node__badge { color: #FF8A7A; }
@keyframes vp-ready { 0%, 100% { box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), 0 0 6px rgba(var(--vp-glow), 0.25); } 50% { box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), 0 0 22px rgba(var(--vp-glow), 0.75); } }

/* ---- THE CHOSEN NODE'S CARD: beside the board on a wide screen, under it on a phone ---- */
.vp-detail {
  position: relative; flex: 0 0 min(380px, 34vw); overflow: auto; padding: 16px 18px 20px 18px;
  margin-right: calc(var(--vp-edge-r) + var(--vp-tabs));
  background: var(--vp-panel); border-left: 2px solid var(--vp-line); box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}
.vp-detail[hidden] { display: none; }
.vp-detail__x { position: absolute; top: 10px; right: 10px; }
.vp-detail__head { display: flex; gap: 12px; align-items: center; padding-right: calc(var(--vp-tap) + 8px); }
.vp-detail__medal { width: 64px; height: 64px; }
.vp-detail__medal .vp-ic { width: 34px; height: 34px; }
.vp-detail__title { margin: 2px 0; font: bold calc(24px * var(--rui-s, 1))/1.15 var(--vp-title-font); color: var(--vp-gold); }
.vp-detail__state { margin: 0; font-size: var(--vp-min); color: var(--vp-soft); }
.vp-detail__state[data-state="owned"] { color: rgb(var(--vp-glow)); }
.vp-detail__state[data-state="open"] { color: #8EF07A; }
.vp-detail__state[data-state="excluded"] { color: #FF8A7A; }
.vp-detail__blurb { margin: 14px 0 8px; font-size: var(--vp-body); line-height: 1.45; }
.vp-detail__soon { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; font-size: var(--vp-min); color: #FFD27A; background: rgba(255, 210, 122, 0.08); border: 1px solid rgba(255, 210, 122, 0.35); }
.vp-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: var(--vp-min); }
.vp-facts dt { color: var(--vp-accent); font-weight: bold; }
.vp-facts dd { margin: 0; color: var(--vp-ink); }
.vp-say { margin: 0 0 10px; font-size: var(--vp-min); color: var(--vp-soft); }
.vp-say:empty { display: none; }
.vp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.vp-actions .rui-btn { min-height: var(--vp-tap); }

/* ---- THE FOOT: the legend, and Back, the round arrow in the bottom right ---- */
.vp-foot {
  position: relative; z-index: 5; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px calc(var(--vp-edge-r) + var(--vp-tabs) + 12px) calc(env(safe-area-inset-bottom, 0px) + 6px) calc(var(--vp-edge-l) + var(--vp-tabs) + 12px);
  background: rgba(13, 9, 22, 0.94); border-top: 2px solid var(--vp-line);
}
.vp-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.vp-legend__i { display: flex; align-items: center; gap: 6px; font-size: var(--vp-min); color: var(--vp-soft); white-space: nowrap; }
.vp-legend__i .vp-ic { width: 20px; height: 20px; }
.vp-legend__i[data-state="owned"] .vp-ic { color: rgb(var(--vp-glow)); }
.vp-legend__i[data-state="open"] .vp-ic { color: var(--vp-gold); }
.vp-legend__i[data-state="level"] .vp-ic { color: #B7AACF; }
.vp-legend__i[data-state="excluded"] .vp-ic { color: #FF8A7A; }
.vp-back { flex: 0 0 auto; width: 56px; height: 56px; }
.vp-back .vp-ic { width: 28px; height: 28px; }

/* the help sheet's key of buttons */
.vp-key { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vp-key li { display: flex; align-items: center; gap: 10px; font-size: var(--rui-min, 16px); }
.vp-key .vp-ic { color: var(--rui-gold, #F5C242); width: 28px; height: 28px; }

/* ---- PHONES AND SHORT WINDOWS ---- */
@media (max-width: 899px) {
  .vp-detail {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; max-height: 62%; margin: 0;
    padding-left: calc(var(--vp-edge-l) + var(--vp-tabs) + 8px); padding-right: calc(var(--vp-edge-r) + var(--vp-tabs) + 8px);
    border-left: 0; border-top: 2px solid var(--vp-line); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
  }
  .vp-detail__x { right: calc(var(--vp-edge-r) + var(--vp-tabs) + 8px); }
}
/* a phone either way up, and any short window: the domain column is its pictures (the words stay for a reader) */
@media (max-width: 899px), (max-height: 520px) {
  .vp { --vp-lab: 64px; }
  .vp-lab .vp-lab__w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .vp-lab { justify-content: center; padding: 6px; }
}
@media (max-width: 640px) {
  .vp { --vp-h1: calc(22px * var(--rui-s, 1)); --vp-tabs: 0px; }
  .vp-crest { width: 72px; height: 44px; }
  .vp-xpbox { min-width: 140px; }
  .vp-head { padding-left: calc(var(--vp-edge-l) + 10px); padding-right: calc(var(--vp-edge-r) + 10px); }
  .vp-note { padding-left: calc(var(--vp-edge-l) + 10px); padding-right: calc(var(--vp-edge-r) + 10px); }
  .vp-foot { padding-left: calc(var(--vp-edge-l) + 10px); padding-right: calc(var(--vp-edge-r) + 10px); }
}
@media (max-height: 520px) {
  .vp-eras { height: calc(92px * var(--rui-s, 1)); }
  .vp-era { top: 4px; bottom: 4px; }
  .vp-crest { display: none; }
  .vp-head { padding-top: 6px; padding-bottom: 6px; flex-wrap: nowrap; gap: 8px 12px; }
  .vp-stage, .vp-kicker { display: none; }
  .vp-titles { flex: 1 1 140px; }
  .vp-stats { flex-wrap: nowrap; gap: 10px; }
  .vp-xpbox { min-width: 110px; flex: 1 1 110px; }
  .vp-points__w { display: none; }
  /* the chosen node's card takes the board's whole height: 62% of a phone held sideways is one line of it */
  .vp-detail { max-height: 100%; }
  .vp-foot { padding-top: 2px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 2px); }
  .vp-back { width: var(--vp-tap); height: var(--vp-tap); }
}
@media (prefers-reduced-motion: reduce) {
  .vp-node[data-state="open"] { animation: none; }
  .vp-node { transition: none; }
}

/* ---- GROW (js/village-grow.js): the slider strip along the foot of the Village's painting ------------------------- */
.vg {
  --vg-glow: 245, 194, 66;
  --vg-ink: #FBF3E7;
  position: fixed; z-index: 45; left: 0; width: 100%; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px;
  padding: 8px calc(12px + var(--sotc-edge-r, env(safe-area-inset-right, 0px))) 8px calc(12px + var(--sotc-edge-l, env(safe-area-inset-left, 0px)));
  background: linear-gradient(180deg, rgba(14, 10, 22, 0) 0%, rgba(14, 10, 22, 0.88) 30%, rgba(14, 10, 22, 0.96) 100%);
  font: 700 16px/1.2 var(--font, 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif); color: var(--vg-ink);
}
.vg[data-side="horde"] { --vg-glow: 107, 224, 74; }
.vg-ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vg-round {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 2px solid rgba(var(--vg-glow), 0.85); color: rgb(var(--vg-glow));
  background: radial-gradient(circle at 35% 30%, #3A2C52, #160F24 70%); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.55);
}
.vg-round:disabled { opacity: 0.4; cursor: default; }
.vg-round:focus-visible, .vg-range:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.vg-play { width: 56px; height: 56px; background: rgb(var(--vg-glow)); color: #160F22; border-color: rgb(var(--vg-glow)); }
.vg-track { position: relative; flex: 1 1 auto; min-width: 120px; height: 48px; }
.vg-range { position: absolute; inset: 0; width: 100%; height: 48px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.vg-range::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.16); }
.vg-range::-moz-range-track { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.16); }
.vg-range::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -12px; border-radius: 50%; background: #FFF6DA; border: 4px solid rgb(var(--vg-glow)); box-shadow: 0 0 14px rgba(var(--vg-glow), 0.8); }
.vg-range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #FFF6DA; border: 4px solid rgb(var(--vg-glow)); box-shadow: 0 0 14px rgba(var(--vg-glow), 0.8); }
.vg-ticks { position: absolute; left: 17px; right: 17px; top: 50%; height: 0; pointer-events: none; }
.vg-tick { position: absolute; top: -12px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); }
.vg-tick[data-got] { background: rgb(var(--vg-glow)); }
.vg-now { position: absolute; top: 34px; width: 0; height: 0; margin-left: 17px; border: 6px solid transparent; border-bottom-color: #FFFFFF; transform: translateX(-6px); pointer-events: none; }
.vg-label { flex: 0 1 auto; min-width: 150px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.vg-label b { font: 700 22px/1 "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; color: rgb(var(--vg-glow)); }
.vg[data-side="horde"] .vg-label b { font-family: "Pirata One", "Palatino Linotype", Georgia, serif; }
.vg-what { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; color: var(--vg-ink); white-space: nowrap; }
.vg-what .vg-ic { width: 20px; height: 20px; color: rgb(var(--vg-glow)); }
.vg-what--now { color: #DED4F2; }
.vg[data-ahead] .vg-label b::after { content: " ahead"; font: 700 16px/1 var(--font, 'Trebuchet MS', sans-serif); color: #DED4F2; }
@media (max-width: 720px), (max-height: 480px) {
  .vg { gap: 6px; padding-top: 4px; padding-bottom: 4px; }
  .vg-label { min-width: 0; }
  .vg-what { display: none; }
  .vg-what:first-of-type { display: inline-flex; }
  .vg[data-ahead] .vg-label b::after { content: ""; }
}
@media (prefers-reduced-motion: reduce) { .vg-range::-webkit-slider-thumb { box-shadow: none; } }

/* ---- A BUILDING'S WINDOW (js/village-window.js): looks, unlocks and its crop field, beside the painting ------------ */
.vw {
  --vw-glow: 245, 194, 66;
  --vw-ink: #FBF3E7;
  --vw-soft: #DED4F2;
  position: fixed; z-index: 46; box-sizing: border-box; display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, rgba(30, 22, 44, 0.97), rgba(16, 11, 26, 0.98));
  border-left: 2px solid rgba(var(--vw-glow), 0.55); box-shadow: -10px 0 30px rgba(0, 0, 0, 0.45);
  font: 600 16px/1.3 var(--font, 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif); color: var(--vw-ink);
  padding-right: var(--sotc-edge-r, env(safe-area-inset-right, 0px));
}
.vw[data-side="horde"] { --vw-glow: 107, 224, 74; background: linear-gradient(180deg, rgba(22, 24, 28, 0.97), rgba(10, 10, 12, 0.98)); }
.vw-ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vw-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 8px 16px; border-bottom: 1px solid rgba(var(--vw-glow), 0.3); }
.vw-title { margin: 0; flex: 1 1 auto; min-width: 0; font: 700 24px/1.1 "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; color: rgb(var(--vw-glow)); }
.vw[data-side="horde"] .vw-title { font-family: "Pirata One", "Palatino Linotype", Georgia, serif; }
.vw-stars { display: inline-flex; gap: 4px; }
.vw-stars i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.vw-stars i[data-on] { background: rgb(var(--vw-glow)); box-shadow: 0 0 8px rgba(var(--vw-glow), 0.8); }
.vw-round { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 2px solid rgba(var(--vw-glow), 0.85); color: rgb(var(--vw-glow)); background: radial-gradient(circle at 35% 30%, #3A2C52, #160F24 70%); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.55); font: 700 20px/1 Georgia, serif; }
.vw-round:focus-visible, .vw-crop:focus-visible, .vw-tab:focus-visible, .vw-enter:focus-visible, .vw-plant:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.vw-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(var(--vw-glow), 0.6) transparent; padding: 12px 14px 18px; display: flex; flex-direction: column; gap: 14px; }
.vw-reel { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; flex: 0 0 auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(var(--vw-glow), 0.6) transparent; }
.vw-reel::-webkit-scrollbar, .vw-body::-webkit-scrollbar { height: 6px; width: 6px; }
.vw-reel::-webkit-scrollbar-thumb, .vw-body::-webkit-scrollbar-thumb { background: rgba(var(--vw-glow), 0.55); border-radius: 3px; }
.vw-reel::-webkit-scrollbar-track, .vw-body::-webkit-scrollbar-track { background: transparent; }
.vw-look { flex: 0 0 auto; margin: 0; width: 132px; scroll-snap-align: start; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.12); background: #120D1C; }
.vw-look img { display: block; width: 100%; height: 92px; object-fit: cover; }
.vw-look[data-ahead] img { filter: grayscale(0.55) brightness(0.7); }
.vw-look[data-now] { border-color: rgb(var(--vw-glow)); box-shadow: 0 0 12px rgba(var(--vw-glow), 0.6); }
.vw-look figcaption { padding: 6px 8px; font-size: 16px; line-height: 1.2; }
.vw-look figcaption b { display: block; color: rgb(var(--vw-glow)); }
.vw-unlocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vw-unlock { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 0 0 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.vw-unlock[data-ahead] { color: var(--vw-soft); }
.vw-unlock[data-ahead] .vw-ic { opacity: 0.6; }
.vw-unlock .vw-ic { color: rgb(var(--vw-glow)); }
.vw-lv { flex: none; min-width: 36px; height: 28px; border-radius: 14px; display: grid; place-items: center; background: rgba(var(--vw-glow), 0.18); color: rgb(var(--vw-glow)); font-weight: 800; }
.vw-word { flex: 1 1 auto; min-width: 0; }
.vw-i { width: 48px; height: 48px; font-style: italic; }
.vw-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.vw-tab { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 24px; cursor: pointer; border: 2px solid rgba(var(--vw-glow), 0.5); background: transparent; color: var(--vw-ink); font: 700 16px/1 var(--font, 'Trebuchet MS', sans-serif); }
.vw-tab[aria-pressed="true"] { background: rgb(var(--vw-glow)); color: #160F22; }
.vw-field { border-radius: 16px; padding: 10px 10px 14px; background: radial-gradient(120% 90% at 50% 0%, rgba(120, 84, 40, 0.35), rgba(40, 26, 16, 0.55)); border: 1px solid rgba(var(--vw-glow), 0.25); }
.vw[data-side="horde"] .vw-field { background: radial-gradient(120% 90% at 50% 0%, rgba(40, 70, 40, 0.3), rgba(12, 14, 12, 0.6)); }
.vw-field__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.vw-field__top h3 { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 700 20px/1.1 "Palatino Linotype", Georgia, serif; }
.vw-pts { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 16px; background: rgba(0, 0, 0, 0.35); color: rgb(var(--vw-glow)); font-weight: 800; }
.vw-plot { display: grid; gap: 6px; }
.vw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vw-row[data-root] { grid-template-columns: minmax(0, 50%); justify-content: center; }
.vw-crop { position: relative; min-height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 6px 4px 8px; border-radius: 14px; cursor: pointer; border: 2px solid transparent; background: rgba(0, 0, 0, 0.22); color: var(--vw-ink); font: 700 16px/1.15 var(--font, 'Trebuchet MS', sans-serif); touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.vw-crop img { width: 72px; height: 72px; object-fit: contain; pointer-events: none; transition: transform 0.25s; }
.vw-crop[data-state="open"] { border-color: rgba(var(--vw-glow), 0.85); box-shadow: 0 0 16px rgba(var(--vw-glow), 0.45); }
.vw-crop[data-state="open"] img { animation: vw-sway 2.4s ease-in-out infinite; }
.vw-crop[data-state="owned"] { background: rgba(var(--vw-glow), 0.14); }
.vw-crop[data-state="level"], .vw-crop[data-state="needs"], .vw-crop[data-state="excluded"] { color: var(--vw-soft); }
.vw-crop[data-state="excluded"] img { filter: grayscale(0.7); opacity: 0.75; }
.vw-crop__name { text-align: center; }
.vw-crop__meta { display: inline-flex; align-items: center; gap: 4px; color: rgb(var(--vw-glow)); }
.vw-crop__meta .vw-ic { width: 18px; height: 18px; }
.vw-ring { position: absolute; inset: 4px; border-radius: 12px; pointer-events: none; opacity: 0; background: conic-gradient(rgba(var(--vw-glow), 0.55) calc(var(--p, 0) * 360deg), transparent 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0); }
.vw-crop[data-holding] .vw-ring { opacity: 1; }
.vw-crop[data-holding] img { transform: scale(1.12); }
.vw-crop[data-just] img { animation: vw-grow 0.7s cubic-bezier(.3, 1.6, .5, 1); }
.vw-enter, .vw-plant { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 24px; cursor: pointer; border: 0; background: rgb(var(--vw-glow)); color: #160F22; font: 800 16px/1 var(--font, 'Trebuchet MS', sans-serif); }
.vw-enter { align-self: flex-start; }
.vw-card { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; padding: 14px 14px 10px; border-radius: 16px; background: #1C1428; border: 2px solid rgba(var(--vw-glow), 0.7); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
.vw[data-side="horde"] .vw-card { background: #141618; }
.vw-card h3 { margin: 0 0 6px; font: 700 20px/1.15 "Palatino Linotype", Georgia, serif; color: rgb(var(--vw-glow)); }
.vw-card p { margin: 0 0 6px; }
.vw-card__row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 6px; }
.vw-say { position: absolute; left: 50%; bottom: 16px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 20px; background: rgba(0, 0, 0, 0.85); color: var(--vw-ink); transition: opacity 0.2s, transform 0.2s; white-space: nowrap; }
.vw-say[data-on] { opacity: 1; transform: translate(-50%, 0); }
@keyframes vw-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes vw-grow { 0% { transform: scale(0.4); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .vw-crop img { animation: none !important; transition: none; } }

/* ---- THE TREE OF AGES (2026-11-09, Goliath: "smooth and beautiful looking ... our gem") ---------------------------- */
/* The crossroads, where both roads meet: a wider ring of light. */
.vp-node[data-kind="crossroads"] { border-width: 3px; border-radius: 22px; background: radial-gradient(120% 140% at 50% 0%, rgba(var(--vp-glow), 0.22), transparent 60%), var(--vp-node); }
.vp-node[data-kind="crossroads"] .vp-node__medal { box-shadow: 0 0 0 3px rgba(var(--vp-glow), 0.35), 0 0 16px rgba(var(--vp-glow), 0.5); }
/* The capstone: a medallion on a banner, gold leaf on the Herd's, bone and fel on the Camp's. */
.vp-node[data-kind="capstone"] { border-width: 3px; border-color: rgba(var(--vp-glow), 0.9);
  background: linear-gradient(160deg, rgba(var(--vp-glow), 0.30), transparent 55%), var(--vp-node);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55), 0 0 22px rgba(var(--vp-glow), 0.35), inset 0 0 0 2px rgba(0, 0, 0, 0.35), inset 0 0 0 4px rgba(var(--vp-glow), 0.35); }
.vp-node[data-kind="capstone"] .vp-node__medal { transform: rotate(45deg); border-radius: 10px; }
.vp-node[data-kind="capstone"] .vp-node__medal .vp-ic { transform: rotate(-45deg); }
/* An alliance: two domains' colours meeting. */
.vp-node[data-kind="alliance"] { border-style: double; border-width: 4px; background: linear-gradient(115deg, rgba(var(--vp-glow), 0.18) 0 50%, rgba(255, 143, 199, 0.14) 50% 100%), var(--vp-node); }
.vp[data-side="horde"] .vp-node[data-kind="alliance"] { background: linear-gradient(115deg, rgba(var(--vp-glow), 0.18) 0 50%, rgba(170, 120, 255, 0.16) 50% 100%), var(--vp-node); }
/* The Crown: the last word of the road. */
.vp-node[data-kind="crown"] { border-width: 3px; border-color: rgb(var(--vp-glow)); border-radius: 26px 26px 14px 14px;
  background: radial-gradient(90% 120% at 50% 0%, rgba(var(--vp-glow), 0.42), transparent 62%), var(--vp-node);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6), 0 0 28px rgba(var(--vp-glow), 0.45); }
.vp-node[data-kind="crown"] .vp-node__name { color: var(--vp-gold); letter-spacing: 0.04em; }
/* THE HERD'S TREE IS HERDY, THE CAMP'S HORDEY (Goliath, 2026-11-02): soft gold and rounded cards for the Village;
   cut corners, bone-white edges and a fel glow for the Camp. */
.vp[data-side="herd"] .vp-node { border-radius: 16px; }
.vp[data-side="horde"] .vp-node { border-radius: 4px; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
/* the cut corners would clip a badge that hangs over the edge, so on the Camp it sits inside the card */
.vp[data-side="horde"] .vp-node__badge { top: 6px; right: 6px; }
.vp[data-side="horde"] .vp-node[data-kind="crown"], .vp[data-side="horde"] .vp-node[data-kind="capstone"] {
  clip-path: polygon(0 12px, 12px 0, calc(50% - 10px) 0, 50% 8px, calc(50% + 10px) 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
/* THE MOMENT OF CHOICE: the bought upgrade blooms, the road not taken cracks to stone. */
@keyframes vp-bloom { 0% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(var(--vp-glow), 0.9); } 45% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(var(--vp-glow), 0); } 100% { transform: none; } }
@keyframes vp-crack { 0% { filter: none; transform: none; } 30% { transform: translateX(-3px) rotate(-0.6deg); } 55% { transform: translateX(3px) rotate(0.6deg); } 100% { filter: grayscale(1) brightness(0.55); transform: none; } }
.vp-node[data-just="bloom"] { animation: vp-bloom 900ms cubic-bezier(.2, .9, .3, 1.2) both; }
.vp-node[data-just="crack"] { animation: vp-crack 700ms ease-out both;
  background-image: linear-gradient(120deg, transparent 47%, rgba(0, 0, 0, 0.55) 48%, transparent 50%), linear-gradient(60deg, transparent 62%, rgba(0, 0, 0, 0.45) 63%, transparent 65%), var(--vp-node); }
.vp-node[data-state="excluded"] { background-image: linear-gradient(120deg, transparent 47%, rgba(0, 0, 0, 0.5) 48%, transparent 50%), linear-gradient(60deg, transparent 62%, rgba(0, 0, 0, 0.4) 63%, transparent 65%), var(--vp-node); }
.vp-scroll { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  .vp-node[data-just] { animation: none; }
  .vp-scroll { scroll-behavior: auto; }
}
/* an upgrade that works today (the room and shop effects, 2026-11-09) */
.vp-detail__now { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; font-size: var(--vp-min); color: #CFF7C4; background: rgba(107, 224, 74, 0.10); border: 1px solid rgba(107, 224, 74, 0.45); }
