/* PLAY ENGINE · kit styles (Terminal State's own copy of Netrun's nr_kit.css; docs/agents/play-engine.md). */
@font-face { font-family: "Creato Display"; src: url("../../fonts/CreatoDisplay-Regular.otf") format("opentype"); font-display: swap; } /* --k-display */
/* Netrun UI kit — the ONE source of look for every Netrun screen: the solo run, the city campaign and the street fight
   board (docs/agents/netrun-ui.md). Loaded before netrun.css / netrun_fight.css. Colors, radii, fonts and shadows are
   tokens here; screen CSS uses them and adds no raw colors. Kit pieces start with .k- and obey html[data-motion]. */

:root {
  /* palette: one meaning each (netrun-ui.md §1) */
  --k-bg: #07030f;
  --k-panel: rgba(10, 6, 24, 0.9);
  --k-panel-hi: rgba(8, 4, 20, 0.96);
  --k-field: rgba(20, 14, 44, 0.9);
  --k-line: rgba(120, 240, 255, 0.34);
  --k-line-soft: rgba(120, 240, 255, 0.14);
  --k-mag: #ff3cac;     /* an action, the primary accent */
  --k-cyan: #5ff6ff;    /* a maneuver, info, you */
  --k-grn: #6dffa8;     /* free / incidental, success, healing */
  --k-yel: #ffe45c;     /* the turn, attention, the selected card, money */
  --k-red: #ff5c6c;     /* danger, damage, exits that cost */
  --k-pur: #c084fc;     /* social */
  --k-pink: #ff8fd2;    /* romance */
  --k-boost: #7dd3fc;   /* a booster card (the Genesys Boost die's blue) */
  --k-ink: #04111a;     /* text on a bright fill */
  --k-text: #eef4ff;
  --k-muted: #9aa8c7;
  --k-card-top: #140d2e;
  --k-card-bot: #0a0618;
  --k-white: #fff; --k-black: #000;   /* tints and shadows: color-mix(in srgb, var(--k-white) 8%, transparent) */
  /* a few colors that belong to one place each */
  --k-heart: #ff4f8b;   /* hearts (the love sim) */
  --k-rose: #ffc2e6;    /* a pale pink highlight */
  --k-fire: #ff9a3c;    /* fire, burn, wounds */
  --k-lime: #9dff6a;    /* the fight board's squad green */
  --k-sky: #9ab8ff;     /* the fight board's pale blue */
  --k-gold-dk: #241a00; /* dark text on gold */
  --k-term: #b8ffd0; --k-term-dim: #7fb894;   /* the BBS terminal's phosphor */
  --k-dead: #c01818; --k-dead-dim: #9a3a3a; --k-dead-text: #c9a0a0; --k-blood: #5a0d0d;   /* the death screen */
  --k-shade: rgba(0, 0, 0, 0.55);
  --k-dim: rgba(4, 2, 10, 0.72);
  /* shape and type */
  --k-r-s: 6px; --k-r: 10px; --k-r-l: 14px; --k-pill: 999px;
  --k-mono: var(--mono, "Cascadia Code", Consolas, ui-monospace, monospace);
  --k-display: "Creato Display", "Segoe UI", system-ui, sans-serif;
  --k-ui: "Segoe UI", Rajdhani, system-ui, sans-serif;
  /* the card */
  --k-card-w: 96px; --k-card-h: 128px;
  /* layers (above the page's own screens; the board pages sit at z 5) */
  --k-z-read: 40; --k-z-dim: 80; --k-z-ghost: 90; --k-z-say: 70;
}
@media (max-width: 720px) { :root { --k-card-w: 84px; --k-card-h: 112px; } }

/* ── buttons: five kinds, nothing else (primary · plain · danger · ghost · chip) ── */
.k-btn, .nr .btn, .nf .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 14px; border-radius: var(--k-r-s);
  border: 1px solid var(--k-line); background: var(--k-field); color: var(--k-text); font: 600 13px var(--k-ui); letter-spacing: 0.02em; text-decoration: none; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, filter 0.15s; }
