/*
 * TAG Legal Desk v2.1, J146 and J147 (29 Sep 2026): the people of the Grove (js\v21_grove_people.js). The name tags
 * grow and carry the person's avatar (their critter or animal in their frame, ringed in their colour) and open their
 * profile; every wren is a button that opens it close up; {ai}'s pile of Leaf Tokens stands beside his robot tree; his
 * section in the trophy room. Tokens only, so every theme reads; High contrast and forced colours set plain edges.
 * Only the close up's turn and the pile's small dip move, and neither does under reduced motion or Calm (the page
 * never starts them then). Custom properties come through the CSSOM; nothing here needs a style attribute.
 */

/* ---------- J147: the name tags, bigger, with the avatar ---------- */
/* J165 (29 Sep 2026): {ai}'s tag (.gb-fred-tag, also .v21gp-tag) takes exactly the people's size in every layout, with
   his robot mark in a round face where their avatar sits, so his tag lines up with theirs (styles\v21_grove.css puts
   it in their row). J163: a tag never clips its avatar's frame (the name keeps its own ellipsis), and an avatar in a
   frame stands a little smaller inside it (the frame takes the place of the colour edge), so the frame sits inside the tag
   at every size (js\v21_grove_people.js draws each avatar at the size it shows). */
.gb-grove.v21gp-on .v21gp-tag { min-height: 34px; padding: 2px 12px 2px 3px; gap: 7px; font-size: .8125rem; overflow: visible; }
.gb-grove.v21gp-on .gb-tag.v21gp-tag > i { display: none; }
.gb-grove .v21gp-tag .v21gp-av, .gb-grove.v21gp-on .v21gp-ftag .gb-fred-mark { flex: none; width: 28px; height: 28px; font-size: .6875rem; box-shadow: 0 0 0 2px var(--glass-2), 0 0 0 3.5px var(--slot, var(--brand)); }
.gb-grove .v21gp-tag .v21gp-av .dot { display: none; }
.gb-grove .v21gp-tag .v21gp-av.v21aa-framed, .gb-grove .v21gp-tag .v21gp-av.v21st-framed { box-shadow: none; margin-inline: 0; transform: scale(.8); }
.gb-grove.v21gp-on .v21gp-ftag .gb-fred-mark { display: inline-grid; place-items: center; border-radius: 50%; background: var(--solid); color: var(--brand-text);
  box-shadow: 0 0 0 2px var(--glass-2), 0 0 0 3.5px var(--v21-fred-c, var(--metal-silver-lo, #737B80)); }
.gb-grove.v21gp-on .v21gp-ftag .gb-fred-mark > svg { width: 62%; height: 62%; }
/* J163 review: an effect colour (J121) moves round a tag's own edge but never stands above it: its glow and flames are
   kept to the thin band just round the pill (the tag itself does not clip, so an avatar's frame is never cut), so no
   flame reaches the row above or the scene's ground. */
.gb-grove .v21gp-tag > .v21-fx-l2, .gb-grove .v21gp-tag > .v21-fx-l3, .gb-grove .v21gp-tag > .v21-fx-l4 { clip-path: inset(var(--fx-halo, 6px) round 999px); }
.gb-grove .v21gp-tag.is-room { cursor: pointer; }
.gb-grove .v21gp-tag.is-room:hover { box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 2px var(--slot, var(--brand)), var(--shadow-2); }
.gb-grove .v21gp-tag.is-room:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gb-grove.v21gp-on .gb-fred-tag.v21gp-ftag.is-room:hover { box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 2px var(--v21-fred-c, var(--brand)), var(--shadow-2); }
/* four or more: a taller strip under the scene for the bigger tags */
.gb-grove.gb-many.v21gp-on .gb-scene { --v21-row: 38px; }
.gb-grove.gb-many.v21gp-on .v21gp-tag { min-height: 30px; padding: 2px 9px 2px 3px; gap: 5px; font-size: .75rem; }
.gb-grove.gb-many.v21gp-on .v21gp-tag .v21gp-av, .gb-grove.gb-many.v21gp-on .v21gp-ftag .gb-fred-mark { width: 24px; height: 24px; font-size: .625rem; }
@container gbgrove (max-width: 560px) {
  .gb-grove.v21gp-on:not(.gb-many) .gb-scene { margin-bottom: 48px; }
  .gb-grove.v21gp-on:not(.gb-many) .gb-scene::before { height: 48px; }
  /* room for the avatar's 3.5 px colour edge inside the tag */
  .gb-grove.v21gp-on .v21gp-tag { min-height: 32px; padding: 3px 9px 3px 4px; gap: 5px; font-size: .75rem; }
  .gb-grove.v21gp-on .v21gp-tag .v21gp-av, .gb-grove.v21gp-on .v21gp-ftag .gb-fred-mark { width: 24px; height: 24px; font-size: .625rem; }
  /* three people or fewer on a small screen: his part of the row is narrow, so his tag keeps its name whole with a
     slimmer face and edge */
  .gb-grove.v21gp-on:not(.gb-many) .v21gp-ftag { padding-right: 7px; gap: 4px; }
  .gb-grove.v21gp-on:not(.gb-many) .v21gp-ftag .gb-fred-mark { width: 20px; height: 20px; }
}
@container gbgrove (min-width: 561px) {
  /* three people or fewer: the bigger tags hang below the ground, so the caption under the scene makes room */
  .v21-grove-sheet .gb-grove.v21gp-on:not(.gb-many) .gb-scene { margin-bottom: 10px; }
  .v21-grove-sheet .gb-grove.v21gp-on .v21gp-tag { font-size: clamp(.875rem, .55rem + .6cqw, 1.25rem); min-height: 2.6em; padding: .15em .9em .15em .2em; gap: .55em; }
  .v21-grove-sheet .gb-grove.v21gp-on .v21gp-tag .v21gp-av, .v21-grove-sheet .gb-grove.v21gp-on .v21gp-ftag .gb-fred-mark { width: 2.2em; height: 2.2em; font-size: .8em; }
  .v21-grove-sheet .gb-grove.gb-many.v21gp-on .gb-scene { --v21-row: clamp(40px, 1.6rem + 1.3cqw, 56px); }
  .v21-grove-sheet .gb-grove.gb-many.v21gp-on .v21gp-tag { font-size: clamp(.75rem, .45rem + .5cqw, 1.0625rem); min-height: 2.4em; }
  .v21-grove-sheet .gb-grove.gb-many.v21gp-on .v21gp-tag .v21gp-av, .v21-grove-sheet .gb-grove.gb-many.v21gp-on .v21gp-ftag .gb-fred-mark { width: 1.9em; height: 1.9em; }
}
:root[data-theme="high_contrast"] .gb-grove .v21gp-tag .v21gp-av, :root[data-theme="high_contrast"] .gb-grove.v21gp-on .v21gp-ftag .gb-fred-mark { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #000000; }
:root[data-theme="high_contrast"] .gb-grove.v21gp-on .v21gp-ftag .gb-fred-mark { background: #FFFFFF; color: #000000; }
:root[data-theme="high_contrast"] .gb-grove .v21gp-tag .v21gp-av.v21aa-framed, :root[data-theme="high_contrast"] .gb-grove .v21gp-tag .v21gp-av.v21st-framed { box-shadow: none; }
:root[data-theme="high_contrast"] .gb-grove .v21gp-tag.is-room:hover { box-shadow: 0 0 0 3px #000000; }
@media (forced-colors: active) {
  .gb-grove .v21gp-tag .v21gp-av, .gb-grove.v21gp-on .v21gp-ftag .gb-fred-mark { box-shadow: none; outline: 2px solid CanvasText; }
  .gb-grove .v21gp-tag.is-room:focus-visible { outline-color: Highlight; }
}

/* ---------- J146: each wren is a button that opens it close up ---------- */
.gb-grove .v21gp-wren { position: absolute; transform: translate(-50%, -50%); min-width: 28px; min-height: 28px; padding: 0; margin: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: zoom-in; }
.gb-grove .v21gp-wren:hover { box-shadow: 0 0 0 2px var(--glass-edge), 0 0 0 4px color-mix(in srgb, var(--brand) 35%, transparent); }
.gb-grove .v21gp-wren:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@supports not (color: color-mix(in srgb, red 35%, white)) { .gb-grove .v21gp-wren:hover { box-shadow: 0 0 0 2px var(--glass-edge); } }
:root[data-theme="high_contrast"] .gb-grove .v21gp-wren:hover { box-shadow: 0 0 0 3px #000000; }
@media (forced-colors: active) { .gb-grove .v21gp-wren:hover, .gb-grove .v21gp-wren:focus-visible { outline: 2px solid Highlight; box-shadow: none; } }

/* ---------- J147: {ai}'s own pile of Leaf Tokens ---------- */
.v21gp-fredpile { --v21gp-face: #C9A24E; --v21gp-rim: #8A6A2A; --v21gp-leaf: #4F7A55; --v21gp-ground: rgba(0, 0, 0, .14);
  display: flex; flex-direction: column; align-items: center; pointer-events: none; }
:root[data-theme="dark"] .v21gp-fredpile, :root[data-v21-theme="night_shift"] .v21gp-fredpile { --v21gp-face: #D8B461; --v21gp-rim: #9C7A33; --v21gp-leaf: #7FB08A; --v21gp-ground: rgba(0, 0, 0, .4); }
:root[data-theme="high_contrast"] .v21gp-fredpile { --v21gp-face: #FFFFFF; --v21gp-rim: #000000; --v21gp-leaf: #000000; --v21gp-ground: #000000; }
/* J165: on the ground just left of his robot tree (js\v21_grove_people.js placePile), never under 28 px wide (22 on a small screen) */
.gb-grove .v21gp-fredpile { position: absolute; transform: translate(-50%, -100%); min-width: 28px; }
.v21gp-fredpile.is-col { width: 76px; margin: 8px auto 0; }
.v21gp-heap { display: block; width: 100%; height: auto; overflow: visible; }
.v21gp-tk-ground { fill: var(--v21gp-ground); }
.v21gp-tk-rim { fill: var(--v21gp-rim); }
.v21gp-tk-face { fill: var(--v21gp-face); stroke: var(--v21gp-rim); stroke-width: .5; }
.v21gp-tk-leaf { fill: var(--v21gp-leaf); }
.v21gp-fredn { margin-bottom: 2px; padding: 1px 8px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-edge); color: var(--ink);
  font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@container gbgrove (min-width: 561px) { .v21-grove-sheet .gb-grove .v21gp-fredn { font-size: clamp(.75rem, .45rem + .45cqw, 1rem); } }
/* J163 review: on a small screen his pile and its number sit quietly beside his small robot tree */
@container gbgrove (max-width: 560px) {
  .gb-grove .v21gp-fredpile { min-width: 22px; }
  .gb-grove .v21gp-fredn { font-size: .625rem; padding: 0 5px; }
}
@keyframes v21gp-dip { 0% { transform: none; } 30% { transform: translateY(3px) scale(.92); } 100% { transform: none; } }
.v21gp-fredpile.is-spent .v21gp-fredn { animation: v21gp-dip 900ms var(--ease-out) 1; }
@media (prefers-reduced-motion: reduce) { .v21gp-fredpile.is-spent .v21gp-fredn { animation: none; } }
:root[data-motion="reduced"] .v21gp-fredpile.is-spent .v21gp-fredn { animation: none; }
:root[data-theme="high_contrast"] .v21gp-fredn { background: #FFFFFF; color: #000000; border: 2px solid #000000; }
@media (forced-colors: active) {
  .v21gp-tk-face, .v21gp-tk-rim, .v21gp-tk-ground { fill: Canvas; stroke: CanvasText; stroke-width: 1px; vector-effect: non-scaling-stroke; }
  .v21gp-tk-leaf { fill: CanvasText; }
  .v21gp-fredn { border-color: CanvasText; }
}

/* ---------- without the art: the columns' names and wrens ---------- */
.v21gp-colname { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 3px 12px 3px 3px; border-radius: 999px;
  border: 1px solid var(--glass-edge); background: var(--glass-2); color: var(--ink); font: inherit; font-size: .9375rem; cursor: pointer; }
.v21gp-colname[tabindex="-1"] { cursor: default; }
.v21gp-colname .v21gp-av { width: 32px; height: 32px; box-shadow: 0 0 0 2px var(--glass-2), 0 0 0 3.5px var(--v21-pc, var(--brand)); }
.v21gp-colname .v21gp-av .dot { display: none; }
.v21gp-colname b { min-width: 0; }
.v21gp-colname.v21gp-fcol { padding-left: 12px; }
.v21gp-colbird { padding: 0; margin: 0; border: 0; border-radius: 12px; background: transparent; cursor: zoom-in; }
.v21gp-colname:focus-visible, .v21gp-colbird:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:root[data-theme="high_contrast"] .v21gp-colname { background: #FFFFFF; color: #000000; border: 2px solid #000000; }

/* ---------- J146: the close up ---------- */
.v21gp-near { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
@media (max-width: 640px) { .v21gp-near { grid-template-columns: minmax(0, 1fr); } }
.v21gp-stage { display: grid; place-items: center; min-height: 260px; padding: 16px; border-radius: 20px; overflow: hidden;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%), var(--glass-2); border: 1px solid var(--glass-edge); }
@supports not (color: color-mix(in srgb, red 12%, white)) { .v21gp-stage { background: var(--glass-2); } }
.v21gp-stage svg.art-wren { display: block; width: min(260px, 100%); height: auto; }
.v21gp-turn { transform-origin: 50% 80%; transition: transform 600ms var(--ease-out); }
.v21gp-turn.is-turned { transform: scaleX(-1); }
.v21gp-stage.is-still .v21gp-turn { transition: none; }
@media (prefers-reduced-motion: reduce) { .v21gp-turn { transition: none; } }
:root[data-motion="reduced"] .v21gp-turn { transition: none; }
.v21gp-noart { margin: 0; text-align: center; }
.v21gp-about p { margin: 4px 0; }
.v21gp-about h3 { margin: 12px 0 6px; font-size: 1rem; }
.v21gp-whose { font-size: 1.0625rem; font-weight: 600; }
.v21gp-pieces { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.v21gp-piece { display: grid; gap: 1px; padding: 8px 10px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--glass-edge); }
.v21gp-ctl { grid-column: 1 / -1; gap: 8px; flex-wrap: wrap; }
:root[data-theme="high_contrast"] .v21gp-stage, :root[data-theme="high_contrast"] .v21gp-piece { background: #FFFFFF; border: 2px solid #000000; }
@media (forced-colors: active) { .v21gp-stage, .v21gp-piece { border: 1px solid CanvasText; background: Canvas; } }

/* ---------- J163: {ai}'s picture in his trophy room: his robot tree in a round face, edged in his colour ---------- */
.av.v21gp-rface { --pc: var(--metal-silver-lo, #737B80); background: var(--solid); color: var(--brand-text); box-shadow: 0 0 0 2px var(--solid), 0 0 0 5px var(--pc); }
.av.v21gp-rface > svg { display: block; }
:root[data-theme="high_contrast"] .av.v21gp-rface { background: #FFFFFF; box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 5px #000000; }
@media (forced-colors: active) { .av.v21gp-rface { box-shadow: none; outline: 2px solid CanvasText; } }

/* ---------- J147: {ai}'s section in the trophy room ---------- */
.v21gp-fhead { display: flex; align-items: center; gap: 12px; }
.v21gp-fhead p { margin: 0; }
.v21gp-fglyph { display: inline-grid; place-items: center; width: 56px; height: 56px; flex: none; color: var(--brand-text); }
.v21gp-fglyph svg { width: 56px; height: 56px; }
.v21gp-fbought { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
