/* Tablić — Balkan kilim / coffee-house theme (from the Tablic Board.dc design).
   Mobile-first: one board column, sidebar as a toggled overlay. On a wide viewport the
   sidebar docks as a real column. Card sizing derives from the viewport via clamp(), so
   the whole board scales from phone to tablet to desktop. */
* { box-sizing: border-box; margin: 0; padding: 0; }
/* registered so ghost cards (game.js spawnGhost/moveGhost) can transition --card-w smoothly
   as they resize between differently-sized zones, instead of jumping at the end of the flight */
@property --card-w {
    syntax: '<length>';
    inherits: true;
    initial-value: 75px;
}
:root {
    --card-w: clamp(47px, 11.5vw, 92px);
    /* NO --card-h here: a custom property substitutes its var()s in the element that
       DECLARES it, so a :root --card-h would keep the root --card-w even inside a zone
       that overrides it (stretched cards). Height is always derived at the point of use
       from the locally resolved --card-w, via --card-ratio. */
    --card-ratio: 1.42;
    --gold: #c9a94f;
    --gold-bright: #e8c15a;
    --cream: #f1e9d8;
    --card-face: #f3ead8;
    --kilim-a: #7a1f2b;
    --kilim-b: #5a1119;
    --ink: #22160a;
    --panel: #12241b;
    --accent: #9befff;
}
html, body { height: 100%; }
body {
    font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    /* real coffee-house table photo (table.avif), dimmed with a dark blue wash so cards
       and panels stay legible on top of it instead of a flat casino-felt color */
    background:
        linear-gradient(rgba(6,13,22,0.76), rgba(6,13,22,0.76)),
        url('../table.avif') center/cover no-repeat fixed;
    color: var(--cream);
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none; user-select: none;
}
#app { display: flex; flex-direction: column; height: 100dvh; width: 100vw; position: relative; }
/* soft vignette to pull focus toward the board and add depth at the edges */
#app::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 5;
    box-shadow: inset 0 0 min(18vw, 160px) rgba(0,0,0,0.55); }

/* header — deck♠des (left) · Tablić brand (centre) · AI + rules (right) */
#header-bar {
    height: 52px; min-height: 52px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px; gap: 8px;
    background: linear-gradient(180deg, #1a3352, #0f2137);
    border-bottom: 1px solid rgba(201,169,79,0.4);
}
#header-left, #header-right { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
#header-right { justify-content: flex-end; }
#header-center { display: flex; align-items: center; gap: 8px; }
#brand-title { font-family: "Playfair Display", Georgia, serif; color: var(--gold-bright);
    font-size: 22px; font-weight: 800; letter-spacing: 0.03em;
    text-shadow: 0 1px 0 rgba(0,0,0,0.4); }
.deckades-logo { font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 19px;
    letter-spacing: 0.05em; color: rgba(241,233,216,0.6); text-decoration: none; line-height: 1;
    transition: color .2s; }
.deckades-logo:hover { color: rgba(241,233,216,0.95); }
.deckades-spade { color: var(--gold); font-size: 1.1em; vertical-align: middle;
    display: inline-block; transform: translateY(-1px); }
#ai-indicator { font-size: 11px; padding: 4px 10px; border-radius: 10px;
    background: rgba(255,255,255,0.12); white-space: nowrap; letter-spacing: 0.02em; }
#ai-indicator.onnx { background: rgba(31,111,235,0.85); }
#ai-indicator.heuristic { background: #8a6d1f; }
#rules-btn, #log-btn, #ai-btn { width: 44px; height: 44px; min-width: 44px; display: grid; place-items: center;
    border-radius: 50%; background: rgba(255,255,255,0.12); color: var(--cream); text-decoration: none;
    font-weight: 700; font-size: 17px; border: 1px solid rgba(201,169,79,0.35); cursor: pointer;
    touch-action: manipulation; }
#log-btn.active, #ai-btn.active { background: var(--gold); color: var(--ink); }