.k-btn:hover, .nr .btn:hover, .nf .btn:hover { border-color: var(--k-cyan); box-shadow: 0 0 12px color-mix(in srgb, var(--k-cyan) 30%, transparent); }
.k-btn.primary, .nr .btn.btn-primary, .nf .btn.btn-primary { border: 0; background: linear-gradient(90deg, var(--k-mag), var(--k-cyan)); color: var(--k-ink); font: 800 13px var(--k-mono); letter-spacing: 0.14em; text-transform: uppercase; box-shadow: 0 0 20px color-mix(in srgb, var(--k-mag) 40%, transparent); }
.k-btn.primary:hover, .nr .btn.btn-primary:hover, .nf .btn.btn-primary:hover { filter: brightness(1.1); }
.k-btn.danger, .nr .btn.warn, .nf .btn.warn { border-color: var(--k-red); color: var(--k-red); background: color-mix(in srgb, var(--k-red) 8%, var(--k-field)); }
.k-btn.ghost { border-color: transparent; background: transparent; color: var(--k-muted); } .k-btn.ghost:hover { color: var(--k-cyan); box-shadow: none; }
.k-btn.chip, .nr .btn.sm, .nf .btn.sm { min-height: 26px; padding: 2px 10px; border-radius: var(--k-pill); font: 700 11px var(--k-mono); letter-spacing: 0.06em; }
.k-btn.chip.on, .nr .btn.on, .nf .btn.on { background: var(--k-cyan); border-color: var(--k-cyan); color: var(--k-ink); }
.k-btn.turn { border-color: var(--k-yel); color: var(--k-yel); }
.k-btn:disabled, .nr .btn:disabled, .nf .btn:disabled { filter: grayscale(1); opacity: 0.4; box-shadow: none; cursor: default; }

/* ── surfaces ── */
.k-panel { background: var(--k-panel); border: 1px solid var(--k-line); border-radius: var(--k-r); padding: 10px 12px; color: var(--k-text); backdrop-filter: blur(4px); }
.k-kicker { font: 700 11px var(--k-mono); letter-spacing: 0.3em; color: var(--k-cyan); text-transform: uppercase; }
.k-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--k-line); background: var(--k-field); color: var(--k-text); font: 700 15px var(--k-ui); cursor: pointer; }
.k-x:hover { border-color: var(--k-cyan); color: var(--k-cyan); }

/* ── the card (hand, pick deck, read panel, played cards) ── */
.k-card { --c: var(--k-cyan); position: relative; flex: 0 0 auto; width: var(--k-card-w); min-height: var(--k-card-h); padding: 0 0 6px; border-radius: 9px; border: 1px solid var(--c);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, var(--k-card-top)), var(--k-card-bot) 75%); color: var(--k-text); font: inherit; font-family: var(--k-ui); text-align: center; cursor: pointer;
  display: grid; grid-template-rows: auto 44px auto auto; align-content: start; overflow: hidden; box-shadow: 0 6px 14px var(--k-shade); transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  touch-action: none; user-select: none; -webkit-user-select: none; }
