/*
 * GROVE AND BADGES lane: the runtime CSS the desk adds beside desk.css.
 * Bush glass art for the approved ideas (ART_DIRECTION.md). Only transform and opacity animate.
 * Colours come from the desk's UI tokens and the art tokens (art\tokens\art_tokens.css).
 */

/* ---------- lane HC hooks: undefined in every normal theme, so each path keeps its art token ---------- */
:root[data-theme="high_contrast"] {
  --gb-hc-ink: #000000; --gb-hc-brass: #6A4000; --gb-hc-gum: #0B2A10; --gb-hc-blue: #00367A;
  /* the plain fill of this lane's drawings: the shared tokens give gum, fern, wattle, brass and wren blue an accent colour
     of their own in High contrast, but in this lane's pieces they are ordinary fills and go white like the rest */
  --gb-hc-paper: #FFFFFF;
  /* every soft plane (part tones, shade and light washes) drops out, so art collapses to three flat values, no greys */
  --gb-hc-soft: 0;
}
/* ---------- enamel fields of the pins and honours: Bush glass only (deep gum green, eucalypt blue grey, a dusty
   eucalypt sky, juvenile gum, blossom cream). Dark holds them near their Light values: enamel is a fired colour, it
   does not lift to pastel at night. The same values are the fallbacks written into every symbol. ---------- */
:root {
  --gb-enamel-gum: #34553A; --gb-enamel-eucalypt: #46636B; --gb-enamel-sky: #6A93AC; --gb-enamel-juvenile: #8FAEA3; --gb-enamel-cream: #F1E8D2;
}
:root[data-theme="dark"], :root[data-theme="night_shift"] {
  --gb-enamel-gum: #38593E; --gb-enamel-eucalypt: #4A6870; --gb-enamel-sky: #648CA4; --gb-enamel-juvenile: #8AA79C; --gb-enamel-cream: #E8DFC9;
}
:root[data-theme="high_contrast"] {
  --gb-enamel-gum: #FFFFFF; --gb-enamel-eucalypt: #FFFFFF; --gb-enamel-sky: #FFFFFF; --gb-enamel-juvenile: #FFFFFF; --gb-enamel-cream: #FFFFFF;
}
@media (forced-colors: active) {
  :root { --gb-enamel-gum: Canvas; --gb-enamel-eucalypt: Canvas; --gb-enamel-sky: Canvas; --gb-enamel-juvenile: Canvas; --gb-enamel-cream: Canvas; }
}
@media (forced-colors: active) {
  :root { --gb-hc-ink: CanvasText; --gb-hc-brass: CanvasText; --gb-hc-gum: CanvasText; --gb-hc-blue: CanvasText; --gb-hc-paper: Canvas; --gb-hc-soft: 0; }
  [data-art="decorative"], [data-art="ambient"] { display: none !important; }
}

.gb-art { display: inline-block; vertical-align: middle; flex: none; overflow: visible; }
.gb-art use { pointer-events: none; }

/* ---------- motion tokens (bible 6), kept here so the art works alone in the review sheet ---------- */
:root {
  --t-micro: 120ms; --t-small: 180ms; --t-card: 280ms; --t-move: 420ms; --t-ring: 600ms; --t-reveal: 900ms;
  --ease-out: cubic-bezier(.2,.8,.2,1); --ease-in: cubic-bezier(.4,0,1,1); --ease-inout: cubic-bezier(.65,0,.35,1);
  --ease-pop: cubic-bezier(.34,1.4,.64,1); --ease-glide: cubic-bezier(.22,1,.36,1);
}

