/* Trophies (quests/trophies.js, docs/TROPHIES.md) — the sticker album of
   the Tiger Squad, the detail card, the unlock window.
   Tier colours = the TigerCoins rarities (.tc-sum--*), plus a holographic
   "event" frame. A sticker = the app's own art die-cut: one white backing behind
   the whole art (the #trpDieCut SVG filter, inventory.html), loose pieces
   included, a slight tilt, a ring in the tier colour; a locked
   one is the catalogue's black silhouette in its white border. */
.trp-t--common    { --tc: var(--tier-common); }
.trp-t--uncommon  { --tc: var(--tier-uncommon); }
.trp-t--rare      { --tc: var(--tier-rare); }
.trp-t--epic      { --tc: var(--tier-epic); }
.trp-t--legendary { --tc: var(--tier-legendary); }
.trp-t--event     { --tc: var(--tier-event); }


/* The app's buttons are 40 px tall (70-detail-misc.css `button`): these size themselves. */
.trp-st.trp-st { height: auto; }

/* ── Banner: the Deals banner's frame (.sqr-hero in quests.css), its own scene ── */
.sqr-hero.trp-hero { --hero-scene: none; --hero-front: none;
  --hero-sink: 4px; --hero-art-w: 560px; --hero-art-ratio: 1; --hero-scene-w: 560px; }
/* Scene objects (TROPHY_SCENE, a 3.4 : 1 box): on the temple wall a torch and two
   vines hanging from the top; on the desk the tiger over its map and the relic. */
.trp-hero { --hl-ratio: 2.5; }
.trp-hero .hl--torch { left: 0; bottom: 36%; height: 50%; }
.trp-hero .hl--vine1, .trp-hero .hl--vine2 { top: -4%; bottom: auto; height: 66%; transform-origin: 50% 0; }
.trp-hero .hl--vine1 { left: 15%; }
.trp-hero .hl--vine2 { left: 92%; scale: -1 1; }
.trp-hero .hl--tiger-map { left: 20%; height: 112%; }
.trp-hero .hl--relic { left: 66%; height: 78%; }
@media (prefers-reduced-motion: no-preference) {
  .trp-hero .hl--vine1 { animation: hl-sway 6s ease-in-out infinite; }
  .trp-hero .hl--vine2 { animation: hl-sway 7s ease-in-out -2s infinite; }
}
/* The temple wall: stone blocks drawn over the banner's own wall colour (the account's
   tint stays), mortar as dark translucent joints, every other row offset by half a block. */
/* The shorthand, not background-image: the wall can be a list of layers carrying
   their own position and size (the Aurora style, inventory.js _auroraBg). */