.k-card .k-tag { font: 800 8px var(--k-mono); letter-spacing: 0.14em; padding: 2px 0; color: var(--k-ink); background: var(--c); white-space: nowrap; overflow: hidden; }
.k-card .k-art { display: grid; place-items: center; padding: 3px 8px; color: var(--c); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 70%, transparent)); }
.k-card .k-art svg { width: 100%; height: 38px; } .k-card .k-art img { width: 100%; height: 40px; object-fit: cover; border-radius: 4px; filter: none; }
.k-card .k-art i { font-style: normal; font-size: 26px; line-height: 40px; }
.k-card b { font-size: 12px; line-height: 1.15; padding: 2px 4px 0; overflow-wrap: anywhere; }
.k-card small { font-size: 9.5px; color: var(--k-muted); padding: 2px 4px 0; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.k-card.c-boost { --c: var(--k-boost); } .k-burst.c-boost { color: var(--k-boost); }
.k-card.c-action { --c: var(--k-mag); } .k-card.c-maneuver, .k-card.c-go { --c: var(--k-cyan); } .k-card.c-free { --c: var(--k-grn); }
.k-card.c-social { --c: var(--k-pur); } .k-card.c-romance { --c: var(--k-pink); } .k-card.c-item, .k-card.c-turn { --c: var(--k-yel); } .k-card.c-danger { --c: var(--k-red); } .k-card.c-info { --c: var(--k-muted); }
.k-card.obj { border-width: 2px; border-color: var(--k-yel); }
.k-card .k-cost { position: absolute; top: 15px; left: 3px; padding: 0 5px; border-radius: var(--k-pill); background: var(--k-red); color: var(--k-ink); font: 800 9px/15px var(--k-mono); letter-spacing: 0.04em; box-shadow: 0 0 8px color-mix(in srgb, var(--k-red) 60%, transparent); }
.k-card:focus-visible { outline: 2px solid var(--k-yel); outline-offset: 2px; }
.k-card.is-new { border-color: var(--k-yel); box-shadow: 0 6px 14px var(--k-shade), 0 0 16px color-mix(in srgb, var(--k-yel) 45%, transparent); }
.k-card.fits { border-color: var(--k-grn); box-shadow: 0 6px 14px var(--k-shade), 0 0 16px color-mix(in srgb, var(--k-grn) 45%, transparent); }
.k-card.fits::after { content: "FITS YOU"; position: absolute; top: 15px; right: 3px; padding: 0 5px; border-radius: var(--k-pill); background: var(--k-grn); color: var(--k-ink); font: 800 8px/15px var(--k-mono); letter-spacing: 0.06em; }
.k-card.mood-ok { border-color: var(--k-grn); box-shadow: 0 6px 14px var(--k-shade), 0 0 14px color-mix(in srgb, var(--k-grn) 40%, transparent); }
.k-card.mood-ok::after, .k-card.mood-no::after { position: absolute; top: 15px; right: 3px; padding: 0 5px; border-radius: var(--k-pill); font: 800 8px/15px var(--k-mono); letter-spacing: 0.06em; }
.k-card.mood-ok::after { content: "♥ MOOD"; background: var(--k-grn); color: var(--k-ink); }
.k-card.mood-no { border-style: dashed; border-color: var(--k-red); }
.k-card.mood-no::after { content: "✗ MOOD"; background: var(--k-panel-hi); color: var(--k-red); border: 1px solid var(--k-red); }
.k-card.mood-ok:has(.k-cost)::after, .k-card.mood-no:has(.k-cost)::after { top: 32px; } /* both badges (TOO SOON + MOOD) on a narrow card */
.k-card.is-new::after { content: "NEW"; position: absolute; top: 15px; right: 3px; padding: 0 5px; border-radius: var(--k-pill); background: var(--k-yel); color: var(--k-ink); font: 800 9px/15px var(--k-mono); letter-spacing: 0.08em; }
@media (max-width: 720px) { .k-card { grid-template-rows: auto 36px auto auto; } .k-card .k-art svg { height: 30px; } .k-card b { font-size: 11px; } }

/* ── the hand: dots for the turn on the left, the cards fanned, sideways scroll when they do not fit ── */
.k-hand { display: flex; gap: 10px; align-items: stretch; min-width: 0; max-width: 100%; }
.k-econ { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 4px 6px 4px 2px; border-right: 1px solid var(--k-line-soft); }
.k-econ:empty { display: none; }
.k-econ i { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid; box-shadow: 0 0 8px currentColor; transition: background 0.2s, opacity 0.2s; }
.k-econ i.a { color: var(--k-mag); background: var(--k-mag); } .k-econ i.m { color: var(--k-cyan); background: var(--k-cyan); }
.k-econ i.m.strain:not(.used) { background: repeating-linear-gradient(45deg, var(--k-cyan) 0 3px, transparent 3px 6px); }
.k-econ i.used { background: transparent; box-shadow: none; opacity: 0.42; }
.k-econ i.gone { background: transparent !important; box-shadow: none; opacity: 0.3; border-style: dashed; position: relative; }
.k-econ i.gone::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: currentColor; transform: rotate(45deg); }
.k-econ .f { font: 800 14px var(--k-mono); color: var(--k-grn); line-height: 1; }
.k-econ .k-btn.chip { min-height: 20px; padding: 1px 6px; font-size: 9px; border-style: dashed; border-color: var(--k-yel); color: var(--k-muted); background: transparent; }
.k-econ .k-btn.chip.on { border-style: solid; background: var(--k-yel); color: var(--k-ink); }
/* the wheel (user, 2026-10-17): the middle cards spread out and readable, the rest stacked in a pile on each side; kit.js
   places every card with --tx / --ty / --rot / --sc and turns the wheel (a sideways drag, the mouse wheel, a tap on a pile) */
