@font-face { font-family: "Marcellus"; src: url("/static/fonts/marcellus-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/static/fonts/archivo-latin-standard-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "New Rocker"; src: url("/static/fonts/new-rocker-latin-400-normal.woff2") format("woff2"); font-display: swap; }   /* the closest font to the KINGS VAULT lettering */
@font-face { font-family: "Figtree"; src: url("/static/fonts/figtree-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

/* ---------- default theme (Kings Vault: black and gold) ---------- */
:root {
  --bg: #000000; --bg-glow-a: #191307; --bg-glow-b: #0d0a04;
  --ink: #f4ecd8; --muted: #979286; --accent: #d4a94a; --on-accent: #000000;
  --frame: rgba(255, 255, 255, .055); --frame-hover: rgba(255, 255, 255, .1); --card-frame: rgba(255, 255, 255, .008);
  --line: rgba(244, 236, 216, .14); --panel: rgba(0, 0, 0, .55); --dialog: #121212;
  --shade: rgba(0, 0, 0, .87); --danger: #ff8f84; color-scheme: dark;
}
/* All other themes are defined in themes.js and applied as these same variables. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background-color: var(--bg);
  background-image:
    radial-gradient(90vmax 60vmax at 12% -10%, var(--bg-glow-a), transparent 62%),
    radial-gradient(70vmax 60vmax at 105% 105%, var(--bg-glow-b), transparent 60%);
  background-attachment: fixed;
  font: 600 semi-condensed 22px/1.4 "Archivo", "Arial Narrow", system-ui, sans-serif;
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4.1px; border-radius: 5.4px; }
[hidden] { display: none !important; }
.wrap { width: min(2268px, 100%); margin: 0 auto; padding: 0 clamp(22px, 4.1vw, 59px); }

/* ---------- banner ---------- */
.banner { border-bottom: 1px solid var(--line); background: var(--panel); }
.bar { position: relative; display: flex; align-items: center; gap: 19px; min-height: 103px; }
.logo { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); }
/* Brand marks: the crest and the KINGS VAULT lettering, each a cut-out filled with one flat color. */
.crest-mark, .word-mark { display: block; flex: none; background: var(--accent); -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.crest-mark { aspect-ratio: 720 / 738; -webkit-mask-image: url("/static/brand/crest-mono.webp"); mask-image: url("/static/brand/crest-mono.webp"); }
.word-mark { aspect-ratio: 1200 / 189; -webkit-mask-image: url("/static/brand/wordmark-mono.png"); mask-image: url("/static/brand/wordmark-mono.png"); }
.logo .crest-mark { height: 76px; }
.logo .word-mark { height: clamp(30px, 3.4vw, 40px); }
.back, .settings-btn, .full-btn {
  display: inline-flex; align-items: center; gap: 11px; height: 57px; padding: 0 19px;
  background: transparent; border: 1px solid var(--line); border-radius: 1349px;
  text-decoration: none; font-weight: 660; font-size: 20px;
}
.back:hover, .full-btn:hover, .settings-btn:hover, .settings-btn[aria-expanded="true"] { background: var(--frame-hover); }
.full-btn { width: 57px; padding: 0; justify-content: center; }
.back svg, .settings-btn svg, .full-btn svg { width: 24px; height: 24px; flex: none; }
.settings-btn { flex: none; margin-left: auto; }

/* Full screen: no page scrollbar (the page still scrolls). */
html:fullscreen { scrollbar-width: none; }
html:fullscreen::-webkit-scrollbar, html:fullscreen body::-webkit-scrollbar { display: none; }

/* Background animation on list pages (bgfx.js): behind everything except the page background itself. */
.bgfx { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none; }
.grid-wrap { position: relative; }
.admin-mark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-transform: uppercase;
  font-size: 18px; letter-spacing: .28em; color: var(--muted); pointer-events: none;
}

.panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.panel.open { grid-template-rows: 1fr; }
.panel > div { overflow: hidden; }
.menu { margin-left: auto; width: min(580px, 100%); padding: 5.4px 0 30px; }
.menu-row {
  display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 18px 5.4px;
  background: none; border: 0; border-top: 1px solid var(--line); text-align: left; font-size: 22px; font-weight: 660;
}
.menu-row:hover { color: var(--accent); }
.menu-row svg { width: 22px; height: 22px; transition: transform .2s; }
.menu-row[aria-expanded="true"] svg { transform: rotate(180deg); }
.sub { padding: 2px 5.4px 24px; }
.theme-scroll { max-height: min(46vh, 567px); overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.theme-group { margin: 19px 0 11px; font-size: 18px; font-weight: 740; color: var(--muted); }
.theme-group:first-child { margin-top: 0; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(173px, 1fr)); gap: 11px; }
.theme-opt {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--frame);
  border: 1px solid var(--line); border-radius: 11px; font-size: 19px;
}
.theme-opt[aria-pressed="true"] { border-color: var(--accent); }
.theme-opt i { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, .5); flex: none; }
.slider { display: grid; grid-template-columns: auto 1fr 2ch; align-items: center; gap: 14px; font-size: 15px; }
.slider input { width: 100%; accent-color: var(--accent); }
.slider output { font-variant-numeric: tabular-nums; text-align: right; }
.sub-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 57px; padding: 0 24px;
  background: var(--frame); border: 1px solid var(--line); border-radius: 11px; font-weight: 800; font-size: 20px;
}
.btn:hover { background: var(--frame-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- page heading + grids ---------- */
.page-title { padding: clamp(35px, 5.4vw, 70px) 0 clamp(24px, 3.2vw, 40px); display: flex; flex-wrap: wrap; align-items: center; column-gap: clamp(19px, 2.7vw, 38px); row-gap: 11px; }
.page-title p { flex-basis: 100%; }
.page-title h1 { font: 800 condensed clamp(40px, 5.9vw, 78px)/1.08 "Archivo", "Arial Narrow", sans-serif; letter-spacing: .01em; text-wrap: balance; }
.page-title p { margin-top: 14px; color: var(--muted); font-size: clamp(20px, 1.8vw, 24px); }
.page-title p:empty { display: none; }
.grid { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: clamp(11px, 1.9vw, 30px); padding-bottom: 130px; }
.tile { container-type: inline-size; min-width: 0; }
.frame {
  position: relative; display: block; width: 100%; padding: 6cqi; background: var(--card-frame);
  border: 1px solid color-mix(in srgb, var(--line) 11%, transparent); border-radius: max(8px, 4cqi); overflow: hidden;
  transition: background .18s, border-color .18s;
}
.frame img { display: block; width: 100%; aspect-ratio: 3 / 5; object-fit: contain; border-radius: max(4.1px, 2cqi); }
button.frame:hover, a.tile:hover .frame { background: var(--frame); border-color: var(--accent); }

/* landing tiles */
a.tile { display: block; text-decoration: none; }
a.tile h2 { display: flex; align-items: flex-end; min-height: 2.3em; font: 800 condensed clamp(16px, 11cqi, 44px)/1.12 "Archivo", "Arial Narrow", sans-serif; margin-bottom: 5cqi; text-wrap: balance; overflow-wrap: anywhere; }
a.tile .frame img { aspect-ratio: 4 / 5; }
a.tile .when { margin-top: 4.5cqi; font-size: clamp(13px, 6.6cqi, 22px); color: var(--muted); line-height: 1.35; }
a.tile .state { display: block; color: var(--ink); font-weight: 740; }
a.tile .state.live { color: var(--accent); }
a.tile.archived { opacity: .55; }
#lists { row-gap: clamp(35px, 4.6vw, 65px); }
.empty { padding: 12vh 0; color: var(--muted); font-size: 24px; max-width: 46ch; }

/* card tiles */
.card .name {
  margin-top: 4cqi; text-align: center; font-weight: 740; letter-spacing: .04em;
  font-size: clamp(11px, 8.4cqi, 22px); line-height: 1.2; overflow-wrap: anywhere;
}
.card.pulled .frame { filter: grayscale(1); }                 /* everything on a pulled card, badges included, goes grey */
.card.pulled .frame img { filter: brightness(.7); opacity: .45; }
.card.pulled .name { color: var(--muted); }
.ribbon {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: grid; gap: 1.2cqi; justify-items: center;
  padding: 3cqi 2cqi; text-align: center; background: rgba(18, 18, 18, .62); color: rgba(235, 235, 235, .88);
  border-block: 1px solid rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  font: 700 condensed 9.5cqi/1 "Archivo", "Arial Narrow", sans-serif; letter-spacing: .3em; text-indent: .3em; pointer-events: none;
}
.ribbon small { font-size: .62em; letter-spacing: .14em; text-indent: .14em; font-weight: 600; color: rgba(235, 235, 235, .7); overflow-wrap: anywhere; }

.to-top {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 122px); z-index: 5;
  height: 62px; padding: 0 27px; background: var(--dialog); border: 1px solid var(--line); border-radius: 1349px;
  font-weight: 800; display: inline-flex; align-items: center; gap: 11px; transition: transform .25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}
.to-top.show { transform: translate(-50%, 0); }
.to-top svg { width: 22px; height: 22px; }

/* ---------- enlarged card ---------- */
dialog { color: var(--ink); }
.lightbox {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--shade); display: none; place-items: center; cursor: zoom-out; outline: none; overflow: hidden;
  transition: background-color .45s ease;
}
.lightbox[open] { display: grid; }
.lightbox::backdrop { background: transparent; }
.lightbox.celebrating { background: rgba(0, 0, 0, .95); cursor: default; }
.lightbox.leaving { background: transparent; }
.lb-card { position: relative; grid-area: 1 / 1; line-height: 0; will-change: transform; }
.lb-card img { max-width: 94vw; max-height: 92dvh; border-radius: 10px; box-shadow: 0 20px 80px rgba(0, 0, 0, .6); }
.lb-fx { position: fixed; inset: 0; width: 100vw; height: 100dvh; pointer-events: none; }
.lightbox .touch-pull {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: none;
  background: var(--dialog); border: 1px solid var(--line); border-radius: 1349px; padding: 14px 24px; font-size: 19px;
}
@media (hover: none) { .lightbox.is-admin .touch-pull { display: block; } }
.lightbox.celebrating .touch-pull, .lightbox.leaving .touch-pull { display: none; }

