/* Layout: a square 7×7 grid; the 24 perimeter cells are the track, the 5×5 interior holds the brand, the die and the turn controls. */
:root {
  --bg: #eef1ee;
  --board: #fbfcfa;
  --panel: #ffffff;
  --ink: #17221d;
  --muted: #5d6b64;
  --line: #c9d2cc;
  --center: #123a2c;
  --center-ink: #f2f7f3;
  --gold: #d9a520;
  --gold-ink: #1c1500;
  --re: #2f7d4f;
  --stock: #2c5fa8;
  --biz: #b4552b;
  --market: #7a4aa0;
  --skill: #0f8a8a;
  --relax: #3f8fb5;
  --remind: #b7791f;
  --news: #3b5bab;
  --bill: #c0392b;
  --tax: #4a4f55;
  --start: #d9a520;
  --font-display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1412; --board: #18201c; --panel: #151d19; --ink: #e8efea; --muted: #9aa8a0; --line: #2e3a34;
    --center: #0b2a1f; --center-ink: #eaf3ed; --gold: #e9b93a; --gold-ink: #1c1500;
    --re: #4bb27a; --stock: #5b8fdc; --biz: #e07a4a; --market: #a77ad0; --skill: #3bb8b8; --relax: #6bb6da; --remind: #e0a43a; --news: #7d97de;
    --bill: #e5604f; --tax: #8c939b; --start: #e9b93a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1412; --board: #18201c; --panel: #151d19; --ink: #e8efea; --muted: #9aa8a0; --line: #2e3a34;
  --center: #0b2a1f; --center-ink: #eaf3ed; --gold: #e9b93a; --gold-ink: #1c1500;
  --re: #4bb27a; --stock: #5b8fdc; --biz: #e07a4a; --market: #a77ad0; --skill: #3bb8b8; --relax: #6bb6da; --remind: #e0a43a; --news: #7d97de;
  --bill: #e5604f; --tax: #8c939b; --start: #e9b93a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body);
  padding-block: 20px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
button, input { font: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 16px; }
.play-area { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: 16px; align-items: start; }
@media (max-width: 820px) { .play-area { grid-template-columns: minmax(0, 1fr); } }
.side { display: grid; gap: 12px; align-content: start; position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); min-width: 0; }
.econ {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.econ i { font-style: normal; color: var(--muted); font-weight: 400; }
.econ .bad { color: var(--bill); }
.econ .good { color: var(--re); }
.econ-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.econ-chips span { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.econ-chips span.bad { border-color: var(--bill); color: var(--bill); background: color-mix(in srgb, var(--bill) 10%, transparent); }
.econ-news { margin: 0; font-size: 13px; color: var(--ink); }
.dice-row { display: flex; gap: 1.2cqw; }
.dice-row:not(:has(.die:not([hidden]))) { display: none; }
.explain {
  position: relative; top: calc(16px + env(safe-area-inset-top, 0px));
  background: var(--panel); border: 1px solid var(--line); border-top: 6px solid var(--c, var(--gold));
  border-radius: 14px; padding: 18px 18px 20px; display: grid; gap: 10px; min-width: 0;
}
.ex-kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
#explain-body { display: grid; gap: 10px; }
.ex-deck { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--c, var(--gold)); }
.ex-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.15; text-wrap: balance; }
.ex-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink); }
.ex-text + .ex-text { margin-top: -2px; }
.ex-goal {
  margin: 4px 0 0; font-size: 15px; line-height: 1.5; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 16%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.ex-goal b { letter-spacing: .04em; }
.ex-sents { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.ex-sents li { font-size: 15px; line-height: 1.5; padding-left: 28px; position: relative; }
.ex-sents li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff; background: var(--c, var(--gold));
}
@media (max-width: 820px) { .side { position: static; } }
.ex-video {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 14px 10px 10px;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c, var(--gold)) 55%, transparent);
  background: color-mix(in srgb, var(--c, var(--gold)) 12%, transparent); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 700; line-height: 1.25; text-align: left; cursor: pointer;
}
.ex-video:hover { background: color-mix(in srgb, var(--c, var(--gold)) 22%, transparent); }
.ex-video .play { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--gold)); color: #fff; }
.ex-video small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.vid-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(5, 10, 8, .82); }
.vid-box { position: relative; display: grid; gap: 10px; justify-items: center; }
.vid-box video { display: block; height: min(86vh, 900px); max-width: calc(100vw - 32px); aspect-ratio: 9 / 16; border-radius: 16px; background: #000; object-fit: contain; }
.vid-box .vid-close { justify-self: end; border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; background: #fff; color: #111; }

/* ---------- Setup ---------- */
.setup {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; display: grid; gap: 20px; max-width: 560px; width: 100%; margin: 0 auto;
}
.setup h1 { font-family: var(--font-display); font-weight: 800; font-size: 32px; margin: 0; letter-spacing: -0.02em; }
.setup h1 span { color: var(--gold); }
.setup p { margin: 0; color: var(--muted); }
.field-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.count { display: flex; gap: 8px; flex-wrap: wrap; }
.count button {
  width: 48px; height: 48px; border-radius: 10px; border: 2px solid var(--line); background: var(--board);
  color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 20px; cursor: pointer;
}
.count button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--panel); }
.names { display: grid; gap: 10px; }
.name-row { display: flex; align-items: center; gap: 10px; }
.name-row .tok-lg { flex: none; }
.name-row input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--board); color: var(--ink);
}
.name-row input[aria-invalid="true"] { border-color: var(--bill); }
.error { color: var(--bill); font-size: 14px; font-weight: 600; min-height: 1.2em; }
.btn {
  height: 48px; padding: 0 22px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--gold); color: var(--gold-ink); font-weight: 700; font-size: 16px;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn:disabled { opacity: 0.5; cursor: default; }
