/* ==========================================================================
   Cards — the cheat-sheet cards and a student's collection of them
   (cards.js). One sheet for the app (index.html: the chip under an answer,
   the card in a dialog, the collection on Me) and for cards.html.

   A card is a trading card: a number and a rarity across the top, a picture
   in a dark window (a stage, like every 3D model here: --stage-*), its name,
   then what a student would copy onto a cheat sheet. Rarity is the colour of
   the frame — grey, teal, coral, amber, the emblems' own scale. A card not
   yet earned is shown in grey; its words are never locked away under an
   answer.
   ========================================================================== */

.tcard {
  --tc: var(--border-depth);
  --tc-ink: var(--muted);
  position: relative;
  display: block;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--tc);
  border-radius: var(--r-lg, 16px);
  text-align: left;
  font: inherit;
}
.tcard.rar-2 { --tc: var(--teal); --tc-ink: var(--teal-dark); }
.tcard.rar-3 { --tc: var(--coral); --tc-ink: var(--coral-ink); }
.tcard.rar-4 { --tc: var(--amber); --tc-ink: var(--amber-ink); }
:root[data-theme="dark"] .tcard.rar-2 { --tc-ink: var(--teal); }
:root[data-theme="dark"] .tcard.rar-3 { --tc-ink: var(--coral); }
:root[data-theme="dark"] .tcard.rar-4 { --tc-ink: var(--amber); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tcard.rar-2 { --tc-ink: var(--teal); }
  :root:not([data-theme="light"]) .tcard.rar-3 { --tc-ink: var(--coral); }
  :root:not([data-theme="light"]) .tcard.rar-4 { --tc-ink: var(--amber); }
  :root:not([data-theme="light"]) .tc-links a, :root:not([data-theme="light"]) .tc-credit a { color: var(--teal); }
}

/* The picture's window. */
.tc-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md, 12px);
  background: radial-gradient(120% 90% at 50% 38%, var(--stage-glow), var(--stage-bg) 72%);
  color: var(--stage-text);
}
.tc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tc-img.cover { object-fit: cover; }
/* A diagram from an open collection: shown whole, on the white it was drawn for. */
.tc-img.whole { object-fit: contain; padding: 6px; }
.tc-art.on-white { background: #fff; }
/* The words a card stood on before it had a photograph, over the foot of it. */
.tc-over {
  position: absolute; inset: auto 0 0 0; display: grid; gap: 1px; padding: 18px 12px 8px; text-align: left;
  background: linear-gradient(transparent, rgba(8, 14, 20, 0.82) 55%);
  color: #fff; font-family: var(--font-display); line-height: 1.15; text-wrap: balance; pointer-events: none;
}
.tc-over b { font-weight: 800; font-size: 15px; }
.tc-over small { font-family: var(--font-body); font-weight: 600; font-size: 11px; color: rgba(255, 255, 255, 0.82); }
.tc-img.fig { inset: 0; padding: 0; }
/* Words set large, for a card whose picture is a formula or a name. */
.tc-big {
  display: grid; gap: 4px; justify-items: center; padding: 8px 12px; text-align: center;
  font-family: var(--font-display); line-height: 1.12; text-wrap: balance;
  background-image: linear-gradient(color-mix(in srgb, var(--stage-text) 6%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--stage-text) 6%, transparent) 1px, transparent 1px);
  background-size: 22px 22px; background-position: center;
  position: absolute; inset: 0; align-content: center;
}
.tc-big b { font-weight: 900; font-size: 26px; color: var(--stage-text); }
.tc-big.m b { font-size: 21px; }
.tc-big.s b { font-size: 16px; }
.tc-big small { font-family: var(--font-body); font-weight: 600; font-size: 12px; color: color-mix(in srgb, var(--stage-text) 70%, transparent); }
.tc-art.k-words { aspect-ratio: 16 / 5; }

/* A set's picture with its parts named: the picture in the middle, names
   down both sides, a leader from each to its part. */