/* ---- pull text: centred, no backing, always revealed left to right ---- */
.pull-text {
  grid-area: 1 / 1; z-index: 5; max-width: 92vw; padding: .3em .4em; text-align: center; pointer-events: none;
  color: var(--accent); font: 800 condensed clamp(40px, 8.6vw, 130px)/1.12 "Archivo", "Arial Narrow", sans-serif; letter-spacing: .03em; text-wrap: balance;
  text-shadow: 0 2px 40px rgba(0, 0, 0, .9), 0 0 2px rgba(0, 0, 0, .8);
  transition: opacity .45s ease;
}
.pull-text.out { opacity: 0; }
.pull-text .w { display: inline-block; white-space: nowrap; }
.pull-text .ch { display: inline-block; }
.pull-text.tx-sweep { animation: kv-sweep 1s cubic-bezier(.3, 0, .2, 1) both; }
@keyframes kv-sweep { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -5% -20% 0); } }
.pull-text.tx-drop .ch { opacity: 0; animation: kv-drop .42s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i) * 38ms); }
@keyframes kv-drop { from { opacity: 0; transform: translateY(-.4em); } to { opacity: 1; transform: none; } }
.pull-text.tx-type .ch { opacity: 0; animation: kv-type 1ms linear forwards; animation-delay: calc(var(--i) * 58ms); }
@keyframes kv-type { to { opacity: 1; } }
.status-note {
  position: fixed; left: 50%; bottom: 38px; transform: translateX(-50%); z-index: 9; padding: 14px 24px; max-width: 90vw;
  background: var(--dialog); border: 1px solid var(--line); border-radius: 1349px; font-size: 19px;
}