.trp-hero.trp-hero {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='70'%3E%3Cpath d='M0 1H120M0 36H120M1 1V36M61 36V70' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='2'/%3E%3C/svg%3E") 0 0 / 120px 70px repeat,
    var(--hero-wall-c);
}
/* Aurora: the wall's lights drift under the stone (the stone layer first, kept still). */
:root.has-theme-aurora .trp-hero.trp-hero { animation: trp-aurora 9s ease-in-out infinite alternate; }
@keyframes trp-aurora {
  0%   { background-size: 120px 70px, 60% 140%, 60% 140%, 60% 140%, 100% 100%; background-position: 0 0, 0% 0%, 100% 10%, 50% 100%, 0 0; }
  50%  { background-size: 120px 70px, 70% 160%, 55% 130%, 65% 150%, 100% 100%; background-position: 0 0, 60% 60%, 10% 80%, 90% 0%, 0 0; }
  100% { background-size: 120px 70px, 55% 130%, 70% 160%, 60% 140%, 100% 100%; background-position: 0 0, 25% 100%, 85% 30%, 40% 30%, 0 0; }
}
@media (prefers-reduced-motion: reduce) { :root.has-theme-aurora .trp-hero.trp-hero { animation: none; } }
/* The count per tier, on the desk stripe at the banner's foot, right-aligned. */
.trp-hero-tiers.trp-hero-tiers { position: absolute; left: 28px; right: 28px; bottom: 0; z-index: 2; height: var(--hero-desk-hc);
  align-items: center; justify-content: flex-end; flex-wrap: nowrap; overflow: hidden; color: var(--on-dark); text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.trp-hero-tiers b { color: var(--on-dark); }
/* The count card on the right, like the Deals balance card. */
.sqr-card.trp-hero-card { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 120px; padding: 10px 14px; }
.trp-hero-n { display: flex; align-items: baseline; gap: 6px; font: 800 28px var(--qw-mono, monospace); color: var(--tier-legendary); }
.trp-hero-lbl { font-size: 12px; font-weight: 600; color: var(--game-muted); }   /* "stickers collected": what you have, never "of how many" */

/* ── Bar under the banner: the Deals bar (quests.css .sqd-bar / .sqd-tab / .sqd-search) ── */
.trp-toolbar .trp-code { margin-left: auto; }
.trp-search { flex: 1 1 220px; }
.trp-st[hidden], .trp-nomatch[hidden] { display: none; }
.trp-nomatch { margin: 0; padding: 24px 0; text-align: center; color: var(--muted); font-size: 13px; }
.trp-tiers { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.trp-tiers li { display: inline-flex; align-items: center; gap: 6px; }
.trp-tiers i { width: 10px; aspect-ratio: 1; border-radius: 50%; background: var(--tc); box-shadow: 0 0 8px var(--tc); }
.trp-tiers b { color: var(--text); font-size: 13px; }
.trp-loading { padding: 40px; text-align: center; color: var(--muted); }

/* ── Album ── */
.trp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.trp-st { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px 12px;
  border-radius: 14px; border: 1px solid var(--ink-06); background: var(--ink-04);
  color: inherit; font: inherit; text-align: center; cursor: pointer; transition: transform .18s, background .18s, border-color .18s; }
.trp-st:hover { transform: translateY(-2px); background: var(--surface-hover); border-color: color-mix(in srgb, var(--tc) 40%, transparent); }
.trp-st-art { position: relative; display: grid; place-items: center; width: 84px; aspect-ratio: 1; margin-bottom: 6px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tc) 22%, transparent), transparent 70%); }
.trp-st-art::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--tc) 55%, transparent); }
.trp-st-art img { width: 72%; height: auto; aspect-ratio: 1; object-fit: contain; transform: rotate(-6deg);
  filter: url(#trpDieCut) drop-shadow(0 4px 6px rgba(0, 0, 0, .45));
  transition: transform .25s cubic-bezier(.2, .8, .2, 1.4); }
.trp-st.is-got:hover .trp-st-art img { transform: rotate(3deg) scale(1.08); }
.trp-st:nth-child(3n + 2) .trp-st-art img { transform: rotate(5deg); }
.trp-st:nth-child(3n) .trp-st-art img { transform: rotate(-2deg); }
/* Every sticker the same size: the name on two lines at most, one line under it;
   the hint is in the app's shared info bubble (#toolInfoPop) on the "i". */
.trp-st-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em; font-size: 13px; line-height: 1.25; }
.trp-st-sub { font-size: 11px; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.trp-st.is-got .trp-st-sub { color: var(--tc); }
.trp-st-info { position: absolute; top: 8px; right: 8px; z-index: 2; display: grid; place-items: center; width: 22px; aspect-ratio: 1;
  border-radius: 50%; color: var(--muted); transition: color .15s, background .15s; }
.trp-st-info .icon { background-color: currentColor; }
.trp-st-info:hover { color: var(--text); background: var(--ink-10); }
/* Locked: just a silhouette of the same art — no disc, no ring (they weighed the album down). */
.trp-st.is-locked .trp-st-art { background: none; }
.trp-st.is-locked .trp-st-art::after { display: none; }
/* The catalogue's silhouette is already the black shape in its white sticker
   border: shown as it is, like a friend's sticker you do not hold. */
.trp-st.is-locked .trp-st-name { color: var(--muted); }
.trp-st-q { font-size: 34px; font-weight: 800; color: var(--ink-25); }
/* Earned: no ring — the whole card takes its rarity colour and the sticker grows
   (same box, so every card keeps its size). */
.trp-st.is-got { border-color: color-mix(in srgb, var(--tc) 60%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 26%, var(--surface)), color-mix(in srgb, var(--tc) 9%, var(--surface))); }
.trp-st.is-got:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 34%, var(--surface)), color-mix(in srgb, var(--tc) 12%, var(--surface))); }
.trp-st.is-got .trp-st-art { background: none; }
.trp-st.is-got .trp-st-art::after { display: none; }
.trp-st.is-got .trp-st-art img, .trp-st.is-locked .trp-st-art img { width: 108%; }   /* a silhouette as big as a sticker held */
.trp-st.is-got .trp-st-info { color: var(--text); }
/* Legendary glows; event: a holographic edge that turns slowly. */
.trp-st.trp-t--legendary.is-got { box-shadow: 0 0 22px color-mix(in srgb, var(--tc) 30%, transparent); }
.trp-st.trp-t--event.is-got { border-color: transparent;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 26%, var(--surface)), color-mix(in srgb, var(--tc) 9%, var(--surface))) padding-box,
    conic-gradient(from var(--trp-a, 0deg), var(--tier-event), var(--tier-legendary), var(--tier-uncommon), var(--tier-rare), var(--tier-epic), var(--tier-event)) border-box;
  animation: trp-holo 6s linear infinite; }