.tok-lg {
  width: 30px; height: 30px; border-radius: 50%; background: var(--p);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25);
}

/* ---------- Board ---------- */
.board {
  container-type: inline-size;
  width: 100%; max-width: 100%; aspect-ratio: 1;
  display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr);
  gap: 0.5cqw; padding: 0.8cqw;
  background: var(--line); border-radius: 1.6cqw;
}
.cell {
  position: relative; background: var(--board); border-radius: 0.8cqw; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; padding: 2.2cqw 0.6cqw 0.8cqw;
  transition: box-shadow .2s;
}
.cell::before { content: ""; position: absolute; inset: 0 0 auto; height: 1.5cqw; background: var(--c); }
.cell.landed { box-shadow: inset 0 0 0 0.5cqw var(--c); }
.cell .name {
  font-family: var(--font-display); font-weight: 800; font-size: 1.75cqw; line-height: 1.05;
  color: var(--c); text-transform: uppercase; letter-spacing: 0.02em; text-wrap: balance;
}
.cell .sub { font-size: 1.3cqw; line-height: 1.15; color: var(--muted); margin-top: 0.5cqw; font-weight: 600; text-wrap: balance; }
.cell .num { position: absolute; bottom: 0.5cqw; right: 0.8cqw; font-size: 1.1cqw; color: var(--muted); font-variant-numeric: tabular-nums; }
.cell.corner .name { font-size: 1.9cqw; }
.cell.start { background: color-mix(in srgb, var(--start) 16%, var(--board)); }
.cell.start .name { color: var(--ink); }
.tokens {
  display: flex; flex-wrap: wrap; gap: 0.35cqw; justify-content: center; margin-top: auto; padding-bottom: 0.6cqw;
}
.tok {
  width: 3cqw; height: 3cqw; border-radius: 50%; background: var(--p);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.5cqw; line-height: 1;
  border: 0.25cqw solid var(--board); box-shadow: 0 0 0 0.12cqw rgba(0,0,0,.45);
}
.tok.active { animation: bob 1s ease-in-out infinite; box-shadow: 0 0 0 0.35cqw var(--ink); }
.tok.face { width: 3.6cqw; height: 3.6cqw; padding: 0.25cqw; }
.tok.face svg { width: 100%; height: 100%; display: block; fill: #fff; stroke: #fff; overflow: visible; }
.tok.face svg .tear { fill: #8fd3ff; stroke: none; }
.tok.face svg .tongue { fill: var(--p); stroke: none; filter: brightness(1.35); }
.tok.walking { animation: hop .22s ease-out; z-index: 3; }
@keyframes hop { 0% { transform: translateY(0) scale(1); } 45% { transform: translateY(-1.4cqw) scale(1.12); } 100% { transform: translateY(0) scale(1); } }
.tok.face-laugh:not(.walking) { animation: laugh .5s ease-in-out 3; }
@keyframes laugh { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-12deg) scale(1.15); } 75% { transform: rotate(12deg) scale(1.15); } }
.tok.face-sad:not(.walking) { animation: sad 1.2s ease-in-out 1 forwards; filter: saturate(.75); }
@keyframes sad { 0% { transform: translateY(0); } 40% { transform: translateY(0.4cqw) scale(.94); } 70% { transform: translateX(-0.25cqw) translateY(0.4cqw) scale(.94); } 100% { transform: translateY(0.25cqw) scale(.96); } }
.tok.face.active { animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-0.5cqw); } }