/* kilim motif strip under the header */
#kilim { height: 7px; min-height: 7px;
    background: repeating-linear-gradient(45deg, var(--gold) 0 7px, var(--kilim-a) 7px 14px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.4); }

/* ── layout ─────────────────────────────────────────────────────────────────── */
/* #sidebar is always position:fixed (see below), so it never takes layout space here —
   #board is the row's only flowed child and centers on the full viewport width, sidebar
   or not, instead of centering only in the leftover space next to a docked sidebar */
#main-row { flex: 1; display: flex; justify-content: center; min-height: 0; padding: 8px 12px; }
#board { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 6px;
    width: 100%; max-width: 880px; }
.player-zone { display: flex; flex-direction: column; gap: 4px; }
.zone-info { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 0 4px;
    color: rgba(241,233,216,0.6); letter-spacing: 0.02em; }
.zone-info .pile-badge, .zone-info .score-badge {
    padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,0.35);
    border: 1px solid rgba(201,169,79,0.25); color: var(--cream); }
.zone-info .score-badge { background: var(--gold-bright); color: var(--ink); font-weight: 700;
    border-color: transparent; }

.hand-row { display: flex; justify-content: center; align-items: center; gap: 11px;
    min-height: calc(var(--card-w) * var(--card-ratio)); flex-wrap: nowrap; }
#hand { flex-wrap: wrap; --card-w: clamp(52px, 12vw, 92px); }
#opp-hand { --card-w: clamp(50px, 10.75vw, 90px); }   /* matches .table-felt's card size */

/* own hand row, centered on its own width — the status message is pinned to its right
   edge (absolutely positioned) so it doesn't pull the hand off-center to make room for it */
.hand-row-wrap { display: flex; justify-content: center; margin-top: 14px; }
.hand-center { position: relative; display: inline-flex; align-items: center; }
#message { position: absolute; left: 100%; top: 50%; margin-left: 16px; transform: translateY(-50%);
    font-size: 14px; opacity: 0.95; text-align: left;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28vw; }

/* table + stock */
#table-zone { flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 6px; min-height: 0; }
#table-row { display: flex; align-items: center; justify-content: center; gap: 14px;
    width: 100%; min-height: 0; }
.table-felt { display: flex; flex-wrap: wrap; align-content: center; justify-content: center;
    gap: 10px; padding: 14px; flex: 1 1 auto; min-width: 0; max-width: 800px;
    max-height: 100%; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* a plain, slight dark pool over the table photo — no woven pattern */
    background: rgba(4,10,17,0.4);
    border-radius: 16px; border: 2px solid var(--gold);
    box-shadow: inset 0 0 0 1px rgba(232,193,90,0.35), inset 0 0 46px rgba(0,0,0,0.55),
        0 6px 20px rgba(0,0,0,0.4);
    /* fixed height (shorter than a full two card rows), so the felt doesn't grow/shrink as
       cards are added or removed — an empty table and a full one occupy the same footprint;
       extra rows beyond this just scroll (overflow-y: auto above) */
    height: calc(var(--card-w) * var(--card-ratio) * 1.3 + 30px);
    --card-w: clamp(50px, 10.75vw, 90px); }
#stock-pile, .stock-pile-spacer { display: flex; flex-direction: column; align-items: center;
    gap: 5px; flex-shrink: 0; --card-w: clamp(50px, 10.75vw, 90px); }
/* invisible clone of #stock-pile on the felt's other side, so its width balances the real
   stock pile's and .table-felt (flex: 1 1 auto between them) lands truly centered in
   #table-row — matching where the hand rows center, instead of drifting toward the stock */
.stock-pile-spacer { visibility: hidden; pointer-events: none; }
.stock-stack { position: relative; width: var(--card-w);
    height: calc(var(--card-w) * var(--card-ratio)); }
