/* BLOODBOUND — one stylesheet for the phone client and the dev table's panels.
   Theme: "candlelit crypt" — near-black stone, bone-white text, aged-gold
   buttons and frames, a flickering candle glow and a vignette.
   Clan colours (--rose, --beast, --inq) appear ONLY on your own card (.bbcard,
   .chip inside it), public tokens and the game-over reveal (BUILD-PLAN §1.4).
   Lobby, avatars and every other piece of chrome stay clan-neutral. */

@font-face {
  font-family: "Cinzel"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/cinzel-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Serif Thai"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/noto-serif-thai-thai.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Noto Serif Thai"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/noto-serif-thai-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0d0a0b; --bg2: #17110f; --ink: #e9e1d3; --gold: #b8893a; --gold2: #d9b25f;
  --rose: #8e1b2a; --beast: #2f4f6b; --inq: #6d6a66; --line: #3a2c25;
  --card: #1c1512; --mut: #a39888; --gold-ink: #1e140a; --ok: #8fbf7a; --warn: #d9a441;
  --display: "Cinzel", "Noto Serif Thai", Georgia, serif;
  --body: "Noto Serif Thai", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body); line-height: 1.45;
  background: radial-gradient(900px 600px at 50% -12%, #2a1a12, var(--bg) 68%) fixed, var(--bg);
  color: var(--ink); -webkit-font-smoothing: antialiased; min-height: 100vh;
}
/* candle glow + vignette (decorative, behind everything, never intercepts taps) */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; }
body::before { background: radial-gradient(420px 320px at 50% 0%, rgba(217,150,70,.16), transparent 70%); animation: candle 5s infinite ease-in-out; }
body::after { background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,.72) 100%); }
@keyframes candle { 0%,100% { opacity: .85; } 18% { opacity: 1; } 22% { opacity: .7; } 40% { opacity: .95; } 63% { opacity: .78; } 70% { opacity: 1; } }
@keyframes wick { 0%,100% { filter: drop-shadow(0 0 5px rgba(217,178,95,.45)); } 30% { filter: drop-shadow(0 0 9px rgba(217,178,95,.8)); } 55% { filter: drop-shadow(0 0 4px rgba(217,178,95,.35)); } 80% { filter: drop-shadow(0 0 8px rgba(217,178,95,.65)); } }
.top .brand .logo { animation: wick 4.1s infinite ease-in-out; }
@media (prefers-reduced-motion: reduce) { body::before, .flicker, .top .brand .logo { animation: none !important; } }

.app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 14px 16px 56px; }
:lang(th) { line-height: 1.6; }
/* Thai script breaks apart under tracking: no letter-spacing on Thai display text */
:lang(th) .tag, :lang(th) .orr, :lang(th) .cname, :lang(th) .screen-title, :lang(th) button, :lang(th) .howto h3 { letter-spacing: 0; }
.client { position: relative; }

button { font: inherit; font-family: var(--display); font-weight: 700; border: 0; border-radius: 12px; padding: 14px 18px; cursor: pointer;
  background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--gold-ink); font-size: 17px; min-height: 44px;
  box-shadow: 0 2px 0 #6e4f1f, 0 6px 16px rgba(0,0,0,.45); }
