/* Tiger Quests (renderer/quests/index.js) — the view-bar chips,
   the Quests views of the main area (their --tsq-* palette mapped onto the theme
   tokens, see "Progress views") and the celebrations. Motion 160–400 ms, none
   under reduced motion. */

/* ── Celebration: a card dropping in at the top, a burst, the XP ───────── */
.qst-cel {
  position: fixed; z-index: 10070; top: 18px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 14px; border-radius: 14px;
  background: #151922; color: #F1F3F8; border: 1px solid #303543; box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  animation: qst-cel-in .32s cubic-bezier(.2, .9, .25, 1.2) both; pointer-events: none;
}
.qst-cel--fullSet, .qst-cel--level { border-color: var(--game-gold); box-shadow: 0 0 0 1px rgba(255, 209, 102, .4), 0 0 36px rgba(255, 209, 102, .35), 0 16px 40px rgba(0, 0, 0, .45); }
.qst-cel.is-out { animation: qst-cel-out .24s ease-in forwards; }
.qst-cel-xp { font-size: 20px; font-weight: 900; background: linear-gradient(90deg, var(--game-orange), var(--game-gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qst-cel-txt { display: flex; flex-direction: column; font-size: 13px; }
.qst-cel-txt small { font-size: 12px; color: var(--game-muted); }
.qst-cel-burst { position: absolute; left: 34px; top: 50%; width: 0; height: 0; }
.qst-cel-burst i {
  position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--game-gold); opacity: 0;
  animation: qst-spark .7s ease-out .1s forwards;
}
.qst-cel-burst i:nth-child(even) { background: var(--game-orange); }
.qst-cel-burst i:nth-child(1)  { --dx: 34px;  --dy: -18px; }
.qst-cel-burst i:nth-child(2)  { --dx: -30px; --dy: -22px; }
.qst-cel-burst i:nth-child(3)  { --dx: 26px;  --dy: 24px; }
.qst-cel-burst i:nth-child(4)  { --dx: -24px; --dy: 26px; }
.qst-cel-burst i:nth-child(5)  { --dx: 4px;   --dy: -34px; }
.qst-cel-burst i:nth-child(6)  { --dx: -6px;  --dy: 32px; }
.qst-cel-burst i:nth-child(7)  { --dx: 40px;  --dy: 4px; }
.qst-cel-burst i:nth-child(8)  { --dx: -38px; --dy: 2px; }
.qst-cel-burst i:nth-child(9)  { --dx: 18px;  --dy: -30px; }
.qst-cel-burst i:nth-child(10) { --dx: -16px; --dy: -32px; }
@keyframes qst-spark { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.4); } }
@keyframes qst-cel-in { from { opacity: 0; transform: translate(-50%, -14px) scale(.94); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes qst-cel-out { to { opacity: 0; transform: translate(-50%, -10px); } }
@media (prefers-reduced-motion: reduce) {
  .qst-cel, .qst-cel.is-out, .qst-cel-burst i { animation: none; }
  .qst-cel-burst { display: none; }
  .qst-bar i, .qst-rank { transition: none; }
}

/* ── View bar, Tiger Quests group: icon buttons (today · journey) with a thin
   progress line under each icon; the figures are in the hover name. ── */
.vtg-quests button { flex-direction: column; gap: 3px; }
.vtg-btn-bar { display: block; width: 18px; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.vtg-btn-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--game-orange), var(--game-gold)); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
#vtgDaily.is-done .vtg-btn-bar i { background: var(--success); }
@media (prefers-reduced-motion: reduce) { .vtg-btn-bar i { transition: none; } }

/* ── Progress views in the main area (view modes questsToday / questsJourney / squad) ──
   The Quests and TigerSquad screens follow the app theme here: their --tsq-*
   palette is mapped onto the theme tokens instead of the fixed dark window. */
/* No search bar, stock filters or colour bars in these views. */
body.progress-view .inv-search-row,
body.progress-view .rv-hue,
body.progress-view #gridSortWrap { display: none; }

.inv-quests-view, .inv-squad-view {
  /* The PAGE colour, resolved here: inside the heroes (dark token scope)
     --bg is the dark one, but their corner ring must match the page. */
  --page-bg: var(--bg);
  container: quests / inline-size;   /* the Quests / Squad layouts follow the view's width (@container quests) */
  margin-top: var(--view-gap); flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  /* The local palette only ever aliases the shared Game UI tokens (00-base.css). */
  --tsq-bg: var(--game-bg); --tsq-bg2: var(--game-bg-2); --tsq-card: var(--game-card); --tsq-line: var(--game-line);
  --tsq-text: var(--game-text); --tsq-muted: var(--game-muted); --tsq-orange: var(--game-orange-text);
}
.inv-quests-view.hidden, .inv-squad-view.hidden { display: none; }


/* The rankings board, drawn inline (squad-board--inline). */
.squad-board--inline { max-width: 820px; color: var(--text); }
.squad-board--inline .squad-invite-x { display: none; }
.squad-board--inline .tsq-scroll { overflow: visible; padding: 4px 0 16px; gap: 12px; }
.squad-board--inline .tsq-title { text-align: left; font-size: 20px; }
.squad-board--inline .sqb-wall, .squad-board--inline .sqb-you { align-self: flex-start; text-align: left; }
.inv-quests-view, .inv-squad-view { scrollbar-width: none; }
.inv-quests-view::-webkit-scrollbar, .inv-squad-view::-webkit-scrollbar { width: 0; height: 0; }
.squad-board.squad-board--inline { width: auto; height: auto; max-width: 980px; }
.squad-board--inline .tsq-title { text-transform: none; letter-spacing: 0; }

/* ── Game world — the Quests views, after the Tiger Quests presentation page:
   one committed dark world (like the TigerSquad windows), cut-corner panels,
   diamond boxes, skewed segmented bars, mono numbers with an orange glow. ── */
.qw {
  --qw-bg: var(--game-bg); --qw-panel: var(--game-card); --qw-panel2: var(--game-card-2); --qw-ink: var(--game-text); --qw-muted: var(--game-muted); --qw-line: var(--game-line);
  --qw-tiger: var(--game-orange); --qw-tiger2: var(--game-orange-hi); --qw-tiger-text: var(--game-orange-text); --qw-glow: color-mix(in srgb, var(--game-orange) 45%, transparent); --qw-ok: var(--game-ok-text); --qw-legend: var(--game-gold-deep-text);
  --qw-display: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --qw-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --qw-cut: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  display: flex; flex-direction: column; gap: 14px; color: var(--qw-ink);   /* no panel of its own: the blocks sit straight on the view */
}
.qw h2 { margin: 0; font: 700 28px/1.05 var(--qw-display); text-transform: uppercase; letter-spacing: .02em; color: var(--qw-ink); text-shadow: 0 0 30px var(--qw-glow); }
.qw-eyebrow { display: inline-block; margin-bottom: 6px; padding: 5px 12px 5px 14px; font: 700 11px/1 var(--qw-display); letter-spacing: .28em; text-transform: uppercase;
  color: var(--game-on-gold); background: var(--qw-tiger); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.qw-empty { margin: 0; padding: 16px; text-align: center; color: var(--qw-muted); border: 1px dashed var(--qw-line); }

.qw-panel { background: linear-gradient(180deg, var(--qw-panel2), var(--qw-panel)); border: 1px solid var(--qw-line); clip-path: var(--qw-cut);
  padding: 20px; display: grid; gap: 16px; align-content: start; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.qw-quest-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }


/* TigerSquad makers: each member's rank inside their own country, next to the flag. */
.sqb-mini-flag { display: inline-flex; align-items: center; gap: 3px; }
.sqb-crank { font-size: 11px; font-weight: 800; color: var(--tsq-muted); font-variant-numeric: tabular-nums; }
/* TigerSquad view, Countries tab: three leagues side by side — countries, the
   member's own country, the makers worldwide (one column in the window, or when narrow). */
.sqb-cols { display: grid; gap: 16px; align-items: start; }
.sqb-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.squad-board--inline .sqb-cols:has(.sqb-col:not(:first-child):not([hidden])) { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.squad-board.squad-board--inline:has(.sqb-col:not(:first-child):not([hidden])) { max-width: none; }
/* Missions: every built level, rank by rank. */

/* Loot ladder — rarity rungs (presentation page "Rarity — loot ladder"). */
.qw-ladder { gap: 10px; }
/* Tiger device artwork drawn as a mask, in the rarity colour (Items cards). */
.qw-item-mask { width: 40px; height: 40px; background: var(--c); -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 55%, transparent)); }

/* ── Today: the daily quests screen (renderer/quests/index.js todayHtml) ──
   Banner (DAILY_SCENE layers, assets/img/quests/daily-hero/, on a CSS wall + desk), progress + full-set
   chest, quest rows, side column. Same dark game world as the presentation. */
.qd { display: flex; flex-direction: column; gap: 14px; }
/* Hero banners (Today, Missions, TigerSquad): each artwork is a transparent
   scene (objects only); the wall and the desk are CSS, so the backdrop is a
   setting. Set --hero-wall (a colour or any gradient), --hero-desk and
   --hero-desk-h on any ancestor (body, a theme…) — the scenes sit on it
   unchanged, at any banner width. The defaults are the navy workshop. */
/* The heroes are in the dark token scope (00-base.css): their local aliases are
   re-resolved here, or they would keep the light values inherited from the view. */
.qd-hero, .qm-hero, .sqr-hero, .sqr-hero-host {
  --qw-bg: var(--game-bg); --qw-panel: var(--game-card); --qw-panel2: var(--game-card-2); --qw-ink: var(--game-text); --qw-muted: var(--game-muted); --qw-line: var(--game-line);
  --qw-tiger-text: var(--game-orange-text); --qw-ok: var(--game-ok-text); --qw-legend: var(--game-gold-deep-text);
  --tsq-bg: var(--game-bg); --tsq-bg2: var(--game-bg-2); --tsq-card: var(--game-card); --tsq-line: var(--game-line);
  --tsq-text: var(--game-text); --tsq-muted: var(--game-muted); --tsq-orange: var(--game-orange-text);
  color: var(--game-text);
}
.qd-hero, .qm-hero, .sqr-hero {
  --hero-wall-c: var(--hero-wall, #13204a);
  --hero-desk-c: var(--hero-desk, linear-gradient(180deg, #c8743a 0 6px, #b5652f 6px 14px, #8a4a26 14px));
  --hero-desk-hc: var(--hero-desk-h, 26px);
  /* Every hero banner is the same height, in every view. */
  position: relative; height: 150px; background: var(--hero-wall-c); }
/* Aurora: the banners' wall drifts like the header glow (theme-aurora, 60-modals.css). */
:root.has-theme-aurora :is(.qd-hero, .qm-hero, .sqr-hero):not(.trp-hero) { animation: theme-aurora 9s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { :root.has-theme-aurora :is(.qd-hero, .qm-hero, .sqr-hero) { animation: none; } }
/* The banner stays on screen while its view scrolls (the views are the
   scroll containers): it sticks to the top, the page sliding under it. The
   Squad rankings banner sits in a host of its own, which is what sticks. */
:is(.inv-quests-view, .inv-squad-view) :is(.qd-hero, .qm-hero, .sqr-hero, .sqr-hero-host) { position: sticky; top: 0; z-index: 5; }
/* What slides under it must not show through its rounded corners: a solid
   ring of the page colour (8 px covers a 14 px radius's corners) fills them,
   invisible over the page itself. The rankings host is square: a plain fill. */
:is(.inv-quests-view, .inv-squad-view) :is(.qd-hero, .qm-hero, .sqr-hero) { box-shadow: 0 0 0 8px var(--page-bg); }
.inv-squad-view .sqr-hero-host { background: var(--page-bg); }
.inv-squad-view .sqr-hero-host .sqr-hero { position: relative; box-shadow: none; }
/* Three planes. The scene is a flex item between the title and the card, so
   it takes the room left and shrinks with the window instead of sliding under
   the card. Its own background is the back layer (behind the desk); the desk
   is the hero's ::after; the scene's ::after is the optional --hero-front
   layer — the same image keeping only what rests ON the desk (paws, printer
   feet) — over the desk. --hero-sink is how far the scene's bottom sits under
   the desk's top edge, so the desk edge lands on the line where waist-up
   characters are cut. Text and card sit above all three. */
.qd-hero::after, .qm-hero::after, .sqr-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  height: var(--hero-desk-hc); background: var(--hero-desk-c); pointer-events: none; }
.qd-hero > .hero-scene, .qm-hero > .hero-scene, .sqr-hero > .hero-scene { position: relative; z-index: auto; align-self: stretch;
  margin-bottom: calc(-6px - var(--hero-sink, 4px));
  /* Full size while there is room; on a narrow banner the art may shrink to
     80 % — never less (below that the banner drops the scene, see the
     container queries further down). */
  flex: 1 1 var(--hero-scene-w, 0); min-width: calc(var(--hero-scene-w, 0px) * .8); }
/* The art is drawn by the two pseudo-elements, so it may extend past the room
   the scene reserves (the card is allowed over the TigerSquad printer). */
.hero-scene::before, .hero-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.hero-scene::before { background: var(--hero-scene) var(--hero-scene-pos, center) bottom / contain no-repeat; }
.hero-scene::after { z-index: 2; background: var(--hero-front, none) var(--hero-scene-pos, center) bottom / contain no-repeat; }
/* --hero-art-w: the art's full width when it is wider than what the scene
   reserves (--hero-scene-w) — centred while there is room, then pinned left and
   spilling right; it scales with the scene when the scene shrinks. */
.sqr-hero:not(.qd-hero) .hero-scene::before, .sqr-hero:not(.qd-hero) .hero-scene::after {
  right: auto; left: max(0px, calc(50% - var(--hero-art-w) / 2)); background-position: left bottom;
  width: min(var(--hero-art-w), calc(100% * var(--hero-art-ratio))); }
/* Narrow banners, in steps — each hero is its own size container. */
.qd-hero, .qm-hero, .sqr-hero { container: hero / inline-size; }   /* named: rules inside a layered scene (itself a size container) can still ask the banner */
.qd-hero > :not(.hero-scene), .qm-hero > :not(.hero-scene), .sqr-hero > :not(.hero-scene) { position: relative; z-index: 3; }
/* Banner: the Missions hero (.qm-hero) — same markup, size and type — with the
   daily scene on the right (the Missions scene sits in the middle). */
/* Missions scene (MISSIONS_SCENE, a 3.4 : 1 box): the tiger behind the desk (its
   image ends on the waist cut: −6 px puts it just over the desk top), the cork
   board hanging behind it on the wall, the compass and the scroll, the printer. */
.qm-hero:not(.qd-hero):not(.xph-hero) .hl-box { left: 50%; translate: -50% 0; }   /* centred between the title and the level card */
.qm-hero:not(.qd-hero):not(.xph-hero) .hl--tiger { left: 0; height: 94%; translate: 0 -4px; }   /* its bottom on the desk's top edge */
.qm-hero:not(.qd-hero):not(.xph-hero) .hl--board { left: 31%; bottom: 28%; height: 64%; translate: none; }
.qm-hero:not(.qd-hero):not(.xph-hero) .hl--compass { left: 36%; height: 30%; }
.qm-hero:not(.qd-hero):not(.xph-hero) .hl--scroll { left: 45%; height: 20%; }
.qm-hero:not(.qd-hero):not(.xph-hero) .hl--printer { left: 63%; height: 74%; }
@media (prefers-reduced-motion: no-preference) {
  .qm-hero:not(.qd-hero):not(.xph-hero) .hl--compass { transform-origin: 50% 60%; animation: hl-sway 5s ease-in-out infinite; }
}
.qm-hero.qd-hero { --hero-scene: none; --hero-front: none; --hero-scene-w: 640px; --hl-ratio: 4.4; }
/* Today scene (DAILY_SCENE, a 4.4 : 1 box pinned right): plant, laptop, the tiger
   (one picture) standing on the desk with its paw resting on it, the thought bubble
   floating, the printer, the spool shelf. Widths follow from the heights (h × ratio ÷ 4.4). */
.qd-hero .hl-box { left: auto; right: 24px; }
.qd-hero .hl--plant { left: 0; height: 56%; }
.qd-hero .hl--laptop { left: 8.5%; height: 31%; }
.qd-hero .hl--tiger { left: 23%; height: 92%; }
.qd-hero .hl--bubble { left: 41%; bottom: 62%; height: 36%; translate: none; }
.qd-hero .hl--printer { left: 52%; height: 74%; }
.qd-hero .hl--shelf { left: 79.5%; height: 98%; }
@media (prefers-reduced-motion: no-preference) {
  .qd-hero .hl--bubble { animation: hl-float 3s ease-in-out infinite; }
}
.qd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 25%); gap: 14px; align-items: start; }
.qd-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.qd-card { position: relative; background: linear-gradient(180deg, var(--qw-panel2), var(--qw-panel)); border: 1px solid var(--qw-line); border-radius: 12px; padding: 14px 16px; }
.qd-card h3 { margin: 0; font: 700 16px var(--qw-display); text-transform: uppercase; letter-spacing: .04em; color: var(--qw-ink); }
.qd-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 34%); gap: 10px; }
.qd-progress { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.qd-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.qd-progress-head h3 { text-transform: none; font-size: 19px; letter-spacing: 0; }
.qd-progress-n { font: 700 18px var(--qw-mono); color: var(--qw-muted); }
.qd-progress-n b, .qd-progress-xp b { color: var(--qw-tiger-text); }
.qd-progress-row { display: flex; align-items: center; gap: 14px; }
/* One segment per quest (as many as the day has): filled orange when done. */
.qd-seg { flex: 1; display: flex; gap: 5px; height: 16px; }
.qd-seg i { position: relative; flex: 1; border-radius: 5px; background: var(--game-bg-2); border: 1px solid var(--qw-line); overflow: hidden; }
.qd-seg i::after { content: ""; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--qw-tiger), var(--qw-tiger2)); }
.qd-seg i.on { border-color: color-mix(in srgb, var(--qw-tiger) 70%, var(--qw-line)); box-shadow: 0 0 8px rgba(255, 122, 26, .25); }
.qd-seg i.on::after { transform: scaleX(1); }
.qd-seg i.on.is-new::after { animation: qd-fill .35s ease-out both; }
@keyframes qd-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.qd-progress-xp { font: 700 15px var(--qw-mono); color: var(--qw-muted); white-space: nowrap; }

.qd-chest { display: flex; align-items: center; gap: 12px; border-color: color-mix(in srgb, var(--qw-legend) 45%, var(--qw-line));
  background: radial-gradient(120% 140% at 20% 50%, rgba(255, 178, 26, .16), transparent 60%), linear-gradient(180deg, var(--qw-panel2), var(--qw-panel)); }
/* The chest is the day's main reward: 96 px on the left, dimmed until earned. */
.qd-chest { gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.qd-chest-art { position: relative; width: 96px; height: 96px; flex-shrink: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 55%, rgba(255, 190, 60, .32), transparent 66%); }
.qd-chest { overflow: hidden; }   /* the jackpot burst stays inside the panel */
.qd-chest-img { width: 96px; height: 96px; object-fit: contain; filter: grayscale(1) brightness(.72) drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); transition: filter .3s ease; }
/* Locked: grey chest; hovering it catches a little gold light. */
.qd-chest.is-locked { transition: border-color .25s ease, box-shadow .25s ease; }
.qd-chest.is-locked:hover { border-color: color-mix(in srgb, var(--qw-legend) 70%, var(--qw-line)); box-shadow: inset 0 0 26px rgba(255, 178, 26, .08); }
.qd-chest.is-locked:hover .qd-chest-img { filter: grayscale(.85) brightness(.8) drop-shadow(0 0 10px rgba(255, 190, 60, .25)); }
.qd-chest-lock { position: absolute; right: 4px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--game-card-2); border: 1px solid color-mix(in srgb, var(--qw-legend) 55%, var(--qw-line)); }
.qd-chest-lock .icon { background: var(--qw-legend); }
.qd-chest.is-near .qd-chest-img { filter: grayscale(1) brightness(.82) drop-shadow(0 0 10px rgba(255, 178, 26, .3)); animation: qd-wiggle 2.4s ease-in-out infinite; }
.qd-chest.is-earned { border-color: var(--qw-legend); box-shadow: 0 0 26px rgba(255, 178, 26, .28), inset 0 0 30px rgba(255, 178, 26, .08); }
.qd-chest.is-earned .qd-chest-img { filter: drop-shadow(0 0 14px rgba(255, 190, 60, .65)) drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.qd-chest-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qd-chest-label { font: 700 13px var(--qw-display); text-transform: uppercase; letter-spacing: .1em; color: var(--qw-legend); }
.qd-chest-xp { font: 800 32px/1 var(--qw-mono); color: #ffd36e; text-shadow: 0 0 16px rgba(255, 178, 26, .35); }
.qd-chest.is-earned .qd-chest-xp { color: var(--qw-ok); text-shadow: 0 0 16px rgba(61, 220, 132, .45); }
.qd-chest small { font-size: 12px; color: var(--qw-muted); }
.qd-chest-check { margin-left: auto; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--qw-ok); box-shadow: 0 0 18px rgba(61, 220, 132, .55); }
.qd-chest-check .icon { background: var(--game-bg); }
@keyframes qd-wiggle { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-6deg); } 94% { transform: rotate(6deg); } 97% { transform: rotate(-3deg); } }

.qd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qd-row { --cat: var(--qw-tiger); display: grid; grid-template-columns: 52px minmax(0, 1fr) 128px 40px minmax(80px, 150px) 70px 150px; gap: 14px; align-items: center;
  padding: 10px 16px 10px 12px; border: 1px solid var(--qw-line); border-radius: 12px; background: linear-gradient(180deg, var(--qw-panel2), var(--qw-panel)); }
.qd-cat-quick { --cat: var(--game-ok); --cat-text: var(--game-ok-text); } .qd-cat-exploration { --cat: var(--game-ice-deep); --cat-text: var(--game-ice-text); } .qd-cat-challenge { --cat: var(--tier-epic); }
/* The badge's WORDS take the category's "-text" shade (readable on the light theme's pale tint). */
/* The mission icon: bare, in the text colour — no tile around it (lighter rows).
   NOT --on-accent: that token is for a label ON a filled button; here the
   ground is the row itself, light in the Light theme. */
.qd-ic { width: 40px; height: 52px; display: grid; place-items: center; }
.qd-ic .icon { width: 24px; height: 24px; background: var(--qw-ink); }
.qd-logo { width: 30px; aspect-ratio: 1; object-fit: contain; }
.qd-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qd-title b { font-size: 15px; color: var(--qw-ink); }
.qd-title small { font-size: 13px; color: var(--qw-muted); }
.qd-badge { justify-self: start; min-width: 104px; height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 8px; border: 1px solid var(--cat); color: var(--cat-text, var(--cat)); background: color-mix(in srgb, var(--cat) 12%, transparent);
  font: 700 12px var(--qw-display); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.qd-count { font: 700 14px var(--qw-mono); color: var(--qw-ink); text-align: right; }
.qd-bar { height: 8px; border-radius: 4px; background: var(--qw-bg); border: 1px solid var(--qw-line); overflow: hidden; }
.qd-bar i { display: block; height: 100%; background: var(--qw-ok); box-shadow: 0 0 10px rgba(61, 220, 132, .5); transition: width .3s ease; }
.qd-xp { font: 700 15px var(--qw-mono); color: var(--qw-tiger-text); white-space: nowrap; text-align: right; display: inline-block; }
.qd-status { display: flex; align-items: center; gap: 10px; }
.qd-status > span:last-child { display: flex; flex-direction: column; font-size: 13px; color: var(--qw-muted); }
.qd-status b { font-weight: 700; color: var(--qw-muted); }
.qd-check { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--qw-line); }
.qd-row { transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.qd-row:hover { background: linear-gradient(180deg, #222944, #1a2033); border-color: color-mix(in srgb, var(--qw-tiger) 45%, var(--qw-line)); box-shadow: 0 0 0 1px rgba(255, 122, 26, .12), 0 0 18px rgba(255, 122, 26, .08); }
.qd-row.is-done { border-color: color-mix(in srgb, var(--qw-ok) 30%, var(--qw-line)); background: linear-gradient(180deg, color-mix(in srgb, var(--qw-ok) 5%, var(--qw-panel2)), var(--qw-panel)); }
.qd-row.is-done:hover { border-color: color-mix(in srgb, var(--qw-ok) 55%, var(--qw-line)); box-shadow: 0 0 18px rgba(61, 220, 132, .08); }
/* Completed while the app is open: the check pops, the bar fills, the XP flashes — once. */
.qd-row.is-new { animation: qd-row-pulse .5s ease-out both; }
@keyframes qd-row-pulse { from { box-shadow: 0 0 0 0 rgba(61, 220, 132, .55); } to { box-shadow: 0 0 0 10px rgba(61, 220, 132, 0); } }
.qd-row.is-new .qd-check { animation: qd-pop .4s cubic-bezier(.2, 1.4, .4, 1) both; }
.qd-row.is-new .qd-bar i { animation: qd-bar .35s ease-out both; }
.qd-row.is-new .qd-xp { animation: qd-flash 1.2s ease-out both; }
@keyframes qd-pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes qd-bar { from { width: 0; } }
@keyframes qd-flash { 0%, 40% { text-shadow: 0 0 14px rgba(61, 220, 132, .9); transform: scale(1.12); } 100% { text-shadow: none; transform: none; } }
.qd-row.is-done .qd-xp, .qd-row.is-done .qd-status b { color: var(--qw-ok); }
.qd-row.is-done .qd-check { border-color: var(--qw-ok); background: var(--qw-ok); box-shadow: 0 0 12px rgba(61, 220, 132, .45); }
.qd-row.is-done .qd-check .icon { background: var(--game-bg); }

.qd-side { display: flex; flex-direction: column; gap: 10px; }
.qd-side-label { display: block; font-size: 13px; color: var(--qw-muted); }
.qd-side-big { display: block; font-size: 19px; font-weight: 800; color: var(--qw-ink); }
.qd-side small { font-size: 12px; color: var(--qw-tiger-text); }
.qd-next { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
/* The streak and freeze cards share one head (.qd-card-head): the card's picture big
   (the flame's size), the title in the cards' white display face, the ⓘ at the end. */
.qd-streak { display: flex; flex-direction: column; gap: 9px; }
.qd-card-head { gap: 10px; }
.qd-card-head.qd-card-head > img { width: 44px; height: 44px; aspect-ratio: 1; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--game-ice) 45%, transparent)); }
.qd-card-head.qd-card-head > .qd-flame { filter: drop-shadow(0 0 8px var(--qw-glow)); }
.qd-card-head > .qd-flame.is-out { padding: 9px; }
.qd-streak-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qd-streak-body small { display: block; margin-top: 2px; }
.qd-flame { width: 52px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 0 8px var(--qw-glow)); }
/* No streak yet: the small flame, smaller and dimmer, in the same 52 px box. */
.qd-flame.is-out { box-sizing: border-box; padding: 12px; filter: saturate(.6); }
.qd-pips { display: flex; gap: 4px; }
.qd-pips { gap: 5px; }
/* The combo badge sits above the week's pills. */
.qd-week { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qd-week .qd-combo { margin-left: 0; order: 1; }   /* under the week's pills */
/* The current week, Monday to Sunday: a pill per day, lit when the full set was
   won, icy when a freeze bridged it, outlined for today, dim for the days to come. */
.qd-pip { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.qd-pip i { width: 11px; height: 18px; border-radius: 6px 6px 4px 4px; background: var(--game-line); border: 1px solid var(--game-line-2); }
.qd-pip small { font-size: 10px; line-height: 1; color: var(--qw-muted); text-transform: uppercase; }
.qd-pip.is-full i { background: linear-gradient(180deg, #ffc061, var(--qw-tiger)); border-color: var(--game-orange-hi); box-shadow: 0 0 10px var(--qw-glow); }
.qd-pip.is-frozen i { background: linear-gradient(180deg, #e6f7ff, #6cc8f2); border-color: #a9e2ff; box-shadow: 0 0 10px rgba(108, 200, 242, .55); }
.qd-pip.is-today i { background: transparent; border: 1px dashed var(--game-orange-hi); }
.qd-pip.is-future i { opacity: .45; }
.qd-pip.is-now small { color: var(--qw-ink); font-weight: 800; }
.qd-streak .qd-side-big { font-size: 24px; color: var(--qw-tiger-text); text-shadow: 0 0 12px rgba(255, 122, 26, .35); }
.qd-next > .icon { background: var(--qw-ink); }
/* Next draw: a ring that charges up to midnight — the Tiger Touch ring (track
   var(--game-line), one blue, rounded end, from 12 o'clock). */
.qd-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.qd-ring circle { fill: none; stroke-width: 5; }
.qd-ring-track { stroke: var(--game-line); }
.qd-ring-fill { stroke: var(--game-ice-text); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.qd-reset.qd-reset { grid-column: 2 / -1; color: var(--qw-muted); }
.qd-rewards ul, .qd-stats ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.qd-rewards li, .qd-stats li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; color: var(--qw-ink); }
.qd-rewards b { font: 700 14px var(--qw-mono); color: var(--qw-ok); white-space: nowrap; }
.qd-stats b { font: 700 14px var(--qw-mono); color: var(--qw-ink); white-space: nowrap; }
.qd-rewards li .icon, .qd-stats li .icon { background: var(--qw-tiger2); }
.qd-gem { width: 14px; height: 14px; margin: 0 auto; transform: rotate(45deg); background: var(--qw-ok); box-shadow: 0 0 10px rgba(61, 220, 132, .55); }
.qd-gem--open { background: var(--qw-tiger2); box-shadow: 0 0 10px var(--qw-glow); }
.qd-gem--gold { background: var(--qw-legend); box-shadow: 0 0 10px rgba(255, 178, 26, .55); }

@media (max-width: 1500px) { .qd-row { grid-template-columns: 48px minmax(0, 1fr) auto 36px 90px 64px 130px; gap: 10px; } }
@media (max-width: 1250px) { .qd-grid, .qd-top { grid-template-columns: minmax(0, 1fr); }  }
@media (max-width: 900px) { .qd-row { grid-template-columns: 44px minmax(0, 1fr) auto; } .qd-badge, .qd-count, .qd-bar { display: none; } .qd-status { grid-column: 2 / -1; } }
@media (prefers-reduced-motion: reduce) {
  .qd-row.is-new, .qd-chest.is-near .qd-chest-img, .qd-seg i.is-new::after,
  .qd-row.is-new .qd-check, .qd-row.is-new .qd-bar i, .qd-row.is-new .qd-xp { animation: none; }
  .qd-row, .qd-bar i { transition: none; }
}
/* Combo badge next to the streak (×2 … ×5, each a step warmer: orange → violet → gold). */
.qd-combo { display: inline-block; margin-left: 6px; padding: 2px 8px; vertical-align: middle; border-radius: 999px;
  font: 800 12px var(--qw-mono); letter-spacing: .02em; text-shadow: none; color: var(--game-on-gold); background: var(--game-orange-hi); }   /* fills: shared tokens (the pill also shows in the rules window, outside .qw) */
/* One rarity colour per step, common → legendary (the trophies' tiers): ×1 … ×5. */
.qd-combo--1 { background: var(--tier-common); color: var(--game-on-gold); }
.qd-combo--2 { background: var(--tier-uncommon); color: var(--game-on-gold); }
.qd-combo--3 { background: var(--tier-rare); color: var(--on-accent); }
.qd-combo--4 { background: var(--tier-epic); color: var(--on-accent); }
.qd-combo--5 { background: var(--tier-legendary); color: var(--game-on-gold); box-shadow: 0 0 12px color-mix(in srgb, var(--tier-legendary) 55%, transparent); }
/* Streak protection (freezeCardHtml): the reserves as ice cubes (filled / dashed)
   with their counts, a line on how it works, the freeze to give and the repair as
   strips, "Buy…". Every button opens its window (freeze-modal.js). */
.qd-freeze { display: flex; flex-direction: column; gap: 9px; --qf-ice: var(--game-ice); }
.qf-head { display: flex; align-items: center; gap: 8px; }
.qf-head img { width: 26px; aspect-ratio: 1; object-fit: contain; }
.qf-head .qf-info { margin-left: auto; position: relative; cursor: help; }
/* The ⓘ's popover: the rule, then one row per TigerSquad badge, counts as ice cubes. */
.qfp { position: absolute; top: calc(100% + 10px); right: -8px; z-index: 30; width: 450px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; text-align: left; cursor: default;
  background: linear-gradient(180deg, var(--qw-panel2), var(--qw-panel)); border: 1px solid color-mix(in srgb, var(--qf-ice) 35%, var(--qw-line));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility 0s .15s; pointer-events: none; }
.qf-info:hover .qfp, .qf-info:focus-visible .qfp, .qf-info:focus-within .qfp { opacity: 1; visibility: visible; transform: none; transition: opacity .15s, transform .15s; pointer-events: auto; }
.qfp-rule { font-size: 12.5px; line-height: 1.45; color: var(--qw-text, var(--game-text)); }
.qfp-cap { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--qf-ice); }
.qfp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.qfp-table thead th { padding: 0 4px 6px; font-size: 10.5px; font-weight: 600; color: var(--qw-muted); text-align: left; vertical-align: bottom; white-space: normal; line-height: 1.25; }
.qfp-table thead th.qfp-group { padding-bottom: 3px; color: var(--qf-ice); border-bottom: 1px solid color-mix(in srgb, var(--qf-ice) 35%, transparent); }
.qfp-table thead tr + tr th { padding-top: 4px; }
.qfp-table tbody th, .qfp-table td { padding: 5px 4px; border-top: 1px solid var(--qw-line); text-align: left; font-weight: 600; white-space: nowrap; }
.qfp-table tbody th { display: flex; align-items: center; gap: 6px; }
.qfp-table tr.is-mine th, .qfp-table tr.is-mine td { background: color-mix(in srgb, var(--qf-ice) 12%, transparent); }
.qfp-table tr.is-mine th { border-radius: 6px 0 0 6px; } .qfp-table tr.is-mine td:last-child { border-radius: 0 6px 6px 0; }
.qfp-badge { width: 22px; aspect-ratio: 1; object-fit: contain; flex-shrink: 0; }
.qfp-badge--none { display: grid; place-items: center; border-radius: 50%; background: var(--qw-bg); border: 1px solid var(--qw-line); }
.qfp-badge--none .icon { background: var(--qw-muted); }
.qfp-melt { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.4; color: var(--qw-muted); }
.qfp-melt img { width: 22px; aspect-ratio: 1; object-fit: contain; flex-shrink: 0; }
.qfp-cubes { display: inline-flex; align-items: center; gap: 1px; }
.qfp-cubes img { width: 15px; aspect-ratio: 1; object-fit: contain; }
.qfp-cubes b { margin-left: 5px; font-size: 11px; color: var(--qw-muted); }
@media (prefers-reduced-motion: reduce) { .qfp { transition: none; } }
.qf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; color: var(--qw-muted); }
.qf-slots { display: inline-flex; gap: 4px; }
.qf-slots img { width: 26px; aspect-ratio: 1; object-fit: contain; }
/* An empty slot of my own reserve is the buy button: a "+" shows on hover. */
.qf-slot-buy { position: relative; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; transition: transform .15s; }
.qf-slot-buy .icon { position: absolute; background: var(--qf-ice); opacity: 0; transition: opacity .15s; }
.qf-slot-buy img { transition: filter .15s, opacity .15s; }
.qf-slot-buy:hover, .qf-slot-buy:focus-visible { transform: translateY(-2px); }
.qf-slot-buy:hover img, .qf-slot-buy:focus-visible img { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--qf-ice) 70%, transparent)); opacity: .6; }
.qf-slot-buy:hover .icon, .qf-slot-buy:focus-visible .icon { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .qf-slot-buy { transition: none; } }
.qf-strip { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--game-ice) 35%, transparent); background: color-mix(in srgb, var(--game-ice) 7%, transparent); font-size: 13px; font-weight: 700; color: var(--qw-ink); }
.qf-strip img { width: 38px; aspect-ratio: 1; object-fit: contain; }
.qf-strip small { display: block; font-size: 11.5px; font-weight: 500; color: var(--qw-muted); }
.qf-strip--none { border-style: dashed; background: none; }
/* Freezes to give: the cube melting in place, one drawn stage per day (quests/index.js). */
.qf-strip--give.qf-strip--give { grid-template-columns: minmax(0, 1fr) auto; padding: 0; border: 0; background: none; font-weight: 400; color: var(--qw-muted); }
.qf-gifts { display: inline-flex; align-items: flex-end; gap: 6px; }
.qf-gifts img { width: 36px; aspect-ratio: 1; object-fit: contain; }
.qf-strip--none .qf-gifts img { width: 32px; opacity: 1; filter: none; }
/* A slot already given this batch: its dashed cube, same size as the others. */
.qf-gifts .qf-gift-given { width: 32px; }
/* A cube still to give is the "give" button: lifts on hover, opens the give window. */
.qf-gift { display: block; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.qf-gift:hover, .qf-gift:focus-visible { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--game-ice) 55%, transparent)); }
.qf-gift img { display: block; }
.qf-strip--none img { opacity: .55; filter: grayscale(.6); }
.qf-strip--repair { position: relative; overflow: hidden; width: 100%; height: auto; margin-top: 4px; grid-column: 1 / -1; grid-template-columns: 34px minmax(0, 1fr) auto; text-align: left; font: inherit; font-size: 13px; font-weight: 700; color: var(--qw-ink); cursor: pointer;
  border-color: color-mix(in srgb, var(--game-orange) 70%, transparent); background: linear-gradient(100deg, color-mix(in srgb, var(--game-orange) 16%, transparent), rgba(255, 70, 20, .08));
  animation: qf-repair-glow 2.2s ease-in-out infinite; transition: transform .15s ease, border-color .15s ease; }