.stock-stack .card { position: absolute; inset: 0; width: 100%; height: 100%; }
.stock-stack .s3 { transform: translate(6px, 6px); }
.stock-stack .s2 { transform: translate(3px, 3px); }
.stock-badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 10px;
    background: rgba(0,0,0,0.4); border: 1px solid rgba(201,169,79,0.3); white-space: nowrap; }
#capture-hint { min-height: 16px; font-size: 12px; color: var(--accent); font-weight: 600;
    letter-spacing: 0.02em; text-align: center; }

/* ── cards ──────────────────────────────────────────────────────────────────── */
.card {
    width: var(--card-w); height: calc(var(--card-w) * var(--card-ratio));
    min-width: var(--card-w);
    border-radius: 9px; color: #1a1a1a; position: relative;
    /* soft top-left sheen for a bit of gloss + a fine warm inner frame, instead of a flat
       matte rectangle */
    background: radial-gradient(circle at 30% 18%, rgba(255,255,255,0.4), transparent 60%), var(--card-face);
    box-shadow: inset 0 0 0 1px rgba(30,90,150,0.32), 0 3px 8px rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; transition: transform .12s, filter .12s, box-shadow .12s;
}
.card.red { color: var(--kilim-a); }
.card.black { color: #1a1a1a; }
/* corner index: rank over suit */
.card .corner { position: absolute; text-align: center; line-height: 0.9; }
.card .corner.tl { top: 6%; left: 7%; }
.card .corner.br { bottom: 6%; right: 7%; transform: rotate(180deg); }
.card .c-rank { display: block; font-family: "Playfair Display", Georgia, serif;
    font-weight: 800; font-size: calc(var(--card-w) * 0.24); }
.card .c-suit { display: block; font-weight: 700; font-size: calc(var(--card-w) * 0.2); margin-top: 3%; }
/* center: pip layout / ace / court */
.card .c-center { position: absolute; inset: 0; pointer-events: none; }
.card .pip-cell { position: absolute; font-weight: 700; line-height: 1;
    font-size: calc(var(--card-w) * 0.24); }
.card .face-ace { position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: calc(var(--card-w) * 0.74); }
.card .face-court { position: absolute; inset: 12%; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 4%; }
.card .face-court .fc-letter { font-family: "Playfair Display", Georgia, serif;
    font-weight: 800; font-size: calc(var(--card-w) * 0.44); line-height: 1; }
.card .face-court .fc-suit { font-weight: 700; font-size: calc(var(--card-w) * 0.46); line-height: 1; }

/* card back: gold mandala on wine (gfx/cardback.webp — WebP with alpha, ~6x smaller than
   the same PNG). The art is pre-cropped to --card-ratio and its rounded corners are baked
   into the alpha channel, so it maps 1:1 with `100% 100%` — no cropping, which would
   otherwise slice those corners off. */
.card.back {
    background: url('gfx/cardback.webp') center / 100% 100% no-repeat;
    border: none; color: var(--gold);
    box-shadow: 0 3px 8px rgba(0,0,0,0.45);   /* drop the face card's inset hairline */
}
.card.back::before, .card.back::after { content: none; }
.card.back .pip, .card.back .corner { display: none; }

.card.playable { cursor: pointer; box-shadow: 0 0 0 2px var(--gold-bright), 0 3px 8px rgba(0,0,0,0.5); }
.card.playable:hover { filter: brightness(1.06); }
.card.selected { transform: translateY(-10px);
    box-shadow: 0 0 0 3px #4fc3f7, 0 8px 16px rgba(0,0,0,0.55); }
/* table cards while choosing a capture */
.card.capturable { cursor: pointer; box-shadow: 0 0 0 2px rgba(79,195,247,0.7); }
.card.capturable:hover { filter: brightness(1.08); }
.card.capture-sel { box-shadow: 0 0 0 3px #4fc3f7, 0 0 12px rgba(79,195,247,0.8);
    transform: translateY(-8px); }
.card.capture-target { box-shadow: 0 0 0 3px #4fc3f7; filter: brightness(1.1); }
.card.dim { opacity: 0.45; }

/* animations */
.card.ghost { box-shadow: 0 8px 22px rgba(0,0,0,0.6); }
.pile-badge.pulse, .score-badge.pulse, .medal.pulse { animation: badge-pulse .45s ease; }
@keyframes badge-pulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.18); filter: brightness(1.3); }
    100% { transform: scale(1); }
}

