/* Koltsina (static/js/games/koltsina.js): a calm, modern table in matte colours — sage, clay, lilac mist, ink, charcoal
   — like a ceramic tray: soft light, a fine inner line, frosted plates for the players; the cards on the table in an open
   row (the ones a chosen card may take glow), the deck at the side, your four cards along the bottom with the choices of
   the chosen card above them. Five tables (.klt-*) and five card backs (drawn in the js). Its own look. */

/* ---------- the tables ---------- */
.klt-sage { --f1: #b9c6ae; --f2: #8a9e83; --ink: #1f2a1d; --mut: #4c5a48; --acc: #2f6b4f; --line: rgba(255,255,255,.38);
  --plate: rgba(255,255,255,.74); --plateb: rgba(255,255,255,.9); --pink: #1f2a1d; --pmut: #5f6b5b; --pan: #f4f6f1; --pan2: #e7ece3; --panb: #8a9e83; }
.klt-clay { --f1: #e4b9a5; --f2: #c4876f; --ink: #3a2018; --mut: #6e4436; --acc: #a8452b; --line: rgba(255,255,255,.4);
  --plate: rgba(255,250,247,.76); --plateb: rgba(255,255,255,.9); --pink: #3a2018; --pmut: #7a5446; --pan: #fbf3ef; --pan2: #f3e2da; --panb: #c4876f; }
.klt-lilac { --f1: #d8cfe8; --f2: #a99bc6; --ink: #2a2340; --mut: #57507a; --acc: #6b4fa3; --line: rgba(255,255,255,.42);
  --plate: rgba(255,255,255,.74); --plateb: rgba(255,255,255,.92); --pink: #2a2340; --pmut: #625a85; --pan: #f6f3fb; --pan2: #ebe5f5; --panb: #a99bc6; }
.klt-ink { --f1: #2c3d5c; --f2: #111a2b; --ink: #eef2f8; --mut: #a9b6cc; --acc: #d9b26a; --line: rgba(217,178,106,.35);
  --plate: rgba(14,22,38,.62); --plateb: rgba(217,178,106,.35); --pink: #eef2f8; --pmut: #a9b6cc; --pan: #152036; --pan2: #1e2c47; --panb: #d9b26a; }
.klt-charcoal { --f1: #3b3b3e; --f2: #19191b; --ink: #f2f0eb; --mut: #b4b0a8; --acc: #e0a96d; --line: rgba(255,255,255,.14);
  --plate: rgba(20,20,22,.6); --plateb: rgba(255,255,255,.16); --pink: #f2f0eb; --pmut: #b4b0a8; --pan: #222224; --pan2: #2d2d30; --panb: #e0a96d; }

/* ---------- a card ---------- */
.klc { position: relative; display: block; width: var(--cw, 70px); aspect-ratio: 2 / 3; flex: none; border-radius: calc(var(--cw, 70px) * .12); }
.klc .klsvg, .kl-hc .klsvg { display: block; width: 100%; height: 100%; }
.kl-ghost { position: fixed; z-index: 95; pointer-events: none; will-change: transform; filter: drop-shadow(0 12px 14px rgba(0,0,0,.28)); }
.kl-ghost .klc { width: 100%; }

/* ---------- the page ---------- */
html:has(body.game-koltsina[data-page="table"]) { overflow: hidden; }
body.game-koltsina[data-page="table"] .site-foot { display: none; }
body.game-koltsina[data-page="table"] .chat-fab { display: none !important; }
body.game-koltsina[data-page="table"] #table.page { max-width: none; height: calc(100dvh - var(--top)); box-sizing: border-box; overflow: hidden; padding: 10px 14px; }
body.game-fs .kl-wrap { height: 100%; }
.kl-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; height: 100%;
  --cw: clamp(56px, 5.6vw, 86px); }

/* ---------- the bar ---------- */
.kl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 5px 6px 5px 14px; border-radius: 18px;
  background: var(--plate); border: 1px solid var(--plateb); color: var(--ink); backdrop-filter: blur(10px); }
.kl-info { min-width: 0; font: 700 12.5px 'Inter', system-ui, sans-serif; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.kl-tool { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 38px; height: 38px; padding: 0; border-radius: 50%; cursor: pointer;
  color: var(--ink); font: 700 12.5px 'Inter', system-ui, sans-serif; background: var(--plate); border: 1px solid var(--plateb); backdrop-filter: blur(10px); }
.kl-tool:hover { color: var(--acc); border-color: var(--acc); }
.kl-tool svg.i { width: 17px; height: 17px; }
.kl-tool.wide { width: auto; padding: 0 14px; border-radius: 999px; white-space: nowrap; }
.kl-tool.hidden { display: none; }
.kl-tool > b { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; display: grid; place-items: center;
  font-size: 10.5px; color: #fff; background: #d64545; }
.kl-tool > b.hidden { display: none; }
.kl-mute .tv-snd-off { display: none; }
body.tv-muted .kl-mute .tv-snd-off { display: inline; } body.tv-muted .kl-mute .tv-snd-on { display: none; }

/* ---------- the table: a matte ceramic tray, soft light, a fine inner line ---------- */
.kl-table { position: relative; min-height: 0; border-radius: 40px; isolation: isolate; color: var(--ink);
  background: radial-gradient(ellipse 70% 60% at 40% 30%, rgba(255,255,255,.16), transparent 70%), radial-gradient(ellipse 90% 80% at 50% 50%, var(--f1), var(--f2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 2px 30px rgba(0,0,0,.12), 0 22px 40px -22px rgba(0,0,0,.55); }
.kl-table::before { content: ''; position: absolute; inset: 14px; border-radius: 28px; pointer-events: none; z-index: -1; border: 1px solid var(--line); }
.kl-table::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: .5;
  background: repeating-radial-gradient(circle at 30% 20%, rgba(255,255,255,.025) 0 1px, transparent 1px 3px); }

/* ---------- the others ---------- */
.kl-opps { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.kl-opp { position: absolute; display: grid; justify-items: center; gap: 6px; }
.kl-opp.at-t { left: 50%; top: 24px; transform: translateX(-50%); }
.kl-opp.at-l { left: 30px; top: 44%; transform: translateY(-50%); } .kl-opp.at-r { right: 30px; top: 44%; transform: translateY(-50%); }
.kl-plate { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; background: var(--plate); border: 1px solid var(--plateb);
  backdrop-filter: blur(10px); box-shadow: 0 8px 18px -10px rgba(0,0,0,.35); }
.kl-opp.turn .kl-plate { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc), 0 8px 18px -10px var(--acc); }
.kl-av { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 3px; box-sizing: border-box; border-radius: 50%; flex: none; }
.kl-tring { position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,.08); }
.kl-opp.turn .kl-tring, .kl-dock.my-turn .kl-tring { background: conic-gradient(var(--acc) calc(var(--k, 1) * 360deg), rgba(0,0,0,.08) 0); }
.kl-avi { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 800; font-size: 16px;
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.4), transparent 45%), var(--bg); box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.kl-avi svg.i { width: 20px; height: 20px; } .kl-avi .ava-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kl-pn { display: grid; line-height: 1.15; color: var(--pink); }
.kl-pn b { font-size: 12.5px; font-weight: 800; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-pn small { font-size: 10.5px; font-weight: 600; color: var(--pmut); }
.kl-pts { min-width: 30px; padding: 3px 8px; border-radius: 999px; text-align: center; font: 800 13px 'Inter', system-ui, sans-serif; color: #fff; background: var(--acc); }
.kl-backs { position: relative; display: block; width: 96px; height: 42px; }
.kl-backs i { position: absolute; left: calc(50% - 14px + var(--k) * 15px); bottom: 0; width: 28px; aspect-ratio: 2 / 3; transform: rotate(calc(var(--k) * 6deg)); transform-origin: 50% 120%;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.kl-backs i .klsvg { display: block; width: 100%; height: 100%; }
/* what a side has taken: a little stack with the count, the clubs, the two scoring cards (lit when taken) */
.kl-took { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 999px; background: var(--plate); border: 1px solid var(--plateb); backdrop-filter: blur(10px);
  font: 700 11.5px 'Inter', system-ui, sans-serif; color: var(--pink); }
.kl-stack { position: relative; display: inline-flex; align-items: center; gap: 4px; padding-left: 14px; }
.kl-stack i { position: absolute; left: 0; top: 50%; width: 9px; height: 13px; border-radius: 2px; background: var(--acc); border: 1px solid rgba(255,255,255,.7); transform: translateY(-50%) rotate(-8deg); }
.kl-stack i + i { left: 3px; transform: translateY(-50%) rotate(6deg); }
.kl-clubs b, .kl-stack b { font-variant-numeric: tabular-nums; }
.kl-clubs { display: inline-flex; gap: 2px; }
.kl-gem { padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 800; color: var(--pmut); background: rgba(0,0,0,.06); opacity: .55; }
.kl-gem.on { opacity: 1; color: #fff; background: #d9a441; box-shadow: 0 0 10px rgba(217,164,65,.6); }

/* ---------- the middle: the deck and the cards on the table ---------- */
.kl-center { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); z-index: 4; display: flex; align-items: center; gap: calc(var(--cw) * .6); width: min(78%, 980px); justify-content: center; }
.kl-deck { position: relative; width: var(--cw); aspect-ratio: 2 / 3; flex: none; }
.kl-deck.empty { visibility: hidden; }
.kl-deck .klc.d { position: absolute; inset: 0; width: 100%; transform: translate(calc(var(--i) * -1.5px), calc(var(--i) * -2px)); filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.kl-deck em { position: absolute; z-index: 5; left: 50%; bottom: -13px; transform: translateX(-50%); font-style: normal; font: 800 11px 'Inter', sans-serif; padding: 2px 8px; border-radius: 999px;
  color: var(--pink); background: var(--plate); border: 1px solid var(--plateb); }
.kl-board { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: calc(var(--cw) * .14); min-height: calc(var(--cw) * 1.5); max-width: calc(var(--cw) * 7.2); }
.kl-board .klc.tc { padding: 0; border: 0; background: none; cursor: default; filter: drop-shadow(0 4px 6px rgba(0,0,0,.22)); transition: transform .18s, filter .2s, opacity .2s; }
.kl-board .klc.tc.lit { cursor: pointer; filter: drop-shadow(0 0 0 var(--acc)) drop-shadow(0 0 9px color-mix(in srgb, var(--acc) 70%, transparent)) drop-shadow(0 4px 6px rgba(0,0,0,.22)); }
.kl-board .klc.tc.pick { transform: translateY(-10px); box-shadow: 0 0 0 3px var(--acc); }
.kl-board .klc.tc.taken { transform: translateY(-14px) scale(1.03); }
.kl-board .klc.incoming { visibility: hidden; }
.kl-empty { font: 600 13px 'Inter', system-ui, sans-serif; color: var(--mut); opacity: .8; letter-spacing: .3px; }

/* ---------- the word in the middle ---------- */
.kl-banner { position: absolute; left: 50%; top: 22%; z-index: 25; transform: translateX(-50%); max-width: min(90%, 520px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; padding: 8px 18px; border-radius: 999px; font: 800 14px 'Inter', system-ui, sans-serif; color: var(--pink); background: var(--plate);
  border: 1px solid var(--plateb); backdrop-filter: blur(12px); box-shadow: 0 10px 22px -10px rgba(0,0,0,.4); animation: klBan .3s ease-out; }
.kl-banner.blank { display: none; }
.kl-banner.good { color: #fff; background: var(--acc); border-color: var(--acc); }
.kl-banner.gold { color: #2b2110; background: #f1cf86; border-color: #d9a441; }
@keyframes klBan { from { opacity: 0; transform: translate(-50%, -6px); } }
.kl-table > .paused21 { z-index: 26; }

/* ---------- the time round the table ---------- */
/* (the turn's line round the table: on its own layer — it changes every frame, the table under it is not drawn again) */
.kl-timer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; will-change: transform; }
.kl-timer rect { fill: none; stroke-width: 3; }
.kl-timer .tr-bg { stroke: rgba(0,0,0,.05); }
.kl-timer .tr-fg { stroke: rgba(0,0,0,.25); stroke-linecap: round; stroke-dasharray: 100 100; }
.kl-timer.mine .tr-fg { stroke: var(--acc); }
.kl-timer.low .tr-fg { stroke: #d64545; animation: klLow .55s ease-in-out infinite alternate; }
.kl-timer.idle .tr-fg, .kl-timer.idle .tr-head { opacity: 0; }
.kl-timer .tr-head { fill: #fff; stroke: var(--acc); stroke-width: 2; }
@keyframes klLow { to { stroke-width: 5; } }

/* ---------- you ---------- */
.kl-me { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.kl-dock { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; padding: 9px 270px; border-radius: 20px; min-width: 0; text-align: center;
  background: var(--pan, #fff); border: 1px solid color-mix(in srgb, var(--panb, #e5e5e5) 55%, transparent); color: var(--pink, #222); }
/* (off the table the bars are solid, in the table's own tone) */
.kl-wrap > .kl-top { background: var(--pan); border-color: color-mix(in srgb, var(--panb) 55%, transparent); backdrop-filter: none; }
.kl-me .kl-took { background: var(--pan2); border-color: transparent; backdrop-filter: none; }
.kl-dock.my-turn { border-color: var(--acc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--acc) 35%, transparent); }
.kl-who { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 10px; }
.kl-meinfo { display: grid; gap: 4px; text-align: left; }
.kl-mepts { display: flex; align-items: baseline; gap: 6px; } .kl-mepts b { font: 800 18px 'Inter', sans-serif; } .kl-mepts small { font-size: 10.5px; font-weight: 600; color: var(--pmut); }
.kl-dock .turnlbl { display: flex; justify-content: center; gap: 10px; margin: 0; max-width: 100%; }
.kl-dock .turnlbl b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kl-dock .turnlbl span { font-size: 12px; font-weight: 600; color: var(--pmut); white-space: nowrap; }
.kl-dock .tbar { display: none; }
/* the choices of the chosen card: each take shown as small cards; and lay it down */
.kl-acts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 2px 8px 0; }
.kl-acts.hidden { display: none; }
.kl-acts-h { font: 600 12px 'Inter', system-ui, sans-serif; color: var(--mut); }
.kl-opt { display: inline-flex; align-items: center; gap: 3px; padding: 5px 9px; border-radius: 14px; cursor: pointer; color: var(--pink);
  background: var(--plate); border: 1px solid var(--plateb); backdrop-filter: blur(10px); font: 800 13px 'Inter', system-ui, sans-serif; }
.kl-opt i { font-style: normal; margin: 0 3px; color: var(--mut); }
.kl-opt.on { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc); }
.kl-opt.lay { padding: 9px 16px; border-radius: 999px; }
.kl-opt .klc.mini { --cw: 22px; margin-left: -6px; } .kl-opt .klc.mini:first-child { margin-left: 0; }
.kl-hand { display: flex; justify-content: center; align-items: flex-end; gap: calc(var(--cw) * .14); min-width: 0; overflow: hidden;
  padding: 22px 8px calc(16px + env(safe-area-inset-bottom)); min-height: calc(var(--cw) * 1.5 + 30px); }
.kl-hc { position: relative; flex: none; width: calc(var(--cw) * 1.08); aspect-ratio: 2 / 3; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: calc(var(--cw) * .13); filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); transform: translateY(calc(var(--d) * var(--d) * 2px)) rotate(calc(var(--d) * 3deg));
  transform-origin: 50% 130%; transition: transform .18s, filter .2s, opacity .2s; }
/* (under the pointer only the picture rises and straightens: the card's place in the fan stays, so neither its lower
   edge nor its sides move away from the pointer — no flicker) */
.kl-hc.ok:hover { z-index: 5; }
.kl-hc .klsvg { transition: transform .18s; }
.kl-hc.ok:hover .klsvg { transform: translateY(-14px) rotate(calc(var(--d) * -3deg)); }
.kl-hc.sel:hover .klsvg { transform: none; }               /* (a chosen card is up already) */
/* (the space a risen card leaves below still counts as the card: it never flickers at its lower edge) */
.kl-hc.ok:hover::before { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 34px; }
/* the points of this hand so far, by the score (live) */
.kl-live { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 999px; font: 800 .72em/1.5 'Inter', system-ui, sans-serif; font-style: normal;
  vertical-align: middle; color: var(--acc); background: color-mix(in srgb, var(--acc) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 45%, transparent); }
.kl-pts .kl-live { color: #fff; background: rgba(255,255,255,.24); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.kl-hc.takes::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.kl-hc.sel { z-index: 6; transform: translateY(-22px) rotate(0) scale(1.04); filter: drop-shadow(0 0 0 var(--acc)) drop-shadow(0 0 10px color-mix(in srgb, var(--acc) 80%, transparent)) drop-shadow(0 10px 12px rgba(0,0,0,.35)); }
.kl-hc.gone { opacity: 0; transform: translateY(-20px) scale(.9); transition: opacity .08s, transform .08s; }
.kl-hand.dealt .kl-hc { animation: klDeal .5s cubic-bezier(.3,1.15,.5,1) backwards; animation-delay: calc(var(--i) * 80ms); }
@keyframes klDeal { from { transform: translateY(-140px) rotate(-6deg) scale(.7); opacity: 0; } }

/* ---------- the end of a hand: what every side took, the points ---------- */
.kl-res { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 12px; pointer-events: none; }
.kl-res.hidden { display: none; }
.kl-res-in { pointer-events: auto; width: min(560px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; box-sizing: border-box; padding: 18px; border-radius: 26px;
  color: var(--pink); background: var(--pan); border: 1px solid var(--panb); box-shadow: 0 30px 70px -20px rgba(0,0,0,.6); animation: klIn .3s ease-out; }
@keyframes klIn { from { transform: translateY(8px) scale(.97); opacity: 0; } }
.kl-res-in h3 { margin: 2px 0 12px; text-align: center; font: 800 19px 'Inter', system-ui, sans-serif; }
.kl-rt { width: 100%; border-collapse: separate; border-spacing: 0 6px; font: 600 13px 'Inter', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.kl-rt th { font-size: 11px; font-weight: 700; color: var(--pmut); text-align: center; padding: 0 4px; }
.kl-rt tr > th:first-child { text-align: left; }
.kl-rt td, .kl-rt tr:not(:first-child) th { padding: 9px 6px; background: var(--pan2); text-align: center; }
.kl-rt tr:not(:first-child) th { text-align: left; color: var(--pink); font-size: 13px; font-weight: 800; border-radius: 12px 0 0 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-rt td:last-child { border-radius: 0 12px 12px 0; }
.kl-rt td small { display: block; font-size: 10.5px; font-weight: 800; color: var(--acc); }
.kl-rt td.got { color: var(--acc); font-weight: 800; }
.kl-rt td.sum { font-weight: 800; color: var(--acc); } .kl-rt td.tot { font-size: 16px; font-weight: 800; }
.kl-rt tr.me th, .kl-rt tr.me td { box-shadow: inset 0 1px 0 var(--acc), inset 0 -1px 0 var(--acc); }
.kl-res-n { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--pmut); }

/* ---------- home and my look ---------- */
.hero-kl .kl-art { display: flex; justify-content: center; padding: 4px 0 10px; }
.hero-kl .kl-art img { display: block; width: 100%; max-width: 320px; height: auto; filter: drop-shadow(0 14px 18px rgba(0,0,0,.4)); }
.kl-target { display: grid; grid-template-columns: repeat(3, 1fr); }
.kl-target button { font-size: 12.5px; font-weight: 900; }
.kl-lk { position: relative; display: block; width: 100%; height: 100%; min-height: 60px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(ellipse 90% 80% at 50% 50%, var(--f1), var(--f2)); box-shadow: inset 0 0 0 1px var(--line); }
.kl-lk-c { position: absolute; top: 50%; width: 28%; max-width: 46px; aspect-ratio: 2 / 3; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.kl-lk-c .klsvg { width: 100%; height: 100%; display: block; }
.kl-lk-c.b { left: 32%; transform: translate(-50%, -50%) rotate(-8deg); } .kl-lk-c.f { left: 64%; transform: translate(-50%, -50%) rotate(6deg); }
.logo-kl { width: 36px; height: 36px; flex: none; } .logo-kl img { width: 36px; height: 36px; display: block; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); }
/* four players in teams: the partner and the others marked on the seats (as in ludo) */
.seat-wrap.xa-mate .seat-row { box-shadow: inset 3px 0 0 #7fe25a; }
.seat-wrap.xa-foe .seat-row { box-shadow: inset 3px 0 0 #ff7a8a; }
.xa-team { align-self: flex-start; margin-top: 4px; padding: 2px 9px; border-radius: 999px; font: 900 10px/1.4 'Inter', system-ui, sans-serif; letter-spacing: .4px;
  text-transform: uppercase; cursor: pointer; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.xa-team.mate { background: rgba(127,226,90,.2); color: #b5f58f; border-color: rgba(127,226,90,.55); }
.xa-team.foe { background: rgba(255,122,138,.12); color: #ffb3bd; border-color: rgba(255,122,138,.3); }
.xa-team.foe:hover { background: rgba(127,226,90,.14); color: #d8ffc4; border-color: rgba(127,226,90,.45); }

/* ---------- a computer: the tools on the table's corner ---------- */
@media (min-width: 761px) and (min-height: 521px) {
  .kl-wrap { grid-template-rows: minmax(0, 1fr) auto; }
  .kl-top { position: absolute; top: 18px; right: 22px; z-index: 30; padding: 0; background: none; border: 0; backdrop-filter: none; }
  .kl-top .kl-info { display: none; }
}
/* ---------- a phone ---------- */
@media (max-width: 760px) {
  .kl-wrap { --cw: clamp(42px, 11.5vw, 58px); }
  .kl-av { width: 32px; height: 32px; padding: 2px; } .kl-pn b { font-size: 11px; max-width: 64px; } .kl-pn small { display: none; }
  .kl-backs { width: 64px; height: 30px; } .kl-backs i { width: 20px; left: calc(50% - 10px + var(--k) * 10px); }
  .kl-took { gap: 3px; padding: 2px 5px; font-size: 10.5px; } .kl-gem { padding: 1px 4px; font-size: 9.5px; }
  .kl-opp.at-l { left: 10px; } .kl-opp.at-r { right: 10px; } .kl-opp.at-t { top: 14px; }
  /* (your own plate shows here too, small, beside what to do: your points, the cards and clubs you took, 2♣ 10♦) */
  .kl-dock { padding: 7px 10px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; text-align: left; }
  .kl-who { display: flex; position: static; transform: none; flex: none; gap: 6px; }
  .kl-who .kl-av { width: 30px; height: 30px; padding: 2px; }
  .kl-mepts b { font-size: 15px; } .kl-mepts small { font-size: 9.5px; }
  .kl-meinfo .kl-took { gap: 3px; padding: 2px 5px; font-size: 10px; } .kl-meinfo .kl-gem { padding: 1px 4px; font-size: 9px; }
  .kl-dock .turnlbl { flex: 1; min-width: 0; flex-direction: column; gap: 0; align-items: flex-start; }
  .kl-dock .turnlbl b { white-space: normal; font-size: 12.5px; line-height: 1.25; }
  .kl-tool { width: 34px; height: 34px; }
  .kl-center { width: 92%; gap: calc(var(--cw) * .3); }
  .kl-board { max-width: calc(var(--cw) * 5.4); }
}
@media (max-width: 760px) and (orientation: portrait) { .kl-table { align-self: center; height: min(100%, 132vw); }
  /* (a narrow table: the others in a row along the top, the deck above the cards on the table) */
  .kl-opp.at-l, .kl-opp.at-r { top: 16px; transform: none; } .kl-opp.at-t { top: 16px; }
  .kl-center { top: 62%; flex-direction: column; gap: 14px; } .kl-deck { width: calc(var(--cw) * .8); } }
@media (orientation: landscape) and (max-height: 520px) {
  body.game-koltsina[data-page="table"] .top { display: none; }
  body.game-koltsina[data-page="table"] #table.page { height: 100dvh; margin: 0; padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(2px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .kl-wrap { --cw: clamp(34px, 9.5vh, 50px); gap: 4px; }
  .kl-dock { padding: 4px 8px; gap: 6px; flex-direction: row; justify-content: center; }
  .kl-who { display: flex; position: static; transform: none; flex: none; gap: 6px; } .kl-who .kl-av { width: 26px; height: 26px; padding: 2px; }
  .kl-meinfo { display: flex; align-items: center; gap: 6px; } .kl-mepts b { font-size: 14px; }
  .kl-hand { padding-top: 12px; min-height: calc(var(--cw) * 1.5 + 14px); }
  .kl-tool { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .kl-hand.dealt .kl-hc { animation: none !important; } }

/* ---------- (2026-10-18) no white edges: the plates, the tools and the pictures take the table's own tone; your bar is
   tall enough for your points and what you took (nothing sticks out over its edge) ---------- */
.kl-wrap[class*="klt-"] { --plateb: color-mix(in srgb, var(--panb) 45%, transparent); --line: color-mix(in srgb, var(--panb) 40%, transparent); }
.kl-wrap.klt-ink { --plateb: rgba(217,178,106,.3); --line: rgba(217,178,106,.25); }
.kl-wrap.klt-charcoal { --plateb: rgba(224,169,109,.22); --line: rgba(224,169,109,.18); }
.kl-table { box-shadow: inset 0 2px 30px rgba(0,0,0,.12), 0 22px 40px -22px rgba(0,0,0,.55); }
.kl-avi { box-shadow: 0 0 0 2px color-mix(in srgb, var(--acc) 55%, transparent); }
.kl-stack i { border-color: color-mix(in srgb, var(--acc) 60%, #000); }
.kl-dock { min-height: 54px; justify-content: center; }
.kl-who { top: 0; bottom: 0; transform: none; }
.kl-meinfo { align-content: center; }
.kl-mepts { line-height: 1.1; }
@media (max-width: 760px) { .kl-dock { min-height: 0; } .kl-who { top: auto; bottom: auto; } }
@media (orientation: landscape) and (max-height: 520px) { .kl-dock { min-height: 0; } .kl-who { top: auto; bottom: auto; } }
/* (the tables bought with chips are dark and rich: the plates and your bar there are dark glass with gold, never white) */
.kl-wrap[class*="klt-cos_"] { --ink: #f3efe6; --mut: #d8d0bd; --acc: #e0b25a; --pink: #f3efe6; --pmut: #c9c2b0;
  --plate: rgba(14,12,22,.62); --plateb: rgba(224,178,90,.28); --pan: rgba(18,16,28,.94); --pan2: rgba(255,255,255,.07); --panb: #b8904a;
  --line: rgba(224,178,90,.22); }
.kl-timer .tr-head { fill: var(--acc); stroke: color-mix(in srgb, var(--acc) 55%, #000); }
.kl-timer .tr-fg { stroke: color-mix(in srgb, var(--ink) 35%, transparent); }