.center {
  position: relative;
  grid-column: 2 / 7; grid-row: 2 / 7;
  /* the current player's color, darkened so white text stays easy to read */
  background: color-mix(in srgb, var(--pc, var(--center)) 74%, #000); color: #fff; border-radius: 1cqw;
  transition: background-color .5s ease;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqw;
  text-align: center; padding: 3cqw;
}
.logo { font-family: var(--font-display); font-weight: 800; font-size: 7cqw; line-height: 0.9; letter-spacing: -0.03em; }
.logo span { color: var(--gold); }
.turn { display: flex; align-items: center; gap: 1.4cqw; font-size: 2.4cqw; font-weight: 700; }
.turn .tok-lg { width: 4.2cqw; height: 4.2cqw; font-size: 2cqw; box-shadow: 0 0 0 0.35cqw #fff; }
.turn-stats {
  margin: 0; display: grid; grid-template-columns: repeat(4, auto); gap: 0.6cqw 2.4cqw;
  padding: 1.1cqw 2.2cqw; border-radius: 1.4cqw; background: rgba(0,0,0,.28); font-variant-numeric: tabular-nums;
}
.turn-stats div { display: grid; gap: 0.2cqw; text-align: center; }
.turn-stats dt { font-size: 1.3cqw; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; opacity: .85; }
.turn-stats dd { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2.3cqw; }
.center .msg { opacity: 1; }
.center.light-pc .roll { background: #fff; color: #1c1500; }
.center.light-pc .logo span { color: #fff3c9; }
.die {
  width: 13cqw; height: 13cqw; background: #fffdf6; border-radius: 2.4cqw;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: 2cqw; box-shadow: 0 1cqw 0 rgba(0,0,0,.25), inset 0 -0.6cqw 0 #e2dccb;
}
.die i { width: 2.4cqw; height: 2.4cqw; border-radius: 50%; background: #17221d; place-self: center; visibility: hidden; }
.die i.on { visibility: visible; }
.die.rolling { animation: shake .12s linear infinite; }
@keyframes shake { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.roll {
  border: 0; cursor: pointer; background: var(--gold); color: var(--gold-ink);
  font-weight: 800; font-size: 2.4cqw; padding: 1.4cqw 4cqw; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.roll:disabled { opacity: 0.5; cursor: default; }
.msg { font-size: 2cqw; min-height: 5cqw; max-width: 52cqw; line-height: 1.35; opacity: 0.92; text-wrap: balance; }

/* ---------- Below the board ---------- */
.bar { display: grid; gap: 12px; justify-items: end; }
.roster { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 12px 6px 6px; border-radius: 18px; max-width: 100%;
  background: var(--panel); border: 1.5px solid var(--line); font-size: 14px; font-weight: 600;
}
.chip.active { border-color: var(--ink); }
.chip .tok-lg { width: 24px; height: 24px; font-size: 12px; }
.chip small { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.log {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  max-height: 180px; overflow: auto; font-size: 14px; color: var(--muted); display: grid; gap: 4px;
}
.log b { color: var(--ink); }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }

.neg { color: var(--bill); }
.pos { color: var(--re); }
.turn .neg { color: #ff8a7a; }
.chip .cash { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--re); }
.chip .cash.neg { color: var(--bill); }
.pop {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, 0);
  font-family: var(--font-display); font-weight: 800; font-size: 2.2cqw; white-space: nowrap;
  background: var(--board); padding: 0.3cqw 0.8cqw; border-radius: 99px;
  box-shadow: 0 0 0 0.2cqw currentColor; pointer-events: none;
  animation: pop 1.4s ease-out forwards; z-index: 2;
}
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 1cqw); } 15% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -3cqw); } }

/* ---------- Cards ---------- */
.card-layer {
  position: absolute; inset: 0; border-radius: 1cqw; z-index: 5;
  background: color-mix(in srgb, color-mix(in srgb, var(--pc, var(--center)) 60%, #000) 82%, transparent);
  display: grid; place-items: center; padding: 3cqw;
}
.card {
  width: min(100%, 50cqw); max-height: 100%; overflow: auto;
  background: var(--board); color: var(--ink); border-radius: 2cqw;
  border-top: 2.2cqw solid var(--c); text-align: left;
  padding: 2.6cqw 3cqw 3cqw; display: grid; gap: 1.4cqw;
  box-shadow: 0 2cqw 4cqw rgba(0,0,0,.35);
  animation: deal .45s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes deal { from { opacity: 0; transform: translateY(6cqw) rotate(-6deg) scale(.9); } }
.card-top {
  display: flex; justify-content: space-between; gap: 2cqw;
  font-size: 1.6cqw; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--c);
}
.card-top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.card-for { font-size: 1.7cqw; color: var(--muted); display: flex; align-items: center; gap: 1cqw; }
.card-for .tok-lg { width: 3cqw; height: 3cqw; font-size: 1.5cqw; }
.card-head {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 3.4cqw;
  line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance;
}
.card-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.9cqw; }
.card-lines li {
  font-size: 2.1cqw; line-height: 1.3; padding-left: 2.2cqw; position: relative;
}
.card-lines li::before {
  content: ""; position: absolute; left: 0; top: 0.75cqw; width: 1cqw; height: 1cqw; border-radius: 50%; background: var(--c);
}
.card-lines li.need { color: var(--muted); font-style: italic; }
.card-ok {
  justify-self: start; border: 0; cursor: pointer; background: var(--c); color: #fff;
  font-weight: 800; font-size: 2.1cqw; padding: 1.2cqw 3cqw; border-radius: 99px; margin-top: 0.6cqw;
}
.card-lines li.check { font-weight: 700; font-size: 1.9cqw; }
.card-lines li.check::before { width: auto; height: auto; background: none; top: 0; font-weight: 800; }
.card-lines li.have { color: var(--re); }
.card-lines li.have::before { content: "✓"; }
.card-lines li.lack { color: var(--bill); }
.card-lines li.lack::before { content: "✕"; }
.chip .skills { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip .skills em {
  font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 99px;
  background: color-mix(in srgb, var(--skill) 16%, transparent); color: var(--skill);
}
/* card actions */
.die.mini { width: 7cqw; height: 7cqw; padding: 1cqw; border-radius: 1.4cqw; box-shadow: 0 0.5cqw 0 rgba(0,0,0,.2), inset 0 -0.4cqw 0 #e2dccb; }
.die.mini i { width: 1.3cqw; height: 1.3cqw; }
.card-result { display: grid; gap: 0.6cqw; }
.card-result:empty { display: none; }
.res { margin: 0; font-size: 1.9cqw; line-height: 1.3; font-weight: 600; padding: 0.8cqw 1.2cqw; border-radius: 1cqw; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.res.have { color: var(--re); background: color-mix(in srgb, var(--re) 12%, transparent); }
.res.lack { color: var(--bill); background: color-mix(in srgb, var(--bill) 12%, transparent); }
.res.muted { color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 1cqw; }
.card-actions:empty { display: none; }
.card-btn {
  border: 0.25cqw solid var(--c); cursor: pointer; background: var(--c); color: #fff;
  font-weight: 800; font-size: 1.9cqw; padding: 1.1cqw 2.4cqw; border-radius: 99px; text-align: left;
}
.card-btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.card-btn:disabled { opacity: .5; cursor: default; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.btn.sound { display: inline-flex; align-items: center; gap: 10px; }
.btn.sound .sw { width: 34px; height: 20px; border-radius: 99px; background: var(--re); position: relative; transition: background .2s; flex: none; }
.btn.sound .sw::after { content: ""; position: absolute; top: 2px; left: 16px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.btn.sound[aria-pressed="false"] { color: var(--muted); }
.btn.sound[aria-pressed="false"] .sw { background: var(--line); }
.btn.sound[aria-pressed="false"] .sw::after { left: 2px; }

.cg-line { font-size: 12px; color: var(--ink); background: color-mix(in srgb, var(--tax) 12%, transparent); padding: 6px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.toast.long { max-width: 420px; white-space: normal; animation-duration: 6s; line-height: 1.4; }
.toasts {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; width: max-content; max-width: calc(100% - 32px);
}
.toast {
  background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: toast 3.2s ease forwards; font-variant-numeric: tabular-nums;
}
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.bank-limit { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bank-limit b { color: var(--ink); }
.bank-limit small { display: block; font-size: 11px; }
.bank-msg { font-size: 12px; color: var(--bill); font-weight: 600; }

/* goal + win */
.goal { display: grid; gap: 4px; }
.goal-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.goal-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.goal-row small { color: var(--muted); font-weight: 400; }
.goal-bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: inherit; background: var(--gold); transition: width .4s; }
.win-layer {
  position: absolute; inset: 0; z-index: 6; border-radius: 1cqw; background: var(--center);
  display: grid; place-items: center; padding: 3cqw;
}
.win { display: grid; gap: 1.6cqw; justify-items: center; text-align: center; width: min(100%, 56cqw); }
.win-kicker { font-size: 1.8cqw; font-weight: 800; text-transform: uppercase; letter-spacing: .2em; color: var(--gold); }
.win-head { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 6.4cqw; line-height: .95; letter-spacing: -0.03em; text-wrap: balance; }
.win-sub { margin: 0; font-size: 2cqw; line-height: 1.35; opacity: .88; max-width: 46cqw; }
.win-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 0.8cqw; text-align: left; }
.win-list li {
  display: flex; align-items: center; gap: 1.4cqw; padding: 1cqw 1.6cqw; border-radius: 1.2cqw;
  background: color-mix(in srgb, var(--center-ink) 9%, transparent); font-size: 2cqw; font-weight: 700;
}
.win-list li:first-child { box-shadow: 0 0 0 0.3cqw var(--gold); }
.win-list .tok-lg { width: 3.6cqw; height: 3.6cqw; font-size: 1.7cqw; flex: none; }
.win-list li > span:nth-child(2) { flex: 1; min-width: 0; }
.win-list small { display: block; font-weight: 400; font-size: 1.5cqw; opacity: .75; font-variant-numeric: tabular-nums; }
.win-list b { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--gold); }

.pcard .perks { display: flex; flex-wrap: wrap; gap: 4px; }
.pcard .perks em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--relax) 16%, transparent); color: var(--relax); }
.pcard .skill-slot { font-size: 11px; color: var(--muted); padding: 2px 0; }
.pcard .skill-slot.used { color: var(--bill); }

.win-checks { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.win-checks li { display: inline-flex; gap: 5px; align-items: baseline; font-variant-numeric: tabular-nums; }
.win-checks li::before { content: "○"; font-weight: 800; }
.win-checks li.ok { color: var(--re); font-weight: 700; }
.win-checks li.ok::before { content: "✓"; }

.pcard .caps { display: flex; flex-wrap: wrap; gap: 4px; }
.pcard .caps span { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.pcard .caps span.full { border-color: var(--gold); color: var(--ink); background: color-mix(in srgb, var(--gold) 18%, transparent); }

.pcard.bankrupt { opacity: .6; filter: grayscale(.7); }
.pcard .bk-tag { margin-left: auto; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #fff; background: var(--bill); padding: 2px 8px; border-radius: 99px; }
.pcard .bk-note { margin: 0; font-size: 13px; color: var(--bill); line-height: 1.4; }
.pcard .risk { margin: 0; font-size: 12px; line-height: 1.4; color: var(--bill); background: color-mix(in srgb, var(--bill) 10%, transparent); padding: 6px 8px; border-radius: 8px; }

/* AI playmate */
.ai-ask { display: grid; gap: 10px; padding: 14px; border-radius: 12px; border: 1.5px solid var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--board)); }
.ai-q { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.ai-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-btns button { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 700; cursor: pointer; }
.ai-btns button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--panel); }
.ai-note { margin: 0; font-size: 13px; color: var(--muted); }
.card-btn.ai-pick { outline: 0.4cqw solid var(--gold); outline-offset: 0.3cqw; }
.card-btn:disabled.ai-pick { opacity: 1; }

/* Normie */
.normie-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--board); cursor: pointer; }
.normie-opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
.normie-opt span { display: grid; gap: 2px; min-width: 0; }
.normie-opt small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.pcard.normie { background: repeating-linear-gradient(135deg, var(--panel) 0 10px, color-mix(in srgb, var(--muted) 6%, var(--panel)) 10px 20px); border-style: dashed; }
.pcard .cpu { margin-left: auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); padding: 2px 6px; border-radius: 99px; }
.normie-plan, .normie-eta { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.normie-eta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pcard.normie .goal-bar i { background: var(--muted); }
.win-list li.normie-row { opacity: .8; border: 0.2cqw dashed color-mix(in srgb, var(--center-ink) 40%, transparent); }

/* bank */
.bank { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }
.bank-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.bank-head span:first-child { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.bank-head .neg { font-weight: 700; font-variant-numeric: tabular-nums; }
.loans { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.loans li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.loans li span { min-width: 0; font-variant-numeric: tabular-nums; }
.loans small { display: block; color: var(--muted); font-size: 11px; }
.borrow { display: flex; gap: 6px; }
.borrow input {
  flex: 1; min-width: 0; width: 100%; height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1.5px solid var(--line); background: var(--board); color: var(--ink); font-variant-numeric: tabular-nums;
}
.mini-btn {
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--board);
  color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.mini-btn:disabled { opacity: .45; cursor: default; }
.mini-btn.warn { border-color: var(--bill); color: var(--bill); justify-self: start; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* contracts picker */
.card-actions:has(.contracts) { display: grid; gap: 1.4cqw; }
.contracts {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1cqw 2cqw;
  padding: 1.4cqw 1.6cqw; border-radius: 1.2cqw; background: color-mix(in srgb, var(--c) 9%, transparent);
}
.contracts > label { font-size: 1.6cqw; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--c); }
.stepper { display: flex; align-items: center; gap: 0.8cqw; justify-self: start; }
.stepper .step {
  width: 4.4cqw; height: 4.4cqw; border-radius: 50%; border: 0.25cqw solid var(--c); background: var(--board);
  color: var(--c); font-weight: 800; font-size: 2.6cqw; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.stepper input {
  width: 9cqw; height: 4.4cqw; text-align: center; border-radius: 1cqw; border: 0.2cqw solid var(--line);
  background: var(--board); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 2.4cqw;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.contracts-math { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.4cqw; }
.contracts-math dt { font-size: 1.4cqw; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.contracts-math dd.neg { color: var(--bill); }
.contracts-math dd { margin: 0.2cqw 0 0; font-family: var(--font-display); font-weight: 800; font-size: 2.8cqw; font-variant-numeric: tabular-nums; }
.contracts-hint { grid-column: 1 / -1; margin: 0; font-size: 1.6cqw; color: var(--muted); line-height: 1.3; }
.contracts-btns { display: flex; flex-wrap: wrap; gap: 1cqw; }

/* player portfolios */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; width: 100%; }
.pcard {
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  display: grid; gap: 10px; align-content: start; min-width: 0;
}
.pcard.active { border-color: var(--p); box-shadow: 0 0 0 2px var(--p); }
.pcard header { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pcard header .tok-lg { width: 26px; height: 26px; font-size: 13px; flex: none; }
.pcard header strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.pcard { grid-template-columns: minmax(0, 1fr); }
.pcard dt { overflow-wrap: anywhere; }
.pcard dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.pcard dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.pcard .skills { display: flex; flex-wrap: wrap; gap: 4px; }
.pcard .skills em {
  font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
  background: color-mix(in srgb, var(--skill) 16%, transparent); color: var(--skill);
}
.pcard .assets { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 13px; }
.pcard .assets li { display: flex; justify-content: space-between; gap: 8px; }
.pcard .assets li span { min-width: 0; }
.pcard .assets li b { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.pcard .paused { font-style: normal; font-size: 11px; color: var(--bill); font-weight: 700; }
.pcard .empty { margin: 0; font-size: 13px; color: var(--muted); }
.chip .hand { color: var(--muted); font-weight: 400; font-size: 12px; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .tok.active, .die.rolling, .pop, .card, .toast, .tok.walking, .tok.face-laugh, .tok.face-sad { animation: none; }
}
/* ---------- Purchase animations (stay until the next roll) ---------- */
.board { position: relative; }
.buyfx { position: absolute; z-index: 5; width: 28cqw; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
  filter: drop-shadow(0 0.6cqw 1cqw rgba(0,0,0,.35)); animation: bf-in .25s ease-out both; }
.buyfx svg { width: 100%; height: 100%; display: block; overflow: visible; }
.buyfx .bf-cap { position: absolute; left: 50%; bottom: -0.4cqw; transform: translateX(-50%); white-space: nowrap;
  font: 800 1.5cqw/1 var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: #fff;
  background: var(--c); padding: 0.55cqw 1.1cqw; border-radius: 999px; box-shadow: 0 0.3cqw 0.8cqw rgba(0,0,0,.3);
  animation: bf-pop .35s 1.6s ease-out both; }
.buyfx.out { animation: bf-out .3s ease-in both; }
@keyframes bf-in { from { opacity: 0; } }
@keyframes bf-out { to { opacity: 0; transform: translate(-50%, -50%) scale(.85); } }
@keyframes bf-pop { from { opacity: 0; transform: translateX(-50%) scale(.6); } }

/* real estate: a hand lowers the house onto the space, lets go and lifts away */
.buyfx .bf-carry { animation: bf-lower 1.05s cubic-bezier(.2,.8,.3,1) both; }
@keyframes bf-lower { from { transform: translateY(-150px); } }
.buyfx .bf-land { transform-box: fill-box; transform-origin: 50% 100%; animation: bf-squash .35s 1s ease-out both; }
@keyframes bf-squash { 0% { transform: scale(1, 1); } 40% { transform: scale(1.06, .92); } 100% { transform: scale(1, 1); } }
.buyfx .bf-lift { animation: bf-up .7s 1.2s ease-in both; }
@keyframes bf-up { to { transform: translateY(-170px); opacity: 0; } }
.buyfx .bf-shadow { fill: rgba(0,0,0,.35); transform-box: fill-box; transform-origin: center; animation: bf-shadow 1.05s ease-out both; }
@keyframes bf-shadow { from { transform: scale(.3); opacity: 0; } }
.buyfx .bf-puffs circle { fill: rgba(255,255,255,.85); transform-box: fill-box; transform-origin: center; opacity: 0; animation: bf-puff .7s 1s ease-out both; }
@keyframes bf-puff { 0% { opacity: 0; transform: scale(.4); } 12% { opacity: .9; } 100% { opacity: 0; transform: scale(2.2); } }

/* stock options: the price line draws upward, then the arrow and "UP" tag appear */
.buyfx .bf-line { stroke-dasharray: 100; animation: bf-draw 1.5s .2s ease-in-out both; }
@keyframes bf-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.buyfx .bf-area { opacity: 0; animation: bf-fade .6s 1.3s ease-out both; }
@keyframes bf-fade { to { opacity: 1; } }
.buyfx .bf-arrow, .buyfx .bf-tag { transform-box: fill-box; transform-origin: center; animation: bf-zoom .35s 1.65s ease-out both; }
@keyframes bf-zoom { from { opacity: 0; transform: scale(.3); } }

/* business: two hands meet from each side and shake three times */
.buyfx .bf-left { animation: bf-from-left .55s ease-out both; }
.buyfx .bf-right { animation: bf-from-right .55s ease-out both; }
@keyframes bf-from-left { from { transform: translateX(-60px); opacity: 0; } }
@keyframes bf-from-right { from { transform: translateX(60px); opacity: 0; } }
.buyfx .bf-shakeg { animation: bf-shake 1.2s .6s ease-in-out both; }
@keyframes bf-shake { 0%, 100% { transform: translateY(0); } 16%, 50%, 84% { transform: translateY(-9px); } 33%, 67% { transform: translateY(7px); } }
.buyfx .bf-spark { transform-box: fill-box; transform-origin: center bottom; animation: bf-zoom .4s 1.8s ease-out both; }

@media (prefers-reduced-motion: reduce) { .buyfx, .buyfx * { animation-duration: .01s !important; animation-delay: 0s !important; } }

/* ---------- Online play ---------- */
.online-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px;
  background: color-mix(in srgb, var(--gold) 9%, transparent); }
.online-box .ob-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.online-box .ob-head b { font-family: var(--font-display); font-size: 18px; }
.online-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.online-btns .btn { flex: 1 1 180px; }
.online-note { font-size: 13px; color: var(--muted); margin: 0; }
.online-note:empty { display: none; }
.code-box { display: grid; justify-items: center; gap: 2px; padding: 14px; border-radius: 12px; border: 2px dashed color-mix(in srgb, var(--gold) 70%, transparent); }
.code-box span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.code-box b { font-family: var(--font-display); font-weight: 800; font-size: 46px; letter-spacing: .2em; line-height: 1.1; padding-left: .2em; }
.ofield { display: grid; gap: 6px; }
.ofield input { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); min-width: 0; }
.ofield input#join-code { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: .25em; text-transform: uppercase; }
.lobby-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lobby-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 0; }
.lobby-list li.empty { color: var(--muted); font-size: 14px; justify-content: center; }
.lobby-list .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-list em { font-style: normal; font-size: 12px; color: var(--muted); }
.orow { display: flex; gap: 8px; flex-wrap: wrap; }
.orow .btn { flex: 1 1 auto; }
.wait-msg { font-weight: 700; color: var(--ink) !important; }
.online-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 14px; }
.online-bar .ob-code { font-weight: 700; color: var(--muted); }
.online-bar .ob-code b { color: var(--ink); font-family: var(--font-display); letter-spacing: .12em; }
#online-seats { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.oseat { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; border: 1px solid var(--line); max-width: 100%; }
.oseat > span { padding-right: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oseat .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #2fbf63; box-shadow: 0 0 0 2px color-mix(in srgb, var(--p) 60%, transparent); }
.oseat.away .dot { background: #9aa8a0; }
.oseat.oturn { border-color: var(--p); box-shadow: inset 0 0 0 1px var(--p); font-weight: 700; }
#online-status { font-weight: 700; }
#online-status.you { background: var(--gold); color: var(--gold-ink, #1c1500); padding: 3px 12px; border-radius: 999px; animation: you-pulse 1.4s ease-in-out 3; }
@keyframes you-pulse { 50% { transform: scale(1.06); } }
.online-flash { flex-basis: 100%; font-size: 13px; color: var(--muted); }
body.online-remote #newgame { display: none; }
body.online-remote .not-mine, body.remote-turn #roll, body.remote-turn #card-actions button { opacity: .5; cursor: not-allowed; }
body.online-remote .sent { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Richer purchase moment ---------- */
.buyfx { width: 32cqw; --t: 1s; }
.buyfx.art-stock { --t: 1.65s; } .buyfx.art-shake { --t: 1.75s; }
.buyfx .bf-ring { position: absolute; left: 50%; top: 55%; width: 70%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%) scale(.2);
  border: 0.6cqw solid color-mix(in srgb, var(--gold) 80%, #fff); opacity: 0; animation: bf-ring .7s var(--t) ease-out both; }
@keyframes bf-ring { 0% { opacity: .9; transform: translate(-50%, -50%) scale(.2); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } }
.buyfx .bf-glow { position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--gold) 45%, transparent), transparent);
  opacity: 0; animation: bf-glow 1.4s var(--t) ease-out both; }
@keyframes bf-glow { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: 1; } 100% { opacity: .35; transform: scale(1.05); } }
.buyfx .bf-coins i { position: absolute; left: 50%; top: 55%; width: 2.6cqw; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4 0 18%, #f2c94c 22% 60%, #c8961e 64%); box-shadow: inset 0 0 0 0.25cqw #a87a12;
  transform: translate(-50%, -50%) scale(.3); opacity: 0; animation: bf-coin 1.1s calc(var(--t) + var(--d)) cubic-bezier(.2,.7,.4,1) both; }
@keyframes bf-coin {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  12% { opacity: 1; }
  60% { opacity: 1; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotateY(360deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 5cqw)) scale(.8) rotateY(540deg); } }
.buyfx .bf-cap { font-size: 1.75cqw; padding: 0.7cqw 1.4cqw; animation-delay: calc(var(--t) + .1s); font-variant-numeric: tabular-nums; }
.buyfx .bf-sign { transform-box: fill-box; transform-origin: 50% 100%; animation: bf-sign .45s 1.25s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes bf-sign { from { opacity: 0; transform: scaleY(0) rotate(-10deg); } }
.buyfx .bf-candles > g { transform-box: fill-box; transform-origin: 50% 100%; animation: bf-candle .35s ease-out both; animation-delay: inherit; }
@keyframes bf-candle { from { opacity: 0; transform: scaleY(0); } }
.buyfx .bf-stamp { transform-box: fill-box; transform-origin: center; animation: bf-stamp .3s 1.85s cubic-bezier(.5,0,.75,1.4) both; }
@keyframes bf-stamp { from { opacity: 0; transform: scale(2.6); } 70% { opacity: 1; transform: scale(.92); } }
.buy-fly { position: fixed; z-index: 70; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; pointer-events: none;
  display: grid; place-items: center; background: var(--c); color: #fff; font: 800 13px/1 var(--font-body); box-shadow: 0 6px 18px rgba(0,0,0,.35); border: 3px solid #fff; }
.pcard.got-asset { animation: got-asset 1.3s ease-out; }
@keyframes got-asset { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 80%, transparent); } 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 70%, transparent); transform: scale(1.02); } 100% { box-shadow: 0 0 0 0 transparent; } }
/* drawing a card: it flies out of the space face-down, then flips over */
.card.flip { position: relative; transform-style: preserve-3d; animation: card-fly .85s cubic-bezier(.2,.8,.3,1) both; }
@keyframes card-fly {
  0% { opacity: 0; transform: translate(var(--fx, 0), var(--fy, 0)) scale(.22) rotateY(180deg) rotate(-12deg); }
  12% { opacity: 1; }
  52% { transform: translate(0, 0) scale(1.03) rotateY(180deg) rotate(0); }
  100% { transform: none; } }
.card.flip::after { content: "Retire3x"; position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center;
  font: 800 4.4cqw/1 var(--font-display); color: #fff; letter-spacing: -.02em; transform: scaleX(-1);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.09) 0 1.2cqw, transparent 1.2cqw 2.4cqw), var(--c);
  box-shadow: inset 0 0 0 0.8cqw rgba(255,255,255,.85), inset 0 0 0 1.2cqw var(--c);
  animation: card-back .85s linear both; pointer-events: none; }
@keyframes card-back { 0%, 74% { opacity: 1; } 76%, 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .card.flip, .card.flip::after { animation: none; } .card.flip::after { display: none; } }