.tc-art.has-pins { aspect-ratio: 20 / 11; }
.tc-art.has-pins .tc-img { left: 28%; width: 44%; object-fit: fill; }
.tc-leads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tc-leads polyline { fill: none; stroke: color-mix(in srgb, var(--stage-text) 62%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tc-dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: var(--r-full, 9999px); background: var(--stage-focus); box-shadow: 0 0 0 2px var(--stage-veil); }
.tc-pin {
  position: absolute; width: 26%; transform: translateY(-50%);
  font-size: 10.5px; line-height: 12px; font-weight: 600; color: var(--stage-text);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tc-pin.l { left: 0; text-align: right; }
.tc-pin.r { right: 0; text-align: left; }

/* ── The whole card ───────────────────────────────────────────────── */
/* Its words are in view wherever it stands, held or not: a card is earned
   by answering, never unlocked by it. `tc-face` is the card as one column
   (a wide page, print); `tc-deck` is the card set into a box of a given
   height and cut into pages where it does not fit — a page is whole on the
   screen and nothing is scrolled (cards.js, `mount`). */
.tc-face, .tc-deck {
  padding: 8px 12px 12px;
  /* A trading card: the frame in its rarity's colour, a hairline inside it,
     and that colour running down from the top behind the picture. */
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 13%, var(--surface)) 0, var(--surface) 168px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 28%, transparent), var(--card-shadow);
}
.tc-face { max-width: 440px; margin-inline: auto; }
.tc-deck { display: block; width: 100%; padding-bottom: 8px; }
.tc-face .tc-art, .tc-deck .tc-art { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stage-text) 16%, transparent); }
.tc-no { font-family: var(--font-display); font-weight: 900; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--tc-ink); }
.tc-deck.compact .tc-no { display: none; }
.tc-bar { display: flex; align-items: center; gap: 8px; min-height: 22px; margin: 0 2px 6px; font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tc-ink); }
.tc-bar .tc-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.tc-earn { display: inline-flex; align-items: center; gap: 4px; letter-spacing: .06em; color: var(--muted); }
.tc-earn.got { padding: 1px 8px 1px 6px; border-radius: var(--r-full, 9999px); background: color-mix(in srgb, var(--amber) 24%, transparent); color: var(--amber-ink); }
.tc-earn.got i { font-style: normal; }
@media (prefers-reduced-motion: no-preference) { .tc-earn.now { animation: tc-pop var(--dur-celebrate, 700ms) var(--ease-reward) 1; } }
.tc-dots { display: inline-flex; gap: 4px; }
.tc-dots i { width: 9px; height: 9px; border-radius: var(--r-full, 9999px); border: 2px solid var(--tc); }
.tc-dots i.on { background: var(--tc); }
.tcard .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* A box too low for the name to have a line of its own: it is said in the bar. */
.tc-name { display: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-weight: 900; font-size: 16px; line-height: 20px; letter-spacing: 0; text-transform: none; color: var(--text); }
.tc-deck.compact .tc-name { display: block; }
.tc-deck.compact .tc-from, .tc-deck.compact .tc-page > .tc-title, .tc-deck.compact .tc-page > .tc-sub, .tc-deck.compact .tc-cont { display: none; }
.tc-deck.compact .tc-turn { width: 30px; height: 30px; font-size: 17px; }
.tc-deck.compact .tc-pager { margin-top: 4px; }
.tc-pages { position: relative; }
.tc-page { display: flow-root; }
.tc-page[hidden] { display: none; }
.tc-deck .tc-art { aspect-ratio: auto; height: var(--tc-art-h, 180px); }
.tc-deck .tc-art.has-pins { aspect-ratio: 20 / 11; height: auto; width: min(100%, calc(var(--tc-art-h, 180px) * 20 / 11)); margin-inline: auto; }
.tc-face .tc-title, .tc-deck .tc-title { margin: 10px 2px 0; font-family: var(--font-display); font-weight: 900; font-size: 21px; line-height: 25px; text-wrap: balance; }
.tc-sub { margin: 2px 2px 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.tc-lead { margin: 6px 2px 0; font-size: 14.5px; line-height: 21px; text-wrap: pretty; }
.tc-cont { display: flex; align-items: baseline; gap: 8px; margin: 2px 2px 4px; }
.tc-cont b { font-family: var(--font-display); font-weight: 900; font-size: 16px; line-height: 20px; }
.tc-cont span { font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

/* What to copy onto the sheet. A short fact is a tag, as on a specimen's
   label; a longer one is a row. The one the question just asked is marked. */
.tc-tags { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tc-tag { padding: 3px 10px; border-radius: var(--r-full, 9999px); border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; line-height: 18px; font-weight: 600; }
.tc-tag span { margin-right: 3px; font-weight: 700; color: var(--muted); }
.tc-facts { margin: 8px 0 0; display: grid; gap: 0; border-top: 1px solid var(--border); }
.tc-fact { display: grid; grid-template-columns: minmax(78px, 30%) 1fr; gap: 10px; padding: 5px 2px; border-bottom: 1px solid var(--border); }
.tc-facts dt { font-size: 12px; line-height: 18px; font-weight: 700; color: var(--muted); }
.tc-facts dd { margin: 0; font-size: 14px; line-height: 19px; }
.tc-list { margin: 8px 0 0; padding-left: 24px; font-size: 14px; line-height: 19px; }
.tc-list li { padding: 2px 0; }
.tc-list li::marker { font-weight: 700; color: var(--tc-ink); font-variant-numeric: tabular-nums; }
.tc-table { margin: 8px 0 0; overflow-x: auto; }
.tc-table table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; }
.tc-table th, .tc-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.tc-table thead th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tc-table tbody th { font-weight: 700; }
.tc-fact.hit, .tc-list li.hit, .tc-table tr.hit > * { background: var(--teal-soft); }
.tc-fact.hit { box-shadow: inset 3px 0 0 var(--teal); padding-left: 8px; }
.tc-fact.hit dt, .tc-table tr.hit th { color: var(--text); }
.tc-list li.hit { box-shadow: -24px 0 0 var(--teal-soft), inset 0 0 0 0 transparent; border-radius: 0 6px 6px 0; }
.tc-tag.hit { border-color: var(--teal); background: var(--teal-soft); }
.tc-asked-here { margin: 8px 0 0; padding: 6px 10px; border-radius: var(--r-sm, 8px); background: var(--teal-soft); box-shadow: inset 3px 0 0 var(--teal); font-size: 14px; line-height: 19px; }
.tc-asked-here b { display: block; font-size: 11px; line-height: 14px; letter-spacing: .09em; text-transform: uppercase; color: var(--teal-dark); }
:root[data-theme="dark"] .tc-asked-here b { color: var(--teal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tc-asked-here b { color: var(--teal); } }
.tc-tip { margin: 8px 0 0; padding: 7px 10px; border-radius: var(--r-sm, 8px); background: color-mix(in srgb, var(--amber) 14%, var(--surface)); font-size: 14px; line-height: 19px; }
.tc-tip b { display: block; font-size: 11px; line-height: 14px; letter-spacing: .09em; text-transform: uppercase; color: var(--amber-ink); }
.tc-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 10px 2px 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.tc-school { padding: 1px 8px; border-radius: var(--r-full, 9999px); border: 1px solid var(--border); font-weight: 700; color: var(--text); }
.tc-foot a { color: var(--teal-dark); }
:root[data-theme="dark"] .tc-foot a { color: var(--teal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tc-foot a { color: var(--teal); } }
.tc-open { font-weight: 700; }
.tc-more, .tc-credit { flex-basis: 100%; }
.tc-credit { font-size: 11px; line-height: 14px; }

/* Turning the pages of a card that is more than one screen. */
.tc-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; }
.tc-pager[hidden] { display: none; }
.tc-turn { width: 36px; height: 36px; border-radius: var(--r-full, 9999px); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 2px; }
.tc-turn:disabled { opacity: .35; cursor: default; }
.tc-turn:not(:disabled):hover { border-color: var(--teal); }
.tc-turn:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 2px; }
.tc-pips { display: inline-flex; gap: 6px; }
.tc-pips i { width: 7px; height: 7px; border-radius: var(--r-full, 9999px); background: var(--border-depth); }
.tc-pips i.on { background: var(--tc-ink); width: 18px; }

/* Where a mineral is met in daily life: a photograph beside one line. */
.tc-use { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; margin: 10px 0 0; }
.tc-use img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--r-sm, 8px); border: 1px solid var(--border); }
.tc-use figcaption { font-size: 13.5px; line-height: 19px; }
.tc-use figcaption b { display: block; font-size: 11px; line-height: 14px; letter-spacing: .09em; text-transform: uppercase; color: var(--tc-ink); }
.tc-use figcaption small { display: block; margin-top: 2px; font-size: 11px; line-height: 14px; color: var(--muted); }
.tc-use figcaption a { color: inherit; }