/* ---------- GB-10 pins: the reveal (like M18) and the streak crossing once ---------- */
.gb-pin { position: relative; display: inline-grid; place-items: center; }
.gb-pin > svg { grid-area: 1 / 1; }
.gb-pin .gb-sweep { grid-area: 1 / 1; width: 100%; height: 100%; overflow: hidden; pointer-events: none; opacity: 0; }
.gb-pin[data-shape="round"] .gb-sweep { border-radius: 50%; clip-path: circle(38% at 50% 50%); }
.gb-pin[data-shape="squircle"] .gb-sweep { clip-path: inset(12% round 18%); }
.gb-pin[data-shape="arch"] .gb-sweep { clip-path: inset(10% 14% 10% 14% round 40% 40% 10% 10%); }
.gb-sweep i { position: absolute; top: -30%; left: -60%; width: 12%; height: 160%; transform: rotate(30deg); opacity: .7;
  /* ONE band, the same shape as the Clear panel sweep (M16) and the static streak on every pin */
  background: linear-gradient(90deg, transparent, var(--art-light, rgba(255,255,255,.72)) 50%, transparent); }
.gb-pin.is-revealing > svg { animation: gb-pin-in var(--t-move) var(--ease-pop) both; }
.gb-pin.is-revealing .gb-sweep { animation: gb-fade-io var(--t-reveal) var(--ease-out) 180ms both; }
.gb-pin.is-revealing .gb-sweep i { animation: gb-sweep var(--t-reveal) var(--ease-glide) 180ms both; }
@keyframes gb-pin-in { 0% { transform: scale(.8); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes gb-sweep { from { transform: translateX(0) rotate(30deg); } to { transform: translateX(1100%) rotate(30deg); } }
@keyframes gb-fade-io { 0% { opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* M8 pop for the Sharp Eye stamp and the Good Mate mark */
.gb-pop { animation: gb-pop 160ms var(--ease-pop) both; }
@keyframes gb-pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- GB-52 the Leaf Token wallet chip and the +n float (M13) ---------- */
.gb-wallet { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 8px; border-radius: 999px;
  background: var(--glass-1); border: 1px solid var(--glass-edge); box-shadow: 0 0 0 1px var(--glass-rim);
  font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.gb-float { position: absolute; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-1); font-weight: 700; font-size: .8125rem;
  color: var(--ink); pointer-events: none; }

/* ---------- GB-70 the quest track ---------- */
.gb-track { position: relative; height: 40px; }
.gb-track > svg.gb-track-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.gb-track .gb-marker { position: absolute; top: 0; width: 24px; height: 32px; transform: translateX(-50%); }
.gb-marker .done { opacity: 0; }
.gb-marker.is-done .open { opacity: 0; }
.gb-marker.is-done .done { opacity: 1; }
.gb-marker.just-done .done { animation: gb-pop 160ms var(--ease-pop) both; }
.gb-marker.is-faded { opacity: .45; transition: opacity var(--t-reveal) var(--ease-out); }

/* ---------- GB-83 the boss bar and the Fred chip ---------- */
.gb-bossbar { position: relative; height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--glass-1); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim); }
.gb-bossbar > .fill { position: absolute; inset: 0; transform-origin: left center; background: var(--accent); transition: transform var(--t-move) var(--ease-glide); }
.gb-bossbar > .notches { position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--glass-2) calc(10% - 1px) 10%); }
.gb-bossbar.is-grey > .fill { background: var(--edge-strong); transition: none; }
.gb-fredchip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 4px; border-radius: 999px;
  background: var(--glass-1); border: 1px solid var(--glass-edge); box-shadow: 0 0 0 1px var(--glass-rim); font-size: .75rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }

/* bosses (boss.js): parts move, nothing idles */
.gb-boss { overflow: visible; }
.gb-boss [data-part] { transform-box: fill-box; }
.gb-boss .gb-paper { transform-box: fill-box; transform-origin: center; }

/* ---------- GB-110 the Canteen item card window ---------- */
.gb-item { width: 288px; max-width: 100%; padding: 16px; border-radius: 20px; background: var(--glass-1); border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim), var(--shadow-1); }
.gb-window { position: relative; width: 256px; max-width: 100%; height: auto; aspect-ratio: 256 / 144; border-radius: 14px; overflow: hidden; isolation: isolate;
  background: var(--glass-1); box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-rim); }