/* ---- card effects (timing and weights live in list.js) ---- */
@keyframes kv-shake {
  0%, 100% { transform: translate(0) rotate(0); }
  12% { transform: translate(-19px, 4.1px) rotate(-2.2deg); } 24% { transform: translate(18px, -5.4px) rotate(2deg); }
  36% { transform: translate(-15px, 2px) rotate(-1.6deg); } 48% { transform: translate(14px, 4.1px) rotate(1.5deg); }
  60% { transform: translate(-9px, -2px) rotate(-1deg); } 72% { transform: translate(8px, 1px) rotate(.8deg); }
  86% { transform: translate(-4.1px, 0) rotate(-.3deg); }
}
.fx-shake { animation: kv-shake .85s ease-in-out; }

.burn { position: absolute; inset: 0; border-radius: 14px; pointer-events: none; }

.pack { position: fixed; z-index: 3; pointer-events: none; filter: drop-shadow(0 32px 68px rgba(0, 0, 0, .6)); }
.pack-body, .pack-top {
  position: absolute; left: 0; right: 0; color: var(--on-accent);
  background:
    linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, .38) 34%, transparent 46%, transparent 62%, rgba(255, 255, 255, .22) 74%, transparent 86%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent) 45%, color-mix(in srgb, var(--accent) 70%, #000));
}
.pack-top {
  top: 0; height: 13%; transform-origin: 0% 100%;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 92% 86%, 84% 100%, 76% 86%, 68% 100%, 60% 86%, 52% 100%, 44% 86%, 36% 100%, 28% 86%, 20% 100%, 12% 86%, 4% 100%, 0 90%);
  background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .16) 0 4.1px, transparent 4.1px 12px), linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent));
}
.pack-body {
  top: 12%; bottom: 0; display: grid; place-items: center; align-content: center; gap: 4%;
  clip-path: polygon(0 1%, 4% 2.2%, 12% 0, 20% 2.2%, 28% 0, 36% 2.2%, 44% 0, 52% 2.2%, 60% 0, 68% 2.2%, 76% 0, 84% 2.2%, 92% 0, 100% 2.2%, 100% 100%, 0 100%);
}
.pack-body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5%; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .16) 0 4.1px, transparent 4.1px 12px); }
.pack-body .crest-mark { width: 52%; background: var(--on-accent); }
.pack-body .word-mark { width: 70%; background: var(--on-accent); }