/* A light sweep across the strip, every few seconds. */
.qf-strip--repair::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--game-gold) 28%, transparent) 50%, transparent 70%); transform: translateX(-100%); animation: qf-repair-sweep 3.2s ease-in-out infinite; }
.qf-strip--repair:hover { transform: translateY(-1px); border-color: var(--game-gold-deep); }
.qf-strip--repair:hover .qf-action { background: var(--game-orange); color: var(--game-on-gold); }
.qf-strip--repair:focus-visible { outline: 2px solid var(--game-gold); outline-offset: 2px; }
.qf-repair-flame { width: 34px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255, 122, 26, .8)); transform-origin: 50% 90%; animation: qfm-flame 1.6s ease-in-out infinite; }
@keyframes qf-repair-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 26, .0), 0 0 10px rgba(255, 122, 26, .25), inset 0 0 12px rgba(255, 122, 26, .08); }
  50% { box-shadow: 0 0 0 3px rgba(255, 122, 26, .18), 0 0 24px rgba(255, 122, 26, .55), inset 0 0 18px rgba(255, 122, 26, .16); }
}
@keyframes qf-repair-sweep { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .qf-strip--repair, .qf-strip--repair::before, .qf-repair-flame { animation: none; } }
.qf-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: auto; min-height: 32px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--qw-line); background: var(--qw-panel); color: var(--qw-ink); font: 700 12.5px inherit; cursor: pointer; white-space: nowrap; }
.qf-action .icon { background: var(--qw-legend); }
.qf-action:hover { border-color: var(--qf-ice); background: color-mix(in srgb, var(--game-ice) 10%, transparent); }
.qf-action--give { border-color: var(--qw-ok); color: var(--qw-ok); }
/* A freeze used at today's check-in, under the streak pips: calm and icy. */
.qd-frozen { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--game-ice) 8%, transparent); border: 1px solid color-mix(in srgb, var(--game-ice) 30%, transparent); font-size: 12.5px; color: #cfe9ff; }
.qd-frozen img { width: 22px; aspect-ratio: 1; object-fit: contain; }
/* Rules and stats, folded at the bottom of the column. */
.qd-more > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none;
  font: 700 16px var(--qw-display); text-transform: uppercase; letter-spacing: .04em; color: var(--qw-ink); }
.qd-more > summary::-webkit-details-marker { display: none; }
.qd-more > summary .icon { background: var(--qw-muted); transition: transform .2s; }
.qd-more[open] > summary .icon { transform: rotate(90deg); }
.qd-more[open] > summary { margin-bottom: 12px; }
.qd-more .qd-stats { margin-top: 16px; }
/* A done quest is shorter and quieter, its full bar and 1/1 kept. */
.qd-row.is-done:not(.is-new) { padding-top: 8px; padding-bottom: 8px; opacity: .78; }
.qd-row.is-done:not(.is-new) .qd-title small { display: none; }
.qst-cel-xp.qst-cel-ic { background: none; -webkit-background-clip: border-box; background-clip: border-box; display: grid; place-items: center; }
.qst-cel-ic .icon { background: var(--game-ice-text); }
.qst-cel--broken .qst-cel-ic .icon { background: var(--qw-tiger, var(--game-orange)); }
/* The freeze windows (freeze-modal.js) on the envelope window's frame. */
.qfm .qfm-art { width: 120px; }
.qfm-body { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.qfm-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--ink-06); }
.qfm-seg button { height: 34px; border: 0; border-radius: 8px; background: none; color: var(--tsq-muted); font: 700 13px inherit; cursor: pointer; }
.qfm-seg button[aria-selected="true"] { background: color-mix(in srgb, var(--game-ice) 16%, transparent); color: #cfe9ff; }
.qfm-recap { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--ink-04); border: 1px solid var(--tsq-line); }
.qfm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--tsq-muted); }
.qfm-row b { display: inline-flex; align-items: center; gap: 6px; font: 700 13.5px var(--qw-mono, monospace); color: var(--tsq-text); }
.qfm-arrow { color: var(--game-ice-text); }
.qfm-slots { display: inline-flex; gap: 3px; }
.qfm-slots img { width: 20px; aspect-ratio: 1; object-fit: contain; }
.qfm-hint { margin: 0; font-size: 12.5px; color: var(--tsq-muted); }
.qfm-why { margin: 0 0 4px; width: 100%; font-size: 12.5px; color: var(--game-danger-text); }
.qfm-actions { flex-direction: column; align-items: stretch; gap: 8px; }
.qfm-list { height: 220px; }
.qfm-f .qfm-slots img { width: 16px; }
.qfm-f-note { font-size: 10.5px; color: var(--tsq-muted); line-height: 1.2; }
.qfm-ok { margin: 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--game-ok) 12%, transparent); color: #7fe8ad; font-size: 13px; font-weight: 700; }
.qfm-ok--big { padding: 18px; font-size: 15px; text-align: center; }
.qfm-card.is-given .qfm-art { animation: tc-give-fly .9s cubic-bezier(.5, 0, .7, .2) forwards; }
@media (prefers-reduced-motion: reduce) { .qfm-card.is-given .qfm-art { animation: none; } }
.qd-next > .icon { width: 28px; height: 28px; }
.sqb-col-title { margin: 0; font-size: 15px; font-weight: 800; color: var(--tsq-text); }
.sqb-col-title[hidden] { display: none; }

/* ── Jackpot: the full set completed while the screen is shown (~2 s, once).
   0–300 ms the bar sweeps and the panel lights up · 300–750 ms the chest goes
   from grey to gold · 750–1400 ms rays + 16 particles burst from the chest ·
   1000–1700 ms the XP counts up, rises and shines, the check pops. Transform /
   opacity / filter only; nothing intercepts the mouse. Never under reduced
   motion (the screen then shows the earned state at once). ── */
.qd-progress.is-jackpot .qd-seg { position: relative; }
.qd-progress.is-jackpot .qd-seg::after { content: ""; position: absolute; inset: -4px 0; pointer-events: none; border-radius: 6px;
  background: linear-gradient(90deg, transparent, rgba(255, 220, 150, .85), transparent); width: 30%;
  animation: qd-sweep .5s ease-in .08s both; }
@keyframes qd-sweep { from { transform: translateX(-110%); opacity: 1; } to { transform: translateX(380%); opacity: 0; } }
.qd-progress.is-jackpot .qd-seg i.on { animation: qd-seg-pulse .45s ease-out .1s both; }
@keyframes qd-seg-pulse { 50% { box-shadow: 0 0 16px rgba(255, 140, 40, .8); } }

.qd-chest.is-jackpot { animation: qd-panel-lit .45s ease-out both; }
@keyframes qd-panel-lit { from { border-color: var(--qw-line); box-shadow: none; } 50% { box-shadow: 0 0 40px rgba(255, 190, 60, .55), inset 0 0 40px rgba(255, 190, 60, .2); } }
.qd-chest.is-jackpot .qd-chest-art { animation: qd-art-glow .5s ease-out both; }
@keyframes qd-art-glow { from { opacity: .6; } 60% { filter: brightness(1.6); } }
.qd-chest.is-jackpot .qd-chest-img { animation: qd-unlock .45s cubic-bezier(.2, 1.2, .4, 1) .3s both; }
@keyframes qd-unlock {
  from { filter: grayscale(1) brightness(.72); transform: scale(1); }
  60% { filter: grayscale(0) brightness(1.35) saturate(1.35) drop-shadow(0 0 22px rgba(255, 200, 80, .95)); transform: scale(1.14); }
  to { filter: drop-shadow(0 0 14px rgba(255, 190, 60, .65)) drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); transform: scale(1); }
}
.qd-burst { position: absolute; left: 64px; top: 50%; width: 0; height: 0; z-index: 2; pointer-events: none; }
.qd-rays { position: absolute; left: -110px; top: -110px; width: 220px; height: 220px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(rgba(255, 210, 110, .55) 0 7deg, transparent 7deg 26deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 70%); mask: radial-gradient(circle, #000 18%, transparent 70%);
  animation: qd-rays 1.1s ease-out .35s both; }
@keyframes qd-rays { 0% { opacity: 0; transform: rotate(0) scale(.5); } 30% { opacity: .9; } 100% { opacity: 0; transform: rotate(40deg) scale(1.25); } }
.qd-p { position: absolute; left: 0; top: 0; opacity: 0; animation: qd-fly .65s cubic-bezier(.15, .7, .3, 1) calc(.75s + var(--dl)) both; }
.qd-p--dot { width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #ffd36e; box-shadow: 0 0 8px var(--game-gold-deep); }
.qd-p--star { width: 12px; height: 12px; margin: -6px; background: var(--game-gold-hi);
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); filter: drop-shadow(0 0 4px #ffd36e); }
.qd-p--conf { width: 5px; height: 9px; margin: -4px -2px; border-radius: 1px; background: var(--qw-tiger); }
.qd-p--conf:nth-child(4n) { background: var(--game-gold); }
@keyframes qd-fly {
  0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(.4); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); }
}
.qd-chest.is-jackpot .qd-chest-xp { animation: qd-xp-win .7s cubic-bezier(.2, 1.3, .4, 1) 1s both, qd-xp-shine .7s ease-in-out 1.15s both;
  background: linear-gradient(110deg, var(--qw-ok) 40%, #eafff2 50%, var(--qw-ok) 60%) 120% 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes qd-xp-win { from { transform: translateY(10px) scale(.85); opacity: .4; } 55% { transform: translateY(-4px) scale(1.18); text-shadow: 0 0 22px rgba(255, 210, 110, .9); opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes qd-xp-shine { from { background-position: 120% 0; } to { background-position: -20% 0; } }
.qd-chest-xp { display: inline-block; }
.qd-chest.is-jackpot .qd-chest-check { animation: qd-pop .4s cubic-bezier(.2, 1.4, .4, 1) 1.15s both; }
/* The open chest replays the jackpot on click (display only). */
.qd-chest.is-earned { cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease; }
.qd-chest.is-earned:hover { box-shadow: 0 0 34px rgba(255, 178, 26, .4), inset 0 0 30px rgba(255, 178, 26, .1); }
.qd-chest.is-earned:focus-visible { outline: 2px solid var(--qw-legend); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .qd-ring-fill { transition: none; } }
/* Jackpot: the closed chest sits on top of the open one and fades out as it lights up. */
.qd-chest-art .qd-chest-closed { position: absolute; inset: 0; margin: auto; pointer-events: none; }
.qd-chest.is-jackpot .qd-chest-closed { animation: qd-unlock .45s cubic-bezier(.2, 1.2, .4, 1) .3s both, qd-lid-off .25s ease-out .55s both; }
@keyframes qd-lid-off { to { opacity: 0; } }

/* ── TigerSquad view (renderer/quests/squad-rankings.js) — one game world like
   the Quests views, following the app theme through the Game UI tokens: hero, My rank, Community pulse,
   the three leagues. ── */
.inv-squad-view {
  --sqr-gold: var(--game-gold-deep-text); --sqr-cyan: var(--game-ice-deep); --sqr-ok: var(--game-ok-text);
  --sqr-display: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --sqr-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--tsq-text);   /* no panel of its own: the blocks sit straight on the view */
}
.squad-board--inline > .squad-invite-x, .squad-board--inline .tsq-title { display: none; }
.squad-board--inline .tsq-scroll { padding: 0 0 8px; gap: 10px; }
.squad-board--inline .sqb-tabs { padding: 3px; }
.squad-board--inline .sqb-tab { height: 32px; }
.squad-board.squad-board--inline { max-width: none; }

.sqr-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 8px 18px 8px 28px;
  border: 1px solid var(--tsq-line); border-radius: 14px; overflow: hidden; }
.sqr-hero:not(.qd-hero) { --hero-scene: none; --hero-front: none; --hero-sink: 6px; --hero-art-w: 560px; --hero-art-ratio: 1.8; --hl-ratio: 4.2;
  /* Reserve the tigers and the trophy only: the card may cover the printer. */
  --hero-scene-w: 312px;
  padding-bottom: calc(var(--hero-desk-hc) + 6px); }
/* Tiger Squad banners use the Tiger Quests title block (.qm-hero-txt: eyebrow
   pill, big title, spaced subtitle); they sit outside .qw, so they carry the
   variables that block reads. */
.sqr-hero { --qw-display: var(--sqr-display); --qw-bg: var(--game-bg); --qw-tiger: var(--game-orange); --qw-tiger-text: var(--game-orange-text); }
.sqr-hero h2 { margin: 0; font: 800 52px/0.95 var(--sqr-display); letter-spacing: .01em; color: #fff; text-shadow: 0 2px 6px #000, 0 0 30px rgba(255, 122, 26, .35); }
/* Every Tiger Squad banner keeps its title and tagline on one line, shrinking
   with the banner: wrapped, they pushed the eyebrow and the tagline out of it. */
.sqr-hero .qm-hero-txt { flex: 0 1 auto; min-width: 0; }
.sqr-hero h2 { white-space: nowrap; font-size: clamp(28px, 3.4cqi, 52px); }
.sqr-hero .qm-hero-txt p { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(11px, 1.15cqi, 14px); letter-spacing: clamp(.2em, .03cqi, .42em); }
.sqr-join { height: 34px; padding: 0 16px; border: none; border-radius: 9px; cursor: pointer; font: 800 13px inherit; color: var(--game-on-gold); background: linear-gradient(180deg, var(--game-orange), #ff6f12); }

.squad-board--inline .sqb-tabs { background: var(--game-bg-2); }
.sqr { display: flex; flex-direction: column; gap: 10px; }
.sqr[hidden], .squad-board--inline .sqb-cols[hidden] { display: none; }
.sqr-updated { margin-left: auto; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--sqr-ok); border: 1px solid color-mix(in srgb, var(--sqr-ok) 50%, transparent); }
.sqr-muted { color: var(--tsq-muted); font-size: 13px; }

/* The account's rank card, on the right of the hero: who / league / XP / ranks,
   then the next rival with the real gap. */
/* Two columns — who (with the ranks on one line under it) and the next rival —
   so the card stays narrow.
   Centred on the banner's full height (it may overlap the desk): the hero's
   bottom padding reserves the desk for the text, so the card is pushed down
   by half the difference between the bottom and top paddings. */
.sqr-card { position: relative; z-index: 1; display: grid; grid-template-columns: auto auto; grid-template-areas: "me rival" "ranks rival"; align-items: stretch; flex: 0 0 auto; align-self: center; top: calc((var(--hero-desk-hc) + 6px - 8px) / 2);
  border-radius: 14px; border: 1px solid color-mix(in srgb, var(--sqr-gold) 70%, transparent); background: rgba(10, 12, 20, .86);
  box-shadow: 0 0 22px rgba(255, 178, 26, .22); backdrop-filter: blur(4px); }
.sqr-card--out { grid-template-columns: 1fr; max-width: 360px; }
/* Left: avatar column (avatar, flag, globe) + text column (name, league, XP, ranks). */
.sqr-card-me { grid-area: me; display: flex; align-items: center; gap: 10px; padding: 10px 12px 6px 10px; }
.sqr-card-ranks { grid-area: ranks; display: grid; grid-template-columns: 18px auto 18px auto; column-gap: 6px; align-items: center; justify-content: start; padding: 6px 12px 10px; border-top: 1px solid var(--ink-12); }
.sqr-card-ranks .sqr-card-rank + .sqr-card-ic { margin-left: 8px; }
/* Not enough room for title + tigers + full card (≈1110 px; the card may
   already cover the printer): the next rival goes first — the scene keeps its
   size, the card keeps who you are and your ranks. */
}
.sqr-card--out .sqr-card-me { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.sqr-card-av .sqb-avatar { width: 46px; height: 46px; font-size: 16px; }
.sqr-card-head { display: flex; flex-direction: column; gap: 1px; }
.sqr-card-name { font-size: 15px; font-weight: 700; color: var(--on-dark); white-space: nowrap; }
.sqr-card-league { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 800; color: var(--sq-a, var(--sqr-gold)); white-space: nowrap; }
.sqr-card-xp { font-size: 18px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: var(--on-dark); white-space: nowrap; }
.sqr-card-ic { justify-self: center; display: grid; place-items: center; font-size: 20px; line-height: 1; }
.sqr-card-rank { font-size: 13px; color: var(--on-dark); white-space: nowrap; }
.sqr-card-rank b { font-weight: 800; color: var(--on-dark); }
.sqr-card-rival { display: flex; flex-direction: column; justify-content: center; grid-area: rival; gap: 7px; width: 170px; padding: 10px 12px; border-left: 1px solid var(--ink-12); }
.sqr-card .sqr-muted { white-space: normal; margin: 0; }
.sqr-me-label { font-size: 13px; font-weight: 600; color: var(--game-text-2); }
.sqr-rival-who { display: flex; align-items: center; gap: 8px; }
.sqr-rival-who .sqb-avatar { width: 34px; height: 34px; flex-shrink: 0; }
.sqr-rival-who > * { flex-shrink: 0; }
.sqr-rival-who > .sqr-rival-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.sqr-rival-who b { font-size: 13.5px; font-weight: 700; color: var(--on-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sqr-rival-who small { font-size: 13.5px; font-weight: 800; color: var(--tsq-orange); white-space: nowrap; }
.sqr-rival-who > .icon { background: var(--game-text-2); }
.sqr-bar { display: block; height: 8px; border-radius: 4px; background: var(--game-line); overflow: hidden; }
.sqr-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--game-orange), var(--game-orange-hi)); box-shadow: 0 0 10px rgba(255, 122, 26, .45); }
.sqr-flag { font-size: 18px; line-height: 1; }

/* Community pulse: one compact strip. */
.sqr-pulse { display: grid; grid-template-columns: minmax(240px, 1.1fr) repeat(3, minmax(0, 1fr)); align-items: stretch; min-height: 86px;
  border: 1px solid var(--tsq-line); border-radius: 14px; background: linear-gradient(180deg, var(--game-card), var(--game-bg-2)); }
.sqr-pulse > * + * { border-left: 1px solid var(--tsq-line); }
.sqr-pulse-intro { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.sqr-pulse-intro h3 { margin: 0; font: 800 17px var(--sqr-display); text-transform: uppercase; letter-spacing: .03em; color: var(--tsq-text); }
.sqr-pulse-intro p { margin: 2px 0 0; font-size: 12px; color: var(--tsq-muted); }
/* The sparkline is the card's background: full width, under the text, fading in toward the right. */
.sqr-stat { --c: var(--sqr-gold); position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-width: 0; overflow: hidden; }
.sqr-stat > .icon, .sqr-stat-txt { position: relative; z-index: 1; }
.sqr-stat--spools { --c: var(--sqr-cyan); } .sqr-stat--printers { --c: var(--tier-epic); }
.sqr-stat > .icon { width: 28px; height: 28px; background: var(--c); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 50%, transparent)); }
.sqr-stat-txt { display: flex; flex-direction: column; min-width: 0; }
.sqr-stat-label { font: 800 11px var(--sqr-display); text-transform: uppercase; letter-spacing: .06em; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sqr-stat-n { font: 800 24px/1.1 var(--sqr-mono); color: var(--tsq-text); font-variant-numeric: tabular-nums; }
/* "+40 XP" rising out of a counter when the community total goes up. */
.sqr-gain { position: absolute; right: 22%; top: 30px; z-index: 2; pointer-events: none; white-space: nowrap;
  font: 800 20px var(--sqr-mono); color: var(--c); text-shadow: 0 0 10px currentColor;
  animation: sqr-gain 1.8s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes sqr-gain { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 15% { opacity: 1; transform: translateY(0) scale(1.1); }
  70% { opacity: 1; transform: translateY(-14px) scale(1); } 100% { opacity: 0; transform: translateY(-26px) scale(.95); } }
.sqr-stat-txt small { font-size: 11px; line-height: 1.25; color: var(--tsq-muted); }
/* Inset from the card's edges so the curve never touches the border. */
.sqr-stat .sqr-spark { position: absolute; left: 12px; right: 12px; bottom: 8px; width: calc(100% - 24px); height: calc(78% - 12px); pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .35) 0, rgba(0, 0, 0, .55) 35%, #000 100%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .35) 0, rgba(0, 0, 0, .55) 35%, #000 100%); }
.sqr-spark-line { fill: none; stroke: var(--c); stroke-width: 1.6; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px var(--c)); }
.sqr-spark-area { fill: color-mix(in srgb, var(--c) 22%, transparent); stroke: none; }
.sqr-stat-n { text-shadow: 0 1px 8px rgba(11, 13, 20, .9); }
.sqr-pulse-intro .sqr-pulse-meta { margin-top: 4px; font-size: 12px; color: var(--tsq-text); }
.sqr-pulse .sqr-updated { margin: 0; padding: 0; border: none; border-radius: 0; font-weight: 700; color: var(--sqr-ok); }
.sqr-unavail { grid-column: 2 / -1; align-self: center; padding: 0 16px; }

/* Leagues */
.sqr-boards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.sqr-board { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--tsq-line); background: linear-gradient(180deg, var(--game-card), var(--game-bg-2)); }
.sqr-board-head { display: flex; align-items: center; gap: 12px; }
.sqr-board-head > div { flex: 1; min-width: 0; }
.sqr-board-head h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--tsq-text); }
.sqr-board-head p { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: var(--tsq-orange); }
.sqr-board-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--game-ice-deep) 12%, transparent); flex-shrink: 0; }
.sqr-board-ic .icon { background: var(--sqr-cyan); }
.sqr-board-ic .sqr-flag { font-size: 24px; }
.sqr-all { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--tsq-line); background: var(--ink-04); color: var(--tsq-text); font: 700 12px inherit; cursor: pointer; white-space: nowrap; }
.sqr-all:hover { border-color: var(--tsq-orange); }
.sqr-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* "View all": the whole list in the same card, which scrolls — the card keeps the
   height of the other columns (--n rows of 52 px + 6 px gaps). */
.sqr-board.is-open .sqr-rows { max-height: calc(var(--n, 5) * 58px - 6px); overflow-y: auto; overscroll-behavior: contain;
  padding-right: 4px; margin-right: -4px; scrollbar-width: thin; scrollbar-color: var(--tsq-line) transparent; }
.sqr-row { display: grid; grid-template-columns: 38px 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; height: 52px; box-sizing: border-box; padding: 5px 12px 5px 8px; border-radius: 10px;
  border: 1px solid var(--tsq-line); background: var(--ink-04); transition: border-color .2s, background-color .2s; }
.sqr-row:hover { border-color: color-mix(in srgb, var(--tsq-orange) 40%, var(--tsq-line)); background: var(--ink-04); }
/* A maker's row in their theme colour (--mc, their avatar colour), fading to the right. Your own row keeps its orange highlight. */
.sqr-row.has-mc { border-color: color-mix(in srgb, var(--mc) 38%, var(--tsq-line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--mc) 50%, transparent), color-mix(in srgb, var(--mc) 12%, transparent) 80%); }
.sqr-row.has-mc:hover { border-color: color-mix(in srgb, var(--mc) 70%, var(--tsq-line)); }
/* …or in their colour style (--ms, inventory.js _styleRowBg): the bicolor / rainbow
   bands or the aurora's lights, the Aurora drifting like their theme (theme-aurora, 60-modals.css). */
