/* Tiers (js/features/tiers.js): quiet medals on tiles, a Tier column in the list, the inspector row, dimmed empty
   tier folders. Colours are tokens; one medal colour per tier, calm enough for the dark UI. */
:root {
  --tier-diamond: #a9ddff;
  --tier-diamond-edit: #84c3ee;
  --tier-gold: #e2b44c;
  --tier-silver: #bfc3cc;
  --tier-bronze: #c58a58;
}
.tier-diamond { color: var(--tier-diamond); }
.tier-diamond-edit { color: var(--tier-diamond-edit); }
.tier-gold { color: var(--tier-gold); }
.tier-silver { color: var(--tier-silver); }
.tier-bronze { color: var(--tier-bronze); }
.tier-ic { width: 14px; height: 14px; flex: none; display: block; }

/* the medal on a tile's picture: top left (the menu button, rating and the select tick sit on the right) */
.tier-badge { position: absolute; top: 8px; left: 8px; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px;
  background: rgba(12, 12, 14, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.tier-badge .tier-ic { width: 15px; height: 15px; }
/* the list: a medal on the thumbnail is for phones only (the Tier column does the job elsewhere) */
.tier-badge.lt { display: none; top: 1px; left: 1px; width: 16px; height: 16px; border-radius: 5px; }
.tier-badge.lt .tier-ic { width: 12px; height: 12px; }

/* list: the Tier column sits before the date */
.ltier { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; }
.ltier .tier-ic { width: 14px; }
.ltier-t { overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.lhead > .ltier { color: inherit; }
.lhead > .ltier.lsort { justify-self: start; }
.l-tier .lhead, .l-tier .lrow { --lc: 56px minmax(0, 1fr) 80px 110px 60px 128px 104px; }
.l-tier.l-dur .lhead, .l-tier.l-dur .lrow { --lc: 56px minmax(0, 1fr) 80px 110px 60px 60px 128px 104px; }
.vgrid:not(.l-tier) .ltier { display: none; }
@container vgrid (max-width: 720px) {
  .l-tier .lhead, .l-tier .lrow { --lc: 52px minmax(0, 1fr) 72px 96px 52px 118px; }
  .l-tier.l-dur .lhead, .l-tier.l-dur .lrow { --lc: 52px minmax(0, 1fr) 72px 96px 52px 52px 118px; }
}
@container vgrid (max-width: 480px) {
  .l-tier .lhead, .l-tier .lrow, .l-tier.l-dur .lhead, .l-tier.l-dur .lrow { --lc: 44px minmax(0, 1fr) 64px; }
  .lhead > .ltier, .lrow > .ltier { display: none; }
  .tier-badge.lt { display: grid; }
}

/* inspector */
.tier-v { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--text); }
.tier-v > span { min-width: 0; }

/* the setting "Dim empty tier folders" */
.tier-empty { opacity: .42; transition: opacity .12s; }
@media (hover: hover) { .tier-empty:hover { opacity: .85; } }
.lrow.tier-empty.sel, .tier-empty.sel { opacity: .85; }

/* a canvas item's medal (canvas/render.js; the canvas draws in world units, --iz keeps it constant on screen) */
.cv-badge.cv-tier { left: auto; right: calc(6px * var(--iz)); padding: 0; width: calc(18px * var(--iz)); justify-content: center; }
.cv-badge.cv-tier .tier-ic { width: calc(13px * var(--iz)); height: calc(13px * var(--iz)); fill: none; }

/* ---------- one top-left corner, several features (integration, 22 Nov) ----------
   Folder tiles: tier medal at 8 px; the select tick (grid.css .tile.sel::after, and the rings of "Select") takes
   that spot, so the medal steps right; culling's "→ Gold" / "Waiting to move" pill follows whatever sits left of
   it. The menu button and the stars stay top-right (actions.css), the duration bottom-right, the link mark
   bottom-left. Search tiles: the % pill owns the top-left, so the medal and the culling pill sit just below it
   (the stars are bottom-left there, the tick and the menu button on the right). */
.tile.sel .tier-badge, body.am-picking .vgrid .tile .tier-badge { left: 36px; }
.vcell:has(.tier-badge) > .cull-badge { left: 36px; }
.tile.sel > .cull-badge, body.am-picking .vgrid .tile > .cull-badge { left: 36px; }
.tile.sel:has(.tier-badge) > .cull-badge, body.am-picking .vgrid .tile:has(.tier-badge) > .cull-badge { left: 64px; }
.s-frame > .tier-badge { top: 36px; }
.s-frame > .cull-badge { top: 36px; }
.s-frame:has(> .tier-badge) > .cull-badge { left: 36px; }
/* a tile with a culling pill already says its tier ("→ Gold"): the plain stars step aside so the pills never meet
   on small tiles (a colour label keeps the badge) */
.vcell:not(.lrow):has(> .cull-badge) > .rate-badge:not(:has(.rate-dot)) { display: none; }