.gb-window > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gb-item .gb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.gb-price { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.gb-state { font-size: .8125rem; color: var(--ink-3); }
.gb-item.is-equipped { box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 2px var(--accent), var(--shadow-1); }

/* ---------- GB-61 the honours reveal: three equal columns, never a podium ---------- */
.gb-honours { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.gb-honour { display: grid; justify-items: center; gap: 8px; padding: 16px 8px; border-radius: 20px; text-align: center;
  background: var(--glass-1); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim); }
.gb-honours.is-revealing .gb-honour { animation: gb-rise var(--t-card) var(--ease-out) both; }
.gb-honours.is-revealing .gb-honour:nth-child(2) { animation-delay: 280ms; }
.gb-honours.is-revealing .gb-honour:nth-child(3) { animation-delay: 560ms; }
@keyframes gb-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- milestones, medals and story moments ---------- */
.gb-moment.is-in { animation: gb-moment var(--t-move) var(--ease-pop) both; }
@keyframes gb-moment { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.gb-medal-rise.is-in { animation: gb-medal var(--t-reveal) var(--ease-glide) both; }
@keyframes gb-medal { from { transform: translateY(16px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- the Grove (grove.js) ---------- */
.gb-grove { position: relative; width: 100%; container: gbgrove / inline-size; }
.gb-grove .gb-scene { position: relative; width: 100%; aspect-ratio: 960 / 360; }
/* the sky is open above (tall crowns may rise past the top), but the ground band is clipped to the window's own bottom
   radius: set --gb-grove-r to the radius of the sheet window the Grove sits in (20 by default) */
.gb-grove .gb-scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  clip-path: inset(-60% 0 0 0 round 0 0 var(--gb-grove-r, 20px) var(--gb-grove-r, 20px)); }
.gb-grove .gb-tag { position: absolute; transform: translate(-50%, 0); display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 0 10px 0 4px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim), var(--shadow-1); font-size: .75rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.gb-grove .gb-tag i { width: 18px; height: 18px; border-radius: 50%; background: var(--slot); box-shadow: 0 0 0 2px var(--glass-2), 0 0 0 3px var(--slot); }
.gb-grove .gb-hit { position: absolute; border: 0; padding: 0; background: transparent; border-radius: 40% 40% 12px 12px; cursor: default; }
.gb-grove .gb-hit:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gb-grove .gb-card { position: absolute; transform: translate(-50%, -100%); min-width: min(170px, calc(100% - 12px)); max-width: calc(100% - 12px); box-sizing: border-box; padding: 10px 12px; border-radius: 14px; pointer-events: none;
  background: var(--glass-2); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-rim), var(--shadow-2);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); font-size: .8125rem; color: var(--ink-2);
  opacity: 0; transition: opacity var(--t-small) var(--ease-out); }
.gb-grove .gb-card.is-on { opacity: 1; }
.gb-grove .gb-card b { display: block; color: var(--ink); font-size: .9375rem; }
.gb-grove.is-swapping .gb-scene > svg { transition: opacity var(--t-card) var(--ease-out); }
/* XS (a phone, the Grove full screen): the scene scales down but words must not, so the name tags move into a row just
   under the scene, each still centred under its own tree, smaller, and never wider than its third of the width */
@container gbgrove (max-width: 560px) {
  .gb-grove .gb-scene { margin-bottom: 40px; }
  /* the ground runs on under the scene as the strip that carries the tags (same ground tone and season tint), so the
     band never stops in a hard edge above them; the strip, not the scene, takes the window's bottom radius */
  .gb-grove .gb-scene > svg { clip-path: inset(-60% 0 0 0); }
  .gb-grove .gb-scene::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 40px; pointer-events: none;
    border-radius: 0 0 var(--gb-grove-r, 20px) var(--gb-grove-r, 20px); background-color: var(--art-ground, #CFC8B6);
    background-image: linear-gradient(color-mix(in srgb, var(--gb-grove-season, transparent) 10%, transparent), color-mix(in srgb, var(--gb-grove-season, transparent) 10%, transparent)); }
  .gb-grove .gb-tag { top: calc(100% + 8px) !important; min-height: 24px; max-width: 31cqw; padding: 0 8px 0 3px; gap: 5px; font-size: .6875rem; }
  .gb-grove .gb-tag i { flex: none; width: 14px; height: 14px; }
  .gb-grove .gb-tag { overflow: hidden; text-overflow: ellipsis; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 600px) {
    .gb-grove .gb-scene { margin-bottom: 40px; }
    .gb-grove .gb-scene > svg { clip-path: inset(-60% 0 0 0); }
    .gb-grove .gb-scene::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 40px; pointer-events: none;
      border-radius: 0 0 var(--gb-grove-r, 20px) var(--gb-grove-r, 20px); background-color: var(--art-ground, #CFC8B6); }
    .gb-grove .gb-tag { top: calc(100% + 8px) !important; min-height: 24px; max-width: 31vw; padding: 0 8px 0 3px; font-size: .6875rem; }
    .gb-grove .gb-tag i { width: 14px; height: 14px; }
  }
}

/* High contrast: the tag strip is the plain HC ground, no season tint */
:root[data-theme="high_contrast"] .gb-grove .gb-scene::before { background-image: none; }

/* ---------- reduced motion: every art motion becomes a 120 ms crossfade or an instant change ---------- */
@media (prefers-reduced-motion: reduce) {
  .gb-pin.is-revealing > svg, .gb-honours.is-revealing .gb-honour, .gb-moment.is-in, .gb-medal-rise.is-in, .gb-pop, .gb-marker.just-done .done {
    animation: gb-xfade 120ms linear both !important; }
  .gb-pin.is-revealing .gb-sweep { display: none; }
}
:root[data-motion="reduced"] .gb-pin.is-revealing > svg, :root[data-motion="reduced"] .gb-honours.is-revealing .gb-honour,
:root[data-motion="reduced"] .gb-moment.is-in, :root[data-motion="reduced"] .gb-medal-rise.is-in, :root[data-motion="reduced"] .gb-pop,
:root[data-motion="reduced"] .gb-marker.just-done .done { animation: gb-xfade 120ms linear both !important; }
:root[data-motion="reduced"] .gb-pin.is-revealing .gb-sweep { display: none; }
@keyframes gb-xfade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- compositions (compose.js): every card that carries art to an edge has ONE intentional bleed edge ---------- */
.gb-measure { position: absolute; left: -9999px; top: 0; visibility: hidden; }
/* a composed symbol draws to its full content box: FLORA's sprays reach past their own viewBox */
symbol[id^="art-fl-06-"], symbol[id^="art-fl-0"][id*="-sprig-"] { overflow: visible; }
.gb-display { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.gb-win { border-radius: 28px; padding: 24px; display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 420px; }
.gb-bday { position: relative; overflow: hidden; border-radius: 28px; padding: 28px 28px 22px; display: grid; gap: 10px; max-width: 420px; }
.gb-bday .gb-display { max-width: 11ch; position: relative; }
.gb-bday-sprig { position: absolute; top: 16px; right: -44px; height: 150px; width: auto; transform: rotate(12deg); transform-origin: 70% 30%; pointer-events: none; }
.gb-finale { position: relative; overflow: hidden; border-radius: 28px; padding: 36px 24px 28px; display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 520px; }
.gb-finale-spray { position: absolute; top: 14px; right: -58px; height: 164px; width: auto; pointer-events: none; }
.gb-finale-peek { position: absolute; bottom: 16px; right: -30px; height: 84px; width: auto; transform: rotate(-14deg); opacity: .92; pointer-events: none; }
.gb-finale .gb-medal-rise { margin-top: 40px; position: relative; }
.gb-finale .gb-display, .gb-finale .gb-state { position: relative; }
@media (max-width: 560px) {
  .gb-finale-spray { height: 100px; right: -40px; }
  .gb-finale-peek { height: 60px; right: -22px; }
  .gb-bday-sprig { height: 112px; right: -38px; }
}
.gb-frame-prev { position: absolute; inset: 0; display: grid; place-items: center; }
.gb-av { position: relative; display: inline-block; border-radius: 50%; flex: none; }
