/* values.io "pop": the shared visual layer on top of Duolingo's components (ui.css). Everything colourful here comes from
   the real subject: an MM2 item's rarity (its tier), real values and real traders. Linked right after ui.css.

   1. The tier map: one colour set per MM2 tier, the only place tier colours are chosen.
   2. Item pictures: every item picture stands on its tier tile (one flat tinted square, no edge, no lip, no motion),
      Chroma a rainbow face; the same tile at every size, from the item tile (UI.tile) to a 24px chip picture.

   Colours only from tokens.css (dark.css re-colours them). Text on a tinted face is eel (7:1 or more); numbers that matter sit on a
   white plate (eel on white, 8.7:1). */

/* ================================================================ 0. words that must read
   Duolingo's light grey (hare, 2.2:1 on white) stays for decoration and 18px+ bold only; every word a kid has to read
   (side labels, times, small labels, inactive tabs, footer links) uses --color-label. */
:root {
  --color-label: color-mix(in srgb, var(--color-wolf) 72%, var(--color-eel));          /* their wolf, a touch deeper: 5.3:1 white, 5.0 polar, 4.7 iguana */
  --color-placeholder: color-mix(in srgb, var(--color-eel) 60%, var(--color-wolf));    /* field hints: 6.1:1 on polar */
  --color-up: color-mix(in srgb, var(--color-tree-frog) 72%, var(--color-black));      /* a rise, "▲ 2.1%": 5.3:1 */
  --color-down: var(--color-eddy-radio);                                               /* a fall, "▼ 1.2%": 6.0:1 */
  --color-warn-text: var(--color-legendary-foreground);                                /* words on canary (yellow notes): 6.7:1 */
  --color-info-text: var(--color-narwhal);                                             /* words on iguana (blue notes): 6.6:1 */
  --color-on-soft-green: var(--color-eel);                                             /* words on sea-sponge ("You have it"): 7.9:1 */
  --color-ok: var(--color-up);                                                        /* "Copied", "Saved": the one done-green */
  --color-timer: color-mix(in srgb, var(--color-fox-always-light) 66%, var(--color-black));   /* "11 HOURS LEFT": their fox, deep enough to read (4.8:1) */
  --color-count: var(--color-eddy-radio);                                              /* red count badges, white 12-13px on it: 6.0:1 */
  --color-link: var(--color-humpback);                                                 /* small text links ("See all", "Just traded ›"): 5.0:1; macaw is 2.4:1 */
}

/* ================================================================ 0b. one of each small part, the same on every page
   The yellow notice, the step circle, the quantity chip, the timestamp and the "You give" side label each have one look.
   Pages keep their own class names; this list gives them the shared look (a page rule only adds spacing/layout). */
:root {
  --note-bg: var(--color-canary);
  --note-line: color-mix(in srgb, var(--color-bee) 55%, var(--color-canary));          /* a soft gold line */
  --note-fg: var(--color-warn-text);
  --note-info-bg: var(--color-iguana);
  --note-info-line: var(--color-blue-jay);
  --note-info-fg: var(--color-info-text);
}
/* the yellow notice: <p class="pop-note">…</p> (info: pop-note--info) */

/* the step circle (their path node, small): a blue face with its lip and the number in white 19px bold (4.9:1 on
   humpback; white on their macaw is 2.4:1), done = owl with a check, a later step = swan */
.pop-step, .it-step__n {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-humpback); box-shadow: 0 3px 0 var(--color-narwhal); color: var(--color-snow-always-light); font: 700 19px/1 var(--font);
}
.pop-step.is-done { background: var(--color-owl); box-shadow: 0 3px 0 var(--color-owl-lip); color: var(--color-on-bright); }
.pop-step.is-later { background: var(--color-swan); box-shadow: 0 3px 0 color-mix(in srgb, var(--color-hare) 70%, var(--color-black)); color: var(--color-eel); }
/* the quantity chip ("×2"): humpback face, white words (4.9:1), a snow ring where it overlaps a tile */
.pop-qty {
  padding: 3px 6px; border: 2px solid var(--color-snow); border-radius: 8px; background: var(--color-humpback);
  color: var(--color-snow-always-light); font: 700 12px/14px var(--font); letter-spacing: .04em; white-space: nowrap;
}
/* a time ("5 min ago") next to a name or a message */
.ch-row__time { color: var(--color-label); font: 700 13px/16px var(--font); text-transform: none; letter-spacing: 0; white-space: nowrap; }
/* the side label of a trade ("You give", "They want") */
.pop-side, .ac-half__label { color: var(--color-label); font: 700 15px/20px var(--font); letter-spacing: 0; text-transform: none; }   /* "You give", as the landing and Chats say it (UX.md rule 17) */
/* ...in its side's colour wherever a trade is shown in two sides: "You give" (and "You gave", "They give") deep orange,
   "You get" (and "You got", "They get") deep green, the same on every trade whatever the values: a side's colour, never
   a verdict (the trade rows, the trade post, a chat's trade, the offer window, Check a trade, the AI's trade cards, an
   alert's strip). Both read at 4.5:1 or more on their pages; dark.css gives them the dark themes' own values. */