.sqr-row.has-ms.has-ms { background: var(--ms); }
:root:not([data-theme="dark"]) .sqr-row.has-ms.has-ms { background: var(--ms); }   /* beats the light theme's colour row */
.sqr-row.sqr-aurora { animation: theme-aurora 9s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { .sqr-row.sqr-aurora { animation: none; } }
/* Countries league: each row in its flag's colours (--f1..--f3); your country
   keeps its orange frame. */
.sqr-row.has-flag { border-color: color-mix(in srgb, var(--f1) 35%, var(--tsq-line));
  /* The flag's colours as bands split at 45° with a short blend, like a
     bicolor / tricolor spool (135deg, the app's SPLIT_BLEND look). */
  /* Mixed into the dark row (not made transparent): a white or yellow stripe
     stays a mid tone, so white text and the rank stay readable on it. */
  --b1: color-mix(in srgb, var(--f1) 58%, var(--game-bg-2)); --b2: color-mix(in srgb, var(--f2) 46%, var(--game-bg-2)); --b3: color-mix(in srgb, var(--f3) 46%, var(--game-bg-2));
  background: linear-gradient(135deg, var(--b1) 0 30%, var(--b2) 37% 63%, var(--b3) 70% 100%); }
/* Text on a bright band (a white or yellow stripe) keeps its contrast. */
.sqr-row.has-flag .sqr-name b, .sqr-row.has-flag .sqr-xp { text-shadow: 0 1px 3px rgba(0, 0, 0, .75); }
.sqr-row.has-flag .sqr-name small { color: rgba(255, 255, 255, .78); text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.sqr-row.has-flag:hover { border-color: color-mix(in srgb, var(--f1) 65%, var(--tsq-line)); }
/* …and keeps the orange frame over a coloured row (declared after the colour rules). */
.sqr-row.is-me.has-mc, .sqr-row.is-me.has-flag { border-color: var(--tsq-orange); box-shadow: 0 0 0 1px var(--tsq-orange), 0 0 18px rgba(255, 122, 26, .3); }
/* Your row: an orange frame and glow. It only paints its own orange fill on a
   plain row — a row in a flag's or a maker's colours keeps them. */
.sqr-row.is-me { border-color: var(--tsq-orange); box-shadow: 0 0 16px rgba(255, 122, 26, .15); }
/* A country row picks the league the middle column shows. */
.sqr-row--pick { cursor: pointer; transition: transform .12s ease, filter .12s ease; }
.sqr-row--pick:hover { filter: brightness(1.08); }
.sqr-row--pick:active { transform: scale(.99); }
.sqr-row--pick:focus-visible { outline: 2px solid var(--tsq-orange); outline-offset: 2px; }
.sqr-row.is-me:not(.has-mc):not(.has-flag) { background: linear-gradient(90deg, color-mix(in srgb, var(--game-orange) 16%, transparent), color-mix(in srgb, var(--game-orange) 4%, transparent)); }
.sqr-medal { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.sqr-rank { text-align: center; font: 800 14px var(--sqr-mono); color: var(--tsq-muted); }
.sqr-av .sqb-avatar { width: 34px; height: 34px; }
.sqr-flagav { display: inline-block; width: var(--s); height: var(--s); flex-shrink: 0; vertical-align: middle; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .16); background: var(--game-line); }
.sqr-flagav img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Top three countries: a gold / silver / bronze ring, matching the medal. */
.sqr-flagav--p1 { box-shadow: 0 0 0 2.5px #f5c542, 0 0 10px rgba(245, 197, 66, .45); }
.sqr-flagav--p2 { box-shadow: 0 0 0 2.5px #d4dbe6, 0 0 10px rgba(212, 219, 230, .35); }
.sqr-flagav--p3 { box-shadow: 0 0 0 2.5px #d0864a, 0 0 10px rgba(208, 134, 74, .4); }
.sqr-board-ic:has(.sqr-flagav) { background: none; }
.sqr-name { display: flex; flex-direction: column; min-width: 0; }
.sqr-name b { font-size: 14px; color: var(--tsq-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sqr-name small { font-size: 12px; color: var(--tsq-muted); }
.sqr-name small[class*="sq-"] { color: var(--sq-a); }
/* Light theme: the coloured rows (a country's flag bands, a maker's colour)
   become pale tints of their colours, and their words go dark — white text
   with a shadow only works on the dark rows. The level name ("Gold") takes a
   deep shade of its colour. */
:root:not([data-theme="dark"]) .sqr-row.has-flag {
  --b1: color-mix(in srgb, var(--f1) 30%, var(--game-card)); --b2: color-mix(in srgb, var(--f2) 22%, var(--game-card)); --b3: color-mix(in srgb, var(--f3) 22%, var(--game-card)); }
:root:not([data-theme="dark"]) .sqr-row.has-mc {
  background: linear-gradient(90deg, color-mix(in srgb, var(--mc) 26%, var(--game-card)), color-mix(in srgb, var(--mc) 6%, var(--game-card)) 80%); }
:root:not([data-theme="dark"]) .sqr-row.has-flag .sqr-name b, :root:not([data-theme="dark"]) .sqr-row.has-flag .sqr-xp { text-shadow: none; }
:root:not([data-theme="dark"]) .sqr-row.has-flag .sqr-name small { color: var(--tsq-muted); text-shadow: none; }
:root:not([data-theme="dark"]) .sqr-name small[class*="sq-"],
:root:not([data-theme="dark"]) .sqb-name small[class*="sq-"] { color: color-mix(in srgb, var(--sq-a) 45%, var(--game-text)); }
.sqr-mini { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-size: 12px; }
/* Rank movement since yesterday, under the XP: green up, red down. */
.sqr-xp { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.sqr-move { display: inline-flex; align-items: center; gap: 3px; font: 800 11px var(--sqr-mono); }
.sqr-move svg { width: 9px; height: 7px; fill: currentColor; }
.sqr-move.is-up { color: var(--game-ok-text); }
.sqr-move.is-down { color: var(--game-danger-text); }
/* "Up 2 places in 7 days": instant bubble left of the arrow (no title= tooltip). */
.sqr-move { position: relative; cursor: default; outline: none; }
.sqr-move::after { content: attr(data-tip); position: absolute; right: calc(100% + 8px); top: 50%; transform: translate(3px, -50%);
  padding: 5px 9px; border-radius: 7px; background: var(--game-bg); border: 1px solid var(--tsq-line); color: var(--tsq-text);
  font: 600 11px var(--qw-font, system-ui); white-space: nowrap; text-shadow: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  opacity: 0; pointer-events: none; z-index: 5; transition: opacity .12s ease, transform .12s ease; }
.sqr-move:hover::after, .sqr-move:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.sqr-mini small { margin-left: 2px; font-size: 11px; color: var(--tsq-muted); }
.sqr-xp { font: 800 14px var(--sqr-mono); color: var(--tsq-text); white-space: nowrap; }
.sqr-gap { text-align: center; color: var(--tsq-muted); line-height: .6; }
/* The account's own row when it ranks below the cut: a dashed top edge marks the skipped rows. */
.sqr-row--far { position: relative; margin-top: 4px; }
.sqr-row--far::before { content: ""; position: absolute; left: 12px; right: 12px; top: -6px; border-top: 1px dashed var(--tsq-line); }

.sqr-skel { border-radius: 14px; background: linear-gradient(90deg, var(--game-card) 0%, var(--game-card-2) 50%, var(--game-card) 100%) 0 0 / 200% 100%; animation: sqr-shimmer 1.4s linear infinite; }
@keyframes sqr-shimmer { to { background-position: -200% 0; } }

@media (max-width: 1400px) { .sqr-pulse { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sqr-pulse-intro { grid-column: 1 / -1; border-bottom: 1px solid var(--tsq-line); padding: 8px 16px; } .sqr-pulse > .sqr-stat:nth-child(2) { border-left: none; } }
@media (max-width: 1200px) { .sqr-boards { grid-template-columns: minmax(0, 1fr); } .sqr-hero h2 { font-size: 44px; } }
@media (prefers-reduced-motion: reduce) { .sqr-skel { animation: none; } .sqr-row { transition: none; } }
/* Narrower windows: the rank card takes a larger share — slide the trophy group left to stay between title and card. */
/* The view bar carries the TigerSquad sections (Rankings, Items, History icons): no tabs in the page. */
.squad-board--inline .sqb-tabs[hidden] { display: none; }
.vtg-sep[hidden] { display: none; }
/* Header (own banner): XP and world-rank chips after the TigerSquad badge. */
.fvb-xp-host { display: contents; }
.fvb-xp { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 7px; border: none; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--text); font-family: inherit; font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: .3px; font-variant-numeric: tabular-nums;
  transition: filter .15s; }
.fvb-xp:hover { filter: brightness(1.25); }
.fvb-xp .icon { background: var(--primary); }
.fvb-rank .icon { background: var(--game-gold-text); }

/* ── Missions (journey): hero, chapter row, chapter heading, illustrated level cards ── */
.qm-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 18px 12px 28px;
  border: 1px solid var(--qw-line); border-radius: 14px; overflow: hidden;
  --hero-scene: none; --hero-front: none; --hero-scene-w: 620px; --hl-ratio: 3.4;
  padding-bottom: calc(var(--hero-desk-hc) + 6px); }
.qm-hero-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.qm-hero-txt h2 { font-size: 52px; line-height: .95; text-shadow: 0 2px 6px #000, 0 0 30px rgba(255, 122, 26, .35); }
.qm-hero-txt p { margin: 4px 0 0; font: 700 14px var(--qw-display); letter-spacing: .42em; text-transform: uppercase; color: var(--on-dark); text-shadow: 0 1px 3px #000, 0 0 12px #000;
  white-space: nowrap; }   /* the tagline runs on one line, over the desk if it must */
.qm-hero-card { display: flex; flex-direction: column; gap: 8px; min-width: 200px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--qw-tiger) 65%, transparent); background: rgba(10, 12, 20, .84); box-shadow: 0 0 22px rgba(255, 122, 26, .2); }
.qm-hero-card b { font: 800 15px var(--qw-display); text-transform: uppercase; letter-spacing: .06em; color: var(--qw-tiger-text); white-space: nowrap; }
/* A narrower view: the banner title and its tagline shrink instead of wrapping. */
@container quests (max-width: 1300px) { .qm-hero-txt h2 { font-size: 40px; } .qm-hero-txt p { font-size: 12px; letter-spacing: .3em; } }
.qm-hero-card > span:not(.qm-bar) { font-size: 13px; font-weight: 600; color: var(--qw-ink); }

.qm-bar { display: block; height: 6px; border-radius: 3px; background: var(--game-line); overflow: hidden; }
.qm-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--game-orange), var(--game-orange-hi)); transition: width .4s ease; }

/* Chapters: one row that slides, arrows on both ends. */
/* The chapter row sits straight on the view (no box around it), arrows at its ends. */
.qm-chapters { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; gap: 8px; align-items: center; }
.qm-chap-track { display: grid; grid-auto-flow: column; grid-auto-columns: 118px; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.qm-chap-track::-webkit-scrollbar { height: 0; }
.qw .qm-arrow { width: 30px; height: 56px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--qw-line); background: var(--ink-04); cursor: pointer; }
.qw .qm-arrow .icon { background: var(--qw-muted); }
.qw .qm-arrow:hover { border-color: var(--qw-tiger); } .qw .qm-arrow:hover .icon { background: var(--qw-tiger2); }
.qw .qm-chap { height: auto; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px; scroll-snap-align: start; text-align: center;
  border-radius: 10px; border: 1px solid var(--qw-line); background: var(--game-card); color: var(--qw-ink); font: inherit; cursor: pointer; transition: border-color .2s, box-shadow .2s, background-color .2s; }
.qm-chap-ic { font-size: 20px; line-height: 1.2; }
.qm-chap-n { font: 700 10px var(--qw-display); letter-spacing: .2em; color: var(--qw-muted); }
.qm-chap b { font: 800 13px var(--qw-display); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; }   /* long names (pt, de…) stay in their tile */
.qm-chap small { font-size: 11px; color: var(--qw-muted); white-space: nowrap; }
.qm-pips { display: flex; gap: 3px; margin-top: 5px; }
.qm-pips i { width: 14px; height: 4px; border-radius: 2px; background: var(--game-line); }
.qm-pips i.on { background: var(--qw-tiger); box-shadow: 0 0 6px var(--qw-glow); }
.qw .qm-chap:hover:not(:disabled) { border-color: color-mix(in srgb, var(--qw-tiger) 60%, var(--qw-line)); }
.qw .qm-chap.is-on { border-color: var(--qw-tiger); background: linear-gradient(180deg, rgba(255, 122, 26, .2), var(--game-card-2)); box-shadow: 0 0 18px rgba(255, 122, 26, .25); }
.qw .qm-chap.is-done .qm-pips i { background: var(--qw-ok); }
.qw .qm-chap.is-soon { opacity: .4; cursor: default; }

/* Chapter heading. */

/* Level cards. */
/* Five levels per chapter: five columns on a wide window, fewer when narrower. */
/* Columns follow the VIEW's width (container .inv-quests-view), not the window's:
   the sidebar takes its share, and a level card needs ~240 px to read. */
.qm-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
@container quests (max-width: 1400px) { .qm-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container quests (max-width: 820px) { .qm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qm-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--qw-line);
  background: linear-gradient(180deg, var(--game-card-2), var(--game-bg-2)); transition: border-color .2s, box-shadow .2s; }
.qm-card:hover { border-color: color-mix(in srgb, var(--qw-tiger) 50%, var(--qw-line)); box-shadow: 0 0 20px rgba(255, 122, 26, .12); }
.qm-card.is-won { border-color: color-mix(in srgb, var(--qw-ok) 70%, var(--qw-line)); background: linear-gradient(180deg, rgba(61, 220, 132, .1), var(--game-bg-2) 45%); box-shadow: 0 0 22px rgba(61, 220, 132, .12); }
.qm-card.is-lock { opacity: .8; }
.qm-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.qm-card-head h4 { margin: 0; font: 800 17px var(--qw-display); text-transform: uppercase; letter-spacing: .03em; color: var(--qw-ink); }
.qm-card-head p { margin: 1px 0 0; font-size: 13px; color: var(--game-text-2); }
.qm-card-n { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.qm-card-n b { font-size: 15px; color: var(--qw-ink); }
.qm-card-n span { font-weight: 800; color: var(--qw-tiger-text); }
.qm-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font: 800 11px var(--qw-display); text-transform: uppercase; letter-spacing: .06em;
  color: var(--qw-ok); border: 1px solid color-mix(in srgb, var(--qw-ok) 60%, transparent); background: color-mix(in srgb, var(--game-ok) 12%, transparent); white-space: nowrap; }
.qm-badge .icon { background: var(--qw-ok); }
.qm-card.is-won .qm-bar i { background: var(--qw-ok); }
/* Illustration (assets/img/quests/mission-<level>.webp): a transparent scene,
   contained and sitting on the card's warm workshop glow. */
.qm-art { height: 92px; border-radius: 10px; border: 1px solid var(--ink-06); padding: 6px 8px 4px; box-sizing: border-box;
  background: var(--art) center bottom / contain no-repeat content-box, radial-gradient(120% 140% at 50% 110%, color-mix(in srgb, var(--game-orange) 45%, transparent), transparent 60%),
  /* The scene's backdrop is the banner's wall: the account's colour (--hero-wall,
     set from it) or, without one, the navy. */
  var(--hero-wall, linear-gradient(180deg, #1a1f30, #0e1220)); }
.qm-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.qm-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 4px 2px; font-size: 13px; color: var(--qw-ink); border-radius: 6px; }
.qm-row-label { min-width: 0; }
.qm-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--game-line-2); display: grid; place-items: center; }
.qm-row.is-full .qm-dot { border-color: var(--qw-ok); background: var(--qw-ok); }
.qm-row.is-full .qm-dot .icon { background: var(--game-bg); }
.qm-row.is-part .qm-dot { border-color: var(--qw-tiger2); background: conic-gradient(var(--qw-tiger2) 0 50%, transparent 50%); }
.qm-row-n { font-weight: 700; color: var(--qw-tiger-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qm-row.is-full .qm-row-n { color: var(--qw-ok); }
/* Always the last column, so the XP lines up whether or not the row has a count. */
.qm-row-xp { grid-column: 4; font-weight: 800; color: var(--qw-tiger-text); white-space: nowrap; }
.qm-row.is-full .qm-row-xp { color: var(--qw-ok); }
.qm-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--qw-line); }
.qm-card-foot b { display: inline-flex; align-items: center; gap: 6px; font: 800 20px var(--qw-display); color: var(--qw-tiger-text); }
.qm-card.is-won .qm-card-foot b { color: var(--qw-ok); }
.qm-card-foot b .icon { background: var(--qw-ok); }
.qm-status { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--qw-line); font-size: 12px; font-weight: 600; color: var(--game-text-2); }
.qm-status .icon { background: currentColor; }
.qm-card.is-won .qm-status { color: var(--qw-ok); border-color: color-mix(in srgb, var(--qw-ok) 50%, var(--qw-line)); }
@media (max-width: 900px) { .qm-hero { height: auto; flex-direction: column; align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { .qm-card, .qw .qm-chap, .qm-bar i { transition: none; } }
/* Rank icons (assets/svg/ranks/rank-NN.svg) drawn as a mask in the current colour. */
.qm-rank-ic { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.qm-chap-ic { color: var(--qw-tiger-text); font-size: 22px; line-height: 1; }
.qm-chap.is-soon .qm-chap-ic { color: var(--qw-muted); }
.qm-hero-card b .qm-rank-ic { color: var(--qw-tiger-text); }

/* ── Hero banners on narrow windows ─────────────────────────────────────────
   Thresholds are the banner's inner width (container queries measure the
   content box), from measured needs: title + gaps + card + scene at 80 %. The
   art never goes below 80 %: past that point the scene is dropped, the title
   stays. TigerSquad drops the next rival, then the ranks line, then the
   scene. Missions drops its level card first (the chapter row right under the
   banner shows the same progress), then the scene. */
@container (max-width: 1020px) {
  .sqr-hero .sqr-card { grid-template-columns: auto; grid-template-areas: "me" "ranks"; }
  .sqr-hero .sqr-card-rival { display: none; }
}
@container (max-width: 790px) {
  .sqr-hero .sqr-card { grid-template-areas: "me"; }
  .sqr-hero .sqr-card-ranks { display: none; }
}
/* The one-line title needs the room: the scene leaves first (the rank card / coins stay). */
@container (max-width: 1000px) { .sqr-hero:not(.qd-hero) > .hero-scene { display: none; } }
@container (max-width: 960px) { .qm-hero > .qm-hero-card { display: none; } }
@container (max-width: 715px) { .qm-hero:not(.qd-hero) > .hero-scene { display: none; } }
@container (max-width: 765px) { .qd-hero > .hero-scene { display: none; } }

/* ── XP history (renderer/quests/xp-history.js) ────────────────────────────────
   The page (view mode "xpHistory", #invXpHistView): tiles across, then the
   curve beside the breakdown ring, then the log across the page. Same dark world as Tiger Quests. */
/* Page layout: tiles across, the curve beside the breakdown ring (same height),
   the log across. One column on a narrow window. */
.xph-board { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px;
  grid-template-areas: "tiles tiles" "chart break" "log log"; }
.xph-board > .xph-tiles { grid-area: tiles; }
.xph-board > .xph-chart-card { grid-area: chart; }
.xph-board > .xph-break-card { grid-area: break; }   /* stretched to the curve's card height */
.xph-break-card .xph-ring-row { margin: auto 0; }
.xph-board > .xph-log-card { grid-area: log; }
@media (max-width: 1350px) { .xph-board { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tiles" "chart" "break" "log"; } }
.xph-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--qw-line); background: linear-gradient(180deg, var(--qw-panel2), var(--qw-panel)); min-width: 0; }
.xph-head { display: flex; align-items: center; gap: 12px; }
.xph-head > div:not(.xph-ranges):not(.xph-filters) { flex: 1; min-width: 0; }
.xph-head h3 { margin: 0; font: 800 17px/1.1 var(--qw-display); text-transform: uppercase; letter-spacing: .04em; color: var(--qw-ink); }
.xph-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--qw-muted); }
.xph-ic { --c: var(--qw-tiger); display: inline-grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px;
  background: color-mix(in srgb, var(--c) 18%, #0e1220); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
/* Card headers: the icon on its own, no tinted box (like the tiles). */
.xph-head > .xph-ic { width: 32px; height: 32px; background: none; border: 0; }
.xph-head > .xph-ic .icon { width: 24px; height: 24px; }
.xph-ic .icon { background: var(--c); }
.xph-arrow { width: 80%; height: 80%; fill: var(--c); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 55%, transparent)); }
.is-up { color: var(--qw-ok); } .is-down { color: var(--game-danger-text); }
.xph-empty { margin: 0; padding: 14px; text-align: center; font-size: 13px; color: var(--qw-muted); border: 1px dashed var(--qw-line); border-radius: 10px; }

/* Breakdown ring */
.xph-ring-row { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 14px; align-items: center; }
.xph-ring { position: relative; width: 136px; height: 136px; }
.xph-ring svg { width: 100%; height: 100%; }
/* Hover an arc or its legend row: that arc swells and glows, the others fade;
   the legend row lights up (pairs matched by data-i, up to 12 categories). */
.xph-ring svg { overflow: visible; }
.xph-ring circle[data-i] { cursor: pointer; transition: stroke-width .25s cubic-bezier(.2, .8, .2, 1.3), opacity .2s, filter .25s; }
.xph-legend li[data-i] { cursor: default; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; transition: background .2s, opacity .2s; }
.xph-ring-row:has([data-i]:hover) [data-i] { opacity: .35; }
.xph-ring-row:has([data-i="0"]:hover) [data-i="0"],
.xph-ring-row:has([data-i="1"]:hover) [data-i="1"],
.xph-ring-row:has([data-i="2"]:hover) [data-i="2"],
.xph-ring-row:has([data-i="3"]:hover) [data-i="3"],
.xph-ring-row:has([data-i="4"]:hover) [data-i="4"],
.xph-ring-row:has([data-i="5"]:hover) [data-i="5"],
.xph-ring-row:has([data-i="6"]:hover) [data-i="6"],
.xph-ring-row:has([data-i="7"]:hover) [data-i="7"],
.xph-ring-row:has([data-i="8"]:hover) [data-i="8"],
.xph-ring-row:has([data-i="9"]:hover) [data-i="9"],
.xph-ring-row:has([data-i="10"]:hover) [data-i="10"],
.xph-ring-row:has([data-i="11"]:hover) [data-i="11"] { opacity: 1; }
.xph-ring-row:has([data-i="0"]:hover) circle[data-i="0"],
.xph-ring-row:has([data-i="1"]:hover) circle[data-i="1"],
.xph-ring-row:has([data-i="2"]:hover) circle[data-i="2"],
.xph-ring-row:has([data-i="3"]:hover) circle[data-i="3"],
.xph-ring-row:has([data-i="4"]:hover) circle[data-i="4"],
.xph-ring-row:has([data-i="5"]:hover) circle[data-i="5"],
.xph-ring-row:has([data-i="6"]:hover) circle[data-i="6"],
.xph-ring-row:has([data-i="7"]:hover) circle[data-i="7"],
.xph-ring-row:has([data-i="8"]:hover) circle[data-i="8"],
.xph-ring-row:has([data-i="9"]:hover) circle[data-i="9"],
.xph-ring-row:has([data-i="10"]:hover) circle[data-i="10"],
.xph-ring-row:has([data-i="11"]:hover) circle[data-i="11"] { stroke-width: 34; filter: drop-shadow(0 0 6px currentColor) brightness(1.15); }
.xph-ring-row:has([data-i="0"]:hover) li[data-i="0"],
.xph-ring-row:has([data-i="1"]:hover) li[data-i="1"],
.xph-ring-row:has([data-i="2"]:hover) li[data-i="2"],
.xph-ring-row:has([data-i="3"]:hover) li[data-i="3"],
.xph-ring-row:has([data-i="4"]:hover) li[data-i="4"],
.xph-ring-row:has([data-i="5"]:hover) li[data-i="5"],
.xph-ring-row:has([data-i="6"]:hover) li[data-i="6"],
.xph-ring-row:has([data-i="7"]:hover) li[data-i="7"],
.xph-ring-row:has([data-i="8"]:hover) li[data-i="8"],
.xph-ring-row:has([data-i="9"]:hover) li[data-i="9"],
.xph-ring-row:has([data-i="10"]:hover) li[data-i="10"],
.xph-ring-row:has([data-i="11"]:hover) li[data-i="11"] { background: var(--ink-06); }
@media (prefers-reduced-motion: reduce) { .xph-ring circle[data-i] { transition: none; } }
.xph-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.xph-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; color: var(--qw-ink); }
.xph-legend b { font: 800 13px var(--qw-mono); }
.xph-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }

.xph-break-card .xph-legend li { font-size: 12.5px; gap: 7px; }

/* Full page */
/* XP History: its own scene — the tiger in the TigerTag cap pointing at its
   rising XP curve, star coins, logbook and hourglass on the desk — one layer per
   object (hero-layers.js, assets/img/quests/xph-hero/), a 2.92 : 1 box pinned right. */
.xph-hero { --hero-scene: none; --hero-front: none; --hero-sink: 5px; --hero-scene-w: 560px; --hl-ratio: 3.4; }
.xph-hero .hl-box { left: auto; right: 24px; }   /* pinned right, off the banner's edge */
/* Widths follow from the heights (height % × the image's ratio ÷ 3.4), laid out
   without overlap: monitor 0–25, tiger 27–59 (its finger on the screen's edge),
   coins 61–75, book 75–93, hourglass 92–99. */
.xph-hero .hl--monitor { left: 0; height: 74%; }
/* The tiger (TigerTag cap from the real cap's photo) in two layers of the same
   size and place: the body behind the desk (its rows end on the waist cut), the
   resting paw in front of it. The cut is 4.26 % above the images' bottom, so both
   move down by that much + 2 px: the cut lands just under the desk's top edge and
   the paw rests on the desk. */
.xph-hero .hl--tiger { left: 27%; height: 78%; translate: 0 -1px; }   /* 4 px up from the plane's 3 px */
.xph-hero .hl--coins { left: 61%; height: 42%; }
.xph-hero .hl--book { left: 75%; height: 44%; }
/* The hourglass turns over on a click (data-xph-hourglass): a half turn around
   its middle, with a little bounce; it stays turned until the next click. */
.xph-hero .hl--hourglass { left: 92%; height: 40%; pointer-events: auto; cursor: pointer; transform-origin: 50% 50%;
  transition: rotate .7s cubic-bezier(.34, 1.4, .64, 1); }
.xph-hero .hl--hourglass.is-flipped { rotate: 180deg; }
.xph-hero .hl--spark1 { left: 19%; bottom: 80%; } .xph-hero .hl--spark2 { left: 62%; bottom: 62%; } .xph-hero .hl--spark3 { left: 87%; bottom: 66%; }
@media (prefers-reduced-motion: no-preference) {
  .xph-hero .hl--coins { animation: hl-float 2.6s ease-in-out infinite; }
}
/* The Tiger Squad banners' top padding, so its title sits exactly where it does on the leagues / Grimoire / Deals. */
.qm-hero.xph-hero { padding-top: 8px; }
.xph-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.xph-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--qw-line);
  background: linear-gradient(180deg, var(--qw-panel2), var(--qw-panel)); min-width: 0; }
/* Minimal: the icon on its own, no tinted box behind it. */
.xph-tile > .xph-ic { width: 44px; height: 44px; background: none; border: 0; }
.xph-tile > .xph-ic .icon { width: 30px; height: 30px; }
.xph-tile > .xph-ic .xph-arrow { width: 100%; height: 100%; }
.xph-tile > div { display: flex; flex-direction: column; min-width: 0; }
.xph-tile-t { font: 800 11.5px var(--qw-display); text-transform: uppercase; letter-spacing: .08em; color: var(--qw-muted); }
.xph-tile b { font: 800 26px/1.15 var(--qw-mono); color: var(--qw-ink); white-space: nowrap; }
.xph-tile b small { font: 800 14px var(--qw-display); color: var(--qw-tiger-text); }
.xph-tile--gain b { color: var(--qw-ok); } .xph-tile--loss b { color: var(--game-danger-text); }
.xph-tile--gain b small, .xph-tile--loss b small { color: inherit; }
.xph-tile-s { font-size: 12px; color: var(--qw-muted); }
.xph-ranges { display: flex; gap: 6px; }
.xph-range { height: 32px; min-width: 48px; padding: 0 12px; border-radius: 8px; cursor: pointer; font: 800 12px var(--qw-display); letter-spacing: .04em;
  color: var(--qw-ink); background: var(--ink-04); border: 1px solid var(--qw-line); transition: background-color .2s, border-color .2s; }