.k-fan { position: relative; flex: 0 1 auto; height: calc(var(--k-card-h) + 30px); min-width: var(--k-card-w); max-width: 100%; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.k-fan .k-card { position: absolute; left: 50%; bottom: 4px; margin-left: calc(var(--k-card-w) / -2);
  transform: translateX(var(--tx, 0px)) translateY(calc(var(--ty, 0px) + var(--lift, 0px))) rotate(var(--rot, 0deg)) scale(var(--sc, 1)); transform-origin: 50% 120%;
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.26s, box-shadow 0.15s; box-shadow: -4px 6px 14px var(--k-shade); }
.k-fan.spin .k-card { transition: opacity 0.2s, box-shadow 0.15s; }
html[data-motion="off"] .k-fan .k-card { transition: none; }
.k-fan .k-card:not(.piled):hover, .k-fan .k-card.reading { --lift: -18px; box-shadow: 0 0 0 2px var(--k-yel), 0 12px 24px var(--k-shade); z-index: 300 !important; }
.k-fan .k-card.piled { filter: brightness(0.72) saturate(0.8); cursor: pointer; }
.k-fan .k-card.piled small, .k-fan .k-card.piled .k-cost { visibility: hidden; }
.k-fan .k-card.lifted { opacity: 0.25 !important; }
.k-pile { position: absolute; top: 0; z-index: 400; min-width: 26px; padding: 1px 7px; border-radius: var(--k-pill); background: var(--k-panel-hi); border: 1px solid var(--k-line); color: var(--k-text); font: 800 11px var(--k-mono); text-align: center; pointer-events: none; }
.k-pile.l { left: 0; } .k-pile.r { right: 0; } .k-pile[hidden] { display: none; }
.k-fan-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--k-muted); font: 12px var(--k-mono); padding: 0 8px; white-space: nowrap; }
html[data-motion="full"] .k-fan.deal .k-card { animation: k-card-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 35ms); }
html[data-motion="reduced"] .k-fan.deal .k-card { animation: k-fade 0.2s ease-out backwards; }
@keyframes k-card-in { from { translate: 0 28px; opacity: 0; } } /* `translate`, not `transform`: the wheel owns transform */
@keyframes k-fade { from { opacity: 0; } }

/* the card in flight, and where it lands */
.k-ghost { position: fixed !important; left: 0; top: 0; z-index: var(--k-z-ghost); margin: 0 !important; pointer-events: none; transform-origin: 50% 50%; box-shadow: 0 18px 34px rgba(0, 0, 0, 0.7) !important; animation: none !important; transition: box-shadow 0.15s; }
.k-ghost.over { box-shadow: 0 0 0 2px var(--k-yel), 0 0 30px color-mix(in srgb, var(--k-yel) 55%, transparent), 0 20px 36px rgba(0, 0, 0, 0.7) !important; }
.k-ghost.landing { transition: transform 0.25s ease-in, opacity 0.25s; opacity: 0; }
.k-ghost.home { transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.3, 1), opacity 0.28s; opacity: 0.4; }
html[data-motion="off"] .k-ghost.landing, html[data-motion="off"] .k-ghost.home { transition: none; }
.k-burst { position: absolute; z-index: 6; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; pointer-events: none; color: var(--k-cyan); }
.k-burst.c-action { color: var(--k-mag); } .k-burst.c-free { color: var(--k-grn); } .k-burst.c-social { color: var(--k-pur); } .k-burst.c-romance { color: var(--k-pink); } .k-burst.c-item, .k-burst.c-turn { color: var(--k-yel); } .k-burst.c-danger { color: var(--k-red); }
.k-burst::before, .k-burst::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.k-burst::before { border: 3px solid currentColor; animation: k-burst 0.6s ease-out forwards; }
.k-burst::after { background: radial-gradient(currentColor, transparent 65%); animation: k-burst-glow 0.5s ease-out forwards; }
@keyframes k-burst { from { transform: scale(0.5); opacity: 1; } to { transform: scale(14); opacity: 0; } }
@keyframes k-burst-glow { from { transform: scale(1); opacity: 0.9; } to { transform: scale(9); opacity: 0; } }
html[data-motion="reduced"] .k-burst::before { animation-duration: 0.3s; } html[data-motion="off"] .k-burst { display: none; }

