/* ashton2rich.com: a wake screen, an entry clip, then a chrome trading card
   floating over the night loop. Black, silver foil, one taillight red. */

:root {
  --bg: #000;
  --ink: #f2f2f5;
  --soft: rgba(242, 242, 245, 0.72);
  --mute: rgba(242, 242, 245, 0.48);
  --line: rgba(255, 255, 255, 0.12);
  --red: #ff2a3d;
  --chrome: linear-gradient(180deg, #ffffff 0%, #d9dbe4 38%, #7c7e8c 52%, #eceef4 70%, #a9abb8 100%);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --goth: "UnifrakturCook", "Old English Text MT", serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* the card's glass: thin on phones so the loop shows through */
  --glass: rgba(8, 8, 12, 0.5);
  --glass-2: rgba(8, 8, 12, 0.36);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; color: var(--mute); }

/* ================= gate ================= */

.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: radial-gradient(70% 60% at 50% 48%, #0d0607 0%, #000 70%);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
  overflow: hidden;
}
.gate.gone { opacity: 0; visibility: hidden; }

.embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }


.g-center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 34px; }

/* the card back, waiting */
.g-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 40%;
  position: relative;
  width: clamp(150px, 15vw, 190px);
  aspect-ratio: 63 / 88;
  perspective: 900px;
  cursor: default;
  animation: g-float 6s ease-in-out infinite;
}
@keyframes g-float { 50% { transform: translateY(-10px); } }

.g-tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.3s ease-out;
}

.g-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(160deg, #111116, #050507);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.05);
  filter: brightness(0.55) saturate(0.6);
  transition: filter 1.2s var(--ease), box-shadow 1.2s var(--ease);
}
.g-pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 42, 61, 0.22), transparent 58%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 11px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 11px);
}
.g-foil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.16), transparent 45%),
    repeating-linear-gradient(115deg, transparent 0%, rgba(196, 210, 255, 0.16) 7%, rgba(255, 196, 236, 0.12) 12%, transparent 20%);
  background-size: 100% 100%, 260% 260%;
  background-position: 0 0, var(--mx) var(--my);
  mix-blend-mode: screen;
  pointer-events: none;
}
.g-mono {
  font-family: var(--goth);
  font-weight: 700;
  font-size: clamp(54px, 5.6vw, 70px);
  line-height: 1;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.9));
}
.g-name { margin-top: 8px; font-size: 8px; letter-spacing: 0.4em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); }

/* the progress: a chrome line drawing itself round the edge */
.g-ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); overflow: visible; pointer-events: none; transform: translateZ(1px); }
.g-ring rect { fill: none; vector-effect: non-scaling-stroke; }
.g-track { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1px; }
.g-line {
  stroke: url(#g-chrome);
  stroke-width: 1.6px;
  stroke-linecap: round;
  stroke-dasharray: 100 100;
  stroke-dashoffset: calc(100 - var(--p, 0));
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
  transition: stroke-dashoffset 0.35s linear;
}

.w-text {
  position: relative;
  font-family: var(--mono);
  font-size: clamp(12px, 1.25vw, 14px);
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.14);
  transition: color 0.8s var(--ease), text-shadow 0.8s;
}

/* ready: the card wakes, beats, and the words light */
.gate.ready .g-card { cursor: pointer; }
.gate.ready .g-back {
  filter: none;
  animation: g-beat 1.7s ease-in-out infinite;
}
@keyframes g-beat {
  0%, 100% { box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 0 rgba(255, 42, 61, 0); }
  14% { box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 46px rgba(255, 42, 61, 0.55); }
  28% { box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 10px rgba(255, 42, 61, 0.15); }
  42% { box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 34px rgba(255, 42, 61, 0.4); }
}
.gate.ready .g-tilt { animation: g-thump 1.7s ease-in-out infinite; }
@keyframes g-thump {
  0%, 100% { scale: 1; }
  14% { scale: 1.035; }
  28% { scale: 1; }
  42% { scale: 1.022; }
}
.gate.ready .g-line { stroke-dasharray: none; animation: g-ring 3s linear infinite; }
@keyframes g-ring { 50% { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9)); } }