.xph-range:hover { border-color: var(--qw-tiger); }
.xph-range.is-on { color: var(--game-on-gold); background: linear-gradient(180deg, var(--qw-tiger2), var(--qw-tiger)); border-color: transparent; }
.xph-chart { position: relative; height: 230px; }
.xph-tip[hidden] { display: none; }
.xph-svg { display: block; overflow: visible; }
.xph-grid { stroke: var(--ink-06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.xph-ylab, .xph-xlab { fill: var(--qw-muted); font: 600 11px system-ui, sans-serif; }
.xph-ylab { text-anchor: end; dominant-baseline: middle; }
.xph-xlab { text-anchor: middle; }
.xph-area { fill: url(#xphFill); }
.xph-line { fill: none; stroke: url(#xphStroke); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255, 140, 40, .55)); }
.xph-end { fill: var(--game-orange-text); stroke: var(--game-bg); stroke-width: 2; }
.xph-end-halo { fill: color-mix(in srgb, var(--game-orange) 25%, transparent); animation: xph-pulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes xph-pulse { 50% { transform: scale(1.5); opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .xph-end-halo { animation: none; } }
.xph-guide { stroke: color-mix(in srgb, var(--game-orange-hi) 45%, transparent); stroke-width: 1; stroke-dasharray: 3 4; }
/* The league curves (scope "My country" / "Leagues"): one line per country in
   its colour (mine orange, thicker, drawn last), and a tooltip listing every
   league that day with its flag. */
.xph-head { flex-wrap: wrap; }
.xph-avs { display: flex; gap: 10px; }
.xph-av { position: relative; width: 40px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; overflow: hidden; cursor: pointer;
  display: grid; place-items: center; background: var(--game-line); color: var(--qw-muted);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .16); opacity: .6; transition: opacity .2s, box-shadow .2s, transform .2s; }
.xph-av:hover { opacity: 1; transform: translateY(-1px); }
.xph-av.is-on { opacity: 1; color: var(--qw-tiger-text); box-shadow: 0 0 0 2px var(--qw-tiger), 0 0 14px rgba(255, 122, 26, .55); }
.xph-av > img { width: 100%; height: 100%; object-fit: cover; }
.xph-av > .sqb-avatar { position: absolute; inset: 0; width: auto; height: auto; }
.xph-av .icon { background: currentColor; }
.xph-mline { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.xph-mline.is-mine { stroke-width: 3; opacity: 1; filter: drop-shadow(0 0 6px rgba(255, 140, 40, .55)); }
.xph-mend { fill: var(--c); stroke: var(--game-bg); stroke-width: 2; }
.xph-flag { height: 12px; aspect-ratio: 4 / 3; border-radius: 2px; object-fit: cover; }
.xph-tip .xph-tip-row { display: flex; align-items: center; gap: 6px; font: 600 12px system-ui, sans-serif; color: var(--qw-muted); }
.xph-tip .xph-tip-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.xph-tip .xph-tip-row b { margin-left: auto; padding-left: 12px; font: 800 12px var(--qw-mono); }
.xph-focus { fill: #fff; stroke: var(--game-orange-text); stroke-width: 3; filter: drop-shadow(0 0 6px rgba(255, 140, 40, .8)); pointer-events: none; }
.xph-tip { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; min-width: 150px; pointer-events: none;
  border-radius: 10px; border: 1px solid var(--qw-line); background: rgba(10, 12, 20, .95); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); font-size: 12.5px; }
.xph-tip small { color: var(--qw-muted); } .xph-tip b { color: var(--qw-ink); } .xph-tip span { font: 800 13px var(--qw-mono); }
.xph-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.xph-filters select, .xph-search { height: 36px; border-radius: 9px; border: 1px solid var(--qw-line); background: var(--game-card); color: var(--qw-ink); font: 600 13px inherit; }
.xph-filters select { padding: 0 10px; cursor: pointer; }
.xph-search { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 220px; }
.xph-search .icon { background: var(--qw-muted); }
.xph-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: inherit; font: inherit; }
.xph-table-wrap { overflow-x: auto; }
.xph-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.xph-table th { padding: 8px 10px; text-align: left; font: 800 11px var(--qw-display); text-transform: uppercase; letter-spacing: .08em; color: var(--qw-muted); border-bottom: 1px solid var(--qw-line); }
.xph-table td { padding: 9px 10px; border-bottom: 1px solid var(--ink-04); color: var(--qw-ink); }
.xph-table tr:hover td { background: var(--ink-04); }
.xph-table .xph-num { text-align: right; font: 800 13px var(--qw-mono); white-space: nowrap; }
.xph-table td.is-up { color: var(--qw-ok); } .xph-table td.is-down { color: var(--game-danger-text); }
.xph-date { color: var(--qw-muted) !important; white-space: nowrap; }
.xph-act { display: inline-flex; align-items: center; gap: 10px; }
.xph-act .xph-ic { width: 20px; height: 20px; background: none; border: 0; border-radius: 0; }  /* bare icon, no box */
.xph-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  color: color-mix(in srgb, var(--c) 85%, #fff); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.xph-pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.xph-pg { min-width: 36px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; cursor: pointer;
  font: 700 13px inherit; color: var(--qw-ink); background: var(--ink-04); border: 1px solid var(--qw-line); }
.xph-pg .icon { background: currentColor; }
.xph-pg:hover:not(:disabled) { border-color: var(--qw-tiger); }
.xph-pg.is-on { color: var(--game-on-gold); background: linear-gradient(180deg, var(--qw-tiger2), var(--qw-tiger)); border-color: transparent; }
.xph-pg:disabled { opacity: .4; cursor: default; }
.xph-gap { color: var(--qw-muted); padding: 0 2px; }
.xph-count { margin-left: auto; font-size: 12.5px; color: var(--qw-muted); }
@media (max-width: 1100px) { .xph-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Next rival, one line per league (country, world): badge, avatar, name + XP to go, a thin bar. */
.sqr-card-rival .sqr-rival-row { display: grid; grid-template-columns: 16px 24px minmax(0, 1fr); column-gap: 6px; row-gap: 3px; align-items: center; }
.sqr-rival-row .sqb-avatar { width: 24px; height: 24px; }
/* Air between the league badge (flag / globe) and the rival's avatar. */
.sqr-rival-row > :first-child { margin-right: 5px; }
.sqr-rival-row .av-squad-heart { display: none; }
.sqr-rival-row .sqr-rival-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.sqr-rival-row .sqr-rival-txt b { font-size: 12px; font-weight: 700; color: var(--on-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sqr-rival-row .sqr-rival-txt small { font-size: 11.5px; font-weight: 800; color: var(--tsq-orange); white-space: nowrap; }
.sqr-rival-row .sqr-bar { grid-column: 2 / -1; height: 4px; }
.sqr-rival-badge { display: inline-flex; align-items: center; justify-content: center; }
.sqr-rival-row.is-top { grid-template-columns: 16px 24px minmax(0, 1fr); }
.sqr-rival-row.is-top b { font-size: 12.5px; font-weight: 800; color: var(--sqr-gold, var(--game-gold)); white-space: nowrap; }
.sqr-rival-medal { width: 24px; height: 24px; filter: drop-shadow(0 0 6px rgba(255, 200, 61, .4)); }
.sqr-hero .sqr-card-rival.sqr-card-rival { width: 200px; }
.sqr-rival-row .sqr-rival-txt small { font-size: 11px; }
/* The one rank number (rankNo() in squad-rankings.js): white, mono, bold, a
   shadow so it reads on any row colour. Size follows where it sits. */
.sqr-no { font-family: var(--sqr-mono, ui-monospace, monospace); font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .75); white-space: nowrap; }
.sqr-rank .sqr-no { font-size: 14px; }
.sqr-mini .sqr-no { font-size: 11px; }
.sqb-row .sqr-no { font-size: 15px; }
.sqb-medal-1 .sqr-no, .sqb-medal-2 .sqr-no, .sqb-medal-3 .sqr-no { color: inherit; }   /* the full list keeps its podium tints */
.sqr-card-rank .sqr-no { font-size: 13px; }
.fvb-xp-n .sqr-no { font-size: inherit; text-shadow: none; }
/* Items banner (squadItemsHeroHtml, hero-layers.js, a 5.4 : 1 box centred in the
   room between the title and the next-level card): the tiger in the TigerTag cap
   behind the desk, still, its bottom outline 1 px above the desk's top edge (the
   box sits 5 px into the desk); the scale and spool on its left, the Touch and
   the POD on its right, standing on the desk — a black silhouette until owned,
   then lit with the legendary glow. */
.sqi-hero { --hl-ratio: 5.4; --hero-art-w: 780px; --hero-art-ratio: 1; }
.sqi-hero .sqi-scene { position: relative; flex: 1 1 auto; align-self: stretch; min-width: 0; margin-bottom: calc(-6px - var(--hero-sink, 4px)); }
.sqi-hero > .sqi-scene.sqi-scene { z-index: auto; }   /* not a stacking context: the tiger's plane goes under the desk */
.sqi-hero .hl--ws-tiger { left: 34.7%; height: 100%; translate: 0 -6px; }
.sqi-hero .hl--tigerscale-flat2 { left: 0; height: 74%; }
.sqi-hero .hl--tigerspool-flat2 { left: 15%; height: 70%; }
.sqi-hero .hl--tigertouch-flat3 { left: 72.5%; height: 52%; }
.sqi-hero .hl--tigerpod-flat2 { left: 91%; height: 72%; }
/* Easter-egg envelopes peeking from behind each owned device (squadItemsHeroHtml),
   tilted, the top third showing; clickable but no pointer cursor (a secret). */
.sqi-hero .hl--egg { height: 30%; pointer-events: auto; }
.sqi-hero .hl--egg-tigerscale-flat2 { left: 1.3%; bottom: 50%; rotate: -16deg; }
.sqi-hero .hl--egg-tigerspool-flat2 { left: 23.5%; bottom: 38%; rotate: 12deg; }
.sqi-hero .hl--egg-tigertouch-flat3 { left: 78%; bottom: 34%; rotate: 16deg; }
.sqi-hero .hl--egg-tigerpod-flat2 { left: 89.8%; bottom: 48%; rotate: -14deg; }
.sqi-item { transition: filter .3s, opacity .3s; filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .5)); opacity: .7; }
.sqi-item.is-on { opacity: 1; filter: drop-shadow(0 0 10px rgba(255, 138, 0, .65)) drop-shadow(0 0 2px rgba(255, 200, 120, .8)); }
/* Narrower: the devices go, the tiger and the next-level card stay. */
@container hero (max-width: 1180px) { .sqi-hero .sqi-item { display: none; } }
@container (max-width: 640px) { .sqi-hero .sqi-scene { display: none; } }
/* Items view — two panels (lootHtml / ladderHtml). The rarity is the item's
   own colour (--c: Diablo — legendary orange, epic green, rare yellow, uncommon
   blue, common white); owned legendary relics glow, items not owned are dimmed
   with a lock. Side by side on wide windows, stacked below 1300 px. */
.qw-ladders { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 1300px) { .qw-ladders { grid-template-columns: 1fr 1fr; } }
/* The two columns sit straight on the page (no panel behind them): lighter, the items carry the colour. */
.qw-ladders .qw-ladder.qw-panel { margin: 0; padding: 4px 0 0; background: none; border: 0; clip-path: none; box-shadow: none; }
.qw-ladders { gap: 28px; }
.qw-ladder-sum { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.qw-ladder-sum b { font: 800 20px var(--qw-mono); color: var(--qw-ink); }
.qw-ladder-sum span { font: 700 12px var(--qw-mono); color: var(--qw-tiger-text); }
.qw-ladders .qw-quest-head { display: flex; align-items: flex-end; gap: 12px; }
.qw-ladder-sum { min-width: min(46%, 280px); }
.qw-ladder-sum b { font-size: 16px; }
.qw-ladder-bar { align-self: stretch; height: 4px; border-radius: 99px; background: var(--ink-08); overflow: hidden; position: relative; }
.qw-ladder-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: inherit; background: var(--qw-tiger2); }
.qw-group { display: flex; flex-direction: column; gap: 8px; }
.qw-group + .qw-group { margin-top: 6px; }
.qw-group-h { margin: 0; font: 700 13px var(--qw-display); color: var(--qw-tiger-text); letter-spacing: .02em; }
.qw-group-h span { color: var(--qw-muted); font-weight: 600; }
/* Loot tiles (relics large, gear 4 across, chips 3 across) and Feats rows
   (art · name + hint · ×N · rarity · XP · status, every column always present). */
.qw-r--legendary { --c: #ff8000; } .qw-r--epic { --c: #1eff4a; } .qw-r--rare { --c: #ffe94a; } .qw-r--uncommon { --c: var(--tier-rare); } .qw-r--common { --c: #e2e2e2; }
.qw-tiles { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qw-tiles--chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .qw-tiles, .qw-tiles--chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qw-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 10px 8px 10px; border-radius: 12px; text-align: center;
  background: color-mix(in srgb, var(--game-bg) 70%, transparent); border: 1.5px solid color-mix(in srgb, var(--c) 30%, var(--qw-line)); transition: border-color .2s, transform .2s; }
.qw-tile.is-got { border-color: color-mix(in srgb, var(--c) 65%, transparent); }
.qw-tile:hover { border-color: var(--c); transform: translateY(-3px); box-shadow: 0 6px 16px -8px var(--c); }
/* Hovered: the art hops (a sound plays with it, quests/index.js). */
@media (prefers-reduced-motion: no-preference) {
  .qw-tile:hover .qw-tile-art img, .qw-row:hover .qw-row-art > * { animation: qw-hop .55s cubic-bezier(.3, 1.6, .5, 1); }
}
@keyframes qw-hop { 0% { transform: none; } 40% { transform: translateY(-7px) rotate(-6deg) scale(1.1); } 70% { transform: translateY(0) rotate(3deg); } 100% { transform: none; } }
.qw-tile-art { position: relative; width: 68px; height: 68px; display: grid; place-items: center; }
.qw-tile-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)); }
.qw-tile-art .icon { width: 28px; height: 28px; background: var(--c); }
.qw-tile-name { max-width: 100%; margin-top: 2px; font-size: 13px; color: var(--qw-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-tiles--relics .qw-tile { padding: 12px 8px; border-width: 2px; background: radial-gradient(110% 70% at 50% 0%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%), color-mix(in srgb, var(--game-bg) 70%, transparent); }
.qw-tiles--relics .qw-tile.is-got { box-shadow: 0 0 22px -8px var(--c); }
.qw-tiles--relics .qw-tile-art { width: 92px; height: 92px; }
/* Gear is mostly wide objects (scale, sensor): a wider box so they read as large as the round chips. */
.qw-tiles--gear .qw-tile-art { width: 96px; height: 72px; }
.qw-tiles--relics .qw-tile-name { font-size: 14px; }
/* Not owned yet: the name and rarity dimmed. */
.qw-tile:not(.is-got) .qw-tile-name, .qw-tile:not(.is-got) .qw-rar { opacity: .55; }
/* Not owned yet: the art as a black silhouette, like the banner's devices. */
.qw-tile:not(.is-got) .qw-tile-art { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, .5)); opacity: .7; }
.qw-n { position: absolute; top: 6px; right: 6px; padding: 1px 7px; border-radius: 99px; font: 800 11px var(--qw-mono); color: var(--game-on-gold); background: var(--c); }
.qw-rar { font: 700 10px var(--qw-display); text-transform: uppercase; letter-spacing: .12em; color: var(--c); white-space: nowrap; }
/* Light theme: the rarity colours are made for a dark ground (pale yellow, near-white) — their words take a deep shade. */
:root:not([data-theme="dark"]) .qw-rar { color: color-mix(in srgb, var(--c) 50%, var(--game-text)); }
.qw-pts { display: inline-flex; align-items: center; justify-content: center; gap: 4px; margin-top: 3px; padding: 2px 9px; border-radius: 99px;
  font: 800 11.5px var(--qw-mono); color: var(--qw-tiger-text); background: var(--ink-06); white-space: nowrap; }
.qw-pts .icon { background: var(--qw-muted); }
/* On a tile the XP rides the card's top edge, centred and overhanging (like the Deals badges). */
.qw-tiles { row-gap: 18px; padding-top: 10px; }
.qw-tile { padding-top: 16px; }
.qw-tile .qw-pts { position: absolute; top: 0; left: 50%; translate: -50% -50%; z-index: 1; margin: 0; padding: 3px 11px;
  border: 1.5px solid color-mix(in srgb, var(--c) 65%, transparent); background: var(--game-card); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.qw-tile.is-got .qw-pts { color: var(--game-on-gold); background: var(--c); border-color: var(--c); }
.qw-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qw-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 40px auto 104px 20px; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; border-radius: 11px;
  background: color-mix(in srgb, var(--game-bg) 70%, transparent); border: 1px solid var(--qw-line); border-left: 3px solid var(--c); transition: border-color .2s; }
.qw-row:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--qw-line)); border-left-color: var(--c); }
.qw-row:not(.is-got) { opacity: .55; border-left-style: dashed; }
.qw-row:not(.is-got) .qw-row-art { filter: grayscale(1); }
.qw-row-art { width: 38px; height: 38px; display: grid; place-items: center; }
.qw-row-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qw-row-art .icon { width: 22px; height: 22px; background: var(--c); }
.qw-row-art .qw-item-mask { width: 26px; height: 26px; }
.qw-row-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.qw-row-txt b { font-size: 13.5px; color: var(--qw-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-row-txt small { font-size: 11.5px; color: var(--qw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-cnt { justify-self: end; font: 800 11px var(--qw-mono); color: var(--qw-muted); }
.qw-cnt:not(:empty) { padding: 1px 7px; border-radius: 99px; background: var(--ink-08); }
.qw-row .qw-rar { justify-self: end; }
.qw-row .qw-pts { margin: 0; }
.qw-st { display: grid; place-items: center; }
.qw-st .icon-check { background: var(--qw-ok); } .qw-st .icon-lock { background: var(--qw-muted); }
/* Secret bonus mission (a `secret` level, shown once its rank's other levels are
   won): the sixth card of the row, purple and gold, with a "Secret mission" tag
   and a soft pulse when it appears. */
.qm-cards.has-secret { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@container quests (max-width: 1500px) { .qm-cards.has-secret { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container quests (max-width: 820px) { .qm-cards.has-secret { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qm-secret-wrap { position: relative; display: flex; }
.qm-secret-wrap > .qm-card { flex: 1; border-color: color-mix(in srgb, var(--tier-epic) 60%, transparent);
  background: radial-gradient(120% 90% at 50% 0%, rgba(160, 90, 255, .3), transparent 60%), linear-gradient(180deg, #241a3a, #151225);
  box-shadow: 0 0 24px rgba(160, 90, 255, .28); }
.qm-secret-wrap > .qm-card .qm-art { border-color: color-mix(in srgb, var(--tier-epic) 35%, transparent); }
.qm-secret-tag { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1; padding: 2px 12px; font: 800 10px var(--qw-display); letter-spacing: .14em; text-transform: uppercase; color: var(--game-on-gold);
  background: linear-gradient(90deg, var(--game-gold), var(--game-gold-deep)); clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 6px 100%); }
.qm-secret-wrap > .qm-card { padding-top: 22px; }
/* Always on, won or not: the card is a foil card — a light sweep crosses it
   every few seconds and its purple glow breathes. (Won, it adds the legendary
   border below.) The sweep passes OVER the content (screen blend, no clicks)
   so it crosses the whole card — under it, the opaque illustration and rows
   cut it off halfway. */
.qm-secret-wrap > .qm-card { position: relative; overflow: hidden; isolation: isolate; animation: qm-secret-breathe 3s ease-in-out infinite; }
.qm-secret-wrap > .qm-card:not(.is-won)::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 30%, rgba(226, 182, 255, .10) 42%, rgba(255, 255, 255, .26) 50%, rgba(255, 211, 77, .12) 57%, transparent 70%);
  background-size: 260% 100%; background-repeat: no-repeat; animation: qm-sweep 5s ease-in-out infinite; }
@keyframes qm-secret-breathe { 50% { box-shadow: 0 0 34px rgba(160, 90, 255, .5), 0 0 8px rgba(255, 211, 77, .25); } }
@media (prefers-reduced-motion: reduce) { .qm-secret-wrap > .qm-card, .qm-secret-wrap > .qm-card::before { animation: none; } }
/* Legendary chapter tile — every level of the rank AND its secret bonus won: a
   rotating gold-and-purple border, a light sweep, a pulsing glow and a crown. */
@property --qm-spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.qw .qm-chap.is-legend { position: relative; overflow: hidden; border-color: transparent;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tier-epic) 30%, var(--game-card)), var(--game-card)) padding-box,
    conic-gradient(from var(--qm-spin), var(--game-gold), var(--game-gold-deep), var(--tier-epic), var(--tier-rare), var(--game-gold)) border-box;
  border: 2px solid transparent; animation: qm-spin 4s linear infinite, qm-legend-glow 2.4s ease-in-out infinite; }
.qw .qm-chap.is-legend b { background: linear-gradient(90deg, var(--game-gold-hi), var(--game-orange-hi), var(--tier-epic)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qw .qm-chap.is-legend .qm-chap-ic { color: var(--game-gold-text); filter: drop-shadow(0 0 6px rgba(255, 211, 77, .8)); }
.qw .qm-chap.is-legend .qm-pips i { background: linear-gradient(90deg, var(--game-gold), var(--tier-epic)); box-shadow: 0 0 6px rgba(255, 211, 77, .6); }
.qm-chap-crown { position: absolute; top: 4px; right: 6px; font-size: 13px; color: var(--game-gold-text); text-shadow: 0 0 8px rgba(255, 211, 77, .9); animation: qm-twinkle 1.6s ease-in-out infinite; }
.qm-chap-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%);
  background-size: 250% 100%; background-repeat: no-repeat; animation: qm-sweep 5s ease-in-out infinite; }
@keyframes qm-spin { to { --qm-spin: 360deg; } }
@keyframes qm-legend-glow { 50% { box-shadow: 0 0 22px rgba(255, 190, 80, .55), 0 0 40px rgba(180, 108, 255, .35); } }
/* One diagonal pass from off the left edge to off the right edge (no-repeat:
   a repeating background left a copy of the band frozen mid-card), then a
   pause with nothing on the card before the next pass. */
@keyframes qm-sweep { 0% { background-position: 150% 0; } 40%, 100% { background-position: -100% 0; } }
@keyframes qm-twinkle { 50% { transform: scale(1.25) rotate(15deg); opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .qw .qm-chap.is-legend, .qm-chap-crown, .qm-chap-shine { animation: none; } }
/* Light theme: the pale gold of the name vanished on the light purple tile —
   the same gold-to-purple run in the deep "-text" shades. */
:root:not([data-theme="dark"]) .qw .qm-chap.is-legend b {
  background-image: linear-gradient(90deg, var(--game-gold-text), var(--game-orange-text), color-mix(in srgb, var(--tier-epic) 70%, var(--game-text))); }
/* The secret mission once WON: the same legendary treatment as its chapter tile —
   rotating gold-and-purple border, light sweep, pulsing glow. */
.qm-secret-wrap > .qm-card.is-won { position: relative; overflow: hidden; border: 2px solid transparent;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 200, 80, .22), transparent 60%) padding-box, linear-gradient(180deg, #2a1e3c, #151225) padding-box,
    conic-gradient(from var(--qm-spin), var(--game-gold), var(--game-gold-deep), var(--tier-epic), var(--tier-rare), var(--game-gold)) border-box;
  animation: qm-spin 4s linear infinite, qm-legend-glow 2.4s ease-in-out infinite; }
.qm-secret-wrap > .qm-card.is-won::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .18) 50%, transparent 65%); background-size: 250% 100%; background-repeat: no-repeat; animation: qm-sweep 5s ease-in-out infinite; }
.qm-secret-wrap:has(.qm-card.is-won) .qm-secret-tag { background: linear-gradient(90deg, var(--game-gold-hi), var(--game-orange-hi), var(--tier-epic)); }
@media (prefers-reduced-motion: reduce) { .qm-secret-wrap > .qm-card.is-won, .qm-secret-wrap > .qm-card.is-won::after { animation: none; } }
/* Light theme: the secret card keeps its purple identity on a LIGHT ground (its
   text follows the theme tokens, so a dark ground made it unreadable). */
:root:not([data-theme="dark"]) .qm-secret-wrap > .qm-card {
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tier-epic) 18%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--tier-epic) 8%, var(--game-card)), color-mix(in srgb, var(--tier-epic) 14%, var(--game-card-2))); }
:root:not([data-theme="dark"]) .qm-secret-wrap > .qm-card.is-won {
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--game-gold) 22%, transparent), transparent 60%) padding-box,
    linear-gradient(180deg, color-mix(in srgb, var(--tier-epic) 8%, var(--game-card)), color-mix(in srgb, var(--tier-epic) 14%, var(--game-card-2))) padding-box,
    conic-gradient(from var(--qm-spin), var(--game-gold), var(--game-gold-deep), var(--tier-epic), var(--tier-rare), var(--game-gold)) border-box; }
/* Items banner — the next squad level in the right card (same frame as the
   Rankings card): badges, title, progress, the how in one short line. */
.sqr-card.sqi-next { display: block; flex-shrink: 0; width: 340px; max-width: 34%; padding: 10px 14px; }
.sqi-next .sqb-next { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; font-weight: 400; color: var(--qw-muted); }
.sqi-next .sqb-next-badge { width: 42px; height: 42px; }
.sqi-next .sqb-next-body { gap: 4px; }
.sqi-next .sqb-next-body b { font-size: 13.5px; }
.sqi-next .sqb-next-body p { font-size: 11.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sqi-next .sqb-next-alt { display: none !important; }
.sqi-next .sqb-next-cta { align-self: flex-start; padding: 4px 10px; font-size: 12px; }
@container (max-width: 980px) { .sqi-hero .sqr-card.sqi-next { display: none; } }

/* ── Tiger Squad Deals (quests/squad-deals.js) ───────────────────────────────
   Same hero as the Grimoire (wall, desk, the tiger behind it) with two glowing
   "%" coins on the desk; then the partner offers as cards, or "coming soon". */
.sqd-view { display: flex; flex-direction: column; gap: 14px; }
/* The view scrolls: its blocks keep their height (the banner was squeezed to
   ~40 px once the deal cards filled the column). */
.sqd-view > * { flex-shrink: 0; }
/* Banner scenes from separate layers (hero-layers.js): two planes with the same
   geometry — the back one under the desk (z auto: the desk's z 1 covers a
   character's waist cut), the front one over it (z 2: objects stand ON the desk).
   The box keeps the banner's proportions (--hl-ratio), as big as the room allows;
   every object sits at the bottom, its base 3 px into the desk's 6 px top stripe,
   placed and sized in % of the box per banner (.<hero> .hl--<name>). */
.hl-scene { position: absolute; inset: 0; container-type: size; pointer-events: none; z-index: 2; }
.hl-scene.hl-scene--back { z-index: auto; }
.sqr-hero .hl-scene { right: auto; left: max(0px, calc(50% - var(--hero-art-w) / 2)); width: min(var(--hero-art-w), calc(100% * var(--hero-art-ratio, 1))); }
.hl-box { position: absolute; left: 0; bottom: 0; width: min(100cqw, calc(100cqh * var(--hl-ratio, 2.7))); aspect-ratio: var(--hl-ratio, 2.7); }
.hl { position: absolute; bottom: 0; translate: 0 3px; height: auto; width: auto; transform-origin: 50% 100%; }   /* width: auto beats the width attribute of a laddered layer (renderer/art.js) */
.hl--spark { height: 12%; }
/* Light life (chosen by the founder): characters stay still; objects float,
   sway or rock a little; sparkles twinkle one after the other. */
@media (prefers-reduced-motion: no-preference) {
  .hl--spark { transform-origin: 50% 50%; animation: hl-twinkle 2.4s ease-in-out infinite; }
  .hl--spark2 { animation-delay: .8s; } .hl--spark3 { animation-delay: 1.6s; }
}
@keyframes hl-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
@keyframes hl-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes hl-rock { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-2deg); } }
@keyframes hl-twinkle { 0%, 100% { transform: scale(.55) rotate(0); opacity: .35; } 50% { transform: scale(1) rotate(25deg); opacity: 1; } }
/* League banner scene (squad-rankings.js LEAGUE_SCENE, a 4.2 : 1 box): the silver,
   gold and bronze tigers behind the desk (still), each moved down by the height
   of its paws under the waist cut (gold 4.02 %, bronze 4.53 %) − 6 px (the box
   itself sits 5 px into the desk) so the cut sits 1 px ABOVE the desk's top edge:
   the black outline under the belly shows, the tigers stand behind the desk; their paw layers, same size and place,
   rest on the desk in front of it. Then the trophy, the printer, four stars. */
.sqr-hero:not(.sqd-hero) .hl--tiger-silver { left: 0; height: 86%; }
.sqr-hero:not(.sqd-hero) .hl--tiger-gold { left: 20%; height: 98%; }
/* The silver tiger ends on the desk's top edge; the gold and bronze ones' paws,
   drawn under their cut, rest on it. */
.sqr-hero:not(.sqd-hero) .hl--tiger-silver { translate: 0 -6px; }
.sqr-hero:not(.sqd-hero) :is(.hl--tiger-gold, .hl--tiger-bronze) { translate: 0 -2px; }
.sqr-hero:not(.sqd-hero) .hl--trophy { left: 41.5%; height: 50%; pointer-events: auto; cursor: pointer; }
/* Clicked (data-trophy): a jump with a spin and a golden flash. */
.sqr-hero:not(.sqd-hero) .hl--trophy.hl--trophy.is-cheering { animation: hl-cheer .9s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes hl-cheer {
  0% { transform: none; filter: none; }
  30% { transform: translateY(-34%) rotate(-10deg) scale(1.15); filter: drop-shadow(0 0 10px var(--game-gold)) brightness(1.25); }
  55% { transform: translateY(-34%) rotate(10deg) scale(1.15); filter: drop-shadow(0 0 14px var(--game-gold-deep)) brightness(1.3); }
  80% { transform: translateY(0) scale(.95, 1.05); filter: drop-shadow(0 0 6px var(--game-gold)); }
  100% { transform: none; filter: none; } }
.sqr-hero:not(.sqd-hero) .hl--tiger-bronze { left: 51%; height: 88%; }
.sqr-hero:not(.sqd-hero) .hl--printer { left: 73.5%; height: 76%; }
.sqr-hero:not(.sqd-hero) .hl--spark { height: 11%; }
.sqr-hero:not(.sqd-hero) .hl--spark1 { left: 6%; bottom: 82%; } .sqr-hero:not(.sqd-hero) .hl--spark2 { left: 15%; bottom: 90%; }
.sqr-hero:not(.sqd-hero) .hl--spark3 { left: 45%; bottom: 76%; } .sqr-hero:not(.sqd-hero) .hl--spark4 { left: 70%; bottom: 84%; }
@media (prefers-reduced-motion: no-preference) {
  .sqr-hero:not(.sqd-hero) .hl--trophy { animation: hl-rock 4s ease-in-out infinite; }
  .sqr-hero .hl--spark4 { transform-origin: 50% 50%; animation: hl-twinkle 2.4s ease-in-out 1.2s infinite; }
}
/* Deals banner scene: the tiger behind the desk in the TigerTag cap, a gift
   beside him, a shopping bag, % coins, coupons and a globe with pins — one
   transparent layer per object (assets/img/tigersquad/deals-hero/). */
.sqr-hero.sqd-hero { --hero-scene: none; --hero-front: none;
  --hero-sink: 4px; --hero-art-w: 560px; --hero-art-ratio: 1; --hero-scene-w: 560px; }
/* Deals scene objects (dealsSceneHtml, a 3.4 : 1 box): bag, coins, the gift
   BESIDE the tiger, the tiger (behind the desk), tickets, globe, sparkles. */
.sqd-hero { --hl-ratio: 3.4; }
.sqd-hero .hl--bag { left: 0; height: 72%; }
.sqd-hero .hl--coins { left: 15%; height: 40%; }
.sqd-hero .hl--gift { left: 26%; height: 34%; }
.sqd-hero .hl--tiger { left: 37%; height: 84%; translate: 0 6px; bottom: 6%; }   /* raised: only the waist cut goes behind the desk */
.sqd-hero .hl--tickets { left: 71%; height: 54%; }
.sqd-hero .hl--globe { left: 84%; height: 57%; }
.sqd-hero .hl--spark1 { left: 12%; bottom: 74%; } .sqd-hero .hl--spark2 { left: 30%; bottom: 52%; } .sqd-hero .hl--spark3 { left: 74%; bottom: 72%; }
/* Easter egg (dealsBanner): a red envelope peeking from behind the gift, the one
   clickable layer; no pointer cursor — it stays a secret. Each click shakes it. */
.sqd-hero .hl--egg { left: 27.5%; bottom: 14%; height: 28%; rotate: 14deg; pointer-events: auto; }
.hl--egg.is-tapped { animation: tch-tap .35s ease; }
@media (prefers-reduced-motion: no-preference) {
  .sqd-hero .hl--coins { animation: hl-float 2.6s ease-in-out infinite; }
  .sqd-hero .hl--globe { transform-origin: 50% 60%; animation: hl-sway 5s ease-in-out infinite; }
  .sqd-hero .hl--tickets { animation: hl-rock 4s ease-in-out infinite; }
}

.sqd-soon { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px;
  border: 1px dashed color-mix(in srgb, var(--tsq-orange) 45%, var(--tsq-line)); border-radius: 14px;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--tsq-orange) 12%, transparent), transparent 70%); }
.sqd-soon-ic { width: 64px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; margin-bottom: 4px;
  background: color-mix(in srgb, var(--tsq-orange) 16%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--tsq-orange) 30%, transparent); }
.sqd-soon-ic .icon { width: 30px; height: 30px; background: var(--tsq-orange); }
.sqd-soon h3 { margin: 0; font: 800 26px var(--sqr-display); letter-spacing: .04em; text-transform: uppercase; color: var(--tsq-text); }
.sqd-soon p { margin: 0; max-width: 460px; color: var(--tsq-muted); font-size: 14px; line-height: 1.5; }

/* Offer cards, one format for all (like the filament cards): a fixed width
   range, a square illustration showing the product whole on white, the cards
   of a row as tall as each other, one-line title, three-line description. */
.sqd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 185px)); gap: 10px; }
/* The card no longer clips (its badge overhangs the top edge): the picture
   clips itself on the card's top corners instead. */
.sqd-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--tsq-line); border-radius: 14px; overflow: visible; background: var(--tsq-card);
  transition: border-color .2s, transform .2s; }
.sqd-card > .sqd-card-art { border-radius: 13px 13px 0 0; overflow: hidden; }
.sqd-card > .sqd-card-art:has(> .sqd-card-badge) { overflow: visible; }
.sqd-card > .sqd-card-art > img { border-radius: 13px 13px 0 0; }
/* The badge: centred on the card's top edge, half outside. */
.sqd-grid .sqd-card { margin-top: 12px; }
.sqd-card .sqd-card-badge { top: -12px; left: 50%; right: auto; translate: -50% 0; z-index: 2; white-space: nowrap; }
.sqd-card:hover { border-color: color-mix(in srgb, var(--tsq-orange) 60%, var(--tsq-line)); transform: translateY(-2px); }
.sqd-card-art { position: relative; aspect-ratio: 1; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tsq-orange) 22%, var(--tsq-bg2)), var(--tsq-bg2)); }
.sqd-card-art img { width: 100%; height: 100%; object-fit: contain; background: var(--on-accent); }
.sqd-card-art > .icon { width: 44px; height: 44px; background: var(--tsq-orange); }
.sqd-card-badge { position: absolute; top: 7px; right: 7px; padding: 5px 11px; border-radius: 99px; font: 800 17px/1 var(--qw-mono, monospace);
  color: var(--on-accent); background: var(--tsq-orange); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
/* One colour per kind of perk (squad-deals.js badgeKind): a percentage stays
   orange; an amount off is red; XP is green; free is black and gold. */
.sqd-card-badge.is-amount { background: var(--game-danger); }
.sqd-card-badge.is-xp { background: #1fa85c; box-shadow: 0 2px 10px rgba(0, 0, 0, .35), 0 0 14px rgba(61, 220, 132, .45); }
.sqd-card-badge.is-free { background: #111318; color: var(--game-gold);   /* bright gold: the badge is always black */ box-shadow: inset 0 0 0 2px var(--game-gold), 0 2px 10px rgba(0, 0, 0, .35), 0 0 14px rgba(255, 207, 61, .35); }
/* Paid in TigerCoins: "Exchange" with the coin, gold like the coins. */
.sqd-card-badge.is-coins { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(180deg, var(--game-gold), var(--game-gold-deep)); color: var(--game-on-gold);
  font-family: var(--qw-display, system-ui); font-size: 15px; letter-spacing: .02em; text-transform: uppercase; }
.sqd-card-badge.is-coins .tcoin { width: 18px; height: 18px; }
.sqd-card-body { display: flex; flex-direction: column; gap: 4px; padding: 9px 10px 10px; flex: 1; }
.sqd-card-partner { font: 700 11px var(--sqr-display); letter-spacing: .14em; text-transform: uppercase; color: var(--tsq-orange); }
/* The partner's site (partnerUrl): the name is a link, an arrow after it. */
.sqd-partner-link { display: inline-flex; align-items: center; gap: 3px; color: inherit; text-decoration: none; cursor: pointer; }
.sqd-partner-link .icon { background: currentColor; opacity: .7; transition: transform .15s, opacity .15s; }
.sqd-partner-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.sqd-partner-link:hover .icon { opacity: 1; transform: translate(1px, -1px); }
/* Side card: the partner's site, a blue call to action (the header's Share blue,
   --info) for every member — distinct from the orange "get my code". */
.sqd-partner-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; border-radius: 10px; text-decoration: none;
  font-size: 13px; font-weight: 700; color: var(--on-accent); border: 0; background: var(--info);
  transition: filter .15s, transform .15s; }
.sqd-partner-btn .icon { background: currentColor; }
.sqd-partner-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sqd-partner-btn:active { transform: translateY(0); }
.sqd-card-body h3 { margin: 0; font-size: 14px; line-height: 1.3; color: var(--tsq-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sqd-card-body p { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--tsq-muted); white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(3 * 1.4em); }
.sqd-card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--tsq-muted); }
.sqd-card-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.sqd-card-meta .icon { background: var(--tsq-muted); }
.sqd-card-actions { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.sqd-code { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 9px; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--tsq-orange) 70%, transparent); background: color-mix(in srgb, var(--tsq-orange) 10%, transparent); color: var(--tsq-text); }
.sqd-code b { font: 800 11px var(--qw-mono, monospace); letter-spacing: .02em; white-space: nowrap; }
.sqd-code .icon { background: var(--tsq-orange); }
.sqd-code.is-copied { border-style: solid; border-color: var(--qw-ok, var(--game-ok)); }
.sqd-code.is-copied .icon { background: var(--qw-ok, var(--game-ok)); }
.sqd-open { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; font-weight: 700; font-size: 12.5px;
  color: var(--on-accent); background: var(--tsq-orange); text-decoration: none; }
.sqd-open .icon { background: var(--on-accent); }
/* A deal above the member's XP: no code, no link — the XP still to earn. */
.sqd-card.is-locked .sqd-card-art { filter: grayscale(.7) brightness(.7); }
.sqd-lock { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.sqd-lock-head { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tsq-text); }
.sqd-lock-head .icon { background: var(--tsq-orange); }
.sqd-lock-bar { height: 4px; border-radius: 99px; background: var(--ink-08); position: relative; overflow: hidden; }
.sqd-lock-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: inherit; background: var(--tsq-orange); }
.sqd-lock small { font-size: 12px; color: var(--tsq-muted); }
/* Unique codes: "Get my code", what is left; "I used it" → the Archived section. */
.sqd-left { align-self: center; font-size: 12px; color: var(--tsq-muted); }
.sqd-get { border: 0; cursor: pointer; }
.sqd-mark { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 13px;
  border: 1px solid var(--tsq-line); background: transparent; color: var(--tsq-muted); }
.sqd-mark:hover { color: var(--tsq-text); border-color: var(--qw-ok, var(--game-ok)); }
.sqd-mark .icon { background: currentColor; }
.sqd-mark { position: relative; overflow: hidden; user-select: none; }
.sqd-mark > :not(.hold-progress) { position: relative; z-index: 1; }
.sqd-mark .hold-progress { background: var(--qw-ok, var(--game-ok)); opacity: .3; }
.sqd-get:disabled, .sqd-mark:disabled { opacity: .5; cursor: progress; }
.sqd-arch-h { margin: 8px 0 0; font: 700 13px var(--sqr-display); letter-spacing: .14em; text-transform: uppercase; color: var(--tsq-muted); }
.sqd-arch-h span { margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--ink-06); }
.sqd-card.is-used { opacity: .6; }
.sqd-card.is-used:hover { opacity: 1; transform: none; }
.sqd-card.is-used .sqd-card-art { filter: grayscale(1); }
.sqd-used-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px; border-radius: 99px; letter-spacing: .06em;
  color: var(--qw-ok, var(--game-ok)); background: color-mix(in srgb, var(--qw-ok, var(--game-ok)) 14%, transparent); }
.sqd-used-tag .icon { background: currentColor; }
/* Ended deals (archived / past their dates, never accepted) and the slim
   "coming soon" line above the history when nothing is live. */
.sqd-card.is-ended { opacity: .55; }
.sqd-card.is-ended .sqd-card-art { filter: grayscale(1); }
.sqd-card.is-ended .sqd-used-tag { color: var(--tsq-muted); background: var(--ink-06); }
.sqd-soon--slim { padding: 22px 24px; }
.sqd-soon--slim h3 { font-size: 18px; }
/* Claimed code countdown (claimDays) and the "valid N days once you get it" hint. */
/* The countdown sits on the illustration, bottom left (dark pill: readable on the white product shot). */
.sqd-timer { position: absolute; left: 7px; bottom: 7px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; white-space: nowrap; border-radius: 99px;
  font: 700 11px var(--qw-mono, monospace); color: var(--tsq-orange); background: rgba(12, 14, 22, .86); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); font-variant-numeric: tabular-nums; }