/* the card being read: big, above the hand, with its rules and ▸ PLAY */
.k-read { position: absolute; left: 50%; bottom: 200px; z-index: var(--k-z-read); transform: translateX(-50%); display: flex; gap: 14px; align-items: flex-start; width: min(560px, calc(100% - 24px));
  padding: 12px 14px; border-radius: var(--k-r-l); border: 1px solid var(--k-yel); background: var(--k-panel-hi); box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
.k-read[hidden] { display: none; }
.k-read .k-card { width: 120px; min-height: 150px; cursor: default; transform: none; }
.k-read-txt { min-width: 0; flex: 1; font-size: 13px; line-height: 1.45; }
.k-read-txt > b { font-size: 15px; } .k-read-txt > small { color: var(--k-muted); font: 11px var(--k-mono); }
.k-read-txt p { margin: 6px 0 0; } .k-read-txt .tip { color: var(--k-yel); font: 12px var(--k-mono); } .k-read-txt .warn { color: var(--k-red); font: 12px var(--k-mono); }
.k-read-acts { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
html[data-motion="full"] .k-read { animation: k-pop 0.18s ease-out; }
@keyframes k-pop { from { transform: translateX(-50%) translateY(8px) scale(0.97); opacity: 0; } }
@media (max-width: 720px) { .k-read { bottom: 170px; padding: 10px; gap: 10px; } .k-read .k-card { width: 92px; min-height: 120px; } .k-read-txt { font-size: 12.5px; } }

/* ── the pick deck: a follow-up choice, mid-screen over a dimmed scene ── */
.k-dim { position: fixed; inset: var(--header-h, 56px) 0 0 0; z-index: var(--k-z-dim); display: grid; place-items: center; padding: 16px; background: var(--k-dim); backdrop-filter: blur(2px); }
.k-pick { position: relative; width: min(860px, 100%); max-height: 100%; overflow-y: auto; padding: 18px 16px 16px; border-radius: var(--k-r-l); text-align: center; color: var(--k-text); }
.k-pick-head { display: grid; gap: 2px; margin: 0 40px 12px; }
.k-pick-head b { font: 800 20px var(--k-ui); letter-spacing: 0.03em; } .k-pick-head small { color: var(--k-muted); font-size: 13px; }
.k-pick-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 6px 4px 10px; }
.k-pick-row .k-card { width: calc(var(--k-card-w) * 1.12); min-height: calc(var(--k-card-h) * 1.08); }
.k-pick-row .k-card:hover:not(:disabled) { transform: translateY(-8px) scale(1.04); box-shadow: 0 0 0 2px var(--k-yel), 0 14px 26px var(--k-shade); }
.k-pick-row .k-card.picked { box-shadow: 0 0 0 2px var(--k-grn), 0 0 18px color-mix(in srgb, var(--k-grn) 50%, transparent); }
.k-pick-row .k-card.picked::after { content: attr(data-n); position: absolute; right: 4px; bottom: 4px; min-width: 18px; padding: 0 4px; border-radius: var(--k-pill); background: var(--k-grn); color: var(--k-ink); font: 800 11px var(--k-mono); }
.k-card .k-i { position: absolute; top: 16px; right: 3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); border: 1px solid var(--k-line); color: var(--k-text); font: 700 11px var(--k-ui); }
.k-card .k-i:hover { border-color: var(--k-yel); color: var(--k-yel); }
.k-pick-read { white-space: pre-line; margin: 4px auto 0; max-width: 560px; padding: 8px 12px; border-radius: var(--k-r); border: 1px solid var(--k-line-soft); background: rgba(0, 0, 0, 0.3); font-size: 13px; line-height: 1.45; text-align: left; }
.k-pick-read:empty { display: none; } .k-pick-read b { color: var(--k-yel); }
/* tap = read, tap again / double tap / drag out = play (user, 2026-10-18) */
.k-pick-row .k-card { touch-action: none; } .k-pick.scrolls .k-pick-row .k-card { touch-action: pan-y; } /* a long deck still scrolls by swiping */
.k-pick-row .k-card.reading { transform: translateY(-10px) scale(1.06); box-shadow: 0 0 0 2px var(--k-yel), 0 14px 26px var(--k-shade); z-index: 2; }
.k-pick-row .k-card.lifted { opacity: 0.25; }
.k-pick-read .warn { margin: 6px 0 0; color: var(--k-red); }
.k-pick-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.k-pick-acts small { color: var(--k-muted); font-size: 11px; }
html[data-motion="full"] .k-dim { animation: k-fade 0.18s ease-out; }
html[data-motion="full"] .k-pick-row .k-card { animation: k-shuffle 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
html[data-motion="reduced"] .k-pick-row .k-card { animation: k-fade 0.2s ease-out backwards; }
@keyframes k-shuffle { from { transform: translate(calc(var(--d, 0) * -1), 30px) rotate(calc(var(--i, 0) * 7deg - 10deg)) scale(0.8); opacity: 0; } }
@media (max-width: 720px) { .k-pick { padding: 14px 8px 10px; } .k-pick-row { gap: 8px; } .k-pick-head b { font-size: 17px; } }

/* ── the dialog box: whoever is speaking, upper middle, a tilted photo on the left, big words (netrun-ui.md §4) ── */
.k-say { position: absolute; left: 50%; top: clamp(44px, 9vh, 96px); z-index: var(--k-z-say); transform: translateX(-50%); width: min(92vw, 760px); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 18px; align-items: start;
  padding: 16px 20px 16px 16px; border-radius: var(--k-r-l); border: 1px solid var(--k-line); background: var(--k-panel-hi); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); }