.gate.ready .w-text { color: #fff; text-shadow: 0 0 18px rgba(255, 255, 255, 0.35); }
.gate.ready .g-card:hover ~ .w-text,
.gate.ready .g-center:hover .w-text { text-shadow: 0 0 22px rgba(255, 42, 61, 0.75), 0 0 2px #fff; }

/* a glitch: red and blue copies slip apart now and then */
.gate.ready .w-text::before,
.gate.ready .w-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.gate.ready .w-text::before { color: var(--red); animation: w-glitch 4.5s 1.2s infinite; }
.gate.ready .w-text::after { color: #9cf; animation: w-glitch 4.5s 1.26s infinite reverse; }
@keyframes w-glitch {
  0%, 92%, 100% { opacity: 0; transform: none; clip-path: none; }
  93% { opacity: 0.85; transform: translate(-3px, 0); clip-path: inset(10% 0 55% 0); }
  95% { opacity: 0.85; transform: translate(3px, 1px); clip-path: inset(60% 0 8% 0); }
  97% { opacity: 0.6; transform: translate(-2px, -1px); clip-path: inset(30% 0 40% 0); }
}

/* clicked: the card is pulled toward you, turns, and the screen flashes */
.gate.opening .g-card { animation: none; }
.gate.opening .g-tilt { animation: g-pull 0.75s cubic-bezier(0.6, 0, 0.3, 1) forwards; }
@keyframes g-pull {
  0% { transform: rotateX(var(--rx)) rotateY(var(--ry)); scale: 1; }
  35% { transform: rotateX(0) rotateY(-14deg); scale: 0.94; }
  100% { transform: rotateX(0) rotateY(180deg); scale: 9; opacity: 0; }
}
.gate.opening .w-text { opacity: 0; transition: opacity 0.3s; }
.g-flash { position: absolute; inset: 0; z-index: 3; background: #fff; opacity: 0; pointer-events: none; }
.gate.opening .g-flash { animation: g-flash 0.75s ease-out forwards; }
@keyframes g-flash { 0%, 55% { opacity: 0; } 70% { opacity: 0.85; } 100% { opacity: 0; } }

/* the cursor's star trail (desktop) */
.trail { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; }

/* ================= entry + background ================= */

.entry {
  position: fixed;
  inset: 0;
  z-index: 25;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s;
}
.entry.on { opacity: 1; visibility: visible; }

.bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  filter: brightness(0.35) blur(6px) saturate(0.8);
  transition: filter 2.4s var(--ease), transform 2.4s var(--ease);
}
body.awake .bg { filter: brightness(0.82) saturate(1.05); transform: scale(1); }

.veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.6) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}

/* ================= stage + card ================= */

.stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  perspective: 1400px;
  overflow-y: auto;
  visibility: hidden;
}
body.awake .stage { visibility: visible; }

.card {
  --rx: 0deg;
  --ry: 0deg;
  --flip: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  width: min(372px, 88vw);
  aspect-ratio: 63 / 88;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip)));
  transition: transform 0.25s ease-out;
  opacity: 0;
}
.card.flipping { transition: transform 0.9s var(--spring); }

/* dealt in: from below, face down, then turned over */
body.awake .card { animation: deal 1.5s 0.25s var(--ease) both; }
@keyframes deal {
  0% { opacity: 0; transform: translateY(70vh) rotateX(40deg) rotateY(180deg) rotateZ(-8deg) scale(0.7); }
  55% { opacity: 1; transform: translateY(0) rotateX(0) rotateY(180deg) rotateZ(0) scale(1); }
  100% { opacity: 1; transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip))); }
}
body.dealt .card { animation: none; opacity: 1; }

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(160deg, var(--glass), var(--glass-2));
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* the chrome frame: its own layer, masked to the edge, so the glass in the
   middle stays clear and the loop shows through */
.face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--a, 0deg), #ffffff, #8b8d9a, #f4f5fa, #45475a, #d8dae4, #6e7080, #ffffff);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  animation: frame 7s linear infinite;
}

@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes frame { to { --a: 360deg; } }

.back { transform: rotateY(180deg); align-items: center; justify-content: center; }

