/* Incident Room 1.0.0: blueprint playmat, printed-style card frames, game-icons.net art and resources.
   1.0 changes: darker email, hunter, medium and done colours so white text on them reaches 4.5:1, a compact layout for
   short screens, the disclaimer, the live player count and the embedded (desktop window) mode. */
:root {
  --table: #08182A;
  --mat: #0E2A47;
  --print: #9CC6EF;
  --print-dim: rgba(156, 198, 239, 0.32);
  --text: #EAF2FB;
  --muted: #A9C2DA;
  --paper: #F7F8FA;
  --ink: #13202E;
  --ink-soft: #46576A;
  --gold: #FFD23F;
  --gold-ink: #1B1400;
  --red: #C8102E;
  --red-soft: #E5484D;
  --amber: #C77700;
  --green: #2E9E6A;
  --brand: #006FDE;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--table); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--gold); text-underline-offset: 2px; }
a:hover { color: #FFE27A; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.tight { gap: 8px; }
.row.end { justify-content: flex-end; }
.row.spread { justify-content: space-between; }

/* ---------- Buttons ---------- */
.btn { min-height: 46px; padding: 0 20px; border-radius: 10px; border: 2px solid rgba(156, 198, 239, 0.45); background: transparent; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.01em; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.btn:hover:not(:disabled) { border-color: var(--print); background: rgba(156, 198, 239, 0.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); box-shadow: 0 3px 0 #B8901A; }
.btn-gold:hover:not(:disabled) { background: #FFDD66; border-color: #FFDD66; }
.btn-quiet { border-color: transparent; color: var(--print); text-decoration: underline; text-underline-offset: 3px; }
.btn-quiet:hover:not(:disabled) { background: transparent; border-color: transparent; color: var(--text); }
.btn-lg { min-height: 56px; font-size: 21px; padding: 0 26px; }
.btn-small { min-height: 40px; font-size: 16px; padding: 0 14px; }
.btn-end { width: 100%; min-height: 64px; font-size: 25px; border-radius: 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--print-dim); background: rgba(8, 24, 42, 0.5); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { border-color: var(--print); }
.icon-btn.on { background: var(--print); color: var(--ink); border-color: var(--print); }

/* ---------- Cards: shared anatomy ---------- */
.c-art .art { display: block; width: 100%; height: 100%; }
.r-identity { --key: #0A6CD6; --frame: #006FDE; --type-c: #00519F; }
.r-email { --key: #B85414; --frame: #D2601A; --type-c: #9E4A12; }
.r-endpoint { --key: #7A4FD6; --frame: #7A4FD6; --type-c: #5A35A8; }
.r-hunter { --key: #08786A; --frame: #0B8A78; --type-c: #08695B; }
.r-any { --key: #56677A; --frame: #4F6478; --type-c: #3B4C5D; }
.r-control { --key: #2F6FB0; --frame: #0E3A63; --type-c: #0E3A63; }

/* ---------- Screens ---------- */
.screen { min-height: 100vh; padding: 44px 24px 64px; display: flex; justify-content: center; background: var(--mat); background-image: linear-gradient(rgba(156, 198, 239, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(156, 198, 239, 0.06) 1px, transparent 1px); background-size: 28px 28px; }
.screen-inner { width: 100%; max-width: 1100px; display: flex; flex-direction: column; gap: 28px; }
.page-title { font-size: 46px; font-weight: 800; }
.lede { font-size: 18px; color: var(--muted); max-width: 64ch; margin-top: 10px; }
.panel { background: rgba(8, 24, 42, 0.6); border: 1px solid rgba(156, 198, 239, 0.22); border-radius: 18px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-2.tight { gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; min-height: 340px; }
.hero h1 { font-size: 92px; font-weight: 800; letter-spacing: -0.01em; line-height: 0.9; }
.hero .lede { font-size: 19px; margin: 16px 0 24px; }
.hero .small { margin-top: 12px; }
.hero-fan { position: relative; height: 320px; display: flex; justify-content: center; align-items: center; }
.mini-card { position: absolute; width: 186px; height: 262px; transform: translateX(var(--x)) rotate(var(--rot)); }
.mini-card:nth-child(2) { z-index: 2; transform: translateY(-16px); }

.scenario { border-radius: 14px; padding: 16px; border: 2px solid var(--print-dim); display: flex; flex-direction: column; gap: 6px; }
.scenario h3 { font-size: 21px; }
.scenario p { color: var(--muted); font-size: 14px; }
.scenario.on { border-color: var(--gold); background: rgba(255, 210, 63, 0.06); }
.scenario.off { opacity: 0.55; border-style: dashed; }
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { min-height: 44px; padding: 0 20px; border-radius: 22px; border: 2px solid var(--print-dim); background: transparent; font-family: var(--display); font-weight: 700; font-size: 18px; }
.pill[aria-pressed="true"] { background: var(--print); border-color: var(--print); color: var(--ink); }
.scores { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scores li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(156, 198, 239, 0.07); }
.scores .pts { font-family: var(--display); font-weight: 800; font-size: 22px; min-width: 64px; }
.stars-sm { display: inline-flex; gap: 2px; } .stars-sm svg { width: 18px; height: 18px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { padding: 6px 12px; border-radius: 8px; background: var(--gold); color: var(--gold-ink); font-family: var(--display); font-weight: 700; font-size: 15px; }
.badge.off { background: transparent; color: var(--muted); border: 1.5px dashed var(--print-dim); }

/* control cards */
.control-card { --frame: #0E3A63; min-height: 330px; padding-bottom: 12px; cursor: pointer; transition: transform 0.15s; }
.control-card:hover { transform: translateY(-3px); }
.control-card .c-art { margin: 4px 4px 0; aspect-ratio: 3 / 2; }
.control-card[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.35), 0 12px 24px rgba(0, 0, 0, 0.35); }
.control-tick { position: absolute; z-index: 2; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #9CC6EF; background: rgba(8, 24, 42, 0.7); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; }
.control-card[aria-pressed="true"] .control-tick { background: var(--gold); border-color: var(--gold); }
.ctl-product { font-family: var(--display); font-weight: 600; font-size: 14px; color: #33597F; padding: 10px 12px 0; }
.ctl-name { font-family: var(--display); font-weight: 800; font-size: 25px; line-height: 1.05; padding: 2px 12px 0; }
.ctl-effect { font-size: 14.5px; padding: 6px 12px 0; }
.ctl-why { font-size: 13px; color: var(--ink-soft); padding: 8px 12px 0; margin-top: auto; }

/* ---------- The table ---------- */
.table { padding: 12px; min-height: 100vh; }
.mat { position: relative; min-height: calc(100vh - 24px); border-radius: 26px; padding: 18px 22px 0; background-color: var(--mat);
  background-image: linear-gradient(rgba(156, 198, 239, 0.065) 1px, transparent 1px), linear-gradient(90deg, rgba(156, 198, 239, 0.065) 1px, transparent 1px);
  background-size: 28px 28px; box-shadow: inset 0 0 0 2px rgba(156, 198, 239, 0.22), inset 0 0 120px rgba(0, 0, 0, 0.4);
  display: grid; grid-template-columns: 226px minmax(0, 1fr) 226px; grid-template-rows: auto 1fr auto; grid-template-areas: "top top top" "team threats side" "hand hand hand"; gap: 16px 22px; overflow-x: clip; }
.mat::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(156, 198, 239, 0.22); border-radius: 19px; pointer-events: none; }
.zone { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--print); margin-bottom: 8px; letter-spacing: 0.02em; }

.top { grid-area: top; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; align-items: start; padding: 2px 8px 0; }
.attacker { display: flex; gap: 16px; align-items: center; min-width: 0; }
.att-portrait { width: 84px; height: 84px; border-radius: 14px; overflow: hidden; flex: none; box-shadow: 0 0 0 3px var(--red), 0 8px 18px rgba(0, 0, 0, 0.4); }
.att-portrait .portrait { display: block; width: 100%; height: 100%; }
.att-kicker { font-family: var(--display); font-weight: 600; color: #FF9DA2; font-size: 16px; }
.attacker h1 { font-size: 34px; font-weight: 800; margin: 2px 0 4px; }
.att-goal { color: var(--muted); font-size: 14px; max-width: 40ch; }

.telegraph { display: flex; align-items: flex-start; gap: 14px; }
.deck-stack { position: relative; width: 96px; height: 140px; margin-top: 30px; }
.deck-stack .back { position: absolute; width: 84px; height: 118px; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45); }
.deck-stack .back svg { display: block; width: 100%; height: 100%; }
.deck-stack .b1 { left: 0; top: 10px; transform: rotate(-6deg); }
.deck-stack .b2 { left: 10px; top: 4px; transform: rotate(3deg); }
.slot { position: relative; padding: 6px; border: 1.5px dashed rgba(229, 72, 77, 0.55); border-radius: 16px; }
.slot-label { position: absolute; top: 4px; right: calc(100% + 12px); white-space: nowrap; font-family: var(--display); font-weight: 600; font-size: 15px; color: #FF9DA2; }
.stamp { position: absolute; right: 8px; bottom: 8px; transform: rotate(-8deg); font-family: var(--display); font-weight: 800; font-size: 17px; padding: 2px 10px; border: 3px solid; border-radius: 6px; background: rgba(255, 255, 255, 0.9); }
.stamp.ok { color: var(--red); border-color: var(--red); }
.stamp.no { color: #1C7A4E; border-color: #1C7A4E; }
.stamp.neutral, .stamp.hidden-stamp { color: #5A4447; border-color: #8A7478; }

.status { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.turn { display: flex; align-items: baseline; gap: 8px; }
.turn-n { font-family: var(--display); font-weight: 800; font-size: 60px; line-height: 0.9; }
.turn-of { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ctrl-chip { min-height: 32px; padding: 0 10px; border-radius: 8px; background: #0E3A63; border: 1.5px solid #4C86C2; font-family: var(--display); font-weight: 600; font-size: 15px; color: #DCEBFB; }
.top-actions { display: flex; gap: 8px; }

/* team */
.team { grid-area: team; display: flex; flex-direction: column; gap: 9px; padding-left: 6px; }
.member { display: flex; gap: 11px; align-items: center; padding: 6px 10px 6px 7px; border-radius: 14px; background: rgba(8, 24, 42, 0.55); border: 1px solid rgba(156, 198, 239, 0.16); }
.m-portrait { width: 48px; height: 48px; border-radius: 11px; overflow: hidden; flex: none; box-shadow: 0 0 0 3px var(--frame); }
.m-portrait .portrait { display: block; width: 100%; height: 100%; }
.m-text { display: flex; flex-direction: column; min-width: 0; }
.m-name { font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.05; }
.m-role { font-size: 13px; color: var(--muted); }
.m-state { font-size: 12.5px; color: #C9DDF0; }
.coin { width: 28px; height: 28px; border-radius: 50%; margin-left: auto; flex: none; background: var(--gold); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 #B8901A, 0 2px 6px rgba(0, 0, 0, 0.35); }
.member.tired .coin { background: #FDE2E1; color: #9E0F23; font-family: var(--display); font-weight: 800; font-size: 15px; box-shadow: inset 0 -3px 0 #E5A3A8, 0 2px 6px rgba(0, 0, 0, 0.35); }
.member.tired .m-state { color: #FFB4B8; }
.member.away { opacity: 0.55; }
.member.away .coin { background: transparent; border: 2px dashed var(--muted); box-shadow: none; }
.member.away .m-portrait { filter: grayscale(0.8); }

/* threats */
.threats { grid-area: threats; display: flex; flex-direction: column; align-items: stretch; min-width: 0; border: 1.5px dashed rgba(156, 198, 239, 0.28); border-radius: 18px; padding: 10px 12px 18px; }
.threat-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.tcard.sev-critical { box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.55), 0 12px 24px rgba(0, 0, 0, 0.35); }
.gems { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.gem { display: inline-flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--ink); }
.gem i { width: 11px; height: 11px; transform: rotate(45deg); border-radius: 2px; background: var(--red-soft); box-shadow: inset 0 0 0 1.5px #8E0F22; }
.gem.off { color: #8695A4; text-decoration: line-through; }
.gem.off i { background: transparent; box-shadow: inset 0 0 0 1.5px #A7B3BF; }
.counter { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.counter b { font-size: 26px; font-weight: 800; color: var(--amber); margin-right: 2px; }
.tcard.sev-critical .counter b { color: var(--red); }
.tbadges { display: flex; flex-wrap: wrap; gap: 4px; }
.tbadge { font-family: var(--display); font-weight: 700; font-size: 12.5px; padding: 1px 7px; border-radius: 5px; background: var(--ink); color: #fff; }
.tcard.resolved { opacity: 0.72; }
.fd-plate { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 7px 9px; border-radius: 8px; background: rgba(5, 16, 28, 0.85); display: flex; flex-direction: column; gap: 1px; }
.fd-title { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1.1; }
.fd-sub { font-size: 12px; color: var(--muted); }
.tcard.is-target { box-shadow: 0 0 0 5px var(--gold), 0 14px 28px rgba(0, 0, 0, 0.45); transform: translateY(-5px); }
.tcard.not-target { opacity: 0.38; filter: saturate(0.5); }
.tcard.hinted { box-shadow: 0 0 0 5px #7EE0C3; }
.tcard.hit { animation: hit 0.5s ease-out; }
.float { position: absolute; left: 50%; top: 42%; z-index: 3; transform: translateX(-50%); white-space: nowrap; background: var(--gold); color: var(--gold-ink); font-family: var(--display); font-weight: 800; font-size: 16px; padding: 3px 10px; border-radius: 8px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4); animation: float-up 1.05s ease-out forwards; pointer-events: none; }
.threat-row.compact { gap: 12px; }
.empty-table { color: var(--muted); padding: 40px; text-align: center; }

/* side and tracks */
.side { grid-area: side; display: flex; flex-direction: column; gap: 14px; padding-right: 6px; }
.track { padding: 12px 12px 10px; border-radius: 14px; background: rgba(8, 24, 42, 0.55); border: 1px solid rgba(156, 198, 239, 0.16); }
.track ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.space { position: relative; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--print-dim); display: flex; align-items: center; justify-content: center; }
.space .num { font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--print); }
.space.end { border-radius: 6px; border-color: rgba(229, 72, 77, 0.7); }
.disrupt .space.end { border-color: rgba(255, 210, 63, 0.7); }
.attack .space.passed { background: rgba(200, 16, 46, 0.35); border-color: rgba(229, 72, 77, 0.6); }
.disrupt .space.passed { background: rgba(255, 210, 63, 0.25); border-color: rgba(255, 210, 63, 0.6); }
.token { position: absolute; inset: 8%; border-radius: 50%; background: var(--red-soft); box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0, 0, 0, 0.5); }
.token.disrupt { border-radius: 4px; background: var(--gold); }
.token.moved { animation: token-pop 0.6s ease-out; }
.track-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* hand */
.hand-area { grid-area: hand; position: sticky; bottom: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; padding: 6px 0 0; overflow: hidden; margin: 0 -22px; background: rgba(8, 24, 42, 0.95); border-top: 1px solid rgba(156, 198, 239, 0.3); border-radius: 22px 22px 0 0; }
.hand-label { min-height: 40px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; padding: 0 16px; position: relative; z-index: 6; }
.guide { color: var(--muted); font-size: 14.5px; }
.coach-line { display: inline-flex; align-items: center; gap: 10px; max-width: 760px; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 6px 14px 6px 6px; font-size: 14.5px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
.coach-face { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 2px var(--brand); }
.coach-face .portrait { display: block; width: 100%; height: 100%; }
.hcard.dealt { animation: deal 0.45s cubic-bezier(.2,.8,.3,1) var(--d, 0ms) both; }

/* ---------- Training coach mark ---------- */
.spot { position: fixed; z-index: 60; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(4, 12, 22, 0.6); outline: 3px solid var(--gold); outline-offset: 0; pointer-events: none; transition: left 0.25s, top 0.25s, width 0.25s, height 0.25s; }
.coach-mark { position: fixed; z-index: 61; display: flex; gap: 14px; align-items: flex-start; background: var(--paper); color: var(--ink); border-radius: 16px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.cm-face { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 3px var(--brand); }
.cm-face .portrait { display: block; width: 100%; height: 100%; }
.cm-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cm-step { font-family: var(--display); font-weight: 600; font-size: 14px; color: #00519F; }
.cm-text { font-size: 15.5px; line-height: 1.45; }
.coach-mark .btn-quiet { color: #33597F; }
.coach-mark .btn-quiet:hover { color: var(--ink); }

/* ---------- Drawer, dialogs, phase, toast ---------- */
.drawer-backdrop, .overlay { position: fixed; inset: 0; background: rgba(4, 12, 22, 0.78); z-index: 40; display: flex; }
.drawer { margin-left: auto; width: min(430px, 100%); height: 100%; overflow-y: auto; background: #0B2238; border-left: 1px solid rgba(156, 198, 239, 0.3); padding: 20px 24px 28px; display: flex; flex-direction: column; gap: 14px; }
.drawer h2 { font-size: 32px; font-weight: 800; }
.drawer-art { border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 2; border: 5px solid var(--frame, #13202E); }
.drawer-art svg { display: block; width: 100%; height: 100%; }
.learn { padding: 14px 16px; border-radius: 12px; background: rgba(156, 198, 239, 0.08); display: flex; flex-direction: column; gap: 6px; }
.learn h3 { font-size: 18px; }
.learn .c-flavour { color: var(--print); border: none; margin: 0; padding: 0; }
.overlay { align-items: center; justify-content: center; padding: 20px; }
.dialog { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: #0B2238; border: 1px solid rgba(156, 198, 239, 0.3); border-radius: 20px; padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.dialog h2 { font-size: 32px; font-weight: 800; }
.brief-head { display: flex; gap: 16px; align-items: center; }
.brief-face { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; flex: none; }
.brief-face .portrait { display: block; width: 100%; height: 100%; }
.steps { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 9px; }

.phase { display: flex; gap: 28px; align-items: center; justify-content: center; width: min(780px, 100%); }
.flip { position: relative; width: 232px; height: 300px; perspective: 1100px; flex: none; }
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: flip 0.75s cubic-bezier(.3,.6,.2,1) both; }
.flip.still .flip-inner { animation: none; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.back-face { transform: rotateY(180deg); border-radius: 13px; overflow: hidden; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5); }
.back-face svg { display: block; width: 100%; height: 100%; }
.front-face { height: 100%; }
.verdict-stamp { position: absolute; z-index: 3; left: 50%; top: 36%; transform: translate(-50%, -50%) rotate(-12deg); font-family: var(--display); font-weight: 800; font-size: 40px; padding: 2px 18px; border: 5px solid; border-radius: 10px; background: rgba(255, 255, 255, 0.92); animation: stamp 0.35s ease-out 0.72s both; }
.verdict-stamp.blocked { color: #1C7A4E; border-color: #1C7A4E; }
.verdict-stamp.success { color: var(--red); border-color: var(--red); }
.verdict-stamp.neutral { color: #5A4447; border-color: #8A7478; }
.flip.still .verdict-stamp { animation: none; }
.phase-art { width: 260px; flex: none; aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; border: 6px solid var(--ink); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5); animation: rise 0.35s ease-out both; }
.phase-art svg { display: block; width: 100%; height: 100%; }
.phase-text { width: min(400px, 100%); background: #0B2238; border: 1px solid rgba(156, 198, 239, 0.3); border-radius: 18px; padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.phase-kicker { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--print); }
.phase-text h2 { font-size: 34px; font-weight: 800; }
.phase-text > p { font-size: 16px; }
.verdict { align-self: flex-start; font-family: var(--display); font-weight: 700; font-size: 17px; padding: 3px 12px; border-radius: 8px; }
.verdict.success, .verdict.bad { background: #FDE2E1; color: #9E0F23; }
.verdict.blocked, .verdict.good { background: #D9F2E5; color: #146C43; }
.verdict.neutral, .verdict.turn, .verdict.recycle, .verdict.warn { background: #E3E8ED; color: #3B4C5D; }
.phase-dots { display: flex; gap: 6px; }
.phase-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(156, 198, 239, 0.3); }
.phase-dots span.on { background: var(--gold); }

.toast { position: fixed; left: 50%; bottom: 320px; transform: translateX(-50%); z-index: 30; background: var(--paper); color: var(--ink); border-left: 6px solid var(--gold); border-radius: 12px; padding: 12px 18px; max-width: min(560px, calc(100% - 32px)); font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); animation: toast-in 0.2s ease-out; }
.toast.bad { border-left-color: var(--red); }

.ghost { position: fixed; z-index: 70; pointer-events: none; }
.ghost .hcard, .ghost.hand-ghost > .card-face { transform: none !important; margin: 0; width: 100%; height: 100%; }
.ghost .c-why { display: none; }

.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.log li { padding: 8px 12px; border-radius: 10px; background: rgba(156, 198, 239, 0.07); font-size: 14px; border-left: 4px solid transparent; }
.log li.you { border-left-color: var(--gold); }
.log li.attacker.success, .log li.bad { border-left-color: var(--red-soft); }
.log li.attacker.blocked, .log li.good { border-left-color: var(--green); }
.log .t { font-family: var(--display); font-weight: 700; color: var(--print); margin-right: 8px; }

/* ---------- Review and guide ---------- */
.verdict-hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.stars { display: flex; gap: 8px; } .stars svg { width: 48px; height: 48px; }
.score-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.score-lines li { display: flex; justify-content: space-between; gap: 12px; }
.score-lines .num { font-family: var(--display); font-weight: 700; font-size: 18px; }
.score-lines li.total { border-top: 1px solid rgba(156, 198, 239, 0.3); padding-top: 9px; font-family: var(--display); font-weight: 800; font-size: 22px; }
.lessons { display: flex; flex-direction: column; gap: 10px; }
.lesson { padding: 14px 16px; border-radius: 12px; background: rgba(156, 198, 239, 0.07); display: flex; flex-direction: column; gap: 6px; border-left: 5px solid var(--red-soft); }
.lesson.good { border-left-color: var(--green); }
.lesson h3 { font-size: 20px; }
.lesson p { color: #C9DDF0; }
.training-done { flex-direction: row; align-items: flex-start; gap: 18px; border-color: var(--gold); }
.training-done > div:last-child { display: flex; flex-direction: column; gap: 12px; }
details.timeline summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 20px; min-height: 44px; display: flex; align-items: center; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 12px; }
.codex-card .c-why-text { font-size: 12.5px; color: var(--ink-soft); padding: 6px 9px 0; }
.codex-card.r-attacker .c-why-text { color: #E7C9CC; }
.codex-card a { color: #00519F; font-size: 13px; font-weight: 600; padding: 6px 9px 0; }

/* ---------- Motion ---------- */
@keyframes deal { from { transform: translateY(160px) rotate(0deg); opacity: 0; } to { transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px)); opacity: 1; } }
@keyframes hit { 0% { transform: none; } 20% { transform: translateX(-6px) rotate(-1.5deg); } 45% { transform: translateX(5px) rotate(1deg); } 70% { transform: translateX(-3px); } 100% { transform: none; } }
@keyframes float-up { from { opacity: 0; transform: translate(-50%, 8px); } 15% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -46px); } }
@keyframes token-pop { 0% { transform: scale(1.8); } 60% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes flip { from { transform: rotateY(180deg); } to { transform: rotateY(0deg); } }
@keyframes stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(1.9); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Narrower screens ---------- */
@media (max-width: 1180px) {
  .mat { grid-template-columns: 208px minmax(0, 1fr) 208px; }
  .hero h1 { font-size: 72px; }
}
@media (max-width: 900px) {
  .table { padding: 0; }
  .mat { display: flex; flex-direction: column; gap: 14px; padding: 14px 12px 0; border-radius: 0; min-height: 100vh; }
  .mat::before { display: none; }
  .top { grid-template-columns: 1fr; padding: 0; gap: 12px; }
  .status { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
  .chips { justify-content: flex-start; }
  .deck-stack { display: none; }
  .slot { width: 100%; }
  .team { flex-direction: row; overflow-x: auto; padding: 0 0 4px; }
  .team .zone { display: none; }
  .member { min-width: 190px; }
  .threats { padding: 10px 8px 14px; }
  .threat-row, .threat-row.compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tcard, .threat-row.compact .tcard { width: auto; min-height: 230px; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 0; }
  .side .track { flex: 1 1 150px; }
  .side .btn-end { flex: 1 1 100%; }
  .hand-area { margin: 0 -12px; border-radius: 0; padding: 6px 0 10px; }
  .hand-label { min-height: 0; }
  .coach-line { font-size: 13.5px; }
  .hcard.dealt { animation-name: deal-flat; }
  .toast { bottom: 300px; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 60px; }
  .hero-fan { height: 280px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-title { font-size: 36px; }
  .phase { flex-direction: column; }
  .flip { width: 196px; height: 274px; }
}
@keyframes deal-flat { from { transform: translateY(80px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Resources (0.4) ---------- */

.hand-area { position: sticky; }
.res-orb { position: absolute; left: 34px; top: 46px; z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 132px; }
.res-ring { position: relative; width: 98px; height: 98px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #FFF1B8 0%, var(--gold) 38%, #C99A12 100%); color: var(--gold-ink);
  box-shadow: 0 0 0 5px rgba(8, 24, 42, 0.9), 0 0 0 8px rgba(255, 210, 63, 0.55), 0 0 28px rgba(255, 210, 63, 0.35), 0 10px 20px rgba(0, 0, 0, 0.45); }
.res-n { font-family: var(--display); font-weight: 800; font-size: 50px; line-height: 0.9; }
.res-of { font-family: var(--display); font-weight: 700; font-size: 15px; opacity: 0.8; }
.res-orb.empty .res-ring { background: radial-gradient(circle at 35% 30%, #4B5D70 0%, #2A3A4F 60%, #1B2838 100%); color: #A9C2DA; box-shadow: 0 0 0 5px rgba(8, 24, 42, 0.9), 0 0 0 8px rgba(156, 198, 239, 0.25), 0 10px 20px rgba(0, 0, 0, 0.45); }
.res-orb.spent .res-ring { animation: orb-spend 0.5s ease-out; }
.res-label { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--gold); margin-top: 6px; }
.res-pips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.res-pips i { width: 11px; height: 11px; transform: rotate(45deg); border-radius: 2px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--print-dim); }
.res-pips i.on { background: var(--gold); box-shadow: inset 0 0 0 1.5px #B8901A; }
.res-next { font-family: var(--display); font-weight: 700; font-size: 13.5px; padding: 1px 8px; border-radius: 6px; }
.res-next.up { background: #D9F2E5; color: #146C43; }
.res-next.down { background: #FDE2E1; color: #9E0F23; }
.piles { position: absolute; right: 34px; top: 56px; z-index: 7; display: flex; flex-direction: column; gap: 8px; width: 132px; }
.pile { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(156, 198, 239, 0.08); border: 1px solid rgba(156, 198, 239, 0.2); font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--muted); }
.pile b { font-size: 22px; font-weight: 800; color: var(--text); min-width: 24px; text-align: right; }
.pile.used b { color: #C9B5F5; }
.btn-end.ready { animation: end-pulse 1.6s ease-in-out infinite; }
@keyframes orb-spend { 0% { transform: scale(1); } 30% { transform: scale(0.86); } 100% { transform: scale(1); } }
@keyframes end-pulse { 0%, 100% { box-shadow: 0 3px 0 #B8901A, 0 0 0 0 rgba(255, 210, 63, 0.55); } 50% { box-shadow: 0 3px 0 #B8901A, 0 0 0 10px rgba(255, 210, 63, 0); } }
@media (max-width: 1180px) {
  .res-orb { left: 18px; width: 112px; }
  .res-ring { width: 84px; height: 84px; }
  .res-n { font-size: 42px; }
  .piles { right: 18px; width: 112px; }
}
@media (max-width: 1040px) {
  .hand-area { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "orb label" "orb piles" "hand hand"; align-items: center; column-gap: 14px; padding: 10px 16px 0; }
  .res-orb { position: static; grid-area: orb; width: auto; flex-direction: row; gap: 10px; }
  .res-ring { width: 66px; height: 66px; }
  .res-n { font-size: 34px; }
  .res-of { font-size: 12px; }
  .res-label, .res-pips { display: none; }
  .res-orb .res-next { position: absolute; margin: 70px 0 0 0; }
  .hand-label { grid-area: label; justify-content: flex-start; padding: 0; }
  .piles { position: static; grid-area: piles; flex-direction: row; width: auto; gap: 6px; flex-wrap: wrap; }
  .pile { padding: 2px 8px; font-size: 13px; }
  .pile b { font-size: 16px; min-width: 0; }
}
@media (max-width: 900px) {
  .hand-area { padding: 10px 12px 10px; }
}

/* ---------- Card system (0.5): printed-style frames ----------
   Every card is the same object: a dark frame with a role-coloured keyline, a head with the cost and name,
   an art window, a role band, and a paper rules box. --key carries the role or severity colour. */
.card-face, .tcard, .att-card, .mini-card, .codex-card {
  position: relative; display: flex; flex-direction: column; text-align: left; overflow: hidden;
  padding: 5px; border: 0; border-radius: 12px; color: var(--ink);
  background: linear-gradient(160deg, #24374D 0%, #142232 52%, #0D1724 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.45), 0 10px 22px rgba(0, 0, 0, 0.4);
}
.card-face::before, .tcard::before, .att-card::before, .mini-card::before, .codex-card::before {
  content: ""; position: absolute; inset: 2.5px; border-radius: 10px; border: 1.5px solid var(--key, #56677A); opacity: 0.9; pointer-events: none; z-index: 1;
}
.control-card {
  position: relative; display: flex; flex-direction: column; text-align: left; overflow: hidden;
  background: var(--paper); color: var(--ink); border: 6px solid #0E3A63; border-radius: 13px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), 0 12px 24px rgba(0, 0, 0, 0.35);
}
.control-card .c-art { position: relative; display: block; overflow: hidden; border-radius: 6px; }

.c-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 7px; flex: none; height: 42px; padding: 2px 4px 4px 3px; }
.c-name { flex: 1; min-width: 0; color: #fff; font-family: var(--display); font-weight: 700; font-size: 17.5px; line-height: 1.02;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: balance; }
.c-name.long { font-size: 15.5px; }
.c-art { position: relative; display: block; flex: none; aspect-ratio: 2 / 1; border-radius: 6px 6px 0 0; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.c-art .art { display: block; width: 100%; height: 100%; }
.c-type { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; padding: 3px 8px;
  background: var(--key, #56677A); color: #fff; font-family: var(--display); font-weight: 600; font-size: 12.5px; line-height: 1.1; }
.c-type > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-tag { flex: none; font-weight: 700; font-size: 11.5px; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.c-tag.gamble { background: var(--gold); color: var(--gold-ink); }
.c-tag.once { background: #fff; color: #3B2470; }
.c-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 5px; padding: 6px 8px 7px; background: #F6F8FB; border-radius: 0 0 6px 6px; }
.c-text { font-size: 12.5px; line-height: 1.34; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.c-flavour { margin-top: auto; padding-top: 5px; border-top: 1px solid rgba(19, 32, 46, 0.12); font-style: italic; font-size: 10.5px; line-height: 1.25; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-block { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 4px 42px 4px 8px; background: rgba(19, 32, 46, 0.88); color: #fff; font-size: 11px; font-weight: 600; line-height: 1.25; }

/* cost gem, set into the head */
.c-cost { position: relative; flex: none; width: 30px; height: 34px; display: flex; align-items: center; justify-content: center; z-index: 0;
  font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1; color: var(--gold-ink); background: #B8901A;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.c-cost::before { content: ""; position: absolute; inset: 2px; z-index: -1; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, #FFE68A 0%, var(--gold) 45%, #E7B524 100%); }
.c-cost.up { background: #7A0A1C; color: #fff; }
.c-cost.up::before { background: linear-gradient(160deg, #FF7A80 0%, #E5484D 45%, #B4182E 100%); }

/* specialist badge on the art */
.c-who { position: absolute; right: 6px; bottom: 5px; z-index: 4; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: #fff;
  box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0, 0, 0, 0.35); }
.c-who .portrait { display: block; width: 100%; height: 100%; }
.c-who.any { background: #E3E8ED; color: var(--ink); padding: 5px; }
.c-who.any svg { width: 100%; height: 100%; }

/* details button in the frame */
.c-why { position: absolute; top: 10px; right: 9px; z-index: 4; width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55); background: rgba(13, 23, 36, 0.6); color: #fff;
  font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 700; font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.c-why:hover { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.hcard .c-head { padding-right: 28px; }
.ghost .c-why { display: none; }

/* the hand */
.hand { display: flex; justify-content: center; align-items: flex-start; height: 252px; padding: 4px 20px 0; overflow: visible; }
.hcard { position: relative; flex: none; width: 166px; height: 246px; margin: 0 -5px; transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px)); transition: transform 0.16s ease; }
.hcard:hover, .hcard.selected, .hcard:focus-within, .hcard.lift { transform: translateY(-34px) scale(1.1); z-index: 20; }
.card-face { width: 100%; height: 100%; cursor: pointer; }
.hcard.selected .card-face { box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(255, 210, 63, 0.45), 0 18px 30px rgba(0, 0, 0, 0.5); }
.hcard.unplayable .c-art { filter: grayscale(0.85) brightness(0.9); }
.hcard.unplayable .c-type { background: #6B7785; }
.hcard.unplayable .c-who { filter: grayscale(0.85); }

/* threats */
.tcard { width: 176px; min-height: 246px; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease; }
.tcard:hover { transform: translateY(-3px); }
.tcard.sev-high, .tcard.sev-critical { --key: #C8102E; }
.tcard.sev-medium { --key: #A86400; }
.tcard.sev-low { --key: #56677A; }
.tcard.sev-done { --key: #237F56; }
.tcard.sev-critical { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 0 3px rgba(229, 72, 77, 0.6), 0 0 26px rgba(229, 72, 77, 0.35), 0 10px 22px rgba(0, 0, 0, 0.4); }
.sev-tag { flex: none; align-self: flex-start; margin-top: 3px; font-family: var(--display); font-weight: 700; font-size: 11.5px; padding: 1px 6px; border-radius: 4px; background: var(--key, #56677A); color: #fff; }
.tcard .c-text { color: #31404F; font-size: 12px; -webkit-line-clamp: 4; }
.c-foot { margin-top: auto; display: flex; flex-direction: column; gap: 5px; padding-top: 6px; border-top: 1px solid rgba(19, 32, 46, 0.12); }
.tcard.face-down { background: #0D1724; color: var(--text); }
.tcard.face-down .back-art { position: absolute; inset: 5px; border-radius: 8px; overflow: hidden; }
.tcard.face-down .back-art svg { display: block; width: 100%; height: 100%; }
.tcard.face-down .fd-plate { z-index: 2; left: 9px; right: 9px; bottom: 9px; }
.threat-row.compact .tcard { width: 154px; min-height: 230px; }
.threat-row.compact .sev-tag { display: none; }
.threat-row.compact .c-name { font-size: 15.5px; }
.threat-row.compact .c-text { font-size: 11.5px; }

/* attacker cards */
.att-card, .codex-card.r-attacker, .mini-card.r-attacker { --key: #E5484D; color: #F6E7E8; background: linear-gradient(160deg, #4C1722 0%, #2B0D14 55%, #1C080C 100%); }
.att-card .c-art, .r-attacker .c-art { background: #241218; }
.att-card .c-type, .r-attacker .c-type { background: #A50E26; }
.att-card .c-type > span:first-child, .r-attacker .c-type > span:first-child { white-space: normal; }
.att-card .c-body, .r-attacker .c-body { background: #2A1418; }
.att-card .c-text, .r-attacker .c-text { color: #F1DADC; }
.next-card { width: 212px; cursor: pointer; }
.next-card:hover { transform: translateY(-2px); }

/* guide and hero */
.codex-card { padding-bottom: 5px; }
.codex-card .c-text { -webkit-line-clamp: unset; }
.codex-card .c-flavour { white-space: normal; margin-top: 2px; }
.codex-card a { color: #00519F; padding: 0; font-size: 13px; font-weight: 600; }
.codex-card .c-why-text { padding: 0; font-size: 12px; color: var(--ink-soft); }
.codex-card.r-attacker .c-flavour { color: #E7C9CC; }
.mini-card { position: absolute; }
.mini-card .c-lines { display: flex; flex-direction: column; gap: 7px; padding: 4px 2px; }
.mini-card .c-lines span { height: 6px; border-radius: 3px; background: rgba(19, 32, 46, 0.14); }
.mini-card .c-lines span:nth-child(2) { width: 80%; }
.mini-card .c-lines span:nth-child(3) { width: 55%; }
.mini-card.r-attacker .c-lines span { background: rgba(255, 255, 255, 0.14); }

@media (max-width: 1040px) {
  .hand { grid-area: hand; }
}
@media (max-width: 900px) {
  .next-card { width: 100%; display: grid; grid-template-columns: 132px minmax(0, 1fr); grid-template-areas: "head head" "art type" "art body"; }
  .next-card .c-head { grid-area: head; }
  .next-card .c-art { grid-area: art; border-radius: 6px 0 0 6px; }
  .next-card .c-type { grid-area: type; }
  .next-card .c-body { grid-area: body; border-radius: 0 0 6px 0; }
  .hand { justify-content: flex-start; overflow-x: auto; height: auto; width: 100%; padding: 26px 0 6px; gap: 8px; }
  .hcard { margin: 0; transform: none; width: 148px; height: 228px; }
  .hcard .c-text { font-size: 11.5px; }
  .hcard .c-name { font-size: 15px; }
  .hcard .c-flavour { display: none; }
  .hcard:hover, .hcard.selected, .hcard:focus-within, .hcard.lift { transform: translateY(-12px); }
  .tcard, .threat-row.compact .tcard { width: auto; min-height: 232px; }
}

/* ---------- Card art (0.6): game-icons.net silhouettes on the role colour ---------- */
.gi-stage { --g1: #7D8EA1; --g2: #56677A; --g3: #3D4A59;
  position: relative; display: block; width: 100%; height: 100%; overflow: hidden;
  background: radial-gradient(circle at 50% 36%, var(--g1) 0%, var(--g2) 70%, var(--g3) 100%); }
.gi-stage::before { content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0 2px, transparent 2px 9px); }
.gi-stage::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.32); }
.g-identity { --g1: #3A95F2; --g2: #0A5BB8; --g3: #07428A; }
.g-email { --g1: #F39252; --g2: #C2561A; --g3: #8E3E0E; }
.g-endpoint { --g1: #A487EE; --g2: #6C45C9; --g3: #4A2C93; }
.g-hunter { --g1: #2CC2AA; --g2: #0B8A78; --g3: #065A4F; }
.g-any { --g1: #8796A8; --g2: #56677A; --g3: #3B4857; }
.g-attacker { --g1: #74293A; --g2: #3A111A; --g3: #1F080D; }
.g-threat { --g1: #45576D; --g2: #233243; --g3: #141D29; }
.g-control { --g1: #3C7FC4; --g2: #0E3A63; --g3: #0A2A49; }
.gi-stage svg { position: absolute; z-index: 1; display: block; aspect-ratio: 1; width: auto; }
.gi-stage svg path { fill: currentColor; }
.gi-stage .gi-main { height: 80%; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.28)); }
.gi-stage.has2 .gi-main { transform: translate(-66%, -50%); }
.gi-stage .gi-second { height: 46%; left: 55%; top: 47%; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.4)); }
.gi-stage .gi-y { color: #FFD23F; }
.gi-stage .gi-r { color: #FF6B70; }
.g-attacker .gi-r { color: #FF5A62; }
.credit { color: var(--muted); font-size: 12.5px; }
.credit a { color: var(--print); }
.next-card .stamp, .att-card .stamp { top: 6px; right: 6px; bottom: auto; z-index: 3; }

/* ---------- 1.0: disclaimer, live count, embedded mode, short screens ---------- */
.disclaimer { font-size: 13.5px; color: var(--muted); max-width: 90ch; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-top: 12px; padding: 4px 12px 4px 10px; border-radius: 999px; border: 1px solid rgba(156, 198, 239, 0.35); background: rgba(8, 24, 42, 0.55); font-size: 14px; color: var(--text); }
.live-pill[hidden] { display: none; }
.live-pill i { width: 9px; height: 9px; border-radius: 50%; background: #3DDC97; box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.25); }
.status .live-pill { margin-top: 0; align-self: flex-end; font-size: 13px; }
html.embed .table { padding: 0; }
html.embed .mat { min-height: 100vh; border-radius: 0; }
html.embed .mat::before { inset: 6px; border-radius: 0; }
@media (min-width: 901px) and (max-height: 980px) {
  .team { gap: 6px; }
  .member { gap: 9px; padding: 4px 8px 4px 5px; border-radius: 12px; }
  .m-portrait { width: 38px; height: 38px; border-radius: 9px; }
  .m-name { font-size: 17px; }
  .m-role, .m-state { font-size: 12px; line-height: 1.25; }
  .coin { width: 24px; height: 24px; }
  .hand-label { min-height: 34px; }
  .hand { zoom: 0.86; }
}
@media (min-width: 901px) and (max-height: 860px) {
  .table { zoom: 0.9; }
  .table .next-card, .table .deck-stack { zoom: 0.82; }
}
/* Focus and scrollIntoView keep targets clear of the sticky hand. */
html:has(main.table) { scroll-padding-bottom: 300px; }
@media (max-width: 600px) {
  html:has(main.table) { scroll-padding-bottom: 260px; }
  .hand-area { padding: 8px 10px 8px; row-gap: 6px; }
  .hand { padding-top: 16px; }
  .hcard { width: 124px; height: 192px; }
  .hcard .c-text { font-size: 10.5px; -webkit-line-clamp: 4; }
  .hcard .c-name { font-size: 13.5px; }
  .hcard .c-name.long { font-size: 12px; }
  .coach-line { font-size: 12.5px; padding: 4px 10px 4px 4px; }
  .coach-line > span:last-child { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .coach-face { width: 30px; height: 30px; }
}