.k-say.no-face { grid-template-columns: minmax(0, 1fr); }
.k-photo { width: 112px; margin: -30px 0 -6px -6px; padding: 6px 6px 18px; background: #e9e4d8; border-radius: 3px; transform: rotate(-4deg); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6); }
.k-photo img, .k-photo i { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; background: #1a1430; }
.k-photo i { display: grid; place-items: center; font: 800 40px var(--k-ui); font-style: normal; color: var(--k-pur); }
.k-say-who { font: 700 11px var(--k-mono); letter-spacing: 0.24em; color: var(--k-cyan); text-transform: uppercase; }
.k-say-line { margin: 4px 0 0; font: 20px/1.4 var(--k-display); color: #f3eee4; text-wrap: pretty; }
.k-say-more { margin-top: 8px; font: 11px var(--k-mono); color: var(--k-muted); cursor: pointer; }
.k-say-who small { color: var(--k-muted); letter-spacing: 0.08em; text-transform: none; font-weight: 400; }
.k-say-body { min-width: 0; }
.k-say-line + .k-say-line { margin-top: 6px; }
.k-say-line.typing .w { white-space: nowrap; } .k-say-line.typing span span { opacity: 0; animation: k-letter 0.22s ease-out forwards; }
.k-say.all .k-say-line.typing span span { animation: none; opacity: 1; }
@keyframes k-letter { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
.k-say-log { display: none; gap: 4px; margin-top: 6px; font-size: 13px; color: var(--k-muted); max-height: 160px; overflow-y: auto; }
.k-say.open-log .k-say-log { display: grid; }
.k-say-log .you { color: var(--k-cyan); font-style: italic; text-align: right; }
html[data-motion="full"] .k-say { animation: k-say-in 0.3s ease-out; }
@keyframes k-say-in { from { transform: translateX(-50%) translateY(-10px); opacity: 0; } }
@media (max-width: 720px) { .k-say { padding: 12px 14px 12px 12px; gap: 0 12px; } .k-photo { width: 78px; margin-top: -20px; padding: 4px 4px 12px; } .k-say-line { font-size: 17px; } }

/* ── the market's preview pane (§5) ── */
.k-preview { display: grid; gap: 8px; align-content: start; min-width: 0; padding: 12px; border-radius: var(--k-r); border: 1px solid var(--k-line); background: var(--k-panel-hi); font-size: 13px; line-height: 1.45; }
.k-preview-pic { aspect-ratio: 4 / 3; border-radius: var(--k-r-s); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c, var(--k-cyan)) 22%, transparent), transparent 70%), #0b0720; display: grid; place-items: center; overflow: hidden; color: var(--c, var(--k-cyan)); }
.k-preview-pic img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; } .k-preview-pic svg { width: 62%; height: auto; filter: drop-shadow(0 0 10px currentColor); }
.k-preview h4 { margin: 0; font-size: 16px; } .k-preview .k-type { font: 700 10px var(--k-mono); letter-spacing: 0.2em; color: var(--c, var(--k-cyan)); text-transform: uppercase; }
.k-stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font: 12px var(--k-mono); } .k-stats dt { color: var(--k-muted); } .k-stats dd { margin: 0; }
.k-preview .k-own { color: var(--k-grn); font: 12px var(--k-mono); }
.k-preview-empty { color: var(--k-muted); font-size: 13px; text-align: center; padding: 30px 10px; }