/* ---- foil, glare, sparkle: follow the pointer or the phone's tilt ---- */
.fx { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.foil {
  z-index: 3;
  background: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(196, 210, 255, 0.22) 6%,
    rgba(255, 196, 236, 0.16) 11%,
    rgba(196, 255, 238, 0.2) 16%,
    rgba(255, 255, 255, 0) 24%
  );
  background-size: 260% 260%;
  background-position: var(--mx) var(--my);
  mix-blend-mode: screen;
  opacity: 0.2;
}
.glare {
  z-index: 4;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.1), transparent 40%);
  mix-blend-mode: screen;
}
.sparkle {
  z-index: 3;
  background: url("/assets/img/sparkle_white.gif") center / 180px;
  mix-blend-mode: screen;
  opacity: 0.16;
  -webkit-mask: radial-gradient(circle at var(--mx) var(--my), #000 0%, transparent 55%);
  mask: radial-gradient(circle at var(--mx) var(--my), #000 0%, transparent 55%);
}

/* ---- top ---- */
.c-top { position: relative; z-index: 5; display: flex; align-items: center; gap: 12px; }
.c-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.c-stage {
  flex: 0 0 auto;
  padding: 2px 6px 1px;
  border-radius: 4px;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0b0b0f;
  background: var(--chrome);
}
.c-name {
  max-width: 100%;
  font-family: var(--goth);
  font-weight: 700;
  font-size: clamp(24px, 7vw, 29px);
  line-height: 1;
  letter-spacing: 0.01em;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 12px rgba(255, 255, 255, 0.12));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.c-hp { flex: 0 0 auto; align-self: flex-start; margin-top: 4px; font-size: 17px; font-weight: 600; color: #fff; text-shadow: 0 0 10px rgba(255, 42, 61, 0.55); }
.c-hp small { margin-right: 2px; font-size: 9px; color: var(--red); letter-spacing: 0.1em; }

/* ---- art window ---- */
.c-art {
  position: relative;
  z-index: 2;
  /* the art takes whatever room the links leave (basis 0, so the video's
     own size never pushes the links out) */
  flex: 1 1 0;
  min-height: 90px;
  border-radius: 10px;
  overflow: hidden;
  background: #050507;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 8px 24px rgba(0, 0, 0, 0.5);
}
.c-art video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; filter: contrast(1.08) saturate(1.1); }
.c-art::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.7); pointer-events: none; }
.c-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(255, 42, 61, 0.14), transparent);
  animation: scan 5.5s 2s linear infinite;
  pointer-events: none;
}
@keyframes scan { to { top: 130%; } }
.c-corner { position: absolute; width: 10px; height: 10px; border-color: rgba(255, 255, 255, 0.7); border-style: solid; border-width: 0; z-index: 2; }
.c-corner.tl { top: 7px; left: 7px; border-top-width: 1px; border-left-width: 1px; }
.c-corner.tr { top: 7px; right: 7px; border-top-width: 1px; border-right-width: 1px; }
.c-corner.bl { bottom: 7px; left: 7px; border-bottom-width: 1px; border-left-width: 1px; }
.c-corner.br { bottom: 7px; right: 7px; border-bottom-width: 1px; border-right-width: 1px; }

.c-badge {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  margin: 2px 2px 0 4px;
}
.c-badge img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.c-badge img:first-child { border: 2px solid rgba(0, 0, 0, 0.8); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 6px 18px rgba(0, 0, 0, 0.6); }
.c-badge .deco { inset: -18%; width: 136%; height: 136%; border-radius: 0; object-fit: contain; border: 0; box-shadow: none; }
.c-badge .deco[hidden] { display: none; }