button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
button.big { width: 100%; font-size: 19px; padding: 16px; margin-top: 10px; letter-spacing: .03em; }
button.sec { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
button.small-btn { padding: 9px 14px; font-size: 15px; margin-top: 8px; }
button.mini { padding: 4px 6px; min-height: 32px; min-width: 32px; background: transparent; color: var(--mut); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.linkish { background: transparent; color: var(--mut); padding: 6px 8px; font-family: var(--body); font-size: 14px; font-weight: 700; min-height: 32px; box-shadow: none; }
.linkish.warnlink { color: var(--warn); }
.langbtn { color: var(--gold2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
input { font: inherit; width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; font-size: 18px; }
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,137,58,.2); }
input.codein { text-transform: uppercase; letter-spacing: .3em; font-family: var(--display); font-weight: 700; }
.mut { color: var(--mut); }
.small { font-size: 13px; }
.center { text-align: center; }
.panel { background: linear-gradient(180deg, rgba(28,21,18,.94), rgba(23,17,15,.94)); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 12px 0; box-shadow: inset 0 1px 0 rgba(217,178,95,.06); }
.tag { font-family: var(--display); font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: .16em; font-weight: 700; margin-bottom: 8px; }
label.tag { display: block; }
.orr { text-align: center; color: var(--mut); font-family: var(--display); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; margin: 20px 0 8px; }
.ic { width: 1.05em; height: 1.05em; vertical-align: -.16em; fill: currentColor; flex: none; }
.ic.big { width: 34px; height: 34px; }
.ic.blood { color: #a3283a; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand h1 { font-family: var(--display); font-size: 30px; letter-spacing: .08em; margin: 0; font-weight: 700; color: var(--gold2); text-shadow: 0 2px 14px rgba(217,178,95,.3); }
.brand .logo { width: 26px; height: 26px; color: var(--gold2); filter: drop-shadow(0 0 6px rgba(217,178,95,.5)); }
.brand.small h1 { font-size: 18px; }
.brand.small .logo { width: 18px; height: 18px; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.top-r { display: flex; align-items: center; gap: 6px; }
.codechip { font-family: var(--display); font-weight: 700; letter-spacing: .2em; color: var(--gold2); background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.code { font-family: var(--display); font-size: 48px; font-weight: 700; letter-spacing: .22em; color: var(--gold2); background: var(--bg); border: 1px solid var(--gold); border-radius: 12px; padding: 6px 10px 6px 22px; display: inline-block; margin: 4px 0 10px; }
.hero { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; margin: 4px 0 6px; }
.hero-dagger { width: 120px; height: 120px; color: #cfc6b8; position: relative; z-index: 1; filter: drop-shadow(0 8px 18px rgba(0,0,0,.8)); }
.hero-glow { position: absolute; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(142,27,42,.45), transparent 70%); animation: candle 4s infinite ease-in-out; }
.tagline { font-style: italic; }
.qr { display: block; margin: 6px auto; border-radius: 10px; background: #e9e1d3; padding: 6px; }
.link { font-size: 13px; word-break: break-all; color: var(--mut); margin: 6px 0 10px; }
.notice, .awaybar { background: rgba(217,164,65,.08); border: 1px solid var(--warn); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; margin: 10px 0; text-align: center; }
.recbar { background: rgba(217,164,65,.08); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.recbar p { margin: 4px 0; }
.recbar b { color: var(--gold2); }
.recbar.warn { border: 2px solid var(--warn); background: rgba(217,164,65,.14); color: var(--warn); font-weight: 700; }
.reason { color: var(--warn); font-weight: 700; font-size: 14px; margin: 8px 0 2px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px); background: var(--card); border: 1px solid var(--gold); color: var(--ink); padding: 12px 18px; border-radius: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; z-index: 90; box-shadow: 0 10px 28px rgba(0,0,0,.55); max-width: 88vw; text-align: center; font-family: var(--body); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.foot { margin-top: 18px; }
.screen-title { font-family: var(--display); color: var(--gold2); font-size: 22px; text-align: center; margin: 10px 0 4px; letter-spacing: .06em; }
.flicker { animation: candle 3.2s infinite ease-in-out; }

/* avatars: placeholder glyphs, desaturated so no avatar carries a clan colour */
.av { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #2a211c, #120d0c); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 26px; line-height: 1; flex: none; filter: grayscale(1) sepia(.25) brightness(1.05); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.av.sm { width: 38px; height: 38px; font-size: 21px; }
.av.xs { width: 26px; height: 26px; font-size: 14px; }

/* lobby */
.cnt { color: var(--ink); }
.cnt.low { color: var(--warn); }
.plist { display: flex; flex-direction: column; gap: 6px; }
.prow { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; min-height: 50px; }
.prow.away { opacity: .5; }
.prow.me { border-color: rgba(184,137,58,.6); }
.prow .nm { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .nm em { color: var(--mut); font-style: normal; font-size: 12px; font-weight: 400; }
.botlbl { border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.hostlbl { color: var(--gold2); display: inline-flex; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.dot.off { background: var(--line); }
.avgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.avpick { background: var(--bg2); border: 1px solid var(--line); padding: 4px; border-radius: 12px; min-height: 0; box-shadow: none; display: flex; justify-content: center; }
.avpick .av { width: 100%; height: auto; aspect-ratio: 1; border: 0; font-size: 24px; }
.avpick.on { border: 2px solid var(--gold2); box-shadow: 0 0 10px rgba(217,178,95,.35); opacity: 1; cursor: default; }
.avpick.taken { opacity: .22; }
.dial { margin: 6px 0; }
.dlabel { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button, .seg span { padding: 7px 16px; font-size: 14px; border-radius: 10px; min-height: 36px; display: inline-flex; align-items: center; box-shadow: none; font-family: var(--display); font-weight: 700; }
.seg .on { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--gold-ink); border: 1px solid var(--gold); }
.seg button.on:disabled { opacity: 1; cursor: default; }
.seg .off { background: var(--bg2); color: var(--mut); border: 1px solid var(--line); }
.lead-list { display: flex; flex-direction: column; }
.lead { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.lead:last-child { border-bottom: 0; }
.lead .nm { flex: 1; }
.lead b { color: var(--gold2); font-family: var(--display); }
.lead.gone { opacity: .5; }
.rstat { font-size: 14px; font-weight: 700; white-space: nowrap; }
.rstat.wait { color: var(--warn); }
.rstat.ok { color: var(--ok); }
.peekrow { width: 100%; margin-top: 10px; background: var(--bg2); color: var(--ink); border: 1px solid var(--line); box-shadow: none; font-family: var(--body); }

/* reveal: the card back is identical for everyone */
.cardback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; width: 220px; height: 300px; margin: 14px auto 6px;
  border-radius: 16px; border: 2px solid var(--gold); color: var(--gold2); padding: 0;
  background: repeating-linear-gradient(45deg, rgba(184,137,58,.07) 0 6px, transparent 6px 14px), radial-gradient(circle at 50% 40%, #2b1d16, #110c0b);
  box-shadow: 0 0 0 6px var(--bg2), 0 0 0 7px var(--line), 0 16px 34px rgba(0,0,0,.6); }
.back-sigil .ic { width: 84px; height: 84px; filter: drop-shadow(0 0 10px rgba(217,178,95,.45)); }
.tapnote { font-family: var(--body); font-size: 14px; color: var(--mut); font-weight: 400; }

/* overlays */
/* Overlays start at the TOP and scroll. Never justify-content:center here: when the content is taller than the
   screen, centring pushes its top above the scroll origin, where it can't be scrolled back into view (the
   "How to play is cut off" bug). Children never shrink, so the overlay itself is what scrolls. */
.overlay { position: fixed; inset: 0; background: rgba(5,3,3,.86); z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.overlay > * { flex: none; }
.cardov { cursor: pointer; padding-top: max(24px, env(safe-area-inset-top)); }
.cardov .tapnote { margin-top: 10px; }
/* the big "✕ Close" on private overlays (no auto-hide timer): sticky, so it's on screen however long the content */
button.closebig { position: sticky; bottom: 0; z-index: 2; width: min(340px, 100%); margin: 12px auto 0; display: block; font-size: 18px; padding: 14px; min-height: 52px;
  border: 1px solid var(--gold); background: var(--bg2); color: var(--gold2); box-shadow: 0 -6px 18px rgba(0,0,0,.55); }
.sheet button.closebig, .dock button.closebig { width: 100%; }
.dock button.closebig { position: static; margin: 0 0 6px; box-shadow: none; }

/* your card: the ONLY clan-coloured element outside public tokens */
.bbcard { --clan: var(--inq); width: min(340px, 100%); background: linear-gradient(180deg, #1d1613, #120d0c); border: 3px solid var(--clan); border-radius: 18px;
  padding: 16px 16px 12px; box-shadow: 0 0 0 1px var(--gold), 0 0 28px color-mix(in srgb, var(--clan) 55%, transparent), 0 20px 40px rgba(0,0,0,.7); text-align: center; }
.bbcard.c-rose { --clan: var(--rose); }
.bbcard.c-beast { --clan: var(--beast); }
.bbcard.c-inq { --clan: var(--inq); }
.portrait { height: 150px; border-radius: 12px; border: 2px solid var(--clan); display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--clan) 45%, #1a1210), #0b0808 75%); }
/* with art: the painting is the card, bright at the top (the face) and fading to near-black behind the text */
.bbcard.hasbg { position: relative; overflow: hidden; background: #0d0a0b; }
.bbcard.hasbg > :not(.cardbg) { position: relative; z-index: 1; }
.cardbg { position: absolute; inset: 0; z-index: 0; }
.cardbg .cbgimg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; display: block; }
.cardbg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,10,11,0) 0%, rgba(13,10,11,.05) 22%, rgba(13,10,11,.62) 36%, rgba(13,10,11,.82) 48%, rgba(13,10,11,.86) 75%, rgba(13,10,11,.94) 100%); }
.portrait.spacer { height: 190px; border: 0; background: none; }
.bbcard.hasbg .cname, .bbcard.hasbg .cclan, .bbcard.hasbg p, .bbcard.hasbg .clue { text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 12px rgba(0,0,0,.7); }
.numeral { font-family: var(--display); font-size: 104px; font-weight: 700; color: var(--gold2); line-height: 1; text-shadow: 0 4px 16px rgba(0,0,0,.8); }
.cname { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--ink); margin-top: 10px; letter-spacing: .05em; }
.cclan { font-size: 14px; color: var(--gold2); margin-bottom: 6px; }
.ability { font-size: 16px; margin: 8px 0 4px; }
.when { font-size: 12px; color: var(--mut); margin: 0 0 8px; }
.iconrow { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
.iconrow .lbl { font-size: 12px; color: var(--mut); }
.rule { font-size: 13px; color: var(--mut); text-align: left; margin: 6px 0; }
.rule .ic { color: var(--gold2); }
.clues { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.clue { font-size: 15px; margin: 6px 0; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }

/* icon chips: shape + colour (+ label) — rose crimson, beast steel, unknown/wild ash */
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px 3px 6px; font-size: 13px; font-weight: 700; border: 1px solid rgba(255,255,255,.18); color: #f2e9dc; background: var(--inq); }
.chip .ic { width: 18px; height: 18px; }
.chip.k-rose { background: var(--rose); }
.chip.k-beast { background: var(--beast); }
.chip.k-unknown { background: #3b3633; }
.chip.k-wild { background: var(--inq); }
.chip:not(:has(span)) { padding: 4px; }

/* how to play */
.howto { background: var(--card); border: 1px solid var(--gold); border-radius: 16px; padding: 18px; max-width: 520px; width: 100%; margin: 0 auto; }
.howto h2 { font-family: var(--display); color: var(--gold2); margin: 0 0 8px; }
.howto h3 { font-family: var(--display); color: var(--gold); font-size: 15px; letter-spacing: .08em; margin: 16px 0 8px; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .pic { width: 64px; min-height: 44px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--gold2); }
.step .pic .pair { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.step .txt { font-size: 14px; }
.step .txt b { display: block; font-family: var(--display); color: var(--ink); }
.chars { display: flex; flex-direction: column; gap: 6px; }
.howto .close { width: 100%; margin-top: 14px; }
.howto .htvid-cap { margin: 0 0 6px; color: var(--mut); font-size: 14px; }
.howto .htvid { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; }
/* items (ability cards) — How to play + the rank guide */
.items { display: flex; flex-direction: column; }
.irow { display: grid; grid-template-columns: 52px 1fr; column-gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.irow .iic { grid-row: span 2; display: flex; gap: 2px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.irow b { font-family: var(--display); }
.irow span:last-child { color: var(--mut); overflow-wrap: anywhere; }
/* 📖 rank guide */
.rankref h3 { margin-top: 0; }
.rankref .items { margin-bottom: 4px; }
.rankref > h3 + p { margin: 0 0 6px; }
.rglegend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 6px; color: var(--mut); }
.rglist { display: flex; flex-direction: column; }
/* rank | its two clue tokens | name over ability — the clue column sizes to its chips, with clear space (no divider) before the text */
.rgrow { display: grid; grid-template-columns: 36px auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rgrow .tk.k-rank { grid-row: span 2; justify-self: center; justify-content: center; width: 34px; height: 34px; padding: 0; font-size: 16px; }
.rgrow .rgic { grid-row: span 2; display: flex; gap: 6px; padding-right: 4px; }
.rgrow > b { font-family: var(--display); align-self: end; }
.rgrow > span:last-child { color: var(--mut); overflow-wrap: anywhere; align-self: start; line-height: 1.4; }
.chip.k-own { background: #4a3d34; border-color: var(--gold); color: #e9e1d3; }

/* ── the table (§6.4) — identical chrome on every phone ──────────────────── */
.status { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 6px 0 8px; font-size: 14px; }
.status > div { overflow-wrap: anywhere; }
.st-dag { font-family: var(--display); font-weight: 700; color: var(--gold2); }
.st-main { font-weight: 700; }
.st-sub, .st-offers, .st-wait { color: var(--mut); font-size: 13px; }
.st-offers { color: var(--ink); }
.ibanner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: rgba(142,27,42,.14); border: 1px solid var(--gold); border-radius: 12px; padding: 8px 10px; margin: 0 0 8px; font-size: 14px; }
.ibanner.offered { background: rgba(184,137,58,.1); }
.ibanner .itxt { flex: 1 1 170px; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.ibanner small { display: block; font-weight: 400; color: var(--mut); font-size: 12px; }
.ibtns { display: flex; gap: 6px; flex-wrap: wrap; }
.ibtns button { padding: 8px 12px; font-size: 15px; min-height: 40px; }

.tlist { display: flex; flex-direction: column; gap: 4px; }
.trow { display: flex; align-items: center; gap: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; min-height: 48px; min-width: 0; }
.trow.away { opacity: .55; }
.trow.me { border-color: rgba(184,137,58,.6); }
.trow.holder { box-shadow: inset 3px 0 0 var(--gold2); }
.trow.pick { cursor: pointer; border-style: dashed; border-color: rgba(217,178,95,.45); }
.trow.sel { border: 2px solid var(--gold2); background: #2a1f17; box-shadow: 0 0 10px rgba(217,178,95,.3); }
.trow .av.sm { width: 34px; height: 34px; font-size: 19px; }
.tmain { flex: 1; min-width: 0; }
.tname { display: flex; align-items: baseline; gap: 4px; min-width: 0; font-weight: 700; font-size: 15px; line-height: 1.3; }
.tname .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tname em { color: var(--mut); font-style: normal; font-size: 12px; font-weight: 400; flex: none; }
.tinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; min-width: 0; margin-top: 2px; }
.pips { display: inline-flex; gap: 2px; margin-right: 2px; }
.pips i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid #6b5a4c; display: inline-block; }
.pips i.on { background: var(--warn); border-color: #f0c46a; } /* amber, not red: red is a clan colour */
.pips i.last { border-style: dashed; }
.tk { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; line-height: 1; }
.chip.tk { padding: 2px; }
.chip.tk .ic { width: 14px; height: 14px; }
.tk.k-rank { background: #2b241f; border: 1px solid var(--gold); color: var(--ink); border-radius: 999px; padding: 2px 7px; font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk.k-rank b { color: var(--gold2); font-family: var(--display); }
.tk.k-rank.ghost { opacity: .5; border-style: dashed; }
.bdg { display: inline-flex; align-items: center; gap: 1px; color: var(--gold2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 3px; font-size: 11px; }
.bdg .ic { width: 14px; height: 14px; }
.bdg.col-purple { color: #b98ae0; border-color: #6c4a8a; }
.bdg.col-green { color: #8fcf87; border-color: #4b7a45; }
.ttag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; white-space: nowrap; }
.ttag .ic { width: 12px; height: 12px; }
.ttag.hit { color: #ff8f9c; border-color: #8e1b2a; }
.ttag.wounding { color: var(--gold2); border-color: var(--gold); } /* clan-neutral: never red or blue */
.ttag.lead { color: var(--gold2); border-color: var(--gold); }
.ttag.curse-true { color: #ffd27a; border-color: var(--warn); }
.ttag.curse-false { color: var(--mut); }
.ttag.wontag { color: var(--ok); border-color: #4f7a42; }
.tmark { width: 22px; flex: none; display: flex; justify-content: center; }
.tmark .dag { width: 22px; height: 22px; color: var(--gold2); filter: drop-shadow(0 0 5px rgba(217,178,95,.6)); }

/* the action dock: sticky, so it is always on screen however long the list is */
.dock { position: sticky; bottom: 0; z-index: 5; margin: 8px -6px 0; background: linear-gradient(180deg, rgba(28,21,18,.97), rgba(17,12,11,.99)); border: 1px solid var(--gold); border-radius: 14px; padding: 8px 10px; box-shadow: 0 -8px 22px rgba(0,0,0,.6); }
.dact:empty { display: none; }
.dh { font-family: var(--display); font-weight: 700; color: var(--gold2); font-size: 15px; overflow-wrap: anywhere; }
.dsub { margin: 2px 0 6px; font-size: 14px; overflow-wrap: anywhere; }
.dsub.center { margin: 0 0 6px; }
.dock.busy button { pointer-events: none; opacity: .55; }
.drow { display: flex; gap: 6px; }
.drow > button { flex: 1 1 0; min-width: 0; padding: 10px 8px; font-size: 15px; overflow-wrap: anywhere; }
.drow.wrap { flex-wrap: wrap; }
.drow.wrap > button { flex: 1 1 120px; }
.dcol { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.dcol > button { width: 100%; padding: 10px; font-size: 15px; overflow-wrap: anywhere; }
/* Inquisitor curse slots: pick a curse, then a player */
.cshead { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.cshead > span { flex: 1 1 auto; min-width: 0; }
.cshead > button { flex: none; padding: 5px 10px; min-height: 36px; font-size: 13px; font-family: var(--body); }
.cslots { display: flex; flex-direction: column; gap: 4px; margin: 0 0 6px; }
.cslot { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 8px; min-height: 40px; font-size: 14px; text-align: left; }
.cslot .csn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cslot .cswho { flex: 1 1 auto; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.cslot.on { border-color: var(--gold2); box-shadow: 0 0 0 2px var(--gold) inset; }
button.wide { width: 100%; margin-top: 4px; padding: 11px; font-size: 15px; }
button.danger { background: linear-gradient(180deg, #b23448, #7c1626); color: #f7ece0; box-shadow: 0 2px 0 #4a0c16, 0 6px 16px rgba(0,0,0,.45); }
.dbtns { display: flex; gap: 6px; margin-top: 6px; }
.dbtns button { flex: 1; padding: 7px 8px; min-height: 38px; font-size: 14px; font-family: var(--body); }
.tokbtn { display: flex; align-items: center; justify-content: flex-start; gap: 8px; font-family: var(--body); }
.tokbtn .chip.tk .ic { width: 20px; height: 20px; }

/* sheets inside overlays (token picker, log) */
.sheet { background: var(--card); border: 1px solid var(--gold); border-radius: 16px; padding: 16px; width: 100%; max-width: 440px; margin: 0 auto; }
.sheet h3 { font-family: var(--display); color: var(--gold2); margin: 0 0 8px; }
.sheet .close { width: 100%; margin-top: 10px; }
.loglist { margin: 0; padding-left: 26px; max-height: 60vh; overflow-y: auto; font-size: 14px; }
.loglist li { padding: 3px 0; border-bottom: 1px solid #2a1f19; overflow-wrap: anywhere; }
.loglist li.lg-capture { color: #ff8f9c; font-weight: 700; }
.loglist li.lg-attack { color: var(--ink); font-weight: 700; }

/* card minis: your card / peeks / the game-over reveal (clan colour allowed here) */
.cmini { --clan: var(--inq); display: inline-flex; align-items: center; gap: 4px; background: var(--clan); color: #f2e9dc; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cmini.c-rose { --clan: var(--rose); } .cmini.c-beast { --clan: var(--beast); } .cmini.c-inq { --clan: var(--inq); }
.cmini b { font-family: var(--display); }

/* game over (§6.7) */
.gobanner { --clan: var(--inq); text-align: center; border: 2px solid var(--clan); border-radius: 16px; padding: 14px 12px; margin: 8px 0; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--clan) 45%, #17110f), #120d0c 80%); box-shadow: 0 0 0 1px var(--gold), 0 0 26px color-mix(in srgb, var(--clan) 50%, transparent); }
.gobanner.w-rose { --clan: var(--rose); } .gobanner.w-beast { --clan: var(--beast); } .gobanner.w-inquisitor { --clan: var(--inq); }
.goart { width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--clan); border: 2px solid var(--gold); }
.goic { width: 58px; height: 58px; color: #f2e9dc; }
.gobanner h2 { font-family: var(--display); color: var(--gold2); margin: 8px 0 4px; font-size: 24px; }
.goev, .gowhy { margin: 4px 0; overflow-wrap: anywhere; }
.gowhy { color: var(--mut); font-size: 14px; }
.golist { display: flex; flex-direction: column; }
.gorow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.gorow:last-child { border-bottom: 0; }
.gorow .nm { flex: 1 1 90px; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gorow.won { background: rgba(143,191,122,.06); }

/* generated art (only when assets/art/manifest.json lists it) */
.av.pic { background: #120d0c; filter: saturate(.8) sepia(.15); overflow: hidden; }
.av.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avpick .av.pic { aspect-ratio: 1; }
.portrait.pic { height: 210px; overflow: hidden; padding: 0; }
.portrait .pimg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
.cardback.pic { position: relative; overflow: hidden; background: #110c0b; }
.cardback .bimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cardback.pic .tapnote { position: relative; margin-top: auto; padding: 0 0 14px; text-shadow: 0 1px 6px #000; color: var(--gold2); }
.dimg { width: 84px; height: 84px; object-fit: contain; mix-blend-mode: screen; display: inline-block; vertical-align: middle; }
.dimg.sm { width: 28px; height: 28px; }
.hero.pic { height: auto; margin: 0 0 8px; }
.hero .himg { width: 100%; max-height: 240px; object-fit: cover; border-radius: 14px; display: block; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.hero .hero-dagger.dimg { width: 120px; height: 120px; }
.goart.pic { width: 100%; height: auto; border-radius: 12px; overflow: hidden; background: none; border: 0; }
.goart .wimg { width: 100%; max-height: 220px; object-fit: cover; display: block; }

/* ── full-screen moments (attack, capture). Never take taps; the game stays usable under them. ── */
.fxlayer { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.fxlayer.embedded { position: absolute; }
.fx { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 16px; background: rgba(5,3,4,.9); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fxDim 1.9s ease forwards; }
.fx-title { font-family: var(--display); font-size: clamp(26px, 8vw, 40px); color: var(--gold2); text-align: center; text-shadow: 0 2px 18px rgba(0,0,0,.9); animation: fxTitle 1.9s ease forwards; }
.fx-row { position: relative; width: min(92%, 420px); display: flex; align-items: center; justify-content: space-between; }
.fx-who { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink); font-size: 18px; min-width: 0; }
.fx-who b { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx .av.fxav { width: 84px; height: 84px; font-size: 44px; border: 2px solid var(--gold); box-shadow: 0 0 24px rgba(217,178,95,.35); }
.fx-b { animation: fxHit 1.9s ease forwards; }
.fx-blade { position: absolute; left: 22%; top: 18px; width: 56px; height: 56px; color: #f3e6c4; filter: drop-shadow(0 0 10px rgba(255,236,190,.9)); animation: fxThrow 1.9s cubic-bezier(.5,0,.75,0) forwards; }
.fx-blade .fxdag { width: 100%; height: 100%; transform: rotate(90deg); }
.fx-slash { position: absolute; right: 2%; top: 4px; width: 110px; height: 84px; background: linear-gradient(135deg, transparent 44%, #fff6dc 48%, #e9c46a 52%, transparent 56%); opacity: 0; animation: fxSlash 1.9s ease forwards; }
.fx-attack.you .fx-title { color: #fff1c9; font-size: clamp(30px, 10vw, 48px); }
.fx-attack.you { animation: fxDim 1.9s ease forwards, fxShake .45s .62s 1; }
@keyframes fxDim { 0% { opacity: 0; } 10%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fxTitle { 0% { transform: scale(.7); opacity: 0; } 14% { transform: scale(1.06); opacity: 1; } 22%, 82% { transform: scale(1); opacity: 1; } 100% { opacity: 0; } }
@keyframes fxThrow { 0%, 12% { left: 22%; opacity: 0; } 18% { opacity: 1; } 34% { left: 70%; opacity: 1; } 40%, 100% { left: 70%; opacity: 0; } }
@keyframes fxSlash { 0%, 32% { opacity: 0; transform: scale(.4); } 36% { opacity: 1; transform: scale(1.1); } 60% { opacity: .8; } 80%, 100% { opacity: 0; transform: scale(1); } }
@keyframes fxHit { 0%, 32% { transform: none; } 36% { transform: translateX(10px) rotate(6deg); filter: brightness(1.8); } 46% { transform: translateX(-4px); filter: none; } 54%, 100% { transform: none; } }
@keyframes fxShake { 0%, 100% { transform: none; } 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
/* capture: the dagger strikes, blood spatters and runs down the screen, the victim greys out */
.fx-capture { animation: fxDim 3s ease forwards, fxShake .5s .42s 1; }
.fx-capture .fx-title { color: #f1d9d0; font-size: clamp(30px, 10vw, 48px); animation: fxTitle 3s ease forwards; animation-delay: .25s; opacity: 0; }
.fx-victim { position: relative; animation: fxDie 3s ease forwards; }
.fx .av.fxav.big { width: 132px; height: 132px; font-size: 70px; border-color: #7a1420; }
.fx-stab { position: absolute; left: 50%; top: -120px; width: 96px; height: 96px; margin-left: -48px; color: #efe3c6; filter: drop-shadow(0 0 10px rgba(255,236,190,.8)); animation: fxStab 3s ease-in forwards; }
.fx-stab .fxdag { width: 100%; height: 100%; transform: rotate(180deg); }
.fx-splat { position: absolute; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #b3172b, #6d0a16 70%); opacity: 0; animation: fxSplat 3s ease forwards; }
.fx-splat.s1 { width: 46px; height: 46px; left: -26px; top: 20px; }
.fx-splat.s2 { width: 30px; height: 30px; right: -20px; top: 6px; animation-delay: .04s; }
.fx-splat.s3 { width: 22px; height: 22px; right: 4px; bottom: -14px; animation-delay: .08s; }
.fx-drips { position: absolute; inset: 0 0 auto 0; height: 100%; overflow: hidden; }
.fx-drips::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 0; background: linear-gradient(#4a0510, #8e1222 70%, rgba(142,18,34,0)); animation: fxBand 3s ease forwards; }
.fx-drips i { position: absolute; top: 0; width: var(--w, 7px); height: 0; border-radius: 0 0 50% 50% / 0 0 8px 8px; background: linear-gradient(#5a0712, #a3162a); animation: fxDrip 2.2s cubic-bezier(.55,0,.8,.6) forwards; }
.fx-drips i::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: calc(var(--w, 7px) + 7px); height: calc(var(--w, 7px) + 9px); transform: translateX(-50%); border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; background: #a3162a; }
@keyframes fxBand { 0%, 16% { height: 0; } 30%, 100% { height: 22px; } }
@keyframes fxStab { 0%, 8% { top: -140px; opacity: 0; } 12% { opacity: 1; } 15% { top: 30px; } 85% { top: 30px; opacity: 1; } 100% { top: 30px; opacity: 0; } }
@keyframes fxSplat { 0%, 14% { opacity: 0; transform: scale(.2); } 18% { opacity: 1; transform: scale(1.25); } 26%, 85% { opacity: .95; transform: scale(1); } 100% { opacity: 0; } }
@keyframes fxDrip { 0% { height: 0; } 100% { height: var(--len); } }
@keyframes fxDie { 0%, 30% { filter: none; transform: none; } 60%, 88% { filter: grayscale(1) brightness(.55); transform: translateY(6px) rotate(-4deg); } 100% { filter: grayscale(1) brightness(.55); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .fx-blade, .fx-slash, .fx-stab, .fx-splat, .fx-drips { display: none; }
  .fx, .fx-b, .fx-victim, .fx-attack.you, .fx-capture { animation: fxDim 2s ease forwards; }
  .fx-title, .fx-capture .fx-title { animation: fxDim 2s ease forwards; opacity: 1; }
}

/* ── intercept: the saver's shield takes the blow ── */
.fx-save .fx-saver { animation: fxStep 2s ease forwards; }
.fx-shield { position: absolute; left: 39%; top: 0; width: 92px; height: 92px; color: #f3e6c4; opacity: 0; filter: drop-shadow(0 0 14px rgba(255,236,190,.9)); animation: fxShield 2s ease forwards; }
.fx-shield .fxitemic, .fx-shield .fxitemimg { width: 100%; height: 100%; object-fit: contain; }
.fx-spark { position: absolute; left: 47%; top: -6px; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, #fff7df 0%, rgba(233,196,106,.7) 30%, transparent 65%); opacity: 0; animation: fxSpark 2s ease forwards; }
.fx-save { animation: fxDim 2s ease forwards; }
.fx-save .fx-title { animation: fxTitle 2s ease forwards; }
@keyframes fxStep { 0%, 10% { transform: none; } 30%, 100% { transform: translateX(46px); } }
@keyframes fxShield { 0%, 12% { opacity: 0; transform: scale(.4); } 28% { opacity: 1; transform: scale(1.15); } 36%, 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes fxSpark { 0%, 34% { opacity: 0; transform: scale(.3); } 40% { opacity: 1; transform: scale(1.2); } 60%, 100% { opacity: 0; transform: scale(1.6); } }

/* ── abilities: the character's painting fills the screen, the item flies from user to target ── */
.fx-ab { animation: fxDim 2.6s ease forwards; }
.fx-bgart { position: absolute; inset: 0; overflow: hidden; opacity: 0; animation: fxBgArt 2.6s ease forwards; }
.fx-bgart .fxbgimg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; filter: saturate(.9); }
.fx-bgart::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 35%, rgba(5,3,4,.25), rgba(5,3,4,.85) 75%); }
.fx-abhead { position: relative; display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: clamp(26px, 8vw, 40px); color: #f3e6c4; letter-spacing: .06em; text-shadow: 0 2px 16px rgba(0,0,0,.9); animation: fxTitle 2.6s ease forwards; }
.fx-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 52px; padding: 0 10px; border: 2px solid var(--gold2); border-radius: 999px; color: var(--gold2); font-size: 28px; }
.fx-ab .fx-row, .fx-ab .fx-title { position: relative; }
.fx-ab .fx-title { animation: fxTitle 2.6s ease forwards; animation-delay: .35s; opacity: 0; font-size: clamp(22px, 6.4vw, 32px); }
.fx-row.solo { justify-content: center; }
.fx-tgts { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.fx-tgts .fx-who b { font-size: 15px; }
.fx-tgts .av.fxav { width: 66px; height: 66px; font-size: 34px; }
.fx-more { color: var(--gold2); font-weight: 700; }
.fx-fly { position: absolute; left: 18%; top: 50%; width: 72px; height: 72px; margin-top: -46px; color: #f3e6c4; opacity: 0; filter: drop-shadow(0 0 12px rgba(255,236,190,.85)); animation: fxFly 1.1s cubic-bezier(.45,0,.3,1) forwards; }
.fx-fly .fxitemic, .fx-fly .fxitemimg { width: 100%; height: 100%; object-fit: contain; }
.fx-fly.self { left: 50%; margin-left: -29px; animation-name: fxFlySelf; }
.ab-assassin .fx-fly .fxitemic, .ab-berserker .fx-fly .fxitemic { transform: rotate(90deg); }
.ab-harlequin .fx-fly, .ab-mentalist .fx-fly { animation-name: fxGaze; }
@keyframes fxBgArt { 0% { opacity: 0; transform: scale(1.08); } 15%, 85% { opacity: .55; transform: scale(1); } 100% { opacity: 0; } }
@keyframes fxFly { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; } 80% { opacity: 1; transform: translate(min(56vw, 250px), var(--dy)) scale(1.1); } 100% { opacity: 0; transform: translate(min(56vw, 250px), var(--dy)) scale(1.4); } }
@keyframes fxFlySelf { 0% { opacity: 0; transform: translateY(40px) scale(.6); } 30% { opacity: 1; transform: translateY(-70px) scale(1.2); } 75% { opacity: 1; transform: translateY(-60px) scale(1); } 100% { opacity: 0; transform: translateY(-60px) scale(1); } }
@keyframes fxGaze { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 70% { opacity: 1; transform: translate(min(56vw, 250px), var(--dy)) scale(1.3); filter: drop-shadow(0 0 22px rgba(255,236,190,1)); } 100% { opacity: 0; transform: translate(min(56vw, 250px), var(--dy)) scale(1.3); } }

/* ── capture, the long version: build-up, strike, death, the card turns, leader?, the winner ── */
.fxlayer.tappable { pointer-events: auto; cursor: pointer; }
.fx-capture { animation: fxDimLong 11.5s ease forwards, fxShake .6s 2.13s 1; justify-content: flex-start; padding-top: 12vh; }
.fx-capture.curse { animation: fxDimLong 14.1s ease forwards, fxShake .6s 2.13s 1; }
@keyframes fxDimLong { 0% { opacity: 0; } 4%, 95% { opacity: 1; } 100% { opacity: 0; } }
.fx-flash { position: absolute; inset: 0; background: #fff6e0; opacity: 0; animation: fxFlash .6s 2.05s ease-out forwards; }
@keyframes fxFlash { 0% { opacity: 0; } 12% { opacity: .9; } 100% { opacity: 0; } }
.fx-pre { font-family: var(--display); font-size: clamp(22px, 7vw, 32px); color: #d9c9a8; letter-spacing: .1em; opacity: 0; animation: fxPre 2.35s .15s ease forwards; }
@keyframes fxPre { 0% { opacity: 0; letter-spacing: .4em; } 40%, 80% { opacity: 1; letter-spacing: .1em; } 100% { opacity: 0; } }
.fx-duel { position: relative; display: flex; align-items: center; justify-content: center; gap: 30px; margin-top: 10px; animation: fxDuelOut 11.5s ease forwards; }
@keyframes fxDuelOut { 0%, 34% { opacity: 1; transform: none; } 40%, 100% { opacity: 0; transform: translateY(-30px) scale(.8); height: 0; } }
.fx-killer { animation: fxLunge 2.35s ease forwards; }
@keyframes fxLunge { 0%, 70% { transform: none; } 88% { transform: translateX(40px); } 100% { transform: translateX(30px); } }
.fx-capture .fx-victim { animation: fxHeart 2.05s ease, fxDieL 4.4s 2.05s ease forwards; }
@keyframes fxHeart { 0%, 30%, 60% { transform: scale(1); } 15%, 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes fxDieL { 0% { filter: none; } 40%, 100% { filter: grayscale(1) brightness(.5); transform: translateY(6px) rotate(-5deg); } }
.fx-capture .fx-stab { animation: fxStabL 11.5s ease-in forwards; }
@keyframes fxStabL { 0%, 16% { top: -150px; opacity: 0; } 17% { opacity: 1; } 19% { top: 30px; } 36% { top: 30px; opacity: 1; } 40%, 100% { opacity: 0; top: 30px; } }
.fx-capture .fx-splat { animation: fxSplatL 11.5s ease forwards; }
@keyframes fxSplatL { 0%, 18.5% { opacity: 0; transform: scale(.2); } 20% { opacity: 1; transform: scale(1.3); } 23%, 36% { opacity: .95; transform: scale(1); } 40%, 100% { opacity: 0; } }
.fx-capture .fx-drips i { animation-duration: 3.6s; }
.fx-capture .fx-drips::before { animation-delay: 1.6s; } /* the blood band starts with the strike, not before */
.fx-capture .fx-captitle { opacity: 0; animation: fxCapTitle 11.5s ease forwards; }
@keyframes fxCapTitle { 0%, 20% { opacity: 0; transform: scale(.7); } 23% { opacity: 1; transform: scale(1.08); } 26%, 36% { opacity: 1; transform: scale(1); } 40%, 100% { opacity: 0; height: 0; margin: 0; } }
/* the victim's card turns over, then the question, then the stamp */
/* each part of the capture scene has a fixed place, so nothing overlaps whatever the phone size */
.fx-capture > .fx-pre, .fx-capture > .fx-duel, .fx-capture > .fx-captitle { position: absolute; left: 0; right: 0; text-align: center; }
.fx-capture > .fx-pre { top: 8vh; }
.fx-capture > .fx-duel { top: calc(8vh + 70px); }
.fx-capture > .fx-captitle { top: calc(8vh + 260px); padding-inline: 16px; }
.fx-reveal { position: absolute; left: 0; right: 0; top: 14vh; display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: 0; animation: fxRevealIn 11.5s ease forwards; }
.fx-capture.curse .fx-reveal { animation-name: fxRevealInC; animation-duration: 14.1s; }
@keyframes fxRevealIn { 0%, 37% { opacity: 0; } 40%, 66% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes fxRevealInC { 0%, 30% { opacity: 0; } 32%, 55% { opacity: 1; } 58%, 100% { opacity: 0; } }
.fx-rcard { --clan: var(--inq); position: relative; width: 150px; height: 200px; perspective: 800px; }
.fx-rcard.c-rose { --clan: var(--rose); } .fx-rcard.c-beast { --clan: var(--beast); }
.fx-rback, .fx-rface { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; backface-visibility: hidden; border: 3px solid var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,.8); }
.fx-rface { border-color: var(--clan); box-shadow: 0 0 30px color-mix(in srgb, var(--clan) 70%, transparent); transform: rotateY(180deg); animation: fxFace 11.5s ease forwards; }
.fx-rback { background: #120d0c; display: flex; align-items: center; justify-content: center; color: var(--gold2); animation: fxBack 11.5s ease forwards; }
.fx-rback .fxdag { width: 60px; height: 60px; }
.fxrimg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; display: block; }
.fx-rlabel { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 6px 6px; background: linear-gradient(transparent, rgba(0,0,0,.9) 45%); color: #f3e6c4; font-family: var(--display); font-size: 16px; text-align: center; }
.fx-rlabel b { color: var(--gold2); font-size: 20px; }
.fx-rlabel span { display: block; font-family: var(--body); font-size: 12px; color: var(--gold2); }
.fx-capture.curse .fx-rface, .fx-capture.curse .fx-rback { animation-duration: 14.1s; }
@keyframes fxBack { 0%, 44% { transform: rotateY(0); } 50%, 100% { transform: rotateY(-180deg); } }
@keyframes fxFace { 0%, 44% { transform: rotateY(180deg); } 50%, 100% { transform: rotateY(0); } }
.fx-q { font-family: var(--display); font-size: clamp(20px, 6vw, 28px); color: #d9c9a8; opacity: 0; animation: fxQ 11.5s ease forwards; }
@keyframes fxQ { 0%, 50% { opacity: 0; } 53% { opacity: 1; } 55%, 57% { opacity: .4; } 59%, 66% { opacity: 1; } 70%, 100% { opacity: 0; } }
.fx-stamp { font-family: var(--display); font-size: clamp(22px, 7vw, 36px); max-width: 84vw; text-align: center; padding: 6px 16px; border: 4px solid currentColor; border-radius: 10px; opacity: 0; transform: rotate(-8deg) scale(2.2); animation: fxStamp 11.5s ease forwards; }
.fx-capture.lead .fx-stamp { color: var(--gold2); text-shadow: 0 0 18px rgba(217,178,95,.7); }
.fx-capture.notlead .fx-stamp { color: #c9c2b6; }
@keyframes fxStamp { 0%, 59% { opacity: 0; transform: rotate(-8deg) scale(2.2); } 62% { opacity: 1; transform: rotate(-8deg) scale(.95); } 64%, 66% { opacity: 1; transform: rotate(-8deg) scale(1); } 70%, 100% { opacity: 0; } }
.fx-capture.curse .fx-q, .fx-capture.curse .fx-stamp { animation-duration: 14.1s; }
/* true curse: "But…", the curse card flips, the Inquisitor steals it */
.fx-twist { position: absolute; top: 30%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: 0; animation: fxTwist 14.1s ease forwards; }
@keyframes fxTwist { 0%, 57% { opacity: 0; } 60%, 72% { opacity: 1; } 75%, 100% { opacity: 0; } }
.fx-but { font-family: var(--display); font-size: clamp(30px, 10vw, 50px); color: #f1d9d0; }
.fx-cursecard { width: 120px; height: 160px; border-radius: 12px; border: 3px solid var(--gold2); background: #160d10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--gold2); animation: fxCurseFlip 14.1s ease forwards; }
.fx-cursecard .fxitemic, .fx-cursecard .fxitemimg { width: 70px; height: 70px; object-fit: contain; }
@keyframes fxCurseFlip { 0%, 61% { transform: rotateY(90deg); } 64%, 100% { transform: rotateY(0); box-shadow: 0 0 40px rgba(217,178,95,.7); } }
/* the winner */
.fx-win { position: absolute; left: 0; right: 0; top: 18vh; display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: 0; animation: fxWin 11.5s ease forwards; }
.fx-capture.curse .fx-win { animation-name: fxWinC; animation-duration: 14.1s; }
@keyframes fxWin { 0%, 68% { opacity: 0; transform: translateY(40px); } 72%, 95% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes fxWinC { 0%, 74% { opacity: 0; transform: translateY(40px); } 77%, 96% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.fx-winart { width: min(92vw, 420px); aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 2px solid var(--gold); box-shadow: 0 0 40px rgba(217,178,95,.35); }
.fxwimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-wintitle { font-family: var(--display); font-size: clamp(34px, 11vw, 56px); color: var(--gold2); text-shadow: 0 0 24px rgba(217,178,95,.6), 0 3px 12px rgba(0,0,0,.9); }
.fx-sparks { position: absolute; left: 50%; top: 40%; width: 0; height: 0; }
.fx-sparks i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #ffe7a6; box-shadow: 0 0 10px #ffd36a; opacity: 0; animation: fxSparkle 1.9s ease-out forwards; }
@keyframes fxSparkle { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--r)); } }
.fx-skip { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; text-align: center; color: var(--mut); font-size: 13px; opacity: .7; }
@media (prefers-reduced-motion: reduce) {
  .fx-shield, .fx-spark, .fx-fly, .fx-flash, .fx-bgart, .fx-sparks { display: none; }
  .fx-save, .fx-ab, .fx-abhead, .fx-ab .fx-title, .fx-saver { animation: fxDim 2.4s ease forwards; opacity: 1; }
  .fx-capture { animation: fxDimLong 11.5s ease forwards; }
}

/* ── a revealed token: it drops onto the player's avatar; a rank token gets the character's painting behind it ── */
.fx-token { animation: fxDim 1.8s ease forwards; }
.fx-token.rank { animation: fxDim 2.6s ease forwards; }
.fx-token .fx-title { position: relative; animation: fxTitle 1.8s ease forwards; animation-delay: .25s; opacity: 0; }
.fx-token.rank .fx-title { animation-duration: 2.6s; font-size: clamp(24px, 7vw, 36px); }
.fx-tokwho { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; }
.fx-tokdrop { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); opacity: 0; animation: fxTokDrop 1.8s cubic-bezier(.3,1.4,.5,1) forwards; }
.fx-token.rank .fx-tokdrop { animation-duration: 2.6s; }
.fx-tokdrop .chip { font-size: 20px; padding: 8px 18px 8px 12px; box-shadow: 0 0 26px rgba(255,236,190,.45); }
.fx-tokdrop .chip .ic { width: 26px; height: 26px; }
.fx-tokrank { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 64px; border-radius: 999px; font-size: 34px; box-shadow: 0 0 30px rgba(217,178,95,.7); }
.fx-token .fx-tokwho .av { margin-bottom: 40px; }
@keyframes fxTokDrop { 0%, 8% { opacity: 0; transform: translate(-50%, -160px) rotateY(90deg) scale(.6); } 26% { opacity: 1; transform: translate(-50%, 0) rotateY(0) scale(1.15); } 34%, 82% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, 0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .fx-token, .fx-token .fx-title, .fx-tokdrop { animation: fxDim 2.2s ease forwards; opacity: 1; } }

/* ── victory: the banner, the title, then each winner pops in with their card and points ── */
.fx-victory { justify-content: flex-start; padding-top: 7vh; gap: 12px; animation: fxDimV 9s ease forwards; }
@keyframes fxDimV { 0% { opacity: 0; } 5% { opacity: 1; } 100% { opacity: 1; } }
.fx-victory .fx-winart { width: min(92vw, 420px); aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 2px solid var(--gold); box-shadow: 0 0 40px rgba(217,178,95,.35); animation: fxWinArt 1.2s ease forwards; }
@keyframes fxWinArt { 0% { opacity: 0; transform: translateY(40px) scale(.9); } 100% { opacity: 1; transform: none; } }
.fx-victory .fx-wintitle { animation: fxWinTitle 1.4s .35s ease both; }
@keyframes fxWinTitle { 0% { opacity: 0; transform: scale(.6); letter-spacing: .3em; } 60% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: none; letter-spacing: normal; } }
.fx-victory.w-rose .fx-wintitle { color: #f0b9b9; text-shadow: 0 0 26px rgba(142,27,42,.9), 0 3px 12px #000; }
.fx-victory.w-beast .fx-wintitle { color: #bcd2ea; text-shadow: 0 0 26px rgba(47,79,107,.95), 0 3px 12px #000; }
.fx-victory .fx-sparks { top: 22vh; }
.fx-wsub { font-family: var(--display); font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); opacity: 0; animation: fxFadeIn .6s 1s ease forwards; }
@keyframes fxFadeIn { to { opacity: 1; } }
.fx-winners { display: grid; grid-template-columns: 1fr; gap: 8px; width: min(92vw, 420px); }
.fx-winner { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 1px solid var(--gold); border-radius: 12px; background: rgba(28,21,18,.92); opacity: 0; animation: fxWinner .55s cubic-bezier(.3,1.5,.5,1) both; min-width: 0; }
.fx-winner .av.fxav.sm { width: 42px; height: 42px; font-size: 22px; border-width: 1px; box-shadow: none; flex: none; }
.fx-wn { flex: 1; min-width: 0; color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-wn em { color: var(--mut); font-weight: 400; }
.fx-pts { font-family: var(--display); color: var(--gold2); font-size: 18px; flex: none; }
@keyframes fxWinner { 0% { opacity: 0; transform: translateY(18px) scale(.85); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fx-victory, .fx-victory *, .fx-winner { animation: none !important; opacity: 1 !important; } }