/* ── the chat client (§6): mIRC ── */
.k-irc { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; border: 2px solid #c0c0c0; border-radius: 2px; background: #000; color: #d4d4d4; font: 13px/1.45 var(--k-mono); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6); }
.k-irc-bar { display: flex; align-items: center; gap: 8px; padding: 2px 6px; background: linear-gradient(90deg, #000080, #1084d0); color: #fff; font: 700 12px "Segoe UI", Tahoma, sans-serif; }
.k-irc-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; opacity: 0.85; }
.k-irc-body { display: grid; grid-template-columns: minmax(0, 1fr) 128px; min-height: 0; }
.k-irc-log { min-height: 0; overflow-y: auto; padding: 6px 8px; border-right: 2px solid #c0c0c0; }
.k-irc-log p { margin: 0 0 2px; overflow-wrap: anywhere; } .k-irc-log time { color: #7f7f7f; }
.k-irc-log .sys { color: #4caf50; } .k-irc-log .act { color: #c678dd; } .k-irc-log .me { color: var(--k-cyan); }
.k-irc-log p.pinned { background: rgba(255, 228, 92, 0.1); } .k-irc-log p.lie { opacity: 0.8; }
.k-irc-nicks { min-height: 0; overflow-y: auto; padding: 6px; background: #0a0a0a; font-size: 12px; }
.k-irc-nicks div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-irc-in { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 6px; border-top: 2px solid #c0c0c0; background: #111; }
.k-irc-in::before { content: ">"; color: #7f7f7f; }
.k-irc .k-btn.chip { border-radius: 2px; background: #c0c0c0; color: #000; border: 1px solid #fff; border-right-color: #404040; border-bottom-color: #404040; font: 700 11px "Segoe UI", Tahoma, sans-serif; letter-spacing: 0; }
@media (max-width: 720px) { .k-irc-body { grid-template-columns: minmax(0, 1fr); } .k-irc-nicks { display: none; } .k-irc.nicks .k-irc-nicks { display: block; position: absolute; right: 6px; top: 30px; max-height: 50%; border: 2px solid #c0c0c0; z-index: 2; } }

/* ── the market (§5): the shelf left, the preview pane right; on phones the preview is a sheet over the shelf ── */
.k-mk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 12px; align-items: start; margin: 6px 0; }
.k-mk-list { display: grid; gap: 4px; max-height: min(52vh, 460px); overflow-y: auto; padding-right: 2px; }
.k-mk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 0 10px; align-items: center; padding: 6px 10px; border-radius: var(--k-r-s); border: 1px solid var(--k-line-soft); background: rgba(0, 0, 0, 0.25); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.k-mk-row b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .k-mk-row small { grid-row: 2; color: var(--k-muted); font: 11px var(--k-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-mk-row .pr { grid-row: 1 / span 2; grid-column: 2; font: 700 12px var(--k-mono); color: var(--k-yel); }
.k-mk-row.own .pr { color: var(--k-grn); }
.k-mk-row:hover { border-color: var(--k-line); } .k-mk-row.on { border-color: var(--k-yel); background: color-mix(in srgb, var(--k-yel) 10%, transparent); box-shadow: inset 3px 0 0 var(--k-yel); }
.k-mk-pv { position: sticky; top: 0; max-height: min(52vh, 460px); overflow-y: auto; overscroll-behavior: contain; } /* a long description scrolls in the preview, not the whole shop (user, 2026-10-17) */
.k-mk-pv p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--k-text); }
.k-mk-act { display: flex; gap: 8px; flex-wrap: wrap; } .k-mk-act:empty { display: none; }
.k-mk-x { display: none; }
.k-mk-note { margin-top: 6px; font-size: 12px; }
@media (max-width: 720px) {
  .k-mk { grid-template-columns: minmax(0, 1fr); }
  .k-mk-list { max-height: none; }
  .k-mk-pv { display: none; position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; z-index: var(--k-z-dim); max-height: 78vh; overflow-y: auto; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7); }
  .k-mk.open .k-mk-pv { display: grid; }
  /* a blurred card around the market would become the fixed sheet's box and clip it: no blur while the sheet is up */
  .k-panel:has(.k-mk.open) { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .k-mk-x { display: block; }
  .k-preview-pic { aspect-ratio: 16 / 9; }
}
.k-irc { position: relative; margin: 6px 0; }
.k-irc-bar em { font-style: normal; font-weight: 400; opacity: 0.9; white-space: nowrap; }
.k-irc-log { max-height: min(48vh, 420px); }
.k-nick { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.k-nick:hover { text-decoration: underline; }
.k-nick.n0 { color: #ff6b6b; } .k-nick.n1 { color: #7cfc00; } .k-nick.n2 { color: #00bfff; } .k-nick.n3 { color: #ffa500; } .k-nick.n4 { color: #da70d6; }
.k-nick.n5 { color: #40e0d0; } .k-nick.n6 { color: #ffd700; } .k-nick.n7 { color: #ff69b4; } .k-nick.n8 { color: #87cefa; } .k-nick.n9 { color: #98fb98; }
.k-irc-nicks .k-nick { display: block; text-align: left; }
.k-irc-log .k-btn.chip { min-height: 18px; padding: 0 6px; font-size: 10px; vertical-align: 1px; }
.k-irc-who { display: none; margin-left: auto; }
@media (max-width: 720px) { .k-irc-who { display: inline-flex; } .k-irc-bar span { display: none; } }
.k-irc { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.k-irc-bar { min-width: 0; }

/* the table (§2b): booster cards put down, waiting for the check they fit; a row above the hand, tap one to take it back */
.k-table { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 2px 4px 6px; flex-wrap: wrap; }
.k-table-k { font: 700 9px var(--k-mono); letter-spacing: 0.2em; color: var(--k-boost); margin-right: 4px; }
.k-table .k-card { width: calc(var(--k-card-w) * 0.66); min-height: 0; grid-template-rows: auto 26px auto; padding-bottom: 4px; box-shadow: 0 0 10px color-mix(in srgb, var(--k-boost) 45%, transparent); }
.k-table .k-card .k-art svg { height: 22px; } .k-table .k-card .k-art i { font-size: 18px; line-height: 26px; } .k-table .k-card b { font-size: 10px; } .k-table .k-card small, .k-table .k-card .k-cost { display: none; }
.k-table .k-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--k-boost), 0 0 14px color-mix(in srgb, var(--k-boost) 60%, transparent); }
html[data-motion="full"] .k-table .k-card { animation: k-card-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }

/* the market's wallet (user, 2026-10-17): what you have, at the top of the shelf and under the price */
.k-mk-wallet { display: flex; justify-content: flex-end; margin: 2px 0 4px; font: 700 11px var(--k-mono); letter-spacing: 0.16em; color: var(--k-muted); }
.k-mk-wallet b { margin-left: 8px; color: var(--k-yel); font-size: 14px; letter-spacing: 0.04em; }
.k-mk-left { font: 11px var(--k-mono); color: var(--k-muted); }
/* PLAY ENGINE (Overlord #1249): a played card lies on the table (no bounce), with a puff of dust */
.k-ghost.k-played { z-index: 4; transition: transform 0.16s cubic-bezier(0.2, 1.4, 0.4, 1); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6) !important; }
.k-ghost.k-played-out { transition: opacity 0.3s; opacity: 0; }
html[data-motion="off"] .k-ghost.k-played { transition: none; }
.k-burst.c-puff { color: #d6dbe6; }
.k-burst.c-puff::before { border-width: 6px; border-style: dotted; opacity: 0.7; animation-duration: 0.7s; }