:root { --color-side-give: var(--color-timer); --color-side-get: var(--color-up); }
.ac-half--give .ac-half__label,
.tv-sides > .tv-box:first-child .tv-box__label,
.ck-side[data-side="give"] .ck-side__label,
.tw-side:not(.tw-side--get) .tw-side__label,
.c-offer__sides > .c-offer__word:first-child .c-offer__label,
.as-check > .as-check__row:first-child > .as-check__head > span:first-child,
:is(.as-trow__deal, .as-deal) > .as-trow__word:first-child,
.ta-side--give .ta-side__word { color: var(--color-side-give); }
.ac-half--get .ac-half__label,
.tv-sides > .tv-box:last-child .tv-box__label,
.ck-side[data-side="get"] .ck-side__label,
.tw-side--get .tw-side__label,
.c-offer__sides > .c-offer__word:not(:first-child) .c-offer__label,
.as-check > .as-check__row:nth-child(2) > .as-check__head > span:first-child,
:is(.as-trow__deal, .as-deal) > .as-trow__word:not(:first-child),
.ta-side--get .ta-side__word { color: var(--color-side-get); }

/* ================================================================ 1. the tier map
   --tier       the tier's colour: the Values chips' dot, the item chart's line
   --tier-soft  the tinted face of a picture's tile; --tier-line its border (profile banners, the item tile's edge) */
[data-tier] { --tier: var(--color-macaw-always-light); }
[data-tier="Unique"] { --tier: var(--color-fox-always-light); }
[data-tier="Ancient"] { --tier: var(--color-beetle); }
[data-tier="Chroma"] { --tier: var(--color-peacock); }
[data-tier="Godly"] { --tier: var(--color-dragon); }
[data-tier="Vintage"] { --tier: var(--color-bee-always-dark); }
[data-tier="Legendary"] { --tier: var(--color-cardinal-always-light); }
[data-tier="Rare"] { --tier: var(--color-humpback); }
[data-tier="Uncommon"] { --tier: var(--color-owl-always-light); }
[data-tier="Common"] { --tier: var(--color-hare-always-light); }
/* the kinds are badges only (Values page strip) */

/* the derived tints: a pale face of the tier on the white page */
[data-tier] {
  --tier-soft: color-mix(in srgb, var(--tier) 16%, var(--color-snow));
  --tier-line: color-mix(in srgb, var(--tier) 42%, var(--color-snow));
}

/* ================================================================ 2. item pictures on their tier tile
   One flat square in the tier's soft colour, inside the picture's own box (no layout change): no edge, no lip, no
   motion, so an item is the same object at every size (a 112px item tile, a 40px row, a 24px chip). Chroma: their Super
   rainbow (the one place Duolingo uses gradients) on the face, still (the owner: "no weird flashes"). */
.u-pic[data-tier] { padding: calc(var(--s) * .1); border-radius: max(8px, calc(var(--s) * .22)); background: var(--tier-soft); isolation: isolate; }
.u-pic[data-tier]:not(.has-img) { border: 0; }
.u-pic[data-tier]:not(.has-img) .u-pic__code { color: var(--color-eel); }
.u-pic[data-tier] > img { z-index: 1; }
.u-pic[data-tier="Chroma"] {
  background: linear-gradient(135deg, rgba(var(--color-super-gradient-green-variant1-rgb), .34), rgba(var(--color-super-gradient-blue-variant1-rgb), .30) 50%, rgba(var(--color-super-gradient-pink-variant1-rgb), .34)), var(--color-snow);
}

/* a tile that fills its grid column (UI.tile); min-height 0 keeps it square when the picture is taller than wide */
.u-pic--fill { width: 100%; height: auto; aspect-ratio: 1; min-height: 0; }
.u-pic--fill[data-tier] { padding: 12%; border-radius: 16px; }

/* overlapping rows of pictures: a snow ring keeps each card apart */
.u-pics > .u-pic[data-tier] + .u-pic[data-tier] { outline: 2px solid var(--color-snow); }