.sqd-timer .icon { background: currentColor; }
.sqd-timer.is-soon { color: var(--on-accent); background: var(--game-danger); animation: sqd-soon 1.6s ease-in-out infinite; }
@keyframes sqd-soon { 50% { box-shadow: 0 0 0 4px rgba(229, 72, 77, .35); } }
@media (prefers-reduced-motion: reduce) { .sqd-timer.is-soon { animation: none; } }
/* Grid card = a button opening the side card; the open deal's card stays lit. */
.sqd-card[data-open] { cursor: pointer; outline: none; }
.sqd-card[data-open]:focus-visible, .sqd-card.is-selected { border-color: var(--tsq-orange); box-shadow: 0 0 0 1px var(--tsq-orange); }
.sqd-card-state { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 4px; font-size: 11.5px; color: var(--tsq-muted); min-width: 0; }
.sqd-card-state .icon { flex-shrink: 0; background: currentColor; }
.sqd-card-state b { font: 800 11px var(--qw-mono, monospace); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sqd-card-state > i { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.sqd-card-state.is-free { color: var(--game-ok-text); }
.sqd-card-state.is-code { color: var(--game-ok-text); }   /* claimed = done, green like "available" */
.sqd-card-state.is-locked { color: var(--tsq-orange); }
.sqd-card-state.is-out { color: var(--tsq-muted); }
/* Limited deals (a pool of codes): how many are gone, how many are left. */
.sqd-stock { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.sqd-stock-bar { position: relative; height: 6px; border-radius: 99px; overflow: hidden; background: var(--ink-08); }
.sqd-stock-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--game-orange-hi), var(--tsq-orange)); transition: width .4s ease; }
.sqd-stock-txt { font: 700 11px var(--qw-mono, monospace); color: var(--tsq-muted); }
.sqd-stock.is-low .sqd-stock-txt { color: var(--tsq-orange); }
.sqd-stock.is-low .sqd-stock-bar > i { background: linear-gradient(90deg, var(--tsq-orange), var(--game-danger)); }
.sqd-stock.is-out .sqd-stock-bar > i { background: var(--tsq-muted); }
.sqd-stock.is-big { gap: 6px; margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: var(--ink-04); border: 1px solid var(--tsq-line); }
.sqd-stock.is-big .sqd-stock-head { font-size: 12.5px; color: var(--tsq-text); }
.sqd-stock.is-big .sqd-stock-bar { height: 8px; }
/* Filter bar over the live deals: two tabs and a search (applyDealsFilter). */
.sqd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sqd-tabs { display: inline-flex; gap: 6px; }
.sqd-tab { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--tsq-line); background: var(--tsq-card); color: var(--tsq-muted); font-size: 13px; font-weight: 600;
  transition: background .15s, color .15s, border-color .15s; }
.sqd-tab .icon { background: currentColor; }
.sqd-tab:hover { color: var(--tsq-text); border-color: color-mix(in srgb, var(--tsq-orange) 40%, var(--tsq-line)); }
.sqd-tab.is-on { color: var(--on-accent); background: var(--tsq-orange); border-color: var(--tsq-orange); }
.sqd-tab b { min-width: 18px; padding: 1px 6px; border-radius: 99px; font-size: 11px; text-align: center; background: var(--ink-15); }
.sqd-search { flex: 1 1 220px; max-width: 360px; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--tsq-line); background: var(--tsq-card); }
.sqd-search:focus-within { border-color: var(--tsq-orange); }
.sqd-search .icon { background: var(--tsq-muted); flex-shrink: 0; }
.sqd-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--tsq-text); font: inherit; font-size: 13px; }
/* A filter list in the bar (ui-kit selectHtml): the inventory's .inv-brand-filter, at the bar's height, */
.sqd-bar .inv-brand-filter.inv-brand-filter { height: 34px; border-radius: 10px; font-weight: 600;
  border-color: var(--tsq-line); background-color: var(--tsq-card); color: var(--tsq-muted); }
/* …with the tabs' colours: hover like a tab, a choice made like the tab that is on. */
.sqd-bar .inv-brand-filter.inv-brand-filter:hover { color: var(--tsq-text); border-color: color-mix(in srgb, var(--tsq-orange) 40%, var(--tsq-line)); }
.sqd-bar .inv-brand-filter.inv-brand-filter.is-active { color: var(--on-accent); background-color: var(--tsq-orange); border-color: var(--tsq-orange); }
.sqd-nomatch { margin: 0; padding: 24px 0; text-align: center; color: var(--tsq-muted); font-size: 13px; }
.sqd-card[hidden], .sqd-nomatch[hidden] { display: none; }
.sqd-card--skel { gap: 8px; padding-bottom: 12px; }
.sqd-card--skel .sqr-skel { display: block; border-radius: 0; }
.sqd-card--skel .sqd-skel-art { aspect-ratio: 1; border-radius: 13px 13px 0 0; }   /* the card no longer clips (its badge overhangs): the art rounds its own top corners */
.sqd-skel-line.sqd-skel-line { height: 12px; margin: 0 10px; border-radius: 6px; }
.sqd-skel-line.is-short { width: 55%; }
.sqd-skel-line.sqd-skel-line.is-kicker { width: 38%; height: 8px; margin-top: 4px; }
.sqd-skel-line.sqd-skel-line.is-bar { height: 4px; margin-top: 6px; }
.sqd-bar.is-skel { opacity: .55; }
/* Side card — slides in from the right like a spool's detail panel. */
.sqd-side { position: fixed; top: 8px; right: 0; bottom: 8px; z-index: 101; width: 380px; max-width: 95vw; display: flex; flex-direction: column;
  background: var(--tsq-card); border: 1px solid var(--tsq-line); border-right: none; border-radius: 14px 0 0 14px; overflow: hidden auto;
  transform: translateX(100%); visibility: hidden; transition: transform .25s cubic-bezier(.4, 0, .2, 1), visibility 0s .25s, box-shadow .25s; }
.sqd-side.is-open { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.4, 0, .2, 1), visibility 0s, box-shadow .25s; box-shadow: -8px 0 32px rgba(0, 0, 0, .35); }
/* The card being covered by the next one: one slot under it, then closed
   without a slide (it is hidden behind the new card by then). */
.sqd-side.is-under { z-index: 100; transition: none; }
/* The view's scroll fade is a mask, and a mask clips every descendant — the
   side cards live inside the view, so the fade would cut through them: no fade
   while one is open. */
.inv-squad-view.sqd-view.scroll-fade:has(.sqd-side.is-open) { -webkit-mask-image: none; mask-image: none; }
/* The picture runs edge to edge from the top of the side card (like a spool's
   detail panel); the card's own rounded corner and overflow clip it. */
.sqd-side-art { padding: 0; }
.sqd-side-art .sqd-card-art { border-radius: 0; overflow: hidden; }
.sqd-side .sqd-card-badge { top: 12px; right: 12px; font-size: 20px; padding: 6px 13px; }
.sqd-side .sqd-timer { left: 12px; bottom: 12px; font-size: 12px; padding: 5px 10px; }
.sqd-side.is-locked .sqd-side-art .sqd-card-art { filter: grayscale(.7) brightness(.7); }
/* The app's » close tab (.pp-close-tab), riding the side card's left edge. */
.sqd-close-tab.sqd-close-tab { right: -36px; opacity: 0; pointer-events: none;
  transition: right .25s cubic-bezier(.4, 0, .2, 1), opacity .2s, background .15s, width .15s, height .2s cubic-bezier(.34, 1.45, .6, 1); }
.sqd-close-tab.sqd-close-tab.is-open { right: min(380px, 95vw); opacity: 1; pointer-events: auto; }
.sqd-side-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 18px; }
.sqd-side-body h2 { margin: 0; font-size: 19px; text-transform: none; letter-spacing: 0; line-height: 1.25; color: var(--tsq-text); }
.sqd-side-body p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--tsq-muted); white-space: pre-line; }
/* Two steps (get the code → use it), the code with Copy, full-width actions. */
.sqd-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sqd-steps:not(.sqd-steps--how) { flex-direction: row; align-items: center; gap: 8px; font-size: 12.5px; }
.sqd-steps:not(.sqd-steps--how) li { white-space: nowrap; }
.sqd-steps:not(.sqd-steps--how) li + li::before { content: "→"; margin-right: 8px; color: var(--tsq-muted); }
.sqd-steps li { display: flex; align-items: center; gap: 7px; color: var(--tsq-muted); font-size: 12.5px; line-height: 1.35; }
.sqd-steps li > span { width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%;
  font: 800 11px var(--qw-mono, monospace); border: 1px solid var(--tsq-line); color: var(--tsq-muted); }
.sqd-steps li.is-current { color: var(--tsq-text); }
.sqd-steps li.is-current > span { border-color: var(--tsq-orange); color: var(--tsq-orange); }
.sqd-steps li.is-done { color: var(--qw-ok, var(--game-ok)); }
.sqd-steps li.is-done > span { border-color: var(--qw-ok, var(--game-ok)); background: var(--qw-ok, var(--game-ok)); }
.sqd-steps li.is-done > span .icon { background: var(--game-bg); }
.sqd-side-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.sqd-wide { width: 100%; justify-content: center; box-sizing: border-box; padding: 10px 14px; font-size: 13.5px; }
.sqd-code-row { display: flex; align-items: stretch; border-radius: 10px; overflow: hidden;
  border: 1px dashed color-mix(in srgb, var(--tsq-orange) 70%, transparent); background: color-mix(in srgb, var(--tsq-orange) 8%, transparent); }
.sqd-code-row code { flex: 1; min-width: 0; padding: 10px 12px; font: 800 13px var(--qw-mono, monospace); letter-spacing: .06em; color: var(--tsq-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sqd-code-row.is-spent code { color: var(--tsq-muted); letter-spacing: .3em; }
.sqd-code-row .sqd-code { border: 0; border-left: 1px solid color-mix(in srgb, var(--tsq-orange) 40%, transparent); border-radius: 0; padding: 0 12px;
  font-size: 12.5px; font-weight: 700; background: none; }
.sqd-side-actions .sqd-mark { justify-content: center; }
.sqd-side-foot { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--tsq-muted); }
.sqd-side-foot .icon { background: currentColor; }
/* An announcement's side card: its body in light markdown (squad-deals.js mdLite). */
.sqd-side--ann .sqd-side-art .sqd-card-art { background: linear-gradient(135deg, color-mix(in srgb, var(--tsq-orange) 22%, var(--tsq-bg2)), var(--tsq-bg2)); }
.sqd-side--ann .sqd-side-art img { width: 100%; height: 100%; object-fit: contain; padding: 14px; box-sizing: border-box; background: none; }
.sqd-md-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.sqd-md-list li { position: relative; padding-left: 16px; font-size: 12.5px; line-height: 1.45; color: var(--tsq-text); }
.sqd-md-list li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: var(--tsq-orange); }
.sqd-steps--how li { color: var(--tsq-text); }
.sqd-steps--how li > span { border-color: var(--tsq-orange); color: var(--tsq-orange); }
.sqd-side-body h4 { margin: 8px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tsq-orange); }
.sqd-side-body .sqd-md-note { margin-top: 4px; padding: 10px 12px; border-radius: 10px; font-size: 12px;
  background: color-mix(in srgb, var(--tsq-orange) 10%, transparent); color: var(--tsq-text); }
/* Announcements (kind "announcement", managed in the TigerHub admin): an
   information card among the deals, dashed; its art is a transparent
   illustration on the card's warm gradient, not a product on white. */
.sqd-ann { border-style: dashed; border-color: color-mix(in srgb, var(--tsq-orange) 45%, var(--tsq-line)); }
.sqd-ann .sqd-card-art img { background: none; padding: 12px; box-sizing: border-box; }
.sqd-ann .sqd-card-art > .icon { width: 40px; height: 40px; background: var(--tsq-orange); }
.sqd-ann .sqd-open { width: 100%; justify-content: center; white-space: nowrap; }
/* imageOnWhite: a product photo ("deal of the moment") — on white, full square. */
.sqd-ann.is-photo .sqd-card-art img, .sqd-side--ann.is-photo .sqd-side-art img { padding: 0; background: var(--on-accent); object-fit: cover; }
.sqd-side--ann.is-photo .sqd-side-art .sqd-card-art { background: var(--on-accent); }

/* ── TigerCoins (functions/tigerCoins.js) ────────────────────────────────────
   The coin, the balance bar over the deals, coin prices, the surprise envelope
   reveal, the gift-code modal and the gift envelope. */
/* The TigerCoin: the illustrated tiger coin (assets/img/tigercoins/coin.webp). */
.tcoin { display: inline-block; flex-shrink: 0; width: 16px; height: 16px; vertical-align: -3px;
  background: url("../../assets/img/tigercoins/coin.webp") center / contain no-repeat; }
.tcoin--big { width: 38px; height: 38px; filter: drop-shadow(0 0 10px rgba(255, 190, 40, .45)); }
/* The TigerCoins card on the Deals banner's right (.sqr-card, like the other
   Tiger Squad heroes), minimal, one row: the coin and the balance; the
   envelope with how many wait (opens them); a gift icon for a code. */
.sqr-card.sqd-coins { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; }
.sqd-coins-bal { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; font: 800 24px var(--qw-mono, monospace); color: var(--game-gold-text);
  text-shadow: 0 0 14px rgba(255, 190, 40, .35); white-space: nowrap; }
.sqd-coins-env { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 8px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--game-orange), var(--game-danger)); color: var(--on-accent); font: 900 17px var(--qw-mono, monospace);
  box-shadow: 0 0 16px rgba(255, 110, 50, .45); transition: transform .15s, box-shadow .15s; }
.sqd-coins-env img { width: 22px; height: 28px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); animation: tc-env-wiggle 2.6s ease-in-out infinite; }
.sqd-coins-env:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(255, 110, 50, .7); }
/* Envelopes waiting: the button calls — a pulsing halo, a little hop every few
   seconds and a light sweep across it. Still with reduced motion. */
.sqd-coins-env { position: relative; overflow: hidden; animation: sqd-env-call 2.6s ease-in-out infinite; }
.sqd-coins-env::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
  animation: sqd-env-shine 2.6s ease-in-out infinite; }
@keyframes sqd-env-call {
  0%, 100% { transform: none; box-shadow: 0 0 16px rgba(255, 110, 50, .45); }
  8% { transform: translateY(-3px) scale(1.06); }
  16% { transform: translateY(0) scale(1); }
  50% { box-shadow: 0 0 28px 4px rgba(255, 110, 50, .75); }
}
@keyframes sqd-env-shine { 0%, 40% { background-position: -150% 0; } 75%, 100% { background-position: 150% 0; } }
.sqd-coins-env:hover { animation-play-state: paused; }
/* No envelope: the counter still shows (0), quiet, and opens the "how to get some" help. */
.sqd-coins-env.is-empty { animation: none; background: linear-gradient(135deg, #5a3a3e, #3e2a30); color: #e9c9c4; box-shadow: none; }
.sqd-coins-env.is-empty::after { display: none; }
.sqd-coins-env.is-empty img { animation: none; filter: grayscale(.35) drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
@media (prefers-reduced-motion: reduce) { .sqd-coins-env, .sqd-coins-env::after { animation: none; } }
.sqd-coins-env:disabled { opacity: .6; cursor: default; }
/* The card loses the hero cards' own downward offset, which pushed it onto
   the buttons; the stack, centred, clears the desk. */
.sqd-coins-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sqd-coins-wrap > .sqr-card.sqd-coins { top: 0; }
.sqd-coins-acts { display: flex; align-items: center; gap: 10px; }
/* The same three in the header (#topCoins), toned down to sit in the bar like
   the stat cards: one flat card, the balance on top, the envelope count and
   the gift under it — no glow, no animation (the Deals banner keeps those). */
.top-coins.top-coins { flex-direction: column; align-items: stretch; justify-content: center; gap: 4px;
  box-sizing: border-box; height: var(--top-card-h, 68px); padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.top-coins.top-coins[hidden] { display: none; }
.top-coins-acts { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.top-coins .top-coins-bal.top-coins-bal { all: unset; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.top-coins .top-coins-bal[hidden] { display: none; }
.top-coins .sqd-coins-bal { margin: 0; gap: 5px; font: 700 15px var(--qw-mono, monospace); color: var(--text); text-shadow: none; }
.top-coins .tcoin--big { width: 16px; height: 16px; filter: none; }
.top-coins .sqd-coins-env.sqd-coins-env { height: 22px; padding: 0 6px 0 2px; gap: 4px; border-radius: 6px; background: none; box-shadow: none;
  color: var(--text); font: 700 13px var(--qw-mono, monospace); animation: none; transition: background .15s; }
.top-coins .sqd-coins-env.sqd-coins-env::after { display: none; }
.top-coins .sqd-coins-env.sqd-coins-env:hover { transform: none; box-shadow: none; background: color-mix(in srgb, var(--text) 8%, transparent); }
.top-coins .sqd-coins-env.is-empty { color: var(--muted); }
.top-coins .sqd-coins-env img { width: 14px; height: 18px; animation: none; filter: none; }
.top-coins .sqd-coins-gift { width: 22px; height: 22px; min-height: 0; }
.top-coins .sqd-coins-gift img { width: 20px; height: 20px; filter: none; }
.top-coins .sqd-coins-gift:hover img { transform: none; }
/* The code's gift: no frame, the illustrated gift box, which hops on hover. */
.sqd-coins-gift { display: grid; place-items: center; width: 36px; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--tsq-muted); transition: color .15s, transform .15s; }
.sqd-coins-gift img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); transition: transform .15s; }
.sqd-coins-gift:hover img { transform: translateY(-2px) rotate(-6deg) scale(1.08); }
.tc-code-card { width: min(460px, 92vw); padding: 28px 26px 22px; }
.tc-code-ic { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 241, 184, .35), rgba(255, 207, 61, .14)); box-shadow: 0 0 24px rgba(255, 190, 40, .25); }
.tc-code-ic .icon { background: var(--game-gold-text); }
.tc-code-card h3 { margin-bottom: 6px; }
.tc-code-hint { margin: 0 0 20px; font-size: 13px; color: var(--tsq-muted); }
.tc-code-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.tc-code-box { width: 96px; min-width: 0; flex: 0 1 96px; height: 52px; padding: 0; border-radius: 12px; text-align: center;
  border: 1.5px solid var(--tsq-line); background: color-mix(in srgb, var(--game-bg) 70%, transparent); color: var(--game-gold-text);
  font: 800 22px var(--qw-mono, monospace); letter-spacing: .14em; text-indent: .14em; text-transform: uppercase; outline: none;
  transition: border-color .15s, box-shadow .15s; }
.tc-code-box::placeholder { color: color-mix(in srgb, var(--tsq-muted) 45%, transparent); }
.tc-code-box:focus { border-color: var(--game-gold); box-shadow: 0 0 0 4px rgba(255, 207, 61, .15); }
.tc-code-dash { color: var(--tsq-muted); font-weight: 700; }
.tc-code-err { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: var(--danger, var(--game-danger)); }
.tc-code-card .tc-reveal-actions { margin-top: 22px; }
.tc-code-cancel { height: 36px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--tsq-line); background: transparent;
  color: var(--tsq-muted); font-weight: 600; cursor: pointer; }
.tc-code-cancel:hover { color: var(--tsq-text, var(--game-text)); }
.tc-code-card.is-busy .tc-code-box { opacity: .6; }
.tc-code-card.is-wrong .tc-code-box { border-color: var(--danger, var(--game-danger)); }
.tc-code-card.is-wrong .tc-code-row { animation: tc-shake .35s; }
@keyframes tc-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .tc-code-card.is-wrong .tc-code-row { animation: none; } }
.sqd-card-state.is-cost { color: var(--game-gold-text); font-weight: 700; }
.sqd-card-state.is-cost.is-short { color: var(--tsq-muted); }
.sqd-spend .tcoin { margin-right: 2px; }
.sqd-open:disabled { opacity: .45; cursor: not-allowed; }
.sqd-coins-short { text-align: center; font-size: 12px; color: var(--tsq-muted); }
/* The reveal: surprise envelopes flip in one after another, the total counts up. */
.tc-reveal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(5, 7, 12, .72);
  opacity: 0; transition: opacity .2s;
  /* Appended to <body>, outside the Tiger Squad view: carries the local aliases. A stage sits on
     a dark scrim in both themes, so it also gets the dark Game UI tokens (00-base.css, `.tc-reveal`). */
  --tsq-bg: var(--game-bg); --tsq-bg2: var(--game-bg-2); --tsq-card: var(--game-card); --tsq-line: var(--game-line);
  --tsq-text: var(--game-text); --tsq-muted: var(--game-muted); --tsq-orange: var(--game-orange-text); }
.tc-reveal.is-open { opacity: 1; }
.tc-reveal-card { width: min(720px, 92vw); max-height: 86vh; overflow: auto; padding: 22px; border-radius: 18px; background: var(--tsq-card, var(--game-card));
  border: 1px solid color-mix(in srgb, var(--game-gold) 35%, var(--tsq-line, var(--game-line))); text-align: center; }
.tc-reveal-card h3 { margin: 0 0 14px; font: 800 22px var(--sqr-display, system-ui); text-transform: uppercase; letter-spacing: .04em; color: var(--tsq-text, var(--game-text)); }
.tc-reveal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tc-sur { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px 26px; border-radius: 12px;
  background: color-mix(in srgb, var(--rc, var(--game-line-2)) 12%, var(--game-card)); border: 1px solid var(--rc, var(--game-line-2)); color: var(--rc, var(--game-muted));
  opacity: 0; transform: rotateY(90deg) scale(.8); animation: tc-flip .45s cubic-bezier(.34, 1.45, .6, 1) var(--d, 0ms) forwards; }
/* The red envelope the note came out of, open, at the bottom of each card. */
.tc-sur::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 20px;
  background: linear-gradient(160deg, var(--game-danger), var(--danger-hover)); clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%); }
.tc-sur b { font: 800 16px var(--qw-mono, monospace); color: var(--game-gold-text); }
.tc-sur small { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tc-sur--uncommon { --rc: var(--game-ok); } .tc-sur--rare { --rc: var(--tier-rare); } .tc-sur--epic { --rc: var(--tier-epic); }
.tc-sur--legendary { --rc: var(--game-gold-deep); box-shadow: 0 0 22px rgba(255, 178, 26, .45); }
.tc-sur--more { --rc: var(--game-line-2); justify-content: center; }
@keyframes tc-flip { to { opacity: 1; transform: none; } }
.tc-reveal-sum { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; margin: 14px 0 4px; font-size: 12px; }
.tc-sum { color: var(--tsq-muted, var(--game-muted)); } .tc-sum--uncommon { color: var(--game-ok-text); } .tc-sum--rare { color: var(--tier-rare); } .tc-sum--epic { color: var(--tier-epic); } .tc-sum--legendary { color: var(--game-gold-text); }
.tc-reveal-total { margin: 6px 0 16px; font: 800 30px var(--qw-mono, monospace); color: var(--game-gold-text); text-shadow: 0 0 22px rgba(255, 190, 40, .4); }
.tc-reveal-actions { display: flex; justify-content: center; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .tc-sur { animation-duration: .01s; } }
/* TigerCoins envelope (squad-deals.js showEnvelope): a red envelope with a gold
   seal; opening lifts the flap and slides up the note with what it held. */
/* Give to a friend (showEnvelope `give`): the button under "Open", then the
   friends to pick from, today's allowance, a held button that sends. */
.tc-env-give, .tp-gift { display: inline-flex; align-items: center; gap: 8px; }
.tp-gift img { width: 20px; height: 20px; object-fit: contain; }
.tp-gift-row { display: flex; justify-content: center; margin-top: 10px; }   /* under "Open ×10", on its own line */
.tc-env-give img { width: 20px; height: 20px; object-fit: contain; }
.tc-give { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.tc-reveal-actions:has(> .tc-give) { margin-top: 0; }   /* the search sits right under the title */
.tc-give-left { margin: 0; font-size: 12.5px; color: var(--tsq-muted); }
.tc-give-count { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--game-gold-text); text-align: center; }   /* the day's gifts: sent · left */
.tc-give-left.is-none { color: var(--game-danger-text); }
/* The friends as a grid of avatars (name under), the picked one ringed and
   checked; scrolls without a visible scrollbar. */
.tc-give-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 6px; height: 236px; overflow-y: auto;   /* fixed height: the modal keeps its size while the search filters */
  padding: 4px; scrollbar-width: none; }
.tc-give-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sqd-search.tc-give-search { flex: none; max-width: none; width: 100%; box-sizing: border-box; }
.tc-give-f[hidden] { display: none; }
.tc-give-f { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: auto; padding: 10px 4px 8px; border-radius: 12px; cursor: pointer;   /* height: auto beats the global button height */
  border: 1px solid transparent; background: none; color: var(--tsq-text); transition: background-color .15s, border-color .15s; }
.tc-give-f:hover:not(:disabled) { background: var(--ink-06); }
.tc-give-f[aria-checked="true"] { border-color: var(--game-gold); background: color-mix(in srgb, var(--game-gold) 10%, transparent); }
.tc-give-f:disabled { opacity: .45; cursor: default; }
.tc-give-av { position: relative; }
.tc-give-av .sqb-avatar { width: 46px; height: 46px; font-size: 16px; }
.tc-give-check { position: absolute; right: -4px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; display: none; place-items: center;
  background: var(--game-gold); color: var(--game-on-gold); box-shadow: 0 0 0 2px #151a33; }
.tc-give-check .icon { background: currentColor; }
.tc-give-f[aria-checked="true"] .tc-give-check { display: grid; }
/* The envelopes to give (picked from the pile, contents never shown): a hand
   of envelopes overlapping each other; a checked one rises out of the pile
   (several can), a hovered one lifts a little. Their names are in aria-label. */
.tc-give-envs { display: flex; justify-content: center; padding: 24px 4px 6px; }
/* --r / --y (set per envelope): its angle and drop in the fan. */
.tc-give-env.tc-give-env { flex: 0 0 auto; padding: 0; margin-left: -30px; border: 0; background: none;
  transform: translateY(var(--y)) rotate(var(--r)); transform-origin: 50% 120%; transition: transform .22s ease; }
.tc-give-env.tc-give-env:first-child { margin-left: 0; }
.tc-give-env.tc-give-env:hover:not(:disabled) { background: none; transform: translateY(calc(var(--y) - 6px)) rotate(var(--r)); }
.tc-give-env.tc-give-env[aria-checked="true"] { background: none; transform: translateY(calc(var(--y) - 22px)) rotate(var(--r)); }   /* rises in place: stays behind its right-hand neighbour */
.tc-give-env .tc-give-name { display: none; }
.tc-give-env-img { width: 58px; aspect-ratio: 821 / 1024; object-fit: contain; display: block; filter: drop-shadow(-3px 3px 4px rgb(0 0 0 / .4)); }
@media (prefers-reduced-motion: reduce) { .tc-give-env.tc-give-env { transition: none; } }
.tc-give-name { max-width: 100%; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-env-card.is-given .tc-env { animation: tc-give-fly .9s cubic-bezier(.5, 0, .7, .2) forwards; }
@keyframes tc-give-fly { to { transform: translate(140px, -120px) rotate(18deg) scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tc-env-card.is-given .tc-env { animation: none; opacity: .4; } }
/* The glints round the envelope go with it once it is opened or given. */
.tc-env-card.is-opened .tch-glints, .tc-env-card.is-given .tch-glints { display: none; }
/* The gift envelope (showEnvelope): the gift-code modal's frame (.tcx--help) —
   the illustrated envelope rising from behind the card (.tch-env), the plaque,
   the message, the prize (coin + amount) that pops in once opened, when the
   envelope flies off. */
.tc-env-card .tc-env-msg { min-height: 18px; margin: 0; font-size: 14px; font-weight: 600; color: var(--game-text-2); }
.tc-env-prize { display: none; align-items: center; justify-content: center; gap: 14px; }
.tc-env-prize img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 0 18px rgba(255, 200, 60, .55)); }
.tc-env-prize span { display: flex; flex-direction: column; align-items: flex-start; }
.tc-env-amount { font: 900 44px/1 var(--qw-mono, monospace); color: var(--game-gold-text); text-shadow: 0 0 22px rgba(255, 190, 40, .5); }
.tc-env-unit { font-size: 12px; font-weight: 800; color: var(--game-gold-text); text-transform: uppercase; letter-spacing: .08em; }
.tc-env-card.is-opened .tc-env-prize { display: flex; animation: tc-prize-pop .45s cubic-bezier(.2, .8, .2, 1.4); }
.tc-env-card.is-opened .tc-env { animation: tc-env-away .5s ease-in forwards; }
@keyframes tc-prize-pop { from { opacity: 0; transform: scale(.5); } }
@keyframes tc-env-away { to { opacity: 0; transform: translateY(-40px) scale(.7) rotate(-8deg); } }
/* A friend's envelope: their avatar sits on the gold seal (envelope.webp: seal
   centre at 50% / 39% of the art, Ø 39% of its width); opening, the seal pops
   off before the envelope flies away and the coins come in. */
.tch-env-seal { position: absolute; left: 50%; top: calc(140px * 1.25 * .39); width: 33%; aspect-ratio: 1; translate: -50% -50%; z-index: 1; font-size: 15px;
  border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2px #ffd24a, 0 2px 6px rgba(0, 0, 0, .45);
  /* Turns with the envelope: the same rotation, around the art's centre (19 px below the seal's). */
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-origin: 50% calc(50% + 19px); transition: transform .18s ease-out; }
.tc-env-card.is-opened .tch-env-seal { animation: tch-seal-pop .45s cubic-bezier(.3, 1.4, .5, 1) forwards; }
.tc-env-card.is-opened .tch-env-tilt:has(.tch-env-seal) .tc-env { animation-delay: .25s; }
@keyframes tch-seal-pop { 40% { transform: scale(1.35); opacity: 1; } to { transform: scale(.2) translateY(-60px) rotate(25deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tc-env-card.is-opened .tch-env-seal { animation: none; opacity: 0; } }
.tc-env-rank { margin: 0; font-size: 13px; font-weight: 700; color: var(--game-gold-text); }
.tc-env-card .tc-reveal-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.tc-env-card .tc-reveal-actions > .tc-code-cancel { min-width: 200px; }
@keyframes tc-env-wiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-3deg); } 88% { transform: rotate(3deg); } 92% { transform: rotate(-2deg); } 96% { transform: rotate(1deg); } }
@media (prefers-reduced-motion: reduce) {
  .tc-env-card.is-opened .tc-env-prize, .tc-env-card.is-opened .tc-env { animation: none; }
  .tc-env-card.is-opened .tc-env { opacity: 0; }
}
.tc-env-mini { display: inline-block; width: 13px; height: 16px; flex-shrink: 0; background: url("../../assets/img/tigercoins/envelope.webp") center / contain no-repeat; }
/* TigerCoins chest (squad-deals.js showChest): a box in its type's colour
   (--cc) with gold bands; opening lifts the lid and spills a light, then its
   envelopes are revealed. */