/* The pictures real tests have printed of it: small, in a row, each a link
   to the question it came with. */
.tc-pics { margin: 10px 0 0; }
.tc-pics .overline { margin: 0 2px 6px; color: var(--muted); }
.tc-pics-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tc-pic { display: block; aspect-ratio: 4 / 3; border-radius: var(--r-sm, 8px); overflow: hidden; background: #fff; border: 1px solid var(--border); }
.tc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.tc-pic:hover, a.tc-pic:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 1px; }

/* A card that is held carries a sheen that passes once. One that is not is
   in its own colours too: a mineral in grey teaches the wrong thing. */
.tcard.held.tc-face::after, .tcard.held.tc-deck::after, .tcard.held.tc-tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, color-mix(in srgb, var(--tc) 22%, transparent) 47%, color-mix(in srgb, #fff 30%, transparent) 50%, color-mix(in srgb, var(--tc) 22%, transparent) 53%, transparent 65%);
  background-size: 300% 100%; background-position: 110% 0; opacity: .0;
}
@media (prefers-reduced-motion: no-preference) {
  .tcard.held.tc-face::after, .tcard.held.tc-deck::after { animation: tc-sheen 1.4s var(--ease-standard) .25s 1 both; }
  .tcard.held.tc-tile:hover::after { animation: tc-sheen .9s var(--ease-standard) 1 both; }
}
@keyframes tc-sheen { 0% { background-position: 110% 0; opacity: 1; } 99% { background-position: -10% 0; opacity: 1; } 100% { background-position: -10% 0; opacity: 0; } }
.tcard:not(.held).tc-tile { --tc: var(--border); }