/* ---- type line ---- */
.c-type {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.c-type span:first-child { color: var(--soft); }

/* ---- moves = links ---- */
.c-moves { position: relative; z-index: 5; display: flex; flex-direction: column; gap: 5px; flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.c-moves::-webkit-scrollbar { display: none; }

.move {
  --c: #d8dae4;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.2s, border-color 0.2s, transform 0.25s var(--spring);
  opacity: 0;
  transform: translateX(-10px);
}
body.dealt .move { animation: move-in 0.6s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 150ms); }
@keyframes move-in { to { opacity: 1; transform: none; } }

.move:hover, .move:focus-visible {
  background: color-mix(in srgb, var(--c) 14%, rgba(255, 255, 255, 0.04));
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  outline: none;
}
.move:active { transform: scale(0.97); }

.m-cost {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 15px;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 55%, #000));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 14px color-mix(in srgb, var(--c) 45%, transparent);
}
.m-cost svg { width: 1em; height: 1em; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
.m-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.m-name b { font-size: 13.5px; font-weight: 600; }
.m-name small { font-size: 11.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-note { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; font: 600 9px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); border: 1px solid rgba(255, 42, 61, 0.45); }
.m-go { flex: 0 0 auto; font: 600 12px var(--mono); color: var(--mute); transition: transform 0.2s, color 0.2s; }
.move:hover .m-go { color: #fff; transform: translateX(3px); }
.move.copied .m-go { color: #7dffb0; }

/* ---- flavor + foot ---- */
.c-flavor {
  position: relative;
  z-index: 5;
  padding: 7px 2px 0;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  font-style: italic;
  line-height: 1.45;
  color: var(--soft);
}
.c-flavor:empty { display: none; }

.c-foot { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.c-play { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 6px; border-radius: 999px; border: 1px solid var(--line); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); transition: border-color 0.2s, color 0.2s; }
.c-play:hover { border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.eq b { width: 2px; height: 100%; background: var(--red); border-radius: 1px; transform-origin: bottom; animation: eq 0.9s ease-in-out infinite; }
.eq b:nth-child(2) { animation-delay: -0.3s; animation-duration: 0.7s; }
.eq b:nth-child(3) { animation-delay: -0.6s; animation-duration: 1.1s; }
.eq b:nth-child(4) { animation-delay: -0.15s; animation-duration: 0.8s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }
.muted .eq b { animation: none; transform: scaleY(0.2); background: var(--mute); }
.c-rarity { font-size: 9.5px; letter-spacing: 0.14em; color: var(--mute); }
.c-flip { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); color: var(--soft); font-size: 14px; transition: transform 0.4s var(--spring), color 0.2s, border-color 0.2s; }
.c-flip:hover { transform: rotate(180deg); color: #fff; border-color: rgba(255, 255, 255, 0.35); }

/* ---- back ---- */
.b-pattern {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 42, 61, 0.16), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 14px);
}
.b-mono {
  position: relative;
  z-index: 5;
  font-family: var(--goth);
  font-weight: 700;
  font-size: clamp(96px, 30vw, 128px);
  line-height: 1;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.12));
}
.b-name { position: relative; z-index: 5; margin-top: 8px; font-size: 11px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--soft); }
.b-flip { position: absolute; z-index: 6; right: 12px; bottom: 12px; }

/* desktop: a light frost behind the glass so text reads over busy frames */
@media (hover: hover) and (min-width: 641px) {
  .front { -webkit-backdrop-filter: blur(7px) saturate(1.15); backdrop-filter: blur(7px) saturate(1.15); }
}

/* ================= phones ================= */

@media (max-width: 640px), (hover: none) {
  :root {
    --glass: rgba(6, 6, 10, 0.3);
    --glass-2: rgba(6, 6, 10, 0.14);
  }
  .move { background: rgba(0, 0, 0, 0.32); border-color: rgba(255, 255, 255, 0.1); }
  .c-name { text-shadow: none; }
  .m-name small, .c-flavor, .c-type { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); }
}

/* short screens: let the card shrink to fit rather than scroll */
@media (max-height: 720px) {
  .card { width: min(330px, 86vw, calc((100dvh - 40px) * 63 / 88)); }
}

@media (prefers-reduced-motion: reduce) {
  .face, .c-scan, .eq b, .g-card, .gate.ready .g-back, .gate.ready .g-tilt, .gate.ready .w-text::before, .gate.ready .w-text::after { animation: none !important; }
  .trail { display: none; }
  body.awake .card { animation-duration: 0.01s; }
}

/* HQ's preview frame: no gate, no deal */
body.preview .gate { display: none; }
body.preview .stage { visibility: visible; }
body.preview .card { animation: none; opacity: 1; }
body.preview .move { opacity: 1; transform: none; animation: none; }
body.preview .bg { filter: brightness(0.82); transform: none; }
body.preview.wakeview .gate { display: grid; }
body.preview.wakeview .stage { visibility: hidden; }