.tc-chest-card { width: min(420px, 92vw); padding: 26px 24px 22px; }
.tc-chest-card .tc-reveal-actions { margin-top: 22px; }
.tc-chest-card h3 { margin-bottom: 4px; color: color-mix(in srgb, var(--cc) 55%, #fff); }
.tc-chest { position: relative; display: block; width: 200px; height: 170px; margin: 6px auto 0; perspective: 600px; }
.tc-chest-body { position: absolute; left: 0; right: 0; bottom: 0; height: 104px; border-radius: 6px 6px 14px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 85%, #fff 15%), color-mix(in srgb, var(--cc) 70%, #000 30%));
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .18), 0 14px 30px color-mix(in srgb, var(--cc) 40%, transparent);
  background-image: linear-gradient(90deg, transparent 18%, var(--game-gold) 18% 25%, transparent 25% 75%, var(--game-gold) 75% 82%, transparent 82%),
    linear-gradient(180deg, color-mix(in srgb, var(--cc) 85%, #fff 15%), color-mix(in srgb, var(--cc) 70%, #000 30%)); }
.tc-chest-lock { position: absolute; left: 50%; top: 10px; width: 28px; height: 32px; transform: translateX(-50%); border-radius: 6px;
  background: radial-gradient(circle at 50% 40%, #3b2a00 0 4px, transparent 5px), linear-gradient(180deg, var(--game-gold-hi), var(--game-gold-deep)); box-shadow: 0 0 0 2px rgba(0, 0, 0, .2); }
.tc-chest-lid { position: absolute; z-index: 2; left: -4px; right: -4px; bottom: 100px; height: 56px; border-radius: 40px 40px 6px 6px; transform-origin: bottom center;
  background-image: linear-gradient(90deg, transparent 18%, var(--game-gold) 18% 25%, transparent 25% 75%, var(--game-gold) 75% 82%, transparent 82%),
    linear-gradient(180deg, color-mix(in srgb, var(--cc) 75%, #fff 25%), color-mix(in srgb, var(--cc) 85%, #000 15%));
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .15); transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.tc-chest-glow { position: absolute; z-index: 1; left: 50%; bottom: 80px; width: 10px; height: 10px; border-radius: 50%; transform: translateX(-50%);
  background: var(--game-gold-hi); box-shadow: 0 0 0 0 rgba(255, 220, 120, .0); opacity: 0; transition: box-shadow .5s .25s, opacity .3s .2s; }
.tc-chest-card.is-opened .tc-chest-lid { transform: rotateX(-115deg); }
.tc-chest-card.is-opened .tc-chest-glow { opacity: 1; box-shadow: 0 0 60px 40px rgba(255, 220, 120, .55); }
.tc-chest-card:not(.is-opened) .tc-chest { animation: tc-env-wiggle 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .tc-chest-card:not(.is-opened) .tc-chest { animation: none; }
  .tc-chest-lid, .tc-chest-glow { transition: none; }
}
/* TigerCoins pulls (quests/coin-pull.js) — "Tiger Arcade Jackpot", gacha ×
   casino: no panel — the envelope, the cards and the controls float over the
   dimmed app, a turning spotlight behind them; the big red envelope; each rarity reveals a card of its own MATERIAL — matte
   paper, green enamel, blue holo, purple neon, solid gold jackpot. */
.tc-reveal.tp { background: rgba(3, 4, 8, .9); }
.tpx { position: relative; width: min(780px, 96vw); display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 26px 24px; text-align: center; user-select: none; }
.tpx-head { position: relative; z-index: 2; align-self: stretch; display: flex; justify-content: flex-end; margin: 4px 6px 0; }
.tpx-ic { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--tsq-line);
  background: color-mix(in srgb, var(--game-bg) 70%, transparent); color: var(--tsq-muted); cursor: pointer; }
.tpx-ic:hover { color: var(--tsq-text); }
.tpx-ic .icon { background: currentColor; }
.tpx-sound.is-off::after { content: ""; position: absolute; width: 2px; height: 20px; background: currentColor; transform: rotate(45deg); border-radius: 2px; }
.tpx-stage { position: relative; z-index: 1; width: 100%; height: 440px; display: grid; place-items: center; }
.tpx-fx { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); pointer-events: none; z-index: 5; }
.tpx-body { position: relative; z-index: 2; display: grid; place-items: center; }
/* The spotlight: two soft beams turning slowly behind everything. */
.tpx-spot { position: absolute; left: 50%; top: 50%; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 20deg, rgba(120, 150, 255, .10) 30deg, transparent 50deg 200deg, rgba(255, 140, 210, .08) 215deg, transparent 235deg);
  mask: radial-gradient(circle, #000 25%, transparent 70%); animation: tpx-spin 14s linear infinite; }
@keyframes tpx-spin { to { transform: rotate(360deg); } }
.tpx-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tpx-foot { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 44px; }
.tpx-total { margin: 0; font: 900 40px var(--qw-mono, monospace); color: var(--game-gold-text); text-shadow: 0 2px 0 #7a4a00, 0 0 24px rgba(255, 190, 40, .7); }
/* A ×N's counts and total: they pop up below the cards, float up over them
   and stay above them until the member moves on — no backdrop, out of the
   layout (the cards never move); a dark outline keeps them readable. */
.tpx-float { position: absolute; left: 50%; bottom: 0; z-index: 7; pointer-events: none; white-space: nowrap;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transform: translate(-50%, 0); opacity: 0; animation: tpx-float 1.6s cubic-bezier(.2, .8, .3, 1) .15s forwards; }
.tpx-float .tc-reveal-sum { margin: 0 0 6px; }
/* The rarity counts as badges: a pill in each rarity's colour. */
.tpx-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 640px; }
.tpx-badges .tc-sum { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 99px;
  font: 800 13px var(--sqr-display, system-ui); letter-spacing: .04em; text-transform: uppercase;
  background: color-mix(in srgb, currentColor 16%, rgba(8, 10, 20, .7)); box-shadow: inset 0 0 0 1.5px currentColor, 0 0 14px color-mix(in srgb, currentColor 35%, transparent); }
.tpx-badges .tc-sum b { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px;
  background: var(--bc); color: var(--game-bg); font: 900 13px var(--qw-mono, monospace); }
.tpx-badges .tc-sum--common { color: #c3c9d9; --bc: #c3c9d9; }
.tpx-badges .tc-sum--uncommon { --bc: var(--game-ok); } .tpx-badges .tc-sum--rare { --bc: var(--tier-rare); }
.tpx-badges .tc-sum--epic { --bc: var(--tier-epic); } .tpx-badges .tc-sum--legendary { --bc: var(--game-gold-deep); }
.tpx-float .tpx-total { font-size: 46px; text-shadow: 0 3px 0 #7a4a00, 0 0 3px #000, 0 0 3px #000, 0 0 26px rgba(255, 190, 40, .8); }
@keyframes tpx-float {
  0% { opacity: 0; transform: translate(-50%, 30px) scale(.6); }
  14% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  24% { transform: translate(-50%, 0) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -455px) scale(1); } }

/* The pile: the big envelope floats, a light sweeps over it; hold → ring fills. */
.tpx-pile { position: relative; width: 210px; height: 262px; min-height: 0; padding: 0; border: 0; background: none; cursor: pointer;
  animation: tpx-bob 3s ease-in-out infinite; }
/* The tilt layer follows the mouse (coin-pull.js tilt): 3D turn + a glare. */
.tpx-pile { perspective: 700px; }
.tpx-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .18s ease-out; }
.tpx-tilt:not(.is-tilted) { transition: transform .6s cubic-bezier(.2, 1.4, .4, 1); }
.tpx-glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; mix-blend-mode: soft-light;
  -webkit-mask: url("../../assets/img/tigercoins/envelope.webp") center / contain no-repeat; mask: url("../../assets/img/tigercoins/envelope.webp") center / contain no-repeat;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 45%); }
.tpx-tilt.is-tilted .tpx-glare { opacity: 1; }
.tpx-pile .tpx-env { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .5)) drop-shadow(0 0 22px rgba(255, 80, 80, .25)); }
.tpx-env-shine { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url("../../assets/img/tigercoins/envelope.webp") center / contain no-repeat; mask: url("../../assets/img/tigercoins/envelope.webp") center / contain no-repeat;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 47%, transparent 58%) -200% 0 / 250% 100% no-repeat;
  animation: tpx-sheen 3.2s ease-in-out infinite; }
@keyframes tpx-sheen { 0%, 45% { background-position: 200% 0; } 85%, 100% { background-position: -100% 0; } }
@keyframes tpx-bob { 50% { transform: translateY(-8px) rotate(-1deg); } }
.tpx-pile.is-holding { animation: tpx-tremble .09s linear infinite; }
@keyframes tpx-tremble { 25% { transform: translate(-1.5px, 1px) rotate(-.8deg); } 75% { transform: translate(1.5px, -1px) rotate(.8deg); } }
.tpx-ring { position: absolute; left: 50%; top: 50%; width: 300px; height: 300px; margin: -150px 0 0 -150px; pointer-events: none; transform: rotate(-90deg); }
.tpx-ring circle { fill: none; stroke: var(--ink-08); stroke-width: 2.5; }
.tpx-ring .tpx-ring-fill { stroke: var(--game-gold-text); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--hold, 0) * 100);
  filter: drop-shadow(0 0 4px var(--game-gold)); opacity: min(1, calc(var(--hold, 0) * 20)); }

/* ×1: the envelope shakes while its glow climbs (--rc), then the card rises. */
.tpx-one { position: relative; width: 300px; height: 420px; display: grid; place-items: center; --glow: 0;
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out; }
.tpx-one:not(.is-tilted) { transition: transform .6s cubic-bezier(.2, 1.4, .4, 1); }
/* The revealed card's light follows the mouse too. */
.tpx-one.is-tilted .tpx-card-shine { animation: none; mix-blend-mode: overlay; opacity: 1;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .9), transparent 50%); }
.tpx-one .tpx-env { position: absolute; width: 210px; transition: transform .45s cubic-bezier(.5, 0, .5, 1), opacity .4s .1s, filter .2s;
  filter: drop-shadow(0 0 calc(8px + var(--glow) * 1px) var(--rc)) drop-shadow(0 0 30px var(--rc)); }