.ct { position: fixed; z-index: 3; pointer-events: none; filter: drop-shadow(0 32px 54px rgba(0, 0, 0, .6)); }
.ct-layer { position: absolute; inset: 0; }
.ct-layer svg, .figure svg, .flyer svg, .rocket svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ct .coin { transform-box: fill-box; transform-origin: center; }
.glow { position: fixed; z-index: 2; border-radius: 50%; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(255, 236, 170, .95), rgba(255, 210, 90, .45) 35%, transparent 68%); }
.figure, .flyer, .rocket { position: fixed; z-index: 3; left: 0; top: 0; pointer-events: none; filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .55)); }
.figure { transform-origin: 50% 100%; }
.royal-title {
  position: fixed; z-index: 6; top: 1.2dvh; left: 0; right: 0; text-align: center; pointer-events: none;
  font: 800 condensed clamp(35px, 6dvh, 86px)/1.1 "Archivo", "Arial Narrow", sans-serif; letter-spacing: .14em; text-indent: .14em;
  background: linear-gradient(180deg, #fff6cf, #f2c14e 48%, #b9861f); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .8)) drop-shadow(0 0 24px rgba(242, 193, 78, .45));
}
.royal-back { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: -1; pointer-events: none; }
.royal-title { background-size: 100% 100%, 250% 100%; }
/* "10" badge, top right of a card. Colors and lettering follow each grader's label; no logos are used. */
.ten {
  position: absolute; z-index: 1; top: 1.5cqi; right: 1.5cqi; display: grid; justify-items: center; align-content: center; pointer-events: none;
  height: 17.6cqi; min-width: 17.6cqi; padding: 0 1.6cqi; border-radius: 14%; line-height: 1;
  font-size: 10.6cqi; box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  background: var(--accent); color: var(--on-accent);
}
.ten b { font-weight: 800; letter-spacing: -.02em; }
.ten i { font-style: normal; font-size: .36em; font-weight: 800; letter-spacing: .12em; margin-top: .12em; }
.ten.psa { background: #d7141a; color: #fff; border: 1px solid #fff; font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif; }
.ten.psa b { font-weight: 900; font-stretch: condensed; }
.ten.cgc { background: #0d0d0d; color: #fff; border: 1px solid #fff; }                               /* CGC 10: black with white lettering */
.ten.cgc.pristine { background: linear-gradient(160deg, #f6dc8a, #d9ad3c 55%, #b98a22); color: #0d0d0d; border: 1px solid #0d0d0d; }   /* CGC Pristine 10: gold with black */
.ten.cgc b { font-weight: 800; letter-spacing: 0; }
.card.pulled .ten, .card.pulled .royal-mark { opacity: .55; }
.royal-mark { position: absolute; z-index: 1; top: 1.5cqi; left: 1.5cqi; height: 17.6cqi; aspect-ratio: 200 / 124; transform: rotate(-12deg); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55)); pointer-events: none; }
.royal-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.orb { position: fixed; z-index: 4; left: 0; top: 0; pointer-events: none; filter: drop-shadow(0 14px 32px rgba(0, 0, 0, .6)); }
.orb svg { display: block; width: 100%; height: 100%; }
.orb .crest-mark { position: absolute; left: 19%; top: 17%; width: 62%; background: var(--on-accent); }
.flash { position: fixed; z-index: 4; border-radius: 50%; pointer-events: none; border: 4.1px solid #fff; box-shadow: 0 0 54px 14px rgba(255, 255, 255, .6); }

/* ---------- popups ---------- */
.modal {
  width: min(702px, calc(100vw - 38px)); max-height: calc(100dvh - 38px); padding: 0; overflow: auto;
  background: var(--dialog); border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 32px 108px rgba(0, 0, 0, .5);
}
.modal::backdrop { background: var(--shade); }
.modal form, .modal .body { padding: 35px clamp(24px, 5.4vw, 40px) 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.modal form > [hidden] + .msg:empty, .modal .msg:empty { display: none; }
.modal h2 { font: 800 condensed 35px/1.15 "Archivo", "Arial Narrow", sans-serif; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; font-size: 19px; font-weight: 800; }
.field small, .hint { font-weight: 560; color: var(--muted); font-size: 18px; }
.field input[type="text"], .field input[type="password"], .field input[type="datetime-local"], .field input[type="file"] {
  width: 100%; min-height: 59px; padding: 12px 16px; background: var(--frame); border: 1px solid var(--line);
  border-radius: 11px; font-weight: 560; font-size: 22px;
}
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } }
.toggle { display: flex; align-items: center; gap: 16px; font-size: 20px; font-weight: 660; cursor: pointer; }
.toggle input { appearance: none; width: 59px; height: 35px; margin: 0; flex: none; border-radius: 1349px; background: var(--line); position: relative; transition: background .15s; cursor: pointer; }
.toggle input::after { content: ""; position: absolute; top: 4.1px; left: 4.1px; width: 27px; height: 27px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(24px); background: var(--on-accent); }
.toggle span small { display: block; color: var(--muted); font-weight: 560; font-size: 18px; }
.actions { display: flex; justify-content: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 5.4px; }
.msg { font-size: 19px; color: var(--danger); white-space: pre-line; }
.msg.ok { color: var(--ink); }
.pick-list { display: grid; gap: 2px; max-height: 46vh; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.pick-list .toggle { padding: 14px 0; border-top: 1px solid var(--line); }
progress { width: 100%; height: 11px; accent-color: var(--accent); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .bar { min-height: 62px; gap: 10px; }
  .logo { gap: 8px; }
  .logo .crest-mark { height: 44px; }
  .logo .word-mark { height: 19px; }
  .back span, .settings-btn span { display: none; }
  .back, .settings-btn, .full-btn { width: 42px; height: 42px; padding: 0; justify-content: center; }
  .back svg, .settings-btn svg, .full-btn svg { width: 18px; height: 18px; }
  body { font-size: 18px; }
  .admin-mark { top: auto; bottom: 3px; transform: translateX(-50%); font-size: 10px; }
  .menu { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
  .crest-spin, .crest-spin .sheen { animation: none !important; }
  .fx-shake, .pull-text, .pull-text .ch { animation: none !important; opacity: 1 !important; }
}

/* ---------- accounts, hosts, import status ---------- */
a.tile .host { display: block; }
.sub-head { margin: 8px 0 0; font: 800 condensed 26px/1.2 "Archivo", "Arial Narrow", sans-serif; }
.btn.small { min-height: 46px; padding: 0 16px; font-size: 18px; }
.acct { display: flex; align-items: center; gap: 11px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 20px; font-weight: 660; }
.acct > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.acct small { display: block; color: var(--muted); font-weight: 560; font-size: 18px; }
.acct input { flex: 1; min-width: 0; min-height: 46px; padding: 5.4px 14px; background: var(--frame); border: 1px solid var(--line); border-radius: 11px; font-size: 19px; }
.fail-lines { white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 11px; }
.field select { width: 100%; min-height: 59px; padding: 12px 16px; background: var(--frame); border: 1px solid var(--line); border-radius: 11px; font: inherit; font-weight: 560; font-size: 22px; color: inherit; }
.field select option { color: #111; background: #fff; }
.field[hidden] { display: none; }

/* ---------- home page: moving crest (left) and card slideshow (right) ---------- */
.hero { --hero-h: min(clamp(405px, 41.9vw, 675px), 62vh); display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; gap: clamp(16px, 4.1vw, 65px); padding-top: clamp(30px, 4.1vw, 59px); }
.hero + .page-title, .strip + .page-title { padding-top: clamp(27px, 3.5vw, 49px); padding-bottom: 6px; }   /* "Active Runs" sits right above the runs */

/* The crest is built in layers (shield, lettering, wings) set at different depths, each with a dark
   stack behind it for thickness, so turning it shows real edges and the parts shift against each other.
   A band of light crosses it in step with the turn. Layers are added by home.js. */
.crest3d { height: var(--hero-h); display: grid; place-items: center; perspective: 1485px; }
.crest-spin { position: relative; height: 88%; aspect-ratio: 720 / 738; transform-style: preserve-3d; animation: kv-crest-turn 7s ease-in-out infinite alternate; filter: drop-shadow(0 35px 46px rgba(0, 0, 0, .55)); }
.crest-spin > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.crest-spin .edge { filter: brightness(.42) saturate(1.15); }
.crest-spin .sheen {
  background: linear-gradient(105deg, rgba(255, 250, 225, 0) 44%, rgba(255, 250, 225, .5) 50%, rgba(255, 250, 225, 0) 56%) 0 0 / 320% 100% no-repeat;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; mix-blend-mode: screen;
  animation: kv-crest-sheen 7s ease-in-out infinite alternate;
}
@keyframes kv-crest-turn {
  from { transform: rotateY(-15deg) rotateX(2.5deg) rotateZ(-.8deg); }
  to { transform: rotateY(15deg) rotateX(-2deg) rotateZ(.8deg); }
}
@keyframes kv-crest-sheen { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* Slideshow: three cards in view, the middle one large and to the front. Positions are set by home.js. */
.carousel { position: relative; height: var(--hero-h); perspective: 1400px; outline: none; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.slide {
  position: absolute; left: 50%; top: 50%; height: 94%; aspect-ratio: 3 / 5; margin: 0; padding: 0; border: 0; background: none;
  container-type: inline-size; transform-origin: 50% 50%; will-change: transform, opacity; cursor: pointer; text-decoration: none; display: block;
  -webkit-tap-highlight-color: transparent;
}
.slide img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 4cqi; filter: drop-shadow(0 14px 26px rgba(0, 0, 0, .55)); -webkit-user-drag: none; }
.slide::after { content: ""; position: absolute; inset: 0; border-radius: 4cqi; background: var(--bg); opacity: var(--dim, 0); pointer-events: none; }
.slide .cap {
  --t: calc(1cqi / var(--grow, 1.35)); font-family: "Figtree", system-ui, sans-serif; font-weight: 400; font-stretch: normal;   /* text keeps its old size while the cards grew */
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 16cqi 5cqi 5cqi; border-radius: 0 0 4cqi 4cqi; text-align: center; opacity: var(--cap, 0); pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .86) 52%, rgba(0, 0, 0, 0) 100%); color: #fff; line-height: 1.15;
}
.slide .cap small { display: block; font-size: calc(5 * var(--t)); font-weight: 600; letter-spacing: .22em; text-transform: uppercase; opacity: .85; }
.slide .cap b { display: block; margin: 1.2cqi 0 1.4cqi; font: 400 calc(10.5 * var(--t))/1.08 "Marcellus", serif; color: var(--cap-accent, #e6c56a); text-wrap: balance; overflow-wrap: anywhere; }
.slide .cap span { display: block; font-size: calc(5.4 * var(--t)); font-weight: 500; }
.slide .cap.plain b { margin: 0; font-size: calc(9.4 * var(--t)); }
.carousel:focus-visible .slide.front { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4cqi; }

@media (max-width: 860px) {                 /* phones and narrow windows: the slideshow alone */
  .hero { display: block; --hero-h: clamp(250px, 72vw, 420px); }
  .slide .cap { --grow: 1; }
  .crest3d { display: none; }
}

/* stream option rows that are not on/off switches */
.opt-row { display: grid; gap: 8px; margin-top: 22px; font-size: 20px; font-weight: 660; }
.opt-row select { width: 100%; min-height: 57px; padding: 11px 16px; background: var(--frame); border: 1px solid var(--line); border-radius: 11px; font: inherit; color: inherit; }
.opt-row select option { color: #111; background: #fff; }
.opt-row small { font-weight: 560; font-size: 18px; color: var(--muted); }

/* ---------- home page: thin strip under the crest and slideshow ---------- */
.strip { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; gap: clamp(16px, 4.1vw, 65px); padding-top: clamp(14px, 1.8vw, 26px); }
.strip-mark { display: grid; place-items: center; }
/* the lettering again, here in the theme's own colors rather than gold */
.strip-mark .word-mark { width: min(78%, 520px); background: linear-gradient(180deg, var(--ink) 8%, var(--accent) 92%); }
.ticker { overflow: hidden; white-space: nowrap; padding: 10px 0; border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); }
.ticker-run { display: inline-flex; animation: kv-ticker var(--secs, 30s) linear infinite; will-change: transform; }
.ticker-run span { display: inline-flex; align-items: center; font-weight: 700; font-size: clamp(16px, 1.5vw, 23px); letter-spacing: .05em; text-transform: uppercase; }
.ticker-run span b { color: var(--accent); font-weight: 800; }
.ticker-run span i { font-style: normal; }
.ticker-run span > * + * { margin-left: .35em; }
.ticker-run span::after { content: ""; width: .5em; height: .5em; margin: 0 1.6em; background: var(--accent); transform: rotate(45deg); opacity: .8; }
@keyframes kv-ticker { to { transform: translateX(-50%); } }
@media (max-width: 860px) { .strip { display: block; } .strip-mark { display: none; } }
@media (prefers-reduced-motion: reduce) { .ticker-run { animation-duration: 240s; } }

/* ---------- home tiles: three-card cover, edit button ---------- */
.fan { position: relative; display: block; aspect-ratio: 4 / 5; }
a.tile .frame .fan img { position: absolute; top: 50%; left: 50%; height: 88%; width: auto; aspect-ratio: 3 / 5; object-fit: contain; border-radius: max(3px, 2cqi); }
a.tile .frame .fan img.l { transform: translate(-108%, -47%) rotate(-9deg) scale(.86); filter: brightness(.6); }      /* the 2nd card, peeking out on the left */
a.tile .frame .fan img.r { transform: translate(8%, -47%) rotate(9deg) scale(.86); filter: brightness(.6); }          /* the 3rd, on the right */
a.tile .frame .fan img.c { transform: translate(-50%, -50%); filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .6)); }     /* the 1st, in front */
.tile-box { min-width: 0; display: grid; align-content: start; gap: 10px; }
.tile-box .btn.small { justify-self: start; }

/* ---------- page titles: the subtitle sits close under the title; the heat meter stands to the right of both ---------- */
.page-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 0; }
.page-title h1 { grid-column: 1; align-self: end; }
.page-title p { grid-column: 1; align-self: start; margin-top: 2px; }
.page-title .heat { grid-column: 2; grid-row: 1 / span 2; }

/* ---------- list page: heat meter ----------
   "Heat Meter" over a tall gauge that fills from the right. Small ticks every 5%, a heavy mark and a
   number at each quarter. --h is how full it is (0 to 1). */
.heat { --h: 0; display: grid; gap: 8px; width: clamp(290px, 27vw, 500px); opacity: calc(.2 + .8 * min(1, var(--h) / .7)); transition: opacity 1s; }   /* 80% see-through when empty, solid from 70% full */
.heat-label { justify-self: center; font: 400 clamp(26px, 2.2vw, 38px)/1 "New Rocker", "Archivo", serif; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent), #fff 50%) 10%, var(--accent) 52%, color-mix(in srgb, var(--accent), #000 38%) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .55)); }
.heat-track { position: relative; height: 66px; border-radius: 12px; background: var(--frame); border: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line)); overflow: hidden;
  box-shadow: inset 0 3px 14px rgba(0, 0, 0, .5), 0 0 calc(var(--h) * 44px) calc(var(--h) * 5px) color-mix(in srgb, var(--accent) calc(var(--h) * 70%), transparent); }
.heat-fill { position: absolute; top: 0; bottom: 0; right: 0; width: calc(var(--h) * 100%); transition: width 1s linear;
  background: linear-gradient(to left, color-mix(in srgb, var(--accent) 45%, transparent), var(--accent) 70%, color-mix(in srgb, var(--accent), #fff 55%)); }
.heat-fill::after { content: ""; position: absolute; inset: 0; }
.heat-fill::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 14px 3px color-mix(in srgb, var(--accent), #fff 40%); }   /* the leading edge */
.heat-scale { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(to right, transparent 0 calc(5% - 1.5px), color-mix(in srgb, var(--ink) 55%, transparent) calc(5% - 1.5px) 5%) bottom / 100% 26% no-repeat; }
.heat-scale i { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--ink); box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); }
.heat.full .heat-track, .heat.full .heat-label { animation: kv-heat-pulse .9s ease-in-out infinite alternate; }
@keyframes kv-heat-pulse { from { filter: brightness(1); } to { filter: brightness(1.45); } }
/* The fill borrows its texture from the background animation that is playing. */
.heat[data-fx="1"] .heat-fill::after { background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, .85) 50%, transparent 60%) 0 0 / 300% 100%; animation: kv-heat-zap 1.7s steps(7) infinite; }
@keyframes kv-heat-zap { 0%, 62% { background-position: 120% 0; opacity: 0; } 64% { opacity: 1; } 100% { background-position: -40% 0; opacity: 1; } }
.heat[data-fx="2"] .heat-fill, .heat[data-fx="4"] .heat-fill { background: linear-gradient(to left, color-mix(in srgb, var(--accent), #000 45%), var(--accent) 55%, color-mix(in srgb, var(--accent), #fff 70%) 96%); }
.heat[data-fx="2"] .heat-fill::after, .heat[data-fx="4"] .heat-fill::after { background: repeating-linear-gradient(100deg, transparent 0 18px, rgba(255, 255, 255, .28) 18px 30px, transparent 30px 56px) 0 0 / 112px 100%; animation: kv-heat-rise 1.1s linear infinite; filter: blur(4px); }
@keyframes kv-heat-rise { to { background-position: -112px 0; } }
.heat[data-fx="3"] .heat-fill::after, .heat[data-fx="6"] .heat-fill::after, .heat[data-fx="7"] .heat-fill::after {
  background-image: radial-gradient(circle, rgba(255, 255, 255, .9) 0 1.4px, transparent 2px), radial-gradient(circle, rgba(255, 255, 255, .6) 0 1px, transparent 1.6px);
  background-size: 26px 16px, 17px 11px; background-position: 0 0, 9px 5px; animation: kv-heat-fall 2.4s linear infinite; }
@keyframes kv-heat-fall { to { background-position: 26px 16px, 26px 16px; } }
.heat[data-fx="7"] .heat-fill { background: linear-gradient(to left, rgba(255, 255, 255, .35), #fff 80%); }
.heat[data-fx="5"] .heat-fill { background: linear-gradient(to left, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 60%, transparent)); }
.heat[data-fx="5"] .heat-fill::after { background: linear-gradient(to bottom, transparent 44%, #fff 49% 51%, transparent 56%); box-shadow: 0 0 22px var(--accent); }
@media (max-width: 640px) {
  .page-title { grid-template-columns: minmax(0, 1fr); }
  .page-title .heat { grid-column: 1; grid-row: auto; width: 100%; margin-top: 14px; }
  .heat-track { height: 44px; } .heat-label { font-size: 22px; }
}
/* The call-out when the meter passes a quarter mark: same family as the "pulled" text, in the logo's style. */
.heat-call { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; pointer-events: none; padding: 0 4vw; text-align: center;
  font: 400 clamp(46px, 8.4vw, 150px)/1.05 "New Rocker", "Archivo", serif; letter-spacing: .03em; text-transform: uppercase; color: var(--accent);
  text-shadow: 0 0 50px color-mix(in srgb, var(--accent) 65%, transparent), 0 4px 40px rgba(0, 0, 0, .95), 0 0 3px rgba(0, 0, 0, .9);
  animation: kv-heat-call 1.9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes kv-heat-call {
  0% { opacity: 0; transform: scale(.55); clip-path: inset(-20% 100% -20% 0); }
  16% { opacity: 1; transform: scale(1.06); clip-path: inset(-20% -5% -20% 0); }
  24% { transform: scale(1); }
  78% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.12); }
}

/* ---------- list page: command bar (name the puller; find a card) ---------- */
.cmd {
  position: fixed; z-index: 30; left: 50%; top: 16vh; transform: translateX(-50%); width: min(760px, calc(100vw - 32px)); cursor: auto;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 16px 26px;
  background: color-mix(in srgb, var(--dialog) 82%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 22px; color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 0, 0, .4), 0 0 44px color-mix(in srgb, var(--accent) 22%, transparent), inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: kv-cmd-in .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes kv-cmd-in { from { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(.97); } }
.cmd svg { width: 30px; height: 30px; color: var(--accent); flex: none; }
.cmd label { display: grid; gap: 2px; min-width: 0; }
.cmd label span { font: 800 condensed 15px/1 "Archivo", "Arial Narrow", sans-serif; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }
.cmd input { width: 100%; padding: 2px 0; background: none; border: 0; outline: none; font: 700 semi-condensed 34px/1.2 "Archivo", "Arial Narrow", sans-serif; color: var(--ink); caret-color: var(--accent); }
.cmd input::placeholder { color: var(--muted); opacity: .55; font-weight: 500; }
.cmd .cmd-side { font-size: 15px; font-weight: 600; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cmd .cmd-side { display: flex; align-items: center; gap: 8px; }
.cmd .cmd-side button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--frame); cursor: pointer; }
.cmd .cmd-side button:hover, .cmd .cmd-side button:focus-visible { background: var(--frame-hover); border-color: var(--accent); }
.cmd .cmd-side button svg { width: 20px; height: 20px; }
.cmd .cmd-side .count { min-width: 6.5ch; text-align: right; }
.cmd kbd { display: inline-block; min-width: 1.9em; padding: 2px 7px; margin: 0 2px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 7px; font: inherit; font-size: 13px; text-align: center; color: var(--ink); }
@media (max-width: 640px) { .cmd { padding: 12px 16px; gap: 12px; } .cmd input { font-size: 24px; } .cmd .cmd-side kbd { display: none; } }
/* cards the search has found */
.card.hit-now .frame { border-color: var(--accent); background: var(--frame-hover); box-shadow: 0 0 0 3px var(--accent), 0 0 34px color-mix(in srgb, var(--accent) 50%, transparent); }
.card .name mark { background: var(--accent); color: var(--on-accent); border-radius: 3px; padding: 0 .1em; }
.searching .card:not(.hit) { opacity: .3; }

/* small select fields in the settings menu */
.opt-row.inline { grid-template-columns: 1fr auto; align-items: center; }
.opt-row.inline select { width: auto; }

/* ---------- upload popup: Slabs / Raw switch; heat time with its own number box ---------- */
.seg { display: inline-flex; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg-btn { min-width: 132px; padding: 12px 22px; border: 0; background: var(--frame); font-weight: 740; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--accent); color: var(--on-accent); }
.heat-time { display: flex; gap: 8px; align-items: center; }
.heat-time input { width: 7.5em; min-height: 42px; padding: 8px 12px; background: var(--frame); border: 1px solid var(--line); border-radius: 8px; }