/* ── In a collection, seen from far off ───────────────────────────── */
.tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 12px; }
.tc-tile { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; padding: 8px; cursor: pointer; min-height: 176px; align-content: start; }
.tc-tile .tc-art { aspect-ratio: 4 / 3; }
.tc-tile .tc-title { font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 18px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tc-tile .tc-big b { font-size: 15px; }
.tc-tile .tc-big.m b, .tc-tile .tc-big.s b { font-size: 12px; }
.tc-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10px; line-height: 14px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tc-ink); }
.tc-tile:focus-visible, .tc-chip:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 2px; }
@media (hover: hover) { .tc-tile:hover { transform: translateY(-2px); box-shadow: var(--card-shadow); } }
.tc-tile { transition: transform var(--dur-short, 180ms) var(--ease-standard), box-shadow var(--dur-short, 180ms) var(--ease-standard); }

/* ── A card named in passing: a small one that says where it stands ── */
.tc-chip { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 6px 10px 6px 6px; cursor: pointer; min-height: 60px; }
.tc-chip .tc-art { width: 72px; aspect-ratio: 4 / 3; border-radius: var(--r-sm, 8px); }
.tc-chip .tc-big b { font-size: 11px; }
.tc-chip .tc-big { padding: 4px; background-size: 12px 12px; }
.tc-chip-text { display: grid; min-width: 0; }
.tc-chip-text .overline { color: var(--tc-ink); }
.tc-chip-text b { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 19px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tc-chip-text small { font-size: 12px; line-height: 16px; color: var(--muted); }
.tc-chip.now { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
@media (prefers-reduced-motion: no-preference) {
  .tc-chip.now { animation: tc-pop var(--dur-celebrate, 700ms) var(--ease-reward) 1; }
}
@keyframes tc-pop { 0% { transform: scale(.94); } 55% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* A row of the cards earned in a session (the summary), or held (Me). */
.tc-row { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.tc-row > * { scroll-snap-align: start; }

@media print {
  .tc-art { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tc-face { box-shadow: none; break-inside: avoid; }
}

/* ── cards.html: the sheet, every card open ───────────────────────── */
.cards-page { background: var(--bg); color: var(--text); }
.cp { max-width: 1120px; margin: 0 auto; padding: 16px 16px 64px; display: grid; gap: 12px; }
.cp-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 16px; }
.cp-back { grid-column: 1 / -1; font-weight: 700; color: var(--teal-dark); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
:root[data-theme="dark"] .cp-back { color: var(--teal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cp-back { color: var(--teal); } }
.cp-back:hover { text-decoration: underline; }
.cp-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 28px; line-height: 32px; }
.cp-event { display: grid; gap: 2px; }
.cp-event select { min-height: var(--tap-min); max-width: 52vw; padding: 0 10px; border-radius: var(--r-md, 12px); border: var(--line) solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; }
.cp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.cp-count { flex: 1 1 220px; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 8px; color: var(--muted); font-size: 14px; }
.cp-count b { font-family: var(--font-display); font-weight: 900; font-size: 26px; line-height: 30px; color: var(--text); }
.cp-track { grid-column: 1 / -1; height: 8px; border-radius: var(--r-full, 9999px); background: var(--surface-2); overflow: hidden; }
.cp-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--amber), var(--coral)); transition: width var(--dur-long) var(--ease-standard); }
.cp-filter { display: inline-flex; padding: 3px; border-radius: var(--r-full, 9999px); background: var(--surface-2); }
.cp-filter button { min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-full, 9999px); background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.cp-filter button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.cp-print { width: auto; min-height: 40px; padding: 0 16px; font-size: 15px; }
.cp-how { margin: 0; }
.cp-keep { display: block; margin-top: 4px; }
/* The event's units, to jump by: it stays at the top as the sheet is read. */
.cp-units { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 8px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); scrollbar-width: none; }
.cp-units::-webkit-scrollbar { display: none; }
.cp-units a { flex: none; padding: 6px 12px; border-radius: var(--r-full, 9999px); border: var(--line) solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; line-height: 18px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.cp-units a:hover { border-color: var(--teal); }
.cp-sections { display: grid; gap: 28px; }
.cp-section { scroll-margin-top: 56px; }
.cp-unit { margin: 0 0 10px; font-family: var(--font-display); font-weight: 900; font-size: 20px; line-height: 26px; }
.cp-unit small { margin-left: 6px; font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--muted); }
.cp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.cp-slot { display: grid; gap: 6px; min-height: 280px; align-content: start; scroll-margin-top: 64px; border-radius: var(--r-lg, 16px); }
.cp-slot.in { min-height: 0; }
.cp-slot .tc-deck { box-shadow: var(--card-shadow); }
.cp-slot:not(.in) .cp-deck { min-height: 240px; border-radius: var(--r-lg, 16px); background: var(--surface); border: 2px solid var(--border); }
.cp-go { justify-self: start; padding: 2px 4px; color: var(--teal-dark); font-size: 13px; line-height: 18px; font-weight: 700; text-decoration: none; }
:root[data-theme="dark"] .cp-go { color: var(--teal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cp-go { color: var(--teal); } }
.cp-go:hover { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) { .cp-slot.flash { animation: cp-flash 1.6s var(--ease-standard) 1; } }
.cp-slot.flash .tc-deck { outline: 3px solid var(--amber); outline-offset: 3px; }
@keyframes cp-flash { 0% { transform: scale(.98); } 30% { transform: scale(1.01); } 100% { transform: none; } }
.cp-sheet { display: none; }
@media print {
  .cards-page > :not(.cp-sheet) { display: none !important; }
  .cp-sheet { display: block; color: #000; background: #fff; }
  .cp-sheet h1 { margin: 0; font: 900 20px/24px var(--font-display); }
  .cp-sheet p { margin: 2px 0 10px; font-size: 11px; }
  .cp-sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: start; }
  .cp-sheet .tc-face { max-width: none; margin: 0; padding: 6px 8px 8px; border-width: 1.5px; background: #fff; color: #000; }
  .cp-sheet .tc-face::after { display: none; }
  .cp-sheet .tc-title { font-size: 14px; line-height: 17px; margin-top: 6px; }
  .cp-sheet .tc-lead, .cp-sheet .tc-facts dd, .cp-sheet .tc-list, .cp-sheet .tc-tip, .cp-sheet .tc-table table, .cp-sheet .tc-tag { font-size: 9.5px; line-height: 12.5px; }
  .cp-sheet .tc-facts dt, .cp-sheet .tc-foot, .cp-sheet .tc-bar, .cp-sheet .tc-sub { font-size: 8px; line-height: 11px; }
  .cp-sheet .tc-more, .cp-sheet .tc-credit, .cp-sheet .tc-open, .cp-sheet .tc-earn, .cp-sheet .tc-pics { display: none; }
  .cp-sheet .tc-tag, .cp-sheet .tc-tip { background: #fff; border-color: #999; }
  .cp-sheet .tc-pin { font-size: 7px; line-height: 8px; }
}

/* The way to an event's sheet from the home screen. */
.home-cards { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--r-lg, 16px); border: var(--line) solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; min-height: var(--tap-min); }
.home-cards .hc-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm, 8px); background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber-ink); font-size: 18px; }
.home-cards .hc-text { display: grid; }
.home-cards .hc-text b { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 20px; }
.home-cards .hc-text small { font-size: 13px; line-height: 18px; color: var(--muted); }
.home-cards .hc-go { font-size: 22px; color: var(--muted); }
.home-cards:hover { border-color: var(--teal); }
.sum-cards { margin-top: var(--sp-lg, 16px); text-align: left; }
.sum-cards .overline { margin: 0 0 6px; color: var(--amber-ink); }
.card-sheet { text-align: left; }

/* Me: each event's sheet, with how much of it is held. */
.me-card-sets { list-style: none; margin: 0 0 var(--sp-md, 12px); padding: 0; display: grid; gap: 2px; }
.me-card-sets a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; padding: 8px 2px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.me-card-sets a:hover span:first-child { text-decoration: underline; }
.me-card-sets .track { grid-column: 1 / -1; height: 6px; border-radius: var(--r-full, 9999px); background: var(--surface-2); overflow: hidden; }
.me-card-sets .track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--amber), var(--coral)); }
.cards-card .tc-row { margin-bottom: var(--sp-sm, 8px); }

/* A link drawn as a button (Me: "Open the cheat sheet"). */
a.cta { display: grid; place-items: center; text-decoration: none; }