.tpx-one[data-r="1"] { --glow: 6; } .tpx-one[data-r="2"] { --glow: 12; } .tpx-one[data-r="3"] { --glow: 20; } .tpx-one[data-r="4"] { --glow: 30; }
.tpx-env.is-shaking { animation: tpx-shake .14s linear infinite; }
@keyframes tpx-shake { 25% { transform: translate(-2px, 1px) rotate(-1.2deg); } 75% { transform: translate(2px, -1px) rotate(1.2deg); } }
.tpx-one.is-step .tpx-env { animation: tpx-step .3s ease-out, tpx-shake .14s linear infinite; }
@keyframes tpx-step { 40% { transform: scale(1.08); } }
.tpx-one.is-open .tpx-env { transform: translateY(110px) scale(.82); opacity: 0; }
.tpx-one > .tpx-card { position: absolute; opacity: 0; transform: translateY(60px) scale(.5) rotate(-6deg); }
.tpx-one.is-open > .tpx-card { animation: tpx-rise .55s cubic-bezier(.2, 1.5, .4, 1) .15s forwards; }
@keyframes tpx-rise { to { opacity: 1; transform: none; } }
/* Rays behind an epic (purple) or a legendary (gold). */
.tpx-rays { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(var(--rc) 0 7deg, transparent 7deg 20deg); mask: radial-gradient(circle, #000 12%, transparent 62%); }
.tpx-one.is-open[data-r="3"] .tpx-rays { opacity: .35; animation: tpx-spin 9s linear infinite; transition: opacity .6s; }
.tpx-one.is-open[data-r="4"] .tpx-rays { opacity: .55; animation: tpx-spin 6s linear infinite; transition: opacity .4s; }
.tpx-stage.is-legend::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9;
  background: radial-gradient(circle, rgba(255, 236, 170, .9), rgba(255, 178, 26, .5) 40%, transparent 75%); animation: tpx-flash .9s ease-out forwards; }
@keyframes tpx-flash { to { opacity: 0; } }
.tpx-stage.is-legend { animation: tpx-quake .4s ease-out; }
@keyframes tpx-quake { 15% { transform: translate(-4px, 2px); } 30% { transform: translate(4px, -2px); } 45% { transform: translate(-3px, -1px); } 60% { transform: translate(2px, 1px); } }

/* Per-rarity colours of the full-screen layer (coin-pull.js rarityFx). */
.tpx-legend.is-r2 { --lc1: #bfe0ff; --lc2: var(--tier-rare); --lr: rgba(120, 180, 255, .3); }
.tpx-legend.is-r3 { --lc1: #f0d9ff; --lc2: var(--tier-epic); --lr: rgba(190, 120, 255, .34); }
.tpx-legend.is-r4 { --lc1: var(--game-gold-hi); --lc2: var(--game-gold-deep); --lr: color-mix(in srgb, var(--game-gold) 38%, transparent); }
.tpx-legend.is-r2 .lg-flash { animation-duration: .6s; opacity: 0; }
.tpx-legend.is-r3 .lg-dim { animation: lg-dim-epic 2.4s ease-out forwards; }
@keyframes lg-dim-epic { 0% { opacity: 0; } 15% { opacity: .85; } 100% { opacity: .55; } }
.tpx-legend.is-r3 .lg-title b { font-size: clamp(34px, 6vw, 84px);
  background: linear-gradient(100deg, #6b21a8, #d9a8ff 30%, #ffffff 45%, #d9a8ff 60%, var(--tier-epic)) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 3px 0 #2e1065) drop-shadow(0 0 26px rgba(168, 85, 247, .9)); }
/* Epic lightning: the screen flickers neon twice. */
.tpx-legend .lg-bolt { position: absolute; inset: 0; background: radial-gradient(circle at var(--cx) var(--cy), rgba(230, 200, 255, .55), transparent 60%);
  opacity: 0; animation: lg-bolt .9s steps(1) .45s; }
@keyframes lg-bolt { 0% { opacity: 1; } 12% { opacity: 0; } 22% { opacity: .8; } 30% { opacity: 0; } 55% { opacity: .5; } 62% { opacity: 0; } }
/* A legendary takes the whole screen (coin-pull.js legendFx): the room goes
   dark, a flash, two shockwaves and god rays from the card (--cx/--cy), a
   full-screen fountain of coins, a LEGENDARY banner sweeping through; the card
   slams in from the foreground. */
.tpx-legend { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; --cx: 50vw; --cy: 50vh; }
/* The stage stays above the legendary layer: the card is always in front. */
.tc-reveal.tp > .tpx { z-index: 1; }
.tpx-legend .lg-dim { position: absolute; inset: 0; background: radial-gradient(circle at var(--cx) var(--cy), rgba(60, 30, 0, .2), rgba(0, 0, 0, .85) 70%);
  opacity: 0; animation: lg-dim 3s ease-out forwards; }
@keyframes lg-dim { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: .7; } }
.tpx-legend .lg-rays { position: absolute; left: var(--cx); top: var(--cy); width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(var(--lr, color-mix(in srgb, var(--game-gold) 38%, transparent)) 0 5deg, transparent 5deg 15deg);
  mask: radial-gradient(circle, #000 4%, transparent 45%); opacity: 0; animation: lg-rays-in .8s ease-out .35s forwards, tpx-spin 18s linear infinite; }
@keyframes lg-rays-in { to { opacity: 1; } }
.tpx-legend .lg-ring { position: absolute; left: var(--cx); top: var(--cy); width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 6px solid var(--lc1, var(--game-gold-hi)); box-shadow: 0 0 30px var(--lc2, var(--game-gold-deep)), inset 0 0 30px var(--lc2, var(--game-gold-deep)); opacity: 0; animation: lg-ring 1.1s cubic-bezier(.1, .7, .3, 1) .4s forwards; }
.tpx-legend .lg-ring--2 { animation-delay: .62s; border-width: 3px; }
@keyframes lg-ring { 0% { opacity: 1; transform: scale(.2); } 100% { opacity: 0; transform: scale(60); } }
.tpx-legend .lg-flash { position: absolute; inset: 0; background: radial-gradient(circle at var(--cx) var(--cy), var(--game-gold-hi), var(--lc1, rgba(255, 210, 90, .9)) 25%, transparent 70%);
  opacity: 0; animation: lg-flash 1s ease-out .38s forwards; }
@keyframes lg-flash { 0% { opacity: 0; } 8% { opacity: 1; } 100% { opacity: 0; } }
.tpx-legend .lg-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
/* An earlier layer under a newer one (epic + legendary in a ×10): its banner
   steps aside, its rays keep turning — the other way, under the gold. */
.tpx-legend.is-under .lg-title { opacity: 0; transition: opacity .3s; }
.tpx-legend.is-under .lg-rays { animation: lg-rays-in .8s ease-out .35s forwards, tpx-spin 22s linear infinite reverse; }
/* The recap floats up: the banners fade out to leave it the top of the screen. */
.tc-reveal.is-recap .tpx-legend .lg-title { opacity: 0; transition: opacity .35s; }
.tpx-legend .lg-title { position: absolute; left: 0; right: 0; top: 9vh; display: flex; justify-content: center; }
.tpx-legend .lg-title b { font: 900 clamp(40px, 8vw, 110px) var(--sqr-display, system-ui); letter-spacing: .14em; text-transform: uppercase; line-height: 1;
  background: linear-gradient(100deg, #b86b00, var(--game-gold) 30%, var(--game-gold-hi) 45%, var(--game-gold) 60%, var(--game-gold-deep)) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #5a2e00) drop-shadow(0 0 30px rgba(255, 190, 40, .8));
  opacity: 0; animation: lg-title 1s cubic-bezier(.2, 1.5, .4, 1) .7s forwards, lg-title-shine 2.2s linear 1.5s infinite; }
@keyframes lg-title { 0% { opacity: 0; transform: scale(2.4) translateY(-20px); letter-spacing: .5em; } 100% { opacity: 1; transform: none; } }
@keyframes lg-title-shine { to { background-position: -250% 0; } }
/* The legendary card slams in from the foreground and the screen shakes. */
.tpx-one.is-open[data-r="4"] > .tpx-card { animation: tpx-slam .75s cubic-bezier(.2, 1.3, .3, 1) .5s forwards; z-index: 9; }
.tpx-one.is-open[data-r="3"] > .tpx-card { animation: tpx-slam-epic .6s cubic-bezier(.2, 1.3, .3, 1) .45s forwards; }
@keyframes tpx-slam-epic { 0% { opacity: 0; transform: scale(2) rotate(-8deg); filter: blur(4px) brightness(1.8); } 60% { opacity: 1; transform: scale(.94); filter: none; } 100% { opacity: 1; transform: none; } }
@keyframes tpx-slam { 0% { opacity: 0; transform: scale(3) rotate(-14deg); filter: blur(6px) brightness(2); } 55% { opacity: 1; transform: scale(.9) rotate(2deg); filter: none; } 100% { opacity: 1; transform: none; } }
.tc-reveal.tp:has(.tpx-legend.is-r4) .tpx { animation: lg-quake .55s ease-out .9s; }
.tc-reveal.tp:has(.tpx-legend.is-r3) .tpx { animation: lg-quake .35s ease-out .8s; }
@keyframes lg-quake { 10% { transform: translate(-10px, 6px); } 25% { transform: translate(9px, -7px); } 40% { transform: translate(-7px, -4px); } 55% { transform: translate(6px, 5px); } 75% { transform: translate(-3px, 2px); } }
.tpx-slot.is-star:has(.r4), .tpx-slot.is-star:has(.r3) { z-index: 9; }

/* The card: one material per rarity. */
.tpx-card { position: relative; width: 260px; height: 360px; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; border: 3px solid var(--game-bg); isolation: isolate; }
.tpx-card-coin { width: 112px; height: 112px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.tpx-card-amt { font: 900 54px var(--qw-mono, monospace); line-height: 1; }
.tpx-card-rar { padding: 5px 14px; border-radius: 99px; font: 800 15px var(--sqr-display, system-ui); letter-spacing: .14em; text-transform: uppercase; }
.tpx-card-shine { position: absolute; inset: 0; z-index: 3; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .85) 45%, transparent 60%) 200% 0 / 250% 100% no-repeat;
  animation: tpx-sheen 2.6s ease-in-out infinite; }
/* Common — matte paper. */
.tpx-card.r0 { background: linear-gradient(180deg, #eef0f5, #cdd2de); color: #2a3045; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
.tpx-card.r0 .tpx-card-rar { background: #9aa3bd; color: #fff; }
.tpx-card.r0 .tpx-card-shine { opacity: .45; }
/* Uncommon — green enamel with a bright rim. */
.tpx-card.r1 { background: radial-gradient(circle at 50% 30%, #4ff09a, #179a57 70%); color: #fff;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .35), inset 0 0 0 7px #0f6b3c, 0 0 22px rgba(61, 220, 132, .45); }
.tpx-card.r1 .tpx-card-amt { text-shadow: 0 2px 0 #0f6b3c; }
.tpx-card.r1 .tpx-card-rar { background: #0f6b3c; color: #b6ffd4; }
/* Rare — blue holo: a rainbow foil drifts across it. */
.tpx-card.r2 { background: linear-gradient(160deg, #2f7bff, #12348a); color: #fff; box-shadow: 0 0 28px rgba(61, 139, 255, .6), inset 0 0 0 3px rgba(190, 220, 255, .6); }
.tpx-card.r2::before { content: ""; position: absolute; inset: 0; z-index: 1; mix-blend-mode: overlay; opacity: .5;
  background: repeating-linear-gradient(120deg, #ff6bd6 0 8%, #6bfff0 12% 20%, #fff36b 24% 32%, #8a6bff 36% 44%) 0 0 / 300% 300%;
  animation: tpx-holo 4s linear infinite; }
@keyframes tpx-holo { to { background-position: 300% 300%; } }
.tpx-card.r2 > * { z-index: 2; }
.tpx-card.r2 .tpx-card-amt { text-shadow: 0 0 12px rgba(160, 210, 255, .9); }
.tpx-card.r2 .tpx-card-rar { background: rgba(10, 30, 80, .55); color: #cfe3ff; }
/* Epic — purple neon: a dark core, a light running round the rim. */
.tpx-card.r3 { background: radial-gradient(circle at 50% 35%, #3a1d63, #160b29 75%); color: #f1e2ff; border-color: transparent;
  box-shadow: 0 0 34px rgba(168, 85, 247, .7), 0 0 80px rgba(168, 85, 247, .3); }
.tpx-card.r3::before { content: ""; position: absolute; inset: -60%; z-index: -1; background: conic-gradient(var(--tier-epic), #ff6bd6, #6be4ff, var(--tier-epic)); animation: tpx-spin 2.2s linear infinite; }
.tpx-card.r3::after { content: ""; position: absolute; inset: 3px; z-index: -1; border-radius: 19px; background: radial-gradient(circle at 50% 35%, #3a1d63, #160b29 75%); }
.tpx-card.r3 .tpx-card-amt { color: #fff; text-shadow: 0 0 8px var(--tier-epic), 0 0 20px var(--tier-epic); }
.tpx-card.r3 .tpx-card-rar { background: var(--tier-epic); color: #fff; box-shadow: 0 0 12px var(--tier-epic); }
/* Legendary — solid gold jackpot, crown on top. */
.tpx-card.r4 { overflow: visible; background: linear-gradient(160deg, #fff1b8, var(--game-gold) 35%, var(--game-gold-deep) 75%, #b86b00); color: #5a2e00; border-color: #5a2e00;
  box-shadow: 0 0 40px rgba(255, 190, 40, .8), 0 0 100px rgba(255, 178, 26, .45), inset 0 0 0 4px rgba(255, 250, 220, .7);
  animation: tpx-gold 1.6s ease-in-out infinite; }
@keyframes tpx-gold { 50% { box-shadow: 0 0 60px rgba(255, 210, 90, .95), 0 0 140px rgba(255, 178, 26, .55), inset 0 0 0 4px rgba(255, 250, 220, .9); } }
.tpx-card.r4 .tpx-card-shine { mix-blend-mode: soft-light; border-radius: 19px; }
.tpx-card.r4 .tpx-card-amt { font-size: 62px; text-shadow: 0 2px 0 #fff4c2; }
.tpx-card.r4 .tpx-card-rar { background: #5a2e00; color: var(--game-gold-text); }
.tpx-crown { position: absolute; top: -86px; left: 50%; width: 170px; transform: translateX(-50%) rotate(-6deg); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4));
  animation: tpx-crown 1.2s cubic-bezier(.2, 1.6, .4, 1) .55s both; }
@keyframes tpx-crown { from { transform: translateX(-50%) translateY(-40px) scale(.3); opacity: 0; } }

/* ×N: a fan of face-down cards, flipped in cascade. */
.tpx-fan { display: grid; grid-template-columns: repeat(5, 130px); gap: 14px; }
.tpx-fan:not(.is-two) { grid-template-columns: repeat(var(--n, 5), 130px); }
.tpx-slot { position: relative; width: 130px; height: 176px; perspective: 600px; animation: tpx-deal .35s cubic-bezier(.2, 1.3, .4, 1) calc(var(--i) * 30ms) both; }
@keyframes tpx-deal { from { opacity: 0; transform: translateY(40px) scale(.6) rotate(-10deg); } }
/* Each ×N card follows the mouse (coin-pull.js tilt), its light too. */
.tpx-slot-tilt { position: absolute; inset: 0; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d;
  transition: transform .18s ease-out; }
.tpx-slot-tilt:not(.is-tilted) { transition: transform .6s cubic-bezier(.2, 1.4, .4, 1); }
.tpx-slot-tilt.is-tilted .tpx-card-shine { animation: none; mix-blend-mode: overlay; opacity: 1;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .85), transparent 55%); }
.tpx-back { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease-in, opacity .2s .1s; }
.tpx-card.is-mini { position: absolute; inset: 0; width: 130px; height: 176px; border-radius: 14px; border-width: 2px; gap: 5px;
  transform: rotateY(-90deg); opacity: 0; transition: transform .28s cubic-bezier(.2, 1.4, .4, 1) .12s, opacity .1s .12s; }
.tpx-card.is-mini .tpx-card-coin { width: 50px; height: 50px; }
.tpx-card.is-mini .tpx-card-amt { font-size: 26px; }
.tpx-card.r4.is-mini .tpx-card-amt { font-size: 28px; }
.tpx-card.is-mini .tpx-card-rar { padding: 3px 8px; font-size: 10px; letter-spacing: .08em; }
.tpx-slot.is-flipped .tpx-back { transform: rotateY(90deg); opacity: 0; }
.tpx-slot.is-flipped .tpx-card { transform: none; opacity: 1; }
.tpx-slot.is-star { z-index: 2; animation: tpx-star .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes tpx-star { 50% { transform: scale(1.22); } to { transform: scale(1.1); } }

/* Coins flying to the balance. */
.tpx-fly { position: fixed; left: 0; top: 0; z-index: 600; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none; }

/* Held buttons: the fill sweeps while the button is held. */
.tp-hold { position: relative; overflow: hidden; }
.tp-hold > span:not(.tp-fill):not(.tp-bubble) { position: relative; }   /* the bubble floats above (absolute), it must not widen the button */
.tp-fill { position: absolute; inset: 0; background: var(--ink-30); pointer-events: none; clip-path: inset(0 calc((1 - var(--hold, 0)) * 100%) 0 0 round 9px); }
/* A click where a hold is needed: a "no" shake and a bubble above. */
.tp-hold.is-nudged, .tpx-pile.is-nudged { animation: tp-no .4s ease-out; }
@keyframes tp-no { 20% { translate: -6px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }
.tp-hold { overflow: visible; }
.tp-hold > .tp-fill { border-radius: inherit; }
.tp-bubble { position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 3; translate: -50% 0; white-space: nowrap; pointer-events: none;
  padding: 6px 12px; border-radius: 10px; background: var(--game-gold-hi); color: var(--game-on-gold); font: 800 12.5px var(--sqr-display, system-ui);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4); animation: tp-bubble 1.4s ease-out forwards; }
.tp-bubble::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--game-gold-hi); }
.tpx-pile .tp-bubble { bottom: auto; top: -18px; }
@keyframes tp-bubble { 0% { opacity: 0; transform: translateY(6px) scale(.9); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.tp-ten { background: linear-gradient(135deg, var(--tier-epic), var(--game-orange)); box-shadow: 0 0 16px rgba(168, 85, 247, .45); }
/* Holding ×10 (2 s): the button strains — it shakes harder and glows brighter as --hold grows. */
.tp-ten.is-holding { animation: tp-strain .08s linear infinite;
  box-shadow: 0 0 calc(16px + var(--hold, 0) * 40px) rgba(255, 170, 60, calc(.45 + var(--hold, 0) * .5)), 0 0 calc(var(--hold, 0) * 70px) rgba(168, 85, 247, .6);
  transform: scale(calc(1 + var(--hold, 0) * .08)); }
@keyframes tp-strain { 25% { translate: calc(var(--hold, 0) * -3px) calc(var(--hold, 0) * 1px); } 75% { translate: calc(var(--hold, 0) * 3px) calc(var(--hold, 0) * -1px); } }
@media (prefers-reduced-motion: reduce) {
  .tpx-spot, .tpx-pile, .tpx-pile.is-holding, .tpx-env-shine, .tpx-env.is-shaking, .tpx-one.is-step .tpx-env,
  .tpx-card-shine, .tpx-card.r2::before, .tpx-card.r3::before, .tpx-card.r4, .tpx-stage.is-legend, .tpx-crown, .tpx-slot, .tpx-slot.is-star,
  .tpx-one.is-open .tpx-rays, .tp-ten.is-holding { animation: none; }
  .tpx-float { animation: none; opacity: 1; }
  .tpx-legend .lg-rays, .tpx-legend .lg-ring, .tpx-legend .lg-flash, .tpx-legend .lg-bolt, .tc-reveal.tp:has(.tpx-legend) .tpx { animation: none; }
  .tpx-legend .lg-title b, .tpx-one.is-open[data-r="4"] > .tpx-card, .tpx-one.is-open[data-r="3"] > .tpx-card { animation: none; opacity: 1; }
  .tpx-stage.is-legend::after { display: none; }
  .tpx-one .tpx-env, .tpx-one > .tpx-card, .tpx-card.is-mini, .tpx-back { transition: opacity .15s; }
}
/* The gift-code modal (squad-deals.js openCoinsCodeModal), from the ChatGPT
   mockup: separate art layers (tiger, chest, coin pile) around a centre with
   the title plaque, the boxes and a big Redeem button; where codes come from
   along the bottom. Each layer moves on its own. */
.tc-code-card.tcx { position: relative; width: min(860px, 94vw); padding: 46px 0 0; overflow: visible; text-align: center;
  border: 2px solid var(--game-gold); border-radius: 26px; box-shadow: 0 0 0 4px rgba(255, 207, 61, .15), 0 0 60px rgba(255, 178, 26, .25), 0 30px 80px rgba(0, 0, 0, .6);
  background: radial-gradient(ellipse at 50% 40%, #26305a 0%, #151a33 55%, #0b0e1c 100%); }
.tcx-main { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 230px 24px; }
.tcx-plaque { position: relative; padding: 12px 46px 10px; border-radius: 16px; background: linear-gradient(180deg, #6a1f2a, #3d0f17);
  box-shadow: inset 0 0 0 3px var(--game-gold-deep), inset 0 0 0 5px #3d0f17, inset 0 0 0 6px rgba(255, 207, 61, .5), 0 8px 20px rgba(0, 0, 0, .4); }
.tcx-plaque h3 { margin: 0; font: 900 34px var(--sqr-display, system-ui); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
  background: linear-gradient(180deg, #fff, var(--game-gold-hi) 55%, var(--game-gold-deep)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #2a0a10); }
/* The illustrated gift box (the banner's), perched on the plaque. */
.tcx-gift { position: absolute; left: 50%; top: -50px; width: 64px; height: 64px; object-fit: contain; translate: -50% 0;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)) drop-shadow(0 0 14px rgba(255, 190, 40, .45)); animation: tcx-gift 2.4s ease-in-out infinite; }
@keyframes tcx-gift { 50% { transform: translateY(-5px) rotate(-4deg); } }
.tcx .tc-code-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--game-text-2); }
.tcx .tc-code-box { width: 112px; flex: 0 1 112px; height: 60px; font-size: 24px; border: 2px solid color-mix(in srgb, var(--game-gold) 55%, transparent); background: #0b0e1c;
  box-shadow: inset 0 0 14px rgba(255, 207, 61, .12), 0 0 14px rgba(255, 207, 61, .15); }
/* A wrong code: a red bubble over the boxes, centred on the middle one —
   it takes no room, so the modal does not grow. */
.tcx .tc-code-row { position: relative; }
.tcx .tc-code-err { position: absolute; left: 50%; bottom: calc(100% + 12px); z-index: 2; margin: 0; padding: 8px 14px; border-radius: 10px; white-space: nowrap;
  font-size: 13px; font-weight: 700; color: var(--on-accent); background: var(--game-danger); box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  transform: translateX(-50%); animation: tcx-err-pop .25s cubic-bezier(.2, .8, .2, 1.3); }
.tcx .tc-code-err::after { content: ""; position: absolute; left: 50%; top: 100%; border: 7px solid transparent; border-top-color: var(--game-danger); transform: translateX(-50%); }
.tcx .tc-code-err[hidden] { display: none; }
@keyframes tcx-err-pop { from { opacity: 0; transform: translate(-50%, 6px) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .tcx .tc-code-err { animation: none; } }
.tcx .tc-code-box:focus { border-color: var(--game-gold); box-shadow: inset 0 0 14px rgba(255, 207, 61, .2), 0 0 0 4px rgba(255, 207, 61, .18), 0 0 22px rgba(255, 207, 61, .45); }
.tcx .tc-code-dash { color: var(--game-gold-text); font-size: 22px; }
.tcx-go { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 330px; max-width: 100%; height: 56px; margin-top: 4px; border: 0; border-radius: 16px; cursor: pointer;
  background: linear-gradient(180deg, var(--game-gold), var(--game-orange)); color: var(--game-on-gold); font: 900 22px var(--sqr-display, system-ui); text-transform: uppercase; letter-spacing: .06em;
  box-shadow: inset 0 -4px 0 rgba(120, 50, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .5), 0 8px 22px rgba(255, 140, 30, .45); transition: transform .12s, filter .12s, opacity .15s; }
.tcx-go .icon { background: currentColor; }
.tcx-go:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.06); }
.tcx-go:not(:disabled):active { transform: translateY(1px); }
.tcx-go:disabled { opacity: .45; cursor: default; }
/* "How to get envelopes" (openEnvelopeHelp): the code modal's frame, narrower,
   the envelope over the plaque, the ways as a list. */
.tc-code-card.tcx.tcx--help { width: min(560px, 94vw); padding-top: 34px; }
.tcx--help .tcx-main { padding: 0 32px 28px; gap: 16px; }
.tcx--help .tcx-plaque { padding: 12px 30px 10px; }
.tcx--help .tcx-plaque h3 { font-size: 24px; white-space: normal; }
/* The envelope rises from BEHIND the card (z-index -1: under the card, over the dim). */
/* Several envelopes received at once: three envelopes fanned (the middle one in
   front), each the single envelope's size (140 px wide, 175 px tall), bobbing and turning toward the mouse as one
   (.tch-env-tilt frame + coin-pull.js tilt on .tch-env-stack); the count is in the title. */
.tch-env-tilt.tch-env-pile { width: 250px; aspect-ratio: auto; }   /* same top as the single envelope (-112px) */
.tch-env-stack { position: relative; display: block; width: 100%; height: 175px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55));
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out; }
.tch-env-stack:not(.is-tilted) { transition: transform .6s cubic-bezier(.2, 1.4, .4, 1); }
.tch-env-stack img { position: absolute; left: 50%; top: 0; width: 140px; aspect-ratio: 821 / 1024; translate: -50% 0; transform-origin: 50% 100%; }   /* the envelope art's own ratio */
.tch-env-stack img:nth-child(1) { rotate: -16deg; translate: -88% 6px; }
.tch-env-stack img:nth-child(2) { rotate: 16deg; translate: -12% 6px; }
/* The middle one, in front, stands higher and casts its shadow on the two
   behind — away from the pointer, as if it were the light (tilt's --tx / --ty). */
.tch-env-stack img:nth-child(3) { translate: -50% -14px; transition: filter .18s ease-out;
  filter: drop-shadow(calc(var(--tx, 0) * -14px) calc(6px + var(--ty, 0) * -10px) 7px rgba(0, 0, 0, .6)); }
.tch-env { position: absolute; left: 50%; top: -112px; z-index: -1; width: 140px; translate: -50% 0; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55)); animation: tcx-gift 2.4s ease-in-out infinite; }
/* Help window: the frame bobs (tcx-gift) and gives the perspective; the envelope
   inside turns toward the mouse (coin-pull.js tilt sets --rx / --ry). */
.tch-env-tilt { position: absolute; left: 50%; top: -112px; z-index: -1; width: 140px; aspect-ratio: 1; translate: -50% 0; perspective: 600px;
  animation: tcx-gift 2.4s ease-in-out infinite; }
.tch-env-tilt .tch-env { position: static; display: block; width: 100%; translate: none; animation: none;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out; }
.tch-env-tilt .tch-env:not(.is-tilted) { transition: transform .6s cubic-bezier(.2, 1.4, .4, 1); }
.tch-env-tilt .tch-env.is-tapped { animation: tch-tap .35s ease; }
/* The easter egg (openEnvelopeHelp): each click shakes the envelope. No pointer cursor — it stays a secret. */
.tch-env.is-tapped { animation: tch-tap .35s ease; }
/* Not found yet: loot glints twinkle around the envelope (Diablo-style), one after the other. */
.tch-glints { position: absolute; left: 50%; top: -112px; z-index: -1; width: 170px; height: 120px; translate: -50% 0; pointer-events: none; }
.tch-glints i { position: absolute; width: 22px; aspect-ratio: 1; background: #fff6c8;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 4px var(--game-gold)) drop-shadow(0 0 10px var(--game-gold-deep)); opacity: 0; animation: tch-glint 2.8s ease-in-out infinite; }
.tch-glints i:nth-child(1) { left: 4px; top: 18px; }
.tch-glints i:nth-child(2) { right: 2px; top: 6px; width: 16px; animation-delay: .7s; }
.tch-glints i:nth-child(3) { right: 18px; top: 74px; width: 26px; animation-delay: 1.4s; }
.tch-glints i:nth-child(4) { left: 26px; top: 82px; width: 14px; animation-delay: 2.1s; }
@keyframes tch-glint { 0%, 55%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); } 70% { opacity: 1; transform: scale(1) rotate(45deg); } 85% { opacity: .8; transform: scale(.6) rotate(90deg); } }
@media (prefers-reduced-motion: reduce) { .tch-glints i { animation: none; opacity: .8; transform: none; } }
@keyframes tch-tap { 0%, 100% { transform: none; } 20% { transform: rotate(-9deg) scale(1.06); } 45% { transform: rotate(8deg) scale(1.08); } 70% { transform: rotate(-4deg); } }
.tch-list { width: 100%; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tch-list li { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 14px; text-align: left;
  background: rgba(11, 14, 28, .6); border: 1px solid color-mix(in srgb, var(--game-gold) 22%, transparent); }
/* No tile behind the art: bigger illustrations, lighter rows. */
.tch-ic { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; color: var(--game-gold-text); }
.tch-ic .icon { width: 28px; height: 28px; background: currentColor; }
.tch-ic img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
/* Discord and e-mail: the two icons, one over the other's corner. */
.tch-duo { position: relative; width: 40px; height: 40px; }
.tch-duo .icon { position: absolute; width: 24px; height: 24px; }
.tch-duo .icon-discord { left: 0; top: 2px; background: #5865f2; }
.tch-duo .icon-mail { right: 0; bottom: 2px; background: var(--game-gold-text); }
.tch-list b { display: block; font-size: 14px; color: var(--game-text); }
.tch-list small { font-size: 12.5px; color: var(--game-text-2); }
.tch-list li { transition: border-color .15s, background-color .15s; }
.tch-list li:hover { border-color: color-mix(in srgb, var(--game-gold) 60%, transparent); background: color-mix(in srgb, var(--game-gold) 6%, transparent); }
.tch-list li:hover .tch-ic > * { animation: tch-hop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tch-hop { 0% { transform: none; } 40% { transform: translateY(-5px) rotate(-8deg) scale(1.12); } 70% { transform: translateY(0) rotate(4deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tch-env, .tch-env-tilt, .tch-list li:hover .tch-ic > * { animation: none; } }
/* "You got an envelope!" (showEnvelopeGift): who gave it, their avatar as in
   the friends bar, no frame around them. */
.tcg-from { display: flex; align-items: center; gap: 14px; margin: 0; text-align: left; }
.tcg-from .sb-friend-avatar { width: 48px; height: 48px; font-size: 17px; }   /* the friends bar's avatar (level ring included) */
.tcg-from b { display: block; font-size: 15px; color: var(--game-text); }
.tcg-from small { font-size: 12.5px; color: var(--game-text-2); }
.tcx-x { position: absolute; z-index: 4; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--ink-15); background: color-mix(in srgb, var(--game-bg) 70%, transparent); color: var(--game-text-2); }
.tcx-x .icon { background: currentColor; }
.tcx-x:hover { color: var(--game-text); }
/* The art layers, each with its own little motion. */
.tcx-tiger { position: absolute; z-index: 3; left: -38px; top: -26px; width: 250px; pointer-events: none; transform-origin: 40% 90%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)); animation: tcx-tiger 3.2s ease-in-out infinite; }
@keyframes tcx-tiger { 50% { transform: rotate(2.5deg) translateY(-4px); } }
.tcx-chest { position: absolute; z-index: 3; right: -40px; bottom: 70px; width: 250px; pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)) drop-shadow(0 0 24px rgba(255, 190, 40, .35)); animation: tcx-chest 2.8s ease-in-out infinite; }
@keyframes tcx-chest { 50% { transform: translateY(-6px) rotate(-1.5deg); } }
.tcx-pile { position: absolute; z-index: 3; left: -14px; bottom: 74px; width: 170px; height: 120px; pointer-events: none; }
.tcx-pile img { position: absolute; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.tcx-pile img:nth-child(1) { left: 0; bottom: 18px; width: 72px; rotate: -14deg; }
.tcx-pile img:nth-child(2) { left: 52px; bottom: 0; width: 96px; animation: tcx-coin 2.6s ease-in-out infinite; }
.tcx-pile img:nth-child(3) { left: 118px; bottom: 6px; width: 52px; animation: tcx-coin 2.6s ease-in-out .8s infinite; }
/* The envelope hides an easter egg (codeEnvelope): it takes clicks, the rest
   of the pile does not; its glints sit around it. */
.tcx-pile .tcx-pile-env { pointer-events: auto; }
.tcx-pile .tcx-pile-env.is-tapped { animation: tch-tap .35s ease; }
.tcx-pile .tch-glints { left: 40px; top: -26px; z-index: 1; translate: -50% 0; width: 120px; height: 110px; }
@keyframes tcx-coin { 50% { transform: translateY(-5px) rotate(6deg); } }
/* Where codes come from. */
.tcx-srcs { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none;
  border-top: 2px solid color-mix(in srgb, var(--game-gold) 45%, transparent); border-radius: 0 0 24px 24px; background: rgba(5, 7, 15, .6); }
.tcx-srcs li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; }
.tcx-srcs li + li { border-left: 1px solid var(--ink-08); }
.tcx-src-ic { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; }
.tcx-src-ic .icon { width: 30px; height: 30px; }
.tcx-src-ic img { width: 30px; height: 30px; object-fit: contain; }
.tcx-src-ic .icon-discord { background: #5865f2; }
.tcx-src-ic .icon-nfc { background: #7aa2ff; height: 22px; }
.tcx-src-ic .icon-card { background: var(--game-gold-text); }
.tcx-src-ic img { width: 30px; height: 36px; object-fit: contain; }
.tcx-srcs b { display: block; font-size: 13.5px; color: var(--game-text); }
.tcx-srcs small { display: block; font-size: 12px; color: var(--game-muted); }
@media (max-width: 900px) { .tcx-tiger, .tcx-chest, .tcx-pile { display: none; } .tcx-main { padding: 0 24px 24px; } .tcx-srcs { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .tcx-gift, .tcx-tiger, .tcx-chest, .tcx-pile img { animation: none; } }
/* An app announcement's side card (squad-deals.js appsBlock): beta / stable
   switch, then a QR code per platform to scan with the phone (also a link). */
.sqd-apps { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--game-bg) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--tsq-line); }
.sqd-apps-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sqd-apps-tabs button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; height: auto; min-height: 0; line-height: 1.25; padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left;
  border: 1px solid var(--tsq-line); background: transparent; color: var(--tsq-muted); }
.sqd-apps-tabs b { font-size: 13px; color: var(--tsq-text, var(--game-text)); }
.sqd-apps-tabs small { font-size: 11px; }
.sqd-apps[data-ch="beta"] [data-app-ch="beta"], .sqd-apps[data-ch="stable"] [data-app-ch="stable"] {
  border-color: var(--tsq-orange); background: color-mix(in srgb, var(--tsq-orange) 14%, transparent); color: var(--tsq-text, var(--game-text)); }
.sqd-apps-scan { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 12.5px; font-weight: 600; color: var(--tsq-muted); }
.sqd-apps-scan .icon { background: currentColor; }
.sqd-apps-qrs { display: none; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.sqd-apps[data-ch="beta"] .sqd-apps-qrs[data-for="beta"], .sqd-apps[data-ch="stable"] .sqd-apps-qrs[data-for="stable"] { display: grid; }
.sqd-app-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; background: var(--on-accent); text-decoration: none;
  transition: transform .15s, box-shadow .15s; }
.sqd-app-qr:hover { transform: translateY(-2px); box-shadow: 0 0 0 3px var(--tsq-orange); }
.sqd-app-qr img { width: 132px; height: 132px; image-rendering: pixelated; }
.sqd-app-qr > span { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--dark-bg); }
.sqd-app-qr .icon { background: var(--dark-bg); }

/* Between two openings: the reveal fades out, then the next envelope rises in. */
.tc-reveal.tp.is-leaving > * { opacity: 0; transform: scale(.97); transition: opacity .35s ease, transform .35s ease; }
.tc-reveal.tp .tpx-pile:not(.is-holding):not(.is-nudged) { animation: tpx-pile-in .55s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes tpx-pile-in { from { opacity: 0; transform: translateY(26px) scale(.86); } }
@media (prefers-reduced-motion: reduce) {
  .tc-reveal.tp.is-leaving > * { transition: opacity .2s; transform: none; }
  .tc-reveal.tp .tpx-pile { animation: none; }
}
/* Easter egg found (coin-pull.js celebrateEgg): the room dims, gold rays turn,
   the envelope flies from where it hid (--fx / --fy from the centre) and swells,
   sparks burst, "Secret found!" lands; ~2.4 s, then it fades out. */
.egg-fx { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; pointer-events: auto;
  background: radial-gradient(circle at 50% 46%, rgba(40, 24, 6, .55), rgba(5, 6, 12, .88) 70%); opacity: 0; transition: opacity .3s; }
.egg-fx.is-on { opacity: 1; }
.egg-fx.is-out { opacity: 0; }
.egg-fx-rays { position: absolute; left: 50%; top: 46%; width: 160vmax; aspect-ratio: 1; translate: -50% -50%; opacity: 0;
  background: repeating-conic-gradient(rgba(255, 210, 90, .22) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0 8%, transparent 32%); mask: radial-gradient(circle, #000 0 8%, transparent 32%); }
.egg-fx.is-on .egg-fx-rays { animation: egg-rays 2.4s ease-out forwards; }
@keyframes egg-rays { 0% { opacity: 0; rotate: 0deg; } 25% { opacity: 1; } 100% { opacity: .8; rotate: 60deg; } }
.egg-fx-stage { position: relative; display: grid; place-items: center; margin-top: -8vh; }
.egg-fx-env { width: 180px; filter: drop-shadow(0 0 30px rgba(255, 200, 80, .8)) drop-shadow(0 18px 24px rgba(0, 0, 0, .6));
  translate: var(--fx) var(--fy); scale: .25; opacity: 0; }
.egg-fx.is-on .egg-fx-env { animation: egg-fly .7s cubic-bezier(.3, 1.3, .5, 1) forwards, egg-bob 1.6s ease-in-out .7s infinite; }
@keyframes egg-fly { 0% { translate: var(--fx) var(--fy); scale: .25; opacity: 1; rotate: -30deg; } 100% { translate: 0 0; scale: 1; opacity: 1; rotate: 0deg; } }
@keyframes egg-bob { 0%, 100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -10px; rotate: 3deg; } }
.egg-fx-sparks { position: absolute; inset: 0; display: grid; place-items: center; }
.egg-fx-sparks i { position: absolute; width: var(--s); aspect-ratio: 1; background: #ffe7a0;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); filter: drop-shadow(0 0 6px var(--game-gold-deep)); opacity: 0; }
.egg-fx.is-on .egg-fx-sparks i { animation: egg-spark 1.1s cubic-bezier(.2, .8, .3, 1) .55s forwards; }
@keyframes egg-spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(1.2); } }
.egg-fx-text { position: absolute; top: calc(46% + 120px); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  opacity: 0; translate: 0 16px; }
.egg-fx.is-on .egg-fx-text { animation: egg-text .5s cubic-bezier(.3, 1.4, .5, 1) .6s forwards; }
@keyframes egg-text { to { opacity: 1; translate: 0 0; } }
.egg-fx-text b { font: 900 44px/1 var(--qw-display, var(--sqr-display, sans-serif)); text-transform: uppercase; letter-spacing: .02em; color: var(--game-gold-text);
  text-shadow: 0 3px 0 #8a4a10, 0 0 24px rgba(255, 178, 26, .8); }
.egg-fx-text small { font-size: 15px; font-weight: 700; color: #f3e6c8; text-shadow: 0 1px 4px #000; }
@media (prefers-reduced-motion: reduce) { .egg-fx.egg-fx.is-on * { animation: none; } .egg-fx.egg-fx .egg-fx-env, .egg-fx.egg-fx .egg-fx-text { translate: 0 0; scale: 1; opacity: 1; } }

/* TigerCoins history (squad-deals.js openCoinsHistory): the help window's frame,
   wider, the coin rising behind it; earned / spent / balance, tabs, a scrolling
   log grouped by day. The banner's balance card opens it. */
.sqd-coins.sqd-coins { cursor: pointer; font: inherit; color: inherit; height: auto; transition: border-color .15s, transform .15s; }
.sqd-coins.sqd-coins:hover { border-color: var(--sqr-gold, var(--game-gold)); transform: translateY(-1px); }
.tc-code-card.tcx.tcx--hist { width: min(620px, 94vw); }
.tcx--hist .tch-env { width: 110px; top: -96px; }
/* A click flips the coin: three turns on its vertical axis, landing face up. */
.tcx--hist .tch-coin { cursor: pointer; }
.tcx--hist .tch-coin.is-flipping { animation: tch-coin-flip 1.1s cubic-bezier(.2, .7, .25, 1); }
@keyframes tch-coin-flip {
  from { transform: perspective(600px) rotateY(0); }
  to { transform: perspective(600px) rotateY(1080deg); }
}
/* The stars it throws: the glints' four-point star, flying out and fading. */
.tch-coin-star { position: absolute; z-index: 2; width: 22px; aspect-ratio: 1; margin: -11px 0 0 -11px; pointer-events: none;
  background: radial-gradient(circle, #fff3a8 0 18%, #ffc93d 50%, #ff9f1a);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); opacity: 0;
  animation: tch-coin-star .9s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes tch-coin-star {
  0% { opacity: 0; transform: translate(0, 0) scale(.2) rotate(0); }
  20%, 65% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(var(--s)) rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) { .tcx--hist .tch-coin.is-flipping, .tch-coin-star { animation: none; } .tch-coin-star { display: none; } }
/* The balance, hero of the history (assets-src/img/tigercoins/mockups/
   coins-balance-mockup.png): a big embossed gold number beside the tiger coin,
   a warm glow behind, a light streak under it and a few twinkling sparks. */
.tch-sum { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 12px 16px;
  border-radius: 14px; border: 1px solid color-mix(in srgb, var(--game-gold) 28%, transparent); overflow: hidden;
  background: radial-gradient(ellipse 60% 75% at 50% 62%, rgba(255, 178, 26, .28), transparent 70%), rgba(11, 14, 28, .6); }
.tch-sum::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 14px; height: 3px; border-radius: 50%;
  background: radial-gradient(ellipse, var(--game-gold-hi), var(--game-gold-deep) 45%, transparent 75%); filter: blur(1.5px); opacity: .9; }
.tch-sum small { position: relative; font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--game-text-2); }
.tch-bal { position: relative; display: inline-flex; align-items: center; gap: 12px; line-height: 1; }
.tch-bal-n { font: 900 72px var(--sqr-display, system-ui); letter-spacing: .01em;
  background: linear-gradient(180deg, var(--game-gold-hi) 0%, var(--game-gold-hi) 38%, var(--game-gold-deep) 70%, #e08a00 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #7a3d00) drop-shadow(0 0 18px rgba(255, 190, 40, .55)); }
.tch-bal-coin { width: 64px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 0 14px rgba(255, 190, 40, .55)); }
/* "Send" beside the balance (mockups/coins-history-send-mockup.png): a golden pill with the red envelope. */
.tch-send.tch-send { position: absolute; right: 16px; top: 50%; transform: translateY(-30%); display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px 0 14px;
  border: 0; border-radius: 999px; cursor: pointer; font: 800 15px var(--sqr-display, system-ui); color: var(--game-on-gold);
  background: linear-gradient(180deg, var(--game-gold-hi), #ffc02e 55%, #f0a20f); box-shadow: 0 0 0 1px var(--game-gold), 0 6px 18px rgba(255, 178, 26, .35); transition: transform .15s, box-shadow .15s; }
.tch-send img { width: 26px; aspect-ratio: 1; object-fit: contain; }
.tch-send.tch-send:hover { transform: translateY(calc(-30% - 2px)); box-shadow: 0 0 0 1px var(--game-gold-hi), 0 10px 24px rgba(255, 178, 26, .5); }
@media (max-width: 520px) { .tch-send.tch-send { position: static; transform: none; margin-top: 8px; } }
.tch-bal-sparks i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #ffe9a0; box-shadow: 0 0 6px 2px rgba(255, 210, 90, .8);
  animation: tch-twinkle 2.4s ease-in-out infinite; }
.tch-bal-sparks i:nth-child(1) { left: 24%; top: 46%; }
.tch-bal-sparks i:nth-child(2) { left: 30%; top: 74%; animation-delay: .5s; width: 3px; height: 3px; }
.tch-bal-sparks i:nth-child(3) { right: 26%; top: 40%; animation-delay: 1s; }
.tch-bal-sparks i:nth-child(4) { right: 30%; top: 72%; animation-delay: 1.5s; width: 3px; height: 3px; }
.tch-bal-sparks i:nth-child(5) { left: 50%; top: 20%; animation-delay: 1.9s; width: 3px; height: 3px; }
@keyframes tch-twinkle { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .tch-bal-sparks i { animation: none; opacity: .6; } }
.tch-amt.is-up { color: var(--game-ok-text); }
.tch-amt.is-down { color: var(--game-danger-text); }
.tch-tabs { display: flex; gap: 6px; width: 100%; }
.tch-tab.tch-tab { flex: 1; height: 32px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--game-gold) 22%, transparent); background: rgba(11, 14, 28, .5); color: var(--game-text-2); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.tch-tab.tch-tab.is-on { background: var(--game-gold); border-color: var(--game-gold); color: var(--game-on-gold); }
/* A fixed height, not a max: the window opens at its final size while the log
   loads, instead of growing once it arrives. The loader / an empty or error
   message sits in the middle. */
.tch-log { width: 100%; height: min(46vh, 380px); overflow: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.tch-log::-webkit-scrollbar { display: none; }
.tch-log > :only-child:not(.tch-row) { margin: auto; }
.tch-day { margin: 6px 2px 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--game-gold-text); }
.tch-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(11, 14, 28, .6); border: 1px solid color-mix(in srgb, var(--game-gold) 14%, transparent); }
/* The row's own icon only — `.tch-row img` also reached the avatar's badge. */
.tch-row > img { width: 30px; height: 30px; object-fit: contain; }
.tch-row b { display: block; font-size: 13px; color: var(--game-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tch-row small { font-size: 11.5px; color: var(--game-muted); }
.tch-amt { font: 800 14px var(--qw-mono, ui-monospace, monospace); color: var(--game-muted); }
.tch-row .tch-amt { display: inline-flex; align-items: center; gap: 7px; overflow: visible; font-size: 17px; }
.tch-amt.is-gold { color: var(--game-gold-text); }
.tch-row .tch-amt .tch-amt-ic { width: 16px; height: 20px; }
.tch-row .tch-amt .tcoin { width: 20px; height: 20px; vertical-align: 0; }
/* Which way it went, at a glance (assets-src/img/tigercoins/coin-history-mockup.png):
   a coloured bar on the left — green in, red out, gold coins earned — and on an
   envelope row an arrow (into / out of the envelope) and the friend's avatar. */
.tch-row--in, .tch-row--out, .tch-row--coin { box-shadow: inset 4px 0 0 var(--tch-acc); }
.tch-row--in { --tch-acc: var(--game-ok); }
.tch-row--out { --tch-acc: var(--game-danger); }
.tch-row--coin { --tch-acc: var(--game-gold); }
.tch-row:has(.tch-dir) { grid-template-columns: 32px 18px 34px minmax(0, 1fr) auto; }
.tch-dir { display: grid; place-items: center; }
.tch-dir .icon { background: var(--tch-acc); }
.tch-row--in .tch-dir .icon { transform: scaleX(-1); }   /* pointing into the envelope */
.tch-empty { margin: 16px 0; text-align: center; color: var(--game-muted); }
/* Send TigerCoins (squad-deals.js showSendCoins): the friends, the amount
   (quick picks + a typed field with the coin), a message, the recap (shares
   the freeze windows' .qfm-recap / .qfm-row / .qfm-why). */
/* Send TigerCoins (assets-src/img/tigercoins/mockups/coins-send-mockup.png):
   a row of friends (the one picked ringed in gold), the amount as the hero, a required
   message on a paper card, one held golden button. */
.tcs-body { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.tcs-row { display: flex; gap: 6px; overflow-x: auto; padding: 10px 6px 8px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--game-gold) 35%, transparent) transparent; overflow-y: hidden; }
.tcs-f.tcs-f { height: auto; min-height: 0; width: 76px; min-width: 0; flex: 0 0 76px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 2px; border: 0; border-radius: 12px; background: none; color: var(--game-text-2); cursor: pointer; }
.tcs-f[hidden] { display: none; }
.tcs-f-av { display: grid; place-items: center; width: 50px; aspect-ratio: 1; border-radius: 50%; font-size: 16px; transition: box-shadow .15s, transform .15s; }
.tcs-f-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.tcs-f:hover .tcs-f-av { transform: translateY(-2px); }
/* The friend picked grows, ringed and glowing in gold; the others step back. */
.tcs-f[aria-checked="true"] .tcs-f-av { transform: scale(1.22); box-shadow: 0 0 0 3px var(--game-gold), 0 0 18px rgba(255, 190, 40, .7); }
.tcs-f[aria-checked="true"]:hover .tcs-f-av { transform: scale(1.22) translateY(-2px); }
.tcs-f[aria-checked="true"] .tcs-f-name { color: var(--game-gold-text); font-weight: 800; transform: translateY(5px); }
.tcs-f-name { transition: transform .15s; }
.tcs-row:has(.tcs-f[aria-checked="true"]) .tcs-f:not([aria-checked="true"]) { opacity: .5; }
.tcs-row:has(.tcs-f[aria-checked="true"]) .tcs-f:not([aria-checked="true"]):hover { opacity: .85; }
/* Already sent an envelope today: greyed until tomorrow, with a small "Sent today". */
.tcs-f.is-sent-today { cursor: default; opacity: .45; filter: grayscale(.8); }
.tcs-f.is-sent-today .tcs-f-av { transform: none; box-shadow: none; }
.tcs-f-today { font-size: 10px; font-weight: 700; color: var(--tsq-muted, var(--game-muted)); }
.tcs-f.tcs-f { transition: opacity .15s; }
/* The amount, hero: a big embossed gold number and the tiger coin, a warm glow and a light streak. */
.tcs-hero { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 2px 0 10px; cursor: text;
  background: radial-gradient(ellipse 40% 65% at 50% 55%, rgba(255, 178, 26, .32), transparent 72%); }
.tcs-hero::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 6px; height: 3px; border-radius: 50%;
  background: radial-gradient(ellipse, var(--game-gold-hi), var(--game-gold-deep) 45%, transparent 75%); filter: blur(1.5px); }
.tcs-amount-input.tcs-amount-input { field-sizing: content; width: auto; min-width: 1ch; max-width: 5ch; height: auto; box-shadow: none; border-radius: 0; min-width: 1ch; padding: 0; border: 0; background: none; outline: none; text-align: right;
  font: 900 64px var(--sqr-display, system-ui); line-height: 1; color: #ffd24a; caret-color: var(--game-gold-hi);
  text-shadow: 0 3px 0 #7a3d00; }   /* the glow is the hero's own background: an input clips a blurred shadow */
.tcs-amount-input.tcs-amount-input:focus { background: none; box-shadow: none; }
.tcs-amount-input::placeholder { color: rgba(255, 210, 74, .3); text-shadow: none; }
.tcs-amount-input::-webkit-inner-spin-button, .tcs-amount-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tcs-hero-coin { width: 58px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 0 14px rgba(255, 190, 40, .55)); transition: opacity .2s; }
.tcs-hero.is-zero .tcs-hero-coin { opacity: .45; }
.tcs-quick { display: flex; justify-content: center; gap: 8px; }
.tcs-q { min-width: 62px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--tsq-line); background: var(--ink-04);
  color: var(--game-text-2); font: 800 14px var(--qw-mono, monospace); cursor: pointer; }
.tcs-q:hover { border-color: var(--game-gold); }
.tcs-q[aria-pressed="true"] { border-color: var(--game-gold); background: var(--game-gold); color: var(--game-on-gold); }
.tcs-avail { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--game-text-2); }
.tcs-avail img { width: 18px; aspect-ratio: 1; object-fit: contain; }
.tcs-fee { margin: -6px 0 0; text-align: center; font-size: 12px; color: var(--tsq-muted); }
.tcs-fee[hidden] { display: none; }
/* The required message, written on the envelope's card. */
.tcs-card-msg { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.tcs-msg-lbl { font-size: 13px; color: var(--tsq-muted); }
.tcs-msg-lbl b { color: var(--game-text); font-size: 14px; }
.tcs-msg-paper { position: relative; display: block; border-radius: 12px; padding: 8px 14px 20px;
  background: linear-gradient(180deg, #fbf3df, #f1e4c4); border: 2px solid var(--game-gold); box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(0, 0, 0, .35); }
.tcs-msg.tcs-msg { display: block; box-shadow: none; border-radius: 0; height: auto; width: 100%; min-height: 28px; field-sizing: content; max-height: 110px; padding: 0; border: 0; background: none; outline: none; resize: none;
  font: 400 20px "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive; line-height: 1.3; color: #2a1d0f; text-align: center; }
.tcs-msg::placeholder { color: rgba(42, 29, 15, .35); }
.tcs-count { position: absolute; right: 12px; bottom: 6px; font: 600 11px var(--qw-mono, monospace); color: rgba(42, 29, 15, .55); }
/* One big golden button, held 2 s. */
.tcs-go.tcs-go { display: grid; place-items: center; min-height: 64px; border-radius: 14px; color: var(--game-on-gold);
  background: linear-gradient(180deg, var(--game-gold-hi), #ffc02e 55%, #f0a20f); box-shadow: 0 0 0 2px var(--game-gold), 0 8px 24px rgba(255, 178, 26, .35); }
.tcs-go.tcs-go:disabled { filter: saturate(.5) brightness(.75); }
.tcs-go-txt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tcs-lbl { font-size: 17px; font-weight: 800; }
.tcs-go-txt small { font-size: 12px; font-weight: 600; opacity: .8; }
/* A friend's letter (showEnvelope isLetter): opening, the parchment unrolls with
   the message in handwriting, signed with the friend's avatar as a stamp; the
   coins come in after it (the prize's pop delayed to the letter's last beat). */
.tc-env-scroll { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; align-items: stretch; }
.tc-env-scroll[hidden] { display: none; }
.tc-env-scroll-roll { display: block; height: 14px; margin: 0 -8px; border-radius: 7px; position: relative; z-index: 1;
  background: linear-gradient(180deg, #a87c48 0%, #ecd8b0 38%, #c39a66 72%, #7d572c 100%); box-shadow: 0 2px 5px rgba(0, 0, 0, .35); }
.tc-env-scroll-paper { overflow: hidden; max-height: 0; padding: 0 22px; text-align: center;
  background:
    radial-gradient(ellipse at 20% 15%, var(--ink-30), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(150, 100, 40, .18), transparent 50%),
    linear-gradient(180deg, #f8efdc, #f1e3c6 55%, #ead7b2);
  box-shadow: inset 0 0 18px rgba(120, 80, 30, .22), inset 0 0 2px rgba(80, 50, 15, .3);
  transition: max-height .62s cubic-bezier(.16, 1, .3, 1), padding .62s cubic-bezier(.16, 1, .3, 1); }
/* One broad warm highlight sweeps the paper as it unrolls. */
.tc-env-scroll-paper { position: relative; }
.tc-env-scroll-paper::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 244, 210, .55) 50%, transparent 70%); transform: translateX(-100%); }
.tc-env-scroll.is-open .tc-env-scroll-paper::after { animation: tc-scroll-sheen .9s ease-out .25s; }
@keyframes tc-scroll-sheen { 0% { opacity: 1; transform: translateX(-100%); } 100% { opacity: 0; transform: translateX(100%); } }
.tc-env-scroll.is-open .tc-env-scroll-paper { max-height: 260px; padding: 16px 22px 14px; }
/* The words appear as if written: a left-to-right wipe (800 → 1450 ms), then the signature, then the stamp. */
.tc-env-scroll-msg { margin: 0; font: 400 26px/1.3 "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive; color: #3a2410;
  white-space: pre-wrap; word-break: break-word; clip-path: inset(0 100% 0 0); transition: clip-path .65s linear .37s; }
.tc-env-scroll-sign { margin: 10px 0 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  font: 400 18px "Bradley Hand", "Segoe Print", cursive; color: #6b4520; opacity: 0; transition: opacity .3s .85s; }
.tc-env-scroll.is-open .tc-env-scroll-msg { clip-path: inset(0); }
.tc-env-scroll.is-open .tc-env-scroll-sign { opacity: 1; }
.tc-env-scroll-stamp { display: inline-block; width: 34px; height: 34px; border-radius: 50%; font-size: 12px; box-shadow: 0 0 0 2px #b0343a, 0 2px 4px rgba(60, 30, 10, .35);
  transform: rotate(-8deg) scale(1.4); opacity: 0; }
.tc-env-scroll-stamp.is-pressed { animation: tc-stamp .18s cubic-bezier(.2, .8, .2, 1.12) forwards; }
@keyframes tc-stamp { 0% { opacity: 0; transform: rotate(-8deg) scale(1.12); } 60% { opacity: 1; transform: rotate(-8deg) scale(.98); } 100% { opacity: 1; transform: rotate(-8deg) scale(1); } }
/* The gift (1620 ms): the main coin rises with a soft overshoot, a warm glow pulses once behind the amount. */
.tc-env-card.is-letter.is-opened .tc-env-prize { position: relative; animation: tc-letter-prize .42s cubic-bezier(.2, .8, .2, 1.12) 1.62s both; }
@keyframes tc-letter-prize { from { opacity: 0; transform: translateY(14px) scale(.82); } 70% { opacity: 1; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.tc-env-card.is-letter.is-opened .tc-env-prize::before { content: ""; position: absolute; inset: -20px -40px; z-index: -1; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 190, 40, .9), transparent 65%); opacity: 0; animation: tc-letter-glow .5s ease-out 1.7s both; }
@keyframes tc-letter-glow { 0% { opacity: 0; } 40% { opacity: .22; } 100% { opacity: .08; } }
.tc-letter-coin.tc-letter-coin { width: 22px; left: -11px; top: -11px; animation-duration: .45s; }
/* The envelope of a letter slips down and fades while the parchment comes out. */
.tc-env-card.is-letter.is-opened .tch-env-tilt .tc-env { animation: tc-env-down .5s cubic-bezier(.4, 0, 1, 1) .14s forwards; }
@keyframes tc-env-down { to { opacity: 0; transform: translateY(24px) scale(.96); } }
/* Held "Collect": the coin rises and glows a little; done, the button turns into a receipt; the header counter pulses. */
.tc-env-card:has(.tc-env-collect.is-holding) .tc-env-prize img { transform: translateY(-4px); filter: drop-shadow(0 0 26px rgba(255, 200, 60, .8)); transition: transform .3s, filter .3s; }
.tc-env-collect.is-done { filter: saturate(.6); }
#topCoinsBal.is-pulse { animation: tc-bal-pulse .2s ease-out; }
@keyframes tc-bal-pulse { 50% { transform: scale(1.06); } }
.tc-env-burst { position: absolute; left: 36px; top: 50%; width: 0; height: 0; z-index: 2; pointer-events: none; }
.tc-env-report[hidden] { display: none; }
.tc-env-collect.tc-env-collect { display: grid; place-items: center; min-height: 56px; border-radius: 14px; color: var(--game-on-gold);
  background: linear-gradient(180deg, var(--game-gold-hi), #ffc02e 55%, #f0a20f); box-shadow: 0 0 0 2px var(--game-gold), 0 8px 24px rgba(255, 178, 26, .35); }
.tc-env-collect-txt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 16px; font-weight: 800; }
.tc-env-collect-txt small { font-size: 12px; font-weight: 600; opacity: .8; }
/* Opened, the envelope gives its place to the TigerCoin rising behind the card's top, like the other TigerCoins windows. */
.tc-env-coin { position: absolute; left: 50%; top: -96px; z-index: -1; width: 110px; translate: -50% 0; opacity: 0; pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55)); }
.tc-env-card.is-opened .tc-env-coin { animation: tc-env-coin-in .6s cubic-bezier(.2, 1.4, .4, 1) .35s both, tcx-gift 2.4s ease-in-out 1s infinite; }
.tc-env-card.is-letter.is-opened .tc-env-coin { animation-delay: 1.1s, 1.8s; }
@keyframes tc-env-coin-in { from { opacity: 0; transform: translateY(40px) scale(.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tc-env-card.is-opened .tc-env-coin { animation: none; opacity: 1; } }
.tc-env-card.is-letter { padding-bottom: 44px; }   /* room for "Report" at the bottom right */
@media (prefers-reduced-motion: reduce) {
  .tc-env-scroll-paper, .tc-env-scroll-msg, .tc-env-scroll-sign { transition: none; }
  .tc-env-card.is-letter.is-opened .tc-env-prize { animation-delay: 0s; }
}
/* Report a friend's message (the envelope window): a quiet link, then a small ask
   with "block and remove from my friends" ticked. */
.tc-env-card.tc-env-card { position: relative; }
.tc-env-report { position: absolute; right: 12px; bottom: 8px; z-index: 3; width: min(340px, calc(100% - 28px)); display: flex; flex-direction: column; align-items: flex-end; }
.tc-env-report-btn { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border: 0; background: none; color: var(--tsq-muted); font: inherit; font-size: 12px; cursor: pointer; }
.tc-env-report-btn .icon { background: currentColor; }
.tc-env-report-btn:hover { color: var(--game-danger-text); }
.tc-env-report-btn[hidden], .tc-env-report-ask[hidden] { display: none; }
.tc-env-report-ask { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 90, 70, .08); border: 1px solid rgba(255, 110, 90, .35); font-size: 12.5px; text-align: left; }
.tc-env-report-ask p { margin: 0; color: var(--game-text-2); }
.tc-env-report-block { display: flex; align-items: center; gap: 8px; color: var(--game-text-2); cursor: pointer; }
.tc-env-report-acts { display: flex; gap: 8px; justify-content: flex-end; }
.tc-env-report-go { height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--game-danger); color: #fff; font-weight: 700; cursor: pointer; }
.tc-env-report-go:disabled { opacity: .6; }
.tc-env-report-back { height: 30px; padding: 0 10px; border: 0; background: none; color: var(--tsq-muted); cursor: pointer; }
.tc-env-report-done { margin: 0; font-size: 12.5px; color: var(--game-ok-text); }
/* The part to fix when "Send" is pressed too early shakes once (beside the bubble). */
.tcs-shake { animation: tcs-shake .4s ease-in-out; }
@keyframes tcs-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .tcs-shake { animation: none; } }
/* No empty gap between the message and the button. */
.tcs-card .tc-reveal-actions { margin-top: 12px; }
.tcs-card .qfm-why:empty { display: none; }
.tcs-card.is-given .tc-env { animation: tc-give-fly .9s cubic-bezier(.5, 0, .7, .2) forwards; }
@media (prefers-reduced-motion: reduce) { .tcs-card.is-given .tc-env { animation: none; } }

/* ── The chest opening (squad-deals.js showChest) ─────────────────────────────
   A stage, not a card: the chest drops in, floats with light leaking from its
   lid; held, it shakes harder (--k 0 → 1) and the seam glows; then the lock
   pops, the lid flies off, flash + god rays in the type's colour (--cc), a
   fountain of coins, the envelopes rise out. */
.tc-reveal.tcc { background: radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--cc, var(--game-gold-deep)) 22%, rgba(8, 9, 16, .9)) 0%, rgba(4, 5, 10, .94) 62%); }
.tcc-stage { position: relative; width: min(520px, 94vw); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0 18px;
  --k: 0; color: var(--tsq-text); text-align: center; }
.tcc-rays { position: absolute; left: 50%; top: 58%; width: 900px; height: 900px; margin: -450px 0 0 -450px; pointer-events: none; opacity: calc(.18 + var(--k) * .3);
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--cc) 55%, var(--game-gold)) 0deg 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 62%); mask: radial-gradient(circle, #000 0%, transparent 62%);
  animation: tcc-spin 26s linear infinite; transition: opacity .3s; }
.tcc-flash { position: fixed; inset: 0; pointer-events: none; background: #fff6d8; opacity: 0; }
.tcc-plaque { position: relative; z-index: 2; opacity: 0; transform: translateY(-14px); transition: opacity .35s .15s, transform .35s .15s; }
.tc-reveal.is-open .tcc-plaque { opacity: 1; transform: none; }
.tcc-kicker { display: inline-block; padding: 3px 12px; border-radius: 999px; font: 800 11px var(--sqr-display, system-ui); letter-spacing: .14em; text-transform: uppercase;
  color: var(--game-on-gold); background: color-mix(in srgb, var(--cc) 75%, var(--game-gold)); box-shadow: 0 0 18px color-mix(in srgb, var(--cc) 60%, transparent); }
.tcc-plaque h3 { margin: 10px 0 4px; font: 900 30px var(--sqr-display, system-ui); text-transform: uppercase; letter-spacing: .03em;
  color: color-mix(in srgb, var(--cc) 45%, #fff); text-shadow: 0 2px 0 #140c0a, 0 0 26px color-mix(in srgb, var(--cc) 55%, transparent); }

.tcc-chest { position: relative; z-index: 1; width: 300px; height: 300px; margin-top: 6px; }
.tcc-box { position: absolute; left: 0; right: 0; bottom: 34px; height: 243px; transform-origin: 50% 100%;
  animation: tcc-drop .7s cubic-bezier(.3, 1.5, .5, 1) both, tcc-float 3.2s ease-in-out .9s infinite; }
.tcc-stage.is-charging .tcc-box { animation: tcc-shake calc(.32s - var(--k) * .24s) linear infinite; }
.tcc-stage.is-waiting .tcc-box { animation-duration: .07s; }
.tcc-box img { position: absolute; display: block; pointer-events: none; user-select: none; }
.tcc-closed { left: 0; bottom: 0; width: 100%; }
.tcc-base { left: 0; bottom: 0; width: 100%; opacity: 0; }
.tcc-lid { left: .5%; bottom: 112px; width: 99%; opacity: 0; transform-origin: 50% 100%; }
/* The lock is the closed chest's own emblem: it only shows as it pops off. */
.tcc-lock { left: 31.7%; top: 53.5%; width: 84px; transform: translate(-50%, -50%); opacity: 0; }
/* The light leaking from the closed lid, brighter as the hold goes on. */
.tcc-seam { position: absolute; left: 8%; right: 8%; top: 41%; height: 10px; border-radius: 50%; pointer-events: none;
  background: #fff3b0; filter: blur(6px); opacity: calc(.25 + var(--k) * .75); animation: tcc-leak 1.6s ease-in-out infinite; }
.tcc-glow { position: absolute; left: 50%; top: 42%; width: 360px; height: 360px; margin: -180px 0 0 -180px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--cc) 55%, #ffe9a0) 0%, transparent 65%); opacity: calc(.35 + var(--k) * .45); filter: blur(4px); }
.tcc-shadow { position: absolute; left: 50%; bottom: 22px; width: 250px; height: 26px; margin-left: -125px; border-radius: 50%; background: rgba(0, 0, 0, .55); filter: blur(5px);
  animation: tcc-shadow 3.2s ease-in-out .9s infinite; }
.tcc-beam { position: absolute; left: 12%; right: 12%; bottom: 150px; height: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(to top, #fff6d0, color-mix(in srgb, var(--cc) 40%, #ffe27a) 40%, transparent);
  clip-path: polygon(10% 100%, 90% 100%, 100% 0, 0 0); filter: blur(2px); }

/* Unlock → burst */
.tcc-stage.is-unlocked .tcc-lock { animation: tcc-lock-off .7s cubic-bezier(.3, .6, .4, 1) forwards; }
.tcc-stage.is-burst .tcc-closed, .tcc-stage.is-burst .tcc-seam { opacity: 0; }
.tcc-stage.is-burst .tcc-base { opacity: 1; }
.tcc-stage.is-burst .tcc-lid { opacity: 1; animation: tcc-lid-off 1s cubic-bezier(.2, .7, .3, 1) forwards; }
.tcc-stage.is-burst .tcc-beam { animation: tcc-beam .9s ease-out forwards; }
.tcc-stage.is-burst .tcc-flash { animation: tcc-flash .55s ease-out; }
.tcc-stage.is-burst .tcc-rays { opacity: .75; animation-duration: 9s; }
.tcc-stage.is-burst .tcc-glow { opacity: 1; animation: tcc-pulse 1.2s ease-out; }
.tcc-stage.is-burst .tcc-box { animation: tcc-recoil .45s cubic-bezier(.3, 1.6, .5, 1); }

/* What comes out */
.tcc-out { position: absolute; left: 50%; bottom: 160px; width: 0; height: 0; z-index: 3; pointer-events: none; }
.tcc-coin { position: absolute; left: -22px; top: -22px; width: 44px; opacity: 0; animation: tcc-coin 1.25s cubic-bezier(.2, .7, .4, 1) var(--d) forwards; }
.tcc-env { position: absolute; left: -38px; top: -40px; width: 76px; opacity: 0; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45));
  animation: tcc-env .6s cubic-bezier(.3, 1.5, .5, 1) forwards; }

/* The button: hold to open — fills as it charges. */
.tcc-go { position: relative; z-index: 2; overflow: hidden; min-width: 220px; padding: 12px 26px 10px; border: 0; border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--game-on-gold);
  background: linear-gradient(180deg, #ffc94a, #ff9a1a); box-shadow: 0 5px 0 #b45a0a, 0 0 26px color-mix(in srgb, var(--cc) 50%, transparent);
  transition: transform .12s; animation: tcc-btn-in .4s .45s both; }
.tcc-go-txt { position: relative; font: 900 16px var(--sqr-display, system-ui); text-transform: uppercase; letter-spacing: .05em; }
.tcc-go small { position: relative; font-size: 11px; font-weight: 700; opacity: .7; }
.tcc-go-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--hold, 0)); background: rgba(255, 255, 255, .45); }
.tcc-go.is-holding { transform: scale(1.04); }
.tcc-go:disabled { cursor: default; opacity: .9; }
.tcc-stage.is-burst .tcc-go { opacity: 0; transition: opacity .2s; }
.tcc-more { margin: 0; font-size: 12px; color: var(--tsq-muted); }

@keyframes tcc-spin { to { transform: rotate(360deg); } }
@keyframes tcc-drop { from { transform: translateY(-120vh) rotate(-8deg); } 70% { transform: translateY(0) scale(1.06, .9); } to { transform: none; } }
@keyframes tcc-float { 50% { transform: translateY(-8px) rotate(-1deg); } }
@keyframes tcc-shadow { 50% { transform: scaleX(.88); opacity: .7; } }
@keyframes tcc-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(calc(var(--k) * -5px), calc(var(--k) * -3px)) rotate(calc(var(--k) * -3deg)); }
  75% { transform: translate(calc(var(--k) * 5px), calc(var(--k) * -2px)) rotate(calc(var(--k) * 3deg)); } }
@keyframes tcc-leak { 50% { opacity: calc(.45 + var(--k) * .55); } }
@keyframes tcc-lock-off { 0% { opacity: 1; } to { transform: translate(-50%, -50%) translate(-160px, 260px) rotate(-540deg) scale(.6); opacity: 0; } }
@keyframes tcc-lid-off { 0% { transform: none; } 40% { transform: translateY(-150px) rotate(-14deg); } 100% { transform: translate(-220px, -420px) rotate(-62deg) scale(.7); opacity: 0; } }
@keyframes tcc-beam { 0% { height: 0; opacity: 0; } 30% { height: 520px; opacity: 1; } 100% { height: 420px; opacity: .55; } }
@keyframes tcc-flash { 0% { opacity: 0; } 15% { opacity: .85; } 100% { opacity: 0; } }
@keyframes tcc-pulse { 0% { transform: scale(.6); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes tcc-recoil { 0% { transform: scale(1); } 40% { transform: scale(1.12, .86); } 100% { transform: none; } }
@keyframes tcc-coin { 0% { opacity: 1; transform: translate(0, 0) scale(.3) rotate(0); }
  45% { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(var(--s)) rotate(calc(var(--rot) / 2)); }
  100% { opacity: 0; transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) * -.2 + 260px)) scale(var(--s)) rotate(var(--rot)); } }
@keyframes tcc-env { from { opacity: 0; transform: translateY(40px) scale(.3); } to { opacity: 1; transform: translate(var(--x), -110px) rotate(var(--tilt)) scale(1.1); } }
@keyframes tcc-btn-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  .tcc-rays.tcc-rays, .tcc-shadow.tcc-shadow, .tcc-seam.tcc-seam, .tcc-go.tcc-go, .tcc-stage .tcc-box.tcc-box.tcc-box { animation: none; }
  .tcc-stage.is-burst .tcc-lid, .tcc-stage.is-unlocked .tcc-lock { animation: none; opacity: 0; }
}

/* A legendary device's tile opens its ecosystem sheet (the header icons' slideshow). */
.qw-tile.is-eco { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.qw-tile.is-eco:hover, .qw-tile.is-eco:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(255, 140, 20, .25); }
@media (prefers-reduced-motion: reduce) { .qw-tile.is-eco { transition: none; } .qw-tile.is-eco:hover { transform: none; } }

/* The freeze windows, in the send window's style: the friends in one row (.tcs-row /
   .tcs-f, the one picked grows), the ice cube as the hero, one line of figures, one
   big golden button held 2 s. */
.qfm-row-f .tcs-f.tcs-f { gap: 4px; }
.qfm-row-f .qfm-slots img { width: 13px; }
.qfm-hero { display: grid; place-items: center; padding: 4px 0 2px;
  background: radial-gradient(ellipse 35% 70% at 50% 55%, color-mix(in srgb, var(--game-ice) 30%, transparent), transparent 72%); }
.qfm-hero img { width: 96px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .45)) drop-shadow(0 0 16px rgba(143, 211, 255, .45));
  animation: qfm-hero-float 3s ease-in-out infinite; }
@keyframes qfm-hero-float { 50% { transform: translateY(-4px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .qfm-hero img { animation: none; } }
.qfm-line { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; font-size: 13px; color: var(--game-text-2); }
.qfm-line b { font-family: var(--qw-mono, monospace); color: var(--game-text); }
.qfm-coin { display: inline-block; width: 16px; height: 16px; background: url("../../assets/img/tigercoins/coin.webp") center / contain no-repeat; vertical-align: -3px; }
.qfm-go.qfm-go { display: grid; place-items: center; min-height: 60px; border-radius: 14px; color: var(--game-on-gold);
  background: linear-gradient(180deg, var(--game-gold-hi), #ffc02e 55%, #f0a20f); box-shadow: 0 0 0 2px var(--game-gold), 0 8px 24px rgba(255, 178, 26, .35); }
.qfm-go-txt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 15px; font-weight: 800; }
.qfm-go-txt small { font-size: 12px; font-weight: 600; opacity: .8; }
.qfm-card .tc-reveal-actions { margin-top: 12px; }

/* Mend a broken streak (a Gold / Platinum perk): the account's badge floats above the
   card, a dead flame lights up again with the days it brings back. */
.qfm-art--badge { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55)) drop-shadow(0 0 18px rgba(255, 200, 60, .45)); }
.qfm-mend { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 6px 0; }
.qfm-flame { position: relative; display: grid; place-items: center; width: 76px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--game-orange) 30%, transparent), transparent 70%); }
.qfm-flame img { width: 60px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255, 122, 26, .7)); transform-origin: 50% 90%; animation: qfm-flame 1.6s ease-in-out infinite; }
.qfm-flame b { position: absolute; right: 2px; bottom: 2px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center;
  background: var(--game-orange); color: var(--game-on-gold); font: 800 13px var(--qw-mono, monospace); box-shadow: 0 0 0 2px #151a33; }
.qfm-flame.is-out { background: none; }
.qfm-flame.is-out img { width: 40px; filter: saturate(.55) brightness(.85); animation: none; }
.qfm-mend-arrow { font-size: 22px; color: var(--game-gold-text); }
@keyframes qfm-flame { 50% { transform: scale(1.08) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .qfm-flame img { animation: none; } }
.qfm-why-perk { margin: 0; font-size: 13px; line-height: 1.45; color: var(--game-text-2); }

/* ── Relight the flame: the ceremony once the repair succeeds (freeze-modal.js relight) ── */
.qfm-relight { position: relative; height: 190px; display: grid; place-items: center; }
.qfm-relight > * { grid-area: 1 / 1; }
.qfm-rl-small { width: 64px; filter: saturate(.5) brightness(.8); transform-origin: 50% 90%; transition: transform .25s ease, opacity .2s ease; }
.qfm-rl-big { width: 150px; opacity: 0; transform: scale(.3); transform-origin: 50% 90%; filter: drop-shadow(0 0 18px rgba(255, 122, 26, .9)); }
.qfm-rl-glow { width: 220px; aspect-ratio: 1; border-radius: 50%; opacity: .25;
  background: radial-gradient(circle, rgba(255, 176, 58, .55), rgba(255, 90, 20, .18) 45%, transparent 70%); transition: opacity .3s ease; }
.qfm-rl-ring { width: 60px; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--game-gold); opacity: 0; }
.qfm-rl-embers { position: relative; width: 0; height: 0; }
.qfm-rl-embers i { position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); aspect-ratio: 1; border-radius: 50%;
  background: var(--game-gold-hi); box-shadow: 0 0 8px 3px rgba(255, 122, 26, .9), 0 0 2px 1px var(--game-gold-hi); }
/* Charging: the dead flame trembles and warms up. */
.qfm-relight.is-charging .qfm-rl-small { animation: qfm-rl-tremble .09s linear infinite; filter: saturate(1) brightness(1.1) drop-shadow(0 0 10px rgba(255, 122, 26, .7)); transition: filter .8s ease; }
.qfm-relight.is-charging .qfm-rl-glow { opacity: .6; }
/* Lit: a flash, a shock ring, the big flame bursting up and then breathing. */
.qfm-relight.is-lit .qfm-rl-small { opacity: 0; transform: scale(1.6); }
.qfm-relight.is-lit .qfm-rl-big { animation: qfm-rl-burst .7s cubic-bezier(.2, 1.6, .4, 1) forwards, qfm-flame 1.6s ease-in-out .7s infinite; }
.qfm-relight.is-lit .qfm-rl-glow { opacity: 1; animation: qfm-rl-flash .6s ease-out, qfm-rl-pulse 1.8s ease-in-out .6s infinite; }
.qfm-relight.is-lit .qfm-rl-ring { animation: qfm-rl-ring .7s ease-out forwards; }
/* Big moments — the animation behind the window (coin-pull.js backfire): huge translucent
   copies of the moment's art swell and fade in staggered waves, under everything else in
   the overlay. --bottom rises from under the card, --center radiates from its middle. */
.bk-fire { position: fixed; z-index: -1; width: 0; height: 0; pointer-events: none; }
.bk-fire img { position: absolute; width: var(--bk-size, 520px); opacity: 0; mix-blend-mode: screen; animation: bk-swell var(--bk-dur, 2.1s) cubic-bezier(.2, .7, .3, 1) infinite; }
.bk-fire--bottom img { left: calc(var(--bk-size, 520px) / -2); bottom: 0; transform-origin: 50% 100%; }
.bk-fire--center img { left: calc(var(--bk-size, 520px) / -2); top: calc(var(--bk-size, 520px) / -2); transform-origin: 50% 50%; }
/* "top": centred on the window's top edge, behind its title plaque. */
.bk-fire--top img { left: calc(var(--bk-size, 520px) / -2); top: calc(var(--bk-size, 520px) / -2); transform-origin: 50% 50%; animation-name: bk-radiate-soft; }
@keyframes bk-swell {
  0% { opacity: 0; transform: scale(.35); filter: blur(4px) saturate(1.3); }
  15% { opacity: .55; }
  100% { opacity: 0; transform: scale(1.7) translateY(-30px); filter: blur(22px) saturate(1.6); }
}
.bk-fire--center img { animation-name: bk-radiate; }
@keyframes bk-radiate {
  0% { opacity: 0; transform: scale(.4) rotate(-4deg); filter: blur(3px) saturate(1.3); }
  15% { opacity: .5; }
  100% { opacity: 0; transform: scale(1.8) rotate(4deg); filter: blur(22px) saturate(1.6); }
}
/* Soft: a slow breath rather than a burst — eased in and out, lighter, less blur. */
.bk-fire--soft img { animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
.bk-fire--soft.bk-fire--center img { animation-name: bk-radiate-soft; }
@keyframes bk-radiate-soft {
  0% { opacity: 0; transform: scale(.55) rotate(-2deg); filter: blur(4px) saturate(1.2); }
  30% { opacity: .32; }
  100% { opacity: 0; transform: scale(1.55) rotate(2deg); filter: blur(16px) saturate(1.4); }
}
.qfm-rl-days { margin: 0; display: grid; justify-items: center; gap: 4px; text-align: center; }
.qfm-rl-days b { font: 800 30px var(--qw-mono, monospace); color: var(--game-gold-text); text-shadow: 0 0 16px rgba(255, 122, 26, .6); opacity: 0; transition: opacity .3s ease; }
.qfm-card.is-relit .qfm-rl-days b { opacity: 1; }
.qfm-rl-days b.is-tick { animation: qfm-rl-tick .22s ease-out; }
.qfm-rl-days span { font-size: 14px; font-weight: 700; color: var(--tsq-text); opacity: 0; animation: qfm-rl-in .5s ease 1.3s forwards; }
.qfm-card.is-relit.is-relit { box-shadow: 0 0 0 2px rgba(255, 176, 58, .8), 0 0 60px rgba(255, 122, 26, .55), 0 0 140px rgba(255, 90, 20, .35); transition: box-shadow .5s ease; }
.qfm-card.is-relighting .qfm-art { animation: qfm-rl-badge 2.4s ease-in-out infinite; }
@keyframes qfm-rl-tremble { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-1.5px) rotate(-2deg); } 75% { transform: translateX(1.5px) rotate(2deg); } }
@keyframes qfm-rl-burst { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; transform: scale(1.25); } 100% { opacity: 1; transform: scale(1); } }
@keyframes qfm-rl-flash { 0% { opacity: 1; transform: scale(.4); filter: brightness(3); } 100% { opacity: 1; transform: scale(1); filter: brightness(1); } }
@keyframes qfm-rl-pulse { 50% { transform: scale(1.08); opacity: .8; } }
@keyframes qfm-rl-ring { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(4.2); border-width: 1px; } }
@keyframes qfm-rl-tick { 0% { transform: scale(1.35); color: var(--game-gold-text); } 100% { transform: scale(1); } }
@keyframes qfm-rl-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes qfm-rl-badge { 50% { transform: translateY(-6px) scale(1.04); filter: drop-shadow(0 0 18px rgba(255, 176, 58, .7)); } }
@media (prefers-reduced-motion: reduce) {
  .qfm-relight.is-lit .qfm-rl-big { animation: none; opacity: 1; transform: none; }
  .qfm-relight.is-lit .qfm-rl-glow, .qfm-relight.is-lit .qfm-rl-ring, .qfm-card.is-relighting .qfm-art, .qfm-rl-days span { animation: none; opacity: 1; }
  .bk-fire { display: none; }
}

/* ── "Daily set complete": the window confirming the day's last quest (fullset-modal.js) ── */
.qfs-card.qfs-card { width: min(440px, 92vw); text-align: center; }
.qfs-stage { position: relative; height: 170px; display: grid; place-items: center; }
.qfs-stage > * { grid-area: 1 / 1; }
.qfs-chest { width: 150px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)); transform-origin: 50% 85%; }
.qfs-chest--open { opacity: 0; transform: scale(.6); }
.qfs-glow { width: 230px; aspect-ratio: 1; border-radius: 50%; opacity: .3; background: radial-gradient(circle, color-mix(in srgb, var(--game-gold) 55%, transparent), rgba(255, 140, 20, .15) 45%, transparent 70%); transition: opacity .3s ease; }
.qfs-ring { width: 70px; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--game-gold); opacity: 0; }
.qfs-sparks { position: relative; width: 0; height: 0; }
.qfs-sparks i { position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); aspect-ratio: 1; border-radius: 50%;
  background: var(--game-gold-hi); box-shadow: 0 0 8px 3px rgba(255, 176, 26, .85), 0 0 2px 1px var(--game-gold-hi); }
.qfs-stage.is-shaking .qfs-chest--closed { animation: qfs-shake .11s linear infinite; }
.qfs-stage.is-shaking .qfs-glow { opacity: .65; }
.qfs-stage.is-open .qfs-chest--closed { opacity: 0; transform: scale(1.3); transition: opacity .15s ease, transform .2s ease; }
.qfs-stage.is-open .qfs-chest--open { animation: qfs-pop .6s cubic-bezier(.2, 1.6, .4, 1) forwards, qfs-float 3s ease-in-out .6s infinite; }
.qfs-stage.is-open .qfs-glow { opacity: 1; animation: qfs-flash .6s ease-out, qfs-pulse 1.8s ease-in-out .6s infinite; }
.qfs-stage.is-open .qfs-ring { animation: qfs-ring .7s ease-out forwards; }
.qfs-xp { margin: 0; }
.qfs-xp b { font: 800 34px var(--qw-mono, monospace); color: #ffd84a; text-shadow: 0 0 18px rgba(255, 200, 40, .55); opacity: 0; transition: opacity .25s ease; }
.qfs-card.is-xp .qfs-xp b { opacity: 1; }
.qfs-streak { margin: 4px auto 0; display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--game-orange) 10%, transparent); border: 1px solid color-mix(in srgb, var(--game-orange) 35%, transparent); opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; }
.qfs-streak img { width: 34px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255, 122, 26, .7)); }
.qfs-streak span { display: grid; text-align: left; }
.qfs-streak small { font-size: 11px; color: var(--tsq-muted); }
.qfs-streak b { font: 800 18px var(--qw-mono, monospace); color: var(--game-gold-text); }
.qfs-streak b.is-tick { animation: qfm-rl-tick .3s ease-out; }
.qfs-combo, .qfs-palier { font-style: normal; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--game-orange); color: var(--game-on-gold); }
.qfs-palier { background: var(--game-gold); }
.qfs-line { margin: 10px 0 0; font-size: 14px; font-weight: 700; color: var(--tsq-text); opacity: 0; transition: opacity .4s ease .2s; }
.qfs-card.is-done .qfs-streak { opacity: 1; transform: none; }
.qfs-card.is-done .qfs-line { opacity: 1; }
.qfs-card.is-done.is-done { box-shadow: 0 0 0 2px rgba(255, 207, 61, .8), 0 0 60px rgba(255, 176, 26, .45); transition: box-shadow .5s ease; }
@keyframes qfs-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg) translateX(-2px); } 75% { transform: rotate(5deg) translateX(2px); } }
@keyframes qfs-pop { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.2); } 100% { opacity: 1; transform: scale(1); } }
@keyframes qfs-float { 50% { transform: translateY(-5px); } }
@keyframes qfs-flash { 0% { transform: scale(.4); filter: brightness(3); } 100% { transform: scale(1); filter: none; } }
@keyframes qfs-pulse { 50% { transform: scale(1.08); opacity: .8; } }
@keyframes qfs-ring { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(4); border-width: 1px; } }
@media (prefers-reduced-motion: reduce) {
  .qfs-stage.is-open .qfs-chest--open { animation: none; opacity: 1; transform: none; }
  .qfs-stage.is-open .qfs-glow, .qfs-stage.is-open .qfs-ring { animation: none; }
  .qfs-xp b, .qfs-streak, .qfs-line { opacity: 1; transform: none; transition: none; }
}