@property --trp-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes trp-holo { to { --trp-a: 360deg; } }

/* ── Detail card ── */
.trp-unlock { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center;
  background: var(--scrim); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.trp-unlock.is-open { opacity: 1; }
.trp-unlock-card { position: relative; width: min(360px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 24px 24px; border-radius: 20px; text-align: center; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--tc) 35%, transparent); box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  transform: translateY(10px) scale(.96); transition: transform .25s cubic-bezier(.2, .8, .2, 1.2); }
.is-open > .trp-unlock-card { transform: none; }
.trp-unlock-card h3 { margin: 4px 0 0; font-size: 20px; }
.trp-unlock-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.trp-card-art, .trp-unlock-art { display: grid; place-items: center; width: 150px; aspect-ratio: 1; margin-bottom: 6px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tc) 30%, transparent), transparent 70%); }
.trp-card-art img, .trp-unlock-art img { width: 74%; height: auto; aspect-ratio: 1; object-fit: contain; transform: rotate(-5deg);
  filter: url(#trpDieCut) drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); }
.trp-card-tier { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); }

/* ── Unlock: overlay (epic, legendary, event) ── */
.trp-unlock-card { overflow: hidden; }
.trp-unlock-card > small { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.trp-unlock-rays { position: absolute; top: -40%; left: 50%; width: 520px; aspect-ratio: 1; margin-left: -260px; pointer-events: none; opacity: .35;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc) 60%, transparent) 0 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 62%); mask: radial-gradient(circle, #000 15%, transparent 62%);
  animation: trp-spin 14s linear infinite; }
@keyframes trp-spin { to { transform: rotate(360deg); } }
.trp-unlock-art { position: relative; }
.is-open .trp-unlock-art img { animation: trp-slap .7s cubic-bezier(.2, .9, .25, 1.3) both; }
@keyframes trp-slap { 0% { transform: scale(1.9) rotate(-28deg); opacity: 0; } 60% { transform: scale(.92) rotate(-2deg); opacity: 1; } 100% { transform: rotate(-5deg); } }
.trp-unlock-go { margin-top: 12px; padding: 10px 20px; border-radius: 999px; border: 0; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--tc); color: var(--on-accent); transition: filter .15s; }
.trp-unlock-go:hover { filter: brightness(1.1); }
/* While the unlock plays (trophies.js UNLOCK_LOCK_MS) the button waits, then fades in. */
.trp-unlock-go { transition: opacity .35s ease; }
.trp-unlock.is-locked .trp-unlock-go { opacity: 0; pointer-events: none; }
.trp-unlock.is-locked { cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .trp-unlock-rays, .trp-st.trp-t--event.is-got { animation: none; }
  .is-open .trp-unlock-art img { animation: none; }
}
/* The sticker is bigger than its halo and spills over it (the halo stays behind),
   under the rarity · family chip. */
.trp-card-art, .trp-unlock-art { margin: 18px 0 22px; }
.trp-card-art img, .trp-unlock-art img { width: 136%; max-width: none; }
/* The open sticker follows the pointer (coin-pull.js tilt: --rx / --ry, --gx / --gy)
   and a gloss, cut to the sticker's own shape, slides across it. */