/* action bar */
#action-bar { min-height: 52px; display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 2px 6px; margin-top: -22px; }
.act-btn { min-width: 110px; min-height: 44px; padding: 10px 18px; border: none; border-radius: 9px;
    font-size: 15px; font-weight: 700; cursor: pointer; touch-action: manipulation; color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 3px 8px rgba(0,0,0,0.35); }
.act-btn.capture { background: linear-gradient(180deg, #379759, #1e6b38); }
.act-btn.trail { background: linear-gradient(180deg, #8a6838, #5a4020); }
.act-btn.cancel { background: rgba(255,255,255,0.14); box-shadow: none; }
.act-btn:disabled { opacity: 0.4; }

/* ── sidebar (score + move log) ───────────────────────────────────────────────
   Mobile default: fixed overlay toggled by the 📜 button. Docks as a column on wide. */
#sidebar {
    position: fixed; top: 60px; right: 8px; width: min(320px, 92vw); max-height: 76vh;
    display: none; flex-direction: column; gap: 12px; z-index: 110;
}
#sidebar.open { display: flex; }

#score-panel { background: linear-gradient(180deg, #163049, #0f1f30);
    border: 1px solid rgba(201,169,79,0.35); border-radius: 14px; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.score-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.score-who { display: flex; flex-direction: column; min-width: 0; }
.who-name { font-size: 13px; color: rgba(241,233,216,0.7); }
.who-sub { font-size: 11px; color: rgba(241,233,216,0.45); white-space: nowrap; }
.score-div { height: 1px; background: rgba(201,169,79,0.25); }
.medal { width: 52px; height: 52px; min-width: 52px; border-radius: 50%; display: grid;
    place-items: center; font-family: "Playfair Display", Georgia, serif; font-weight: 800;
    font-size: 20px; line-height: 1; border: 2px solid rgba(255,255,255,0.25);
    box-shadow: inset 0 0 0 3px rgba(0,0,0,0.12), 0 3px 8px rgba(0,0,0,0.4); }
.medal.me { background: radial-gradient(circle at 35% 30%, var(--gold-bright), #b88a2e 70%); color: var(--ink); }
.medal.opp { background: radial-gradient(circle at 35% 30%, #9aa0a0, #54584f 70%); color: #1a1a1a; }
.score-foot { text-align: center; font-size: 11px; color: rgba(232,193,90,0.7); letter-spacing: 0.03em; }

#log-panel { flex: 1; min-height: 0; display: flex; flex-direction: column;
    background: rgba(10,17,25,0.95); border: 1px solid rgba(201,169,79,0.35); border-radius: 14px;
    overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
#log-panel.collapsed { display: none; }    /* hidden by the 📜 header button */
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 14px; border-bottom: 1px solid rgba(201,169,79,0.25); background: rgba(0,0,0,0.2); }
.log-title { font-family: "Playfair Display", Georgia, serif; font-weight: 700;
    color: var(--gold-bright); font-size: 14px; }
#log-deal { font-size: 11px; color: rgba(241,233,216,0.45); margin-left: auto; }
.log-head button { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer;
    min-width: 32px; min-height: 32px; touch-action: manipulation; }
#log-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 14px;
    display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.5; }
.log-entry { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.log-entry.you { color: #cfe9ff; }
.log-entry.opp { color: #ffd9b0; }
.log-entry.deal { color: var(--gold-bright); font-weight: 700; }
.log-entry.tabla { color: var(--accent); font-weight: 700; }
.log-empty { opacity: 0.5; font-style: italic; }

/* wide viewport: dock the sidebar as a real column, drop the inline score badges */
@media (min-width: 1000px) and (min-height: 560px) {
    /* stays position:fixed (from the base #sidebar rule) rather than docking in-flow —
       so it floats over the right edge without pulling #board's centering off-true */
    #sidebar { display: flex; width: 300px; min-width: 300px; max-height: calc(100dvh - 76px); }
    #log-panel, #score-panel { box-shadow: 0 8px 30px rgba(0,0,0,0.45); }
    #log-close { display: none; }          /* the header 📜 button does the hiding here */
    .zone-info .pile-badge, .zone-info .score-badge { display: none; }
    /* #board centers on the full viewport (see #main-row) — cap it so its centered box
       can never reach into the floating sidebar's reserved zone on the right */
    #board { max-width: min(880px, calc(100vw - 672px)); }
}

/* ── overlays ───────────────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; display: grid; place-items: center;
    background: rgba(3,10,18,0.85); z-index: 200; padding: 16px; }
.overlay.hidden { display: none; }
.panel { position: relative;   /* anchors the start screen's corner language picker */
    background: linear-gradient(180deg, #163049, #0f1f30);
    border: 1px solid rgba(201,169,79,0.4); border-radius: 16px;
    padding: 24px; width: min(360px, 92vw); text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.panel h1 { font-family: "Playfair Display", Georgia, serif; color: var(--gold-bright); margin-bottom: 8px; }
.subtitle { font-size: 14px; opacity: 0.85; margin-bottom: 18px; }
.setting { display: flex; justify-content: space-between; align-items: center; margin: 10px 0;
    font-size: 14px; }
.setting select { width: 150px; min-height: 40px; border-radius: 8px; padding: 4px 8px;
    background: #0d1a13; color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.setting input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--gold-bright);
    cursor: pointer; }
/* single flag-icon button in the start-screen panel's top-right corner showing the current
   language; click opens a popover grid of flags to switch — same placement and pattern as
   Sevens' cornerBox/langBtn. Flags are inline SVG (see LANG_META in i18n.js), so the buttons
   clip the artwork rather than set a font-size. */
.lang-picker { position: absolute; top: 14px; right: 16px; display: flex; align-items: center; z-index: 5; }
.lang-btn { width: 40px; height: 28px; padding: 0; border-radius: 5px; overflow: hidden;
    border: 1px solid rgba(201,169,79,0.45); background: rgba(0,0,0,0.3);
    cursor: pointer; touch-action: manipulation; display: block;
    transition: border-color .15s, box-shadow .15s; }
.lang-btn:hover { border-color: var(--gold-bright); box-shadow: 0 0 10px rgba(232,193,90,0.4); }
.lang-popover { position: absolute; top: calc(100% + 8px); right: 0;
    display: flex; flex-wrap: wrap; gap: 8px; width: 190px; justify-content: center; padding: 10px;
    background: rgba(10,17,25,0.98); border: 1px solid rgba(201,169,79,0.4); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6); z-index: 210; }
.lang-opt { width: 44px; height: 30px; min-width: 44px; padding: 0; overflow: hidden;
    border-radius: 5px; border: 2px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.3);
    cursor: pointer; touch-action: manipulation; display: block;
    transition: border-color .15s; }
.lang-opt:hover { border-color: rgba(232,193,90,0.7); }
.lang-opt.selected { border-color: var(--gold-bright); }

/* AI panel — the 🤖 header button lists the AI's top-ranked moves for the current position */
#ai-panel { position: fixed; top: 60px; right: 8px; width: min(330px, 92vw); max-height: 70vh;
    display: none; flex-direction: column; z-index: 120;
    background: rgba(10,17,25,0.97); border: 1px solid rgba(201,169,79,0.4); border-radius: 14px;
    overflow: hidden; box-shadow: 0 10px 34px rgba(0,0,0,0.6); }
#ai-panel.open { display: flex; }
.ai-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    border-bottom: 1px solid rgba(201,169,79,0.25); background: rgba(0,0,0,0.25); }
.ai-title { font-family: "Playfair Display", Georgia, serif; font-weight: 700;
    color: var(--gold-bright); font-size: 14px; }
.ai-head button { margin-left: auto; background: none; border: none; color: #fff; font-size: 16px;
    cursor: pointer; min-width: 32px; min-height: 32px; touch-action: manipulation; }
#ai-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 12px 12px;
    display: flex; flex-direction: column; gap: 6px; }
.ai-move { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 8px;
    border-radius: 8px; background: rgba(255,255,255,0.04); }
.ai-move.top { background: rgba(232,193,90,0.14); border: 1px solid rgba(232,193,90,0.35); }
.ai-rank { color: rgba(241,233,216,0.45); font-size: 11px; min-width: 16px; }
.ai-desc { flex: 1; color: rgba(241,233,216,0.9); }
.ai-prob { color: var(--gold-bright); font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-bar { height: 3px; border-radius: 2px; background: var(--gold); margin-top: 3px; }
.ai-empty { opacity: 0.55; font-style: italic; font-size: 13px; padding: 4px 2px; }
.primary-btn { margin-top: 18px; width: 100%; min-height: 48px; border: none; border-radius: 10px;
    background: linear-gradient(180deg, var(--gold-bright), #b88a2e); color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 10px rgba(0,0,0,0.35);
    font-size: 17px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.rules-link { display: inline-block; margin-top: 12px; color: #9fd8ff; font-size: 13px; }
/* secondary start-screen action (Multiplayer) — same shape as .primary-btn, quieter fill */
.primary-btn.alt { margin-top: 10px; background: rgba(255,255,255,0.14); color: var(--cream);
    border: 1px solid rgba(201,169,79,0.4); box-shadow: none; font-size: 15px; }
.primary-btn.alt:hover { background: rgba(255,255,255,0.2); }
/* shown to the multiplayer guest in place of Continue — only the host deals */
.deal-waiting { font-size: 13px; opacity: 0.8; margin-top: 14px; min-height: 18px; }

/* deal-over scoring breakdown */
#dealover .panel { width: min(400px, 92vw); }
.deal-breakdown { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.deal-breakdown th { font-weight: 600; color: rgba(241,233,216,0.6); font-size: 12px;
    padding: 4px 6px; text-align: right; }
.deal-breakdown th:first-child, .deal-breakdown td:first-child { text-align: left; }
.deal-breakdown td { padding: 5px 6px; text-align: right; border-top: 1px solid rgba(201,169,79,0.15); }
.deal-breakdown tr.total-row td { border-top: 1px solid rgba(201,169,79,0.5); font-weight: 800;
    color: var(--gold-bright); padding-top: 8px; }
.deal-match-line { font-size: 13px; opacity: 0.8; margin-top: 6px; }
#go-detail { font-size: 15px; margin: 12px 0; line-height: 1.5; }
.card-tip { position: fixed; transform: translate(-50%, -100%); z-index: 1000; display: none;
    background: rgba(0,0,0,0.92); color: #fff; border: 1px solid var(--gold); border-radius: 8px;
    padding: 4px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5); }

.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 150;
    background: rgba(0,0,0,0.85); border: 1px solid var(--gold); color: #fff; padding: 12px 20px;
    border-radius: 12px; font-size: 15px; text-align: center; pointer-events: none;
    transition: opacity .3s; max-width: 90vw; white-space: pre-line; }
.toast.tabla { border-color: #4fc3f7; color: #cfefff; font-weight: 700; }

/* short landscape phones: shrink the cards and drop non-essential chrome */
@media (max-height: 520px) {
    :root { --card-w: clamp(42px, 8.75vw, 75px); }
    #hand { --card-w: clamp(45px, 9.25vw, 78px); }
    .table-felt, #stock-pile, .stock-pile-spacer, #opp-hand { --card-w: clamp(42px, 8.5vw, 72px); }
    .subtitle { display: none; }
}