/* ── "How it works" window (openDialog "ceremony", the ⓘ of the streak and freeze cards, quests/index.js) ── */
.qd-streak { position: relative; }
.qf-info { border: 0; background: none; padding: 2px; cursor: pointer; display: inline-grid; place-items: center; }
.qf-info .icon { background: var(--qw-muted); transition: background .15s; }
.qf-info:hover .icon { background: var(--qw-ink); }
.qrules { --qw-tiger: var(--game-orange); --qw-glow: color-mix(in srgb, var(--game-orange) 45%, transparent); --qw-ink: var(--game-text); --qw-text: var(--game-text); --qw-muted: var(--game-muted); --qw-line: var(--game-line); --qw-bg: var(--game-bg); --qf-ice: var(--game-ice); }
.qrules-body { width: 100%; }
.qfp-static { display: flex; flex-direction: column; gap: 12px; text-align: left; color: var(--game-text); }
.qfp-static .qfp-rule { font-size: 14px; }
.qsr-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qsr-rules li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; line-height: 1.4; }
/* Each rule's mark: the real thing (pill, flame, combo badge, freeze cube) in a fixed column. */
.qsr-mark { flex-shrink: 0; width: 78px; display: inline-flex; justify-content: center; align-items: center; min-height: 22px; }
.qsr-mark img { width: 34px; aspect-ratio: 1; object-fit: contain; }
.qsr-mark .qd-pip i { width: 12px; height: 20px; }
.qsr-mark .qd-combo { margin: 0; font-size: 10.5px; padding: 1px 7px; white-space: nowrap; }
.qsr-table td b { color: var(--game-orange-text); }
.qsr-table tr.is-mine th, .qsr-table tr.is-mine td { background: color-mix(in srgb, var(--game-orange) 14%, transparent); }

/* The milestone table: a clean header row — small caps, centred, one line under it, no band. */
.qsr-table { table-layout: fixed; }
.qsr-table thead, .qsr-table thead tr { background: none; }
.qsr-table thead th { padding: 0 6px 8px; text-align: center; background: none; border-bottom: 1px solid var(--game-line); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--game-muted); }
.qsr-table tbody th, .qsr-table td { text-align: center; }
.qsr-table tbody th { display: table-cell; }
/* The freeze table: badge + name on one line, left; the cubes centred like the streak table's cells. */
.qsr-table .qsr-badge { display: inline-flex; align-items: center; gap: 6px; }
.qsr-table--freeze tbody th, .qsr-table--freeze thead th:first-child { text-align: left; }
.qsr-table .qfp-cubes { justify-content: center; }
.qsr-table .qfp-cubes img { width: 18px; }