.trp-sticker .trp-card-art { perspective: 700px; }
.trp-sticker .trp-tilt { position: relative; display: block; width: 136%; aspect-ratio: 1; transform-style: preserve-3d;
  transform: rotate(-5deg) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2, .8, .3, 1); }
.trp-sticker .trp-tilt.is-tilted { transition-duration: .12s; }
.trp-sticker .trp-card-art .trp-tilt img { width: 100%; transform: none; }
.trp-gloss { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .55; transition: opacity .3s;
  background: radial-gradient(circle at var(--gx, 30%) var(--gy, 25%), rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 42%),
    linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%) 0 0 / 250% 100% no-repeat;
  -webkit-mask: var(--art) center / contain no-repeat; mask: var(--art) center / contain no-repeat;
  animation: trp-gloss-sweep 4.5s cubic-bezier(.45, 0, .55, 1) infinite; }
.trp-tilt.is-tilted .trp-gloss { opacity: .9; }
@keyframes trp-gloss-sweep { 0% { background-position: 0 0, 130% 0; } 60%, 100% { background-position: 0 0, -30% 0; } }
/* The open sticker: the same clear band crossing it as in the album, plus the
   soft spot that follows the pointer. */
.trp-sticker .trp-gloss { mix-blend-mode: screen; opacity: 1;
  background: radial-gradient(circle at var(--gx, 30%) var(--gy, 25%), rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 40%),
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .85) 49%, rgba(255, 255, 255, .35) 53%, transparent 62%) 0 0 / 250% 100% no-repeat; }
/* The same light on every earned sticker of the album: the gloss lies exactly on
   the art (its size and tilt), the sweeps staggered so the page shimmers. */
.trp-gloss--tile { inset: auto; left: 50%; top: 50%; width: 108%; aspect-ratio: 1; translate: -50% -50%; transform: rotate(-6deg);
  opacity: 1; mix-blend-mode: screen; transition: transform .25s cubic-bezier(.2, .8, .2, 1.4);
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .85) 49%, rgba(255, 255, 255, .35) 53%, transparent 62%) 0 0 / 250% 100% no-repeat;
  animation-name: trp-gloss-tile; }
@keyframes trp-gloss-tile { 0% { background-position: 130% 0; } 55%, 100% { background-position: -30% 0; } }
.trp-st:nth-child(3n + 2) .trp-gloss--tile { transform: rotate(5deg); }
.trp-st:nth-child(3n) .trp-gloss--tile { transform: rotate(-2deg); }
.trp-st.is-got:hover .trp-gloss--tile { transform: rotate(3deg) scale(1.08); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .trp-gloss { animation: none; } }
/* A sticker still to win does not open. */
.trp-st.is-locked { cursor: default; }
.trp-st.is-locked:hover { transform: none; }
/* The detail card sits in the envelopes' window frame (tcx card + plaque). */
.trp-sticker .tcx-main { align-items: center; text-align: center; }
.trp-sticker .trp-card-art { align-self: center; }
.trp-sticker .trp-sticker-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.trp-sticker .trp-card-meta { margin: 0; color: var(--text); font-size: 12px; }
.trp-sticker .trp-card-art { flex: none; width: 170px; height: 170px; margin: 26px 0 30px; }
.trp-sticker .trp-tilt { width: 150%; }
/* Centred on the halo whatever its overflow. */
.trp-sticker .trp-card-art { position: relative; }
.trp-sticker .trp-tilt { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
/* No halo behind the sticker in the card: the window's own art swells behind it. */
.trp-sticker .trp-card-art { background: none; }

/* A sticker still to win, opened for its mission: its silhouette as it is, no gloss. */
/* The friend who revealed a sticker: their avatar before "Seen at …" (in its card only). */
/* The friend's avatar through userAvatar (ring + TigerSquad badge): never clipped,
   the badge overhangs the corner like in the friends bar. */
.trp-seen-av { display: inline-block; position: relative; width: 32px; aspect-ratio: 1; margin-right: 10px; vertical-align: middle; }
.trp-seen-av .av-squad-heart { width: 16px; min-width: 16px; right: -4px; bottom: -4px; }
