/* TipsyTable Digital — virtual card table (styles mirror TipsyTable.html) */
:root {
    --bg-primary: #0b1020;
    --bg-secondary: #111827;
    --bg-card: #1f2937;
    --border: #374151;
    --accent: #a855f7;
    --accent-hover: #9333ea;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --green: #22c55e;
    --red: #ef4444;
    --blue: #3b82f6;
    --yellow: #eab308;
    --card-ratio: 0.7176;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0; padding: 0; background: var(--bg-primary); color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}
button { font-family: inherit; }
.piles, .bf-row, .hand-zone, .sidebar-panel, .chat-messages, .zone-grid, .deck-list { scrollbar-width: thin; scrollbar-color: #5b21b6 transparent; }

/* ── Buttons ─────────────────────────────────── */
.btn {
    padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 600; cursor: pointer; border: none;
    font-size: 0.875rem; transition: all 0.2s; display: inline-flex; align-items: center; gap: 0.4rem;
    color: var(--text);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); border: 1px solid var(--border); }
.btn-secondary:hover { background: #374151; }
.dcard-destroy {
    display: none; position: absolute; top: 3%; right: 4%; z-index: 3; width: 18px; height: 18px; padding: 0;
    border-radius: 50%; border: 1px solid #fca5a5; background: rgba(127,29,29,0.9); color: #fff;
    font-size: 0.6rem; line-height: 1; cursor: pointer; align-items: center; justify-content: center; opacity: 0.85;
}
.dcard.own .dcard-destroy { display: flex; }
.dcard-destroy:hover { opacity: 1; background: #dc2626; transform: scale(1.1); }
.dcard-flip {
    display: none; position: absolute; bottom: 4%; right: 4%; z-index: 3; width: 20px; height: 20px; padding: 0;
    border-radius: 50%; border: 1px solid #93c5fd; background: rgba(30,58,138,0.9); color: #fff;
    font-size: 0.6rem; line-height: 1; cursor: pointer; align-items: center; justify-content: center; opacity: 0.85;
}
.dcard.own .dcard-flip { display: flex; }
.dcard-flip:hover { opacity: 1; background: #2563eb; transform: scale(1.1); }
.btn-blue { background: var(--blue); color: #fff; border: 1px solid var(--blue); }
.btn-blue:hover { background: #2563eb; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Splash (joining / login / error) ─────────── */
.splash {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at top, #2a1748 0%, var(--bg-primary) 60%); z-index: 50;
}
.splash-box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 0.75rem;
    padding: 2rem; max-width: 420px; width: 90%; text-align: center;
}
.splash-box h1 { margin: 0 0 0.5rem; font-size: 1.4rem; color: var(--accent); }
.splash-box p { color: var(--text-muted); font-size: 0.9rem; }
.splash-actions { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }

/* ── Layout ───────────────────────────────────── */
.game-container { display: none; height: 100vh; overflow: hidden; }
.game-container.active { display: grid; grid-template-columns: 1fr 320px; }
.table-area { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #3b2354; }

.board-grid { flex: 1; display: grid; gap: 4px; padding: 4px; min-height: 0; position: relative; overflow: hidden; }
.board-grid.players-2 { grid-template: 1fr 1fr / 1fr; }
.board-grid.players-4 { grid-template: 1fr 1fr / 1fr 1fr; }

/* ── Player slot ──────────────────────────────── */
.pslot {
    position: relative; background: #0b060f; border-radius: 0.5rem; overflow: hidden; overflow: clip;
    display: flex; flex-direction: column; min-height: 0; min-width: 0; border: 2px solid transparent;
}
.pslot.is-me { border-color: rgba(168,85,247,0.45); }
.pslot.active-turn { box-shadow: inset 0 0 0 2px var(--yellow); }
.pslot.empty { align-items: center; justify-content: center; color: var(--text-muted); gap: 0.5rem; }
.slot-flash {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 8; pointer-events: none;
    background: rgba(17,12,30,0.92); border: 1px solid var(--accent); color: #fff; border-radius: 0.6rem;
    padding: 0.5rem 1rem; font-size: 1rem; font-weight: 700; white-space: nowrap;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5); animation: ttd-slot-flash 1.6s ease forwards;
}
.slot-flash i { color: var(--accent); margin-right: 0.35rem; }
@keyframes ttd-slot-flash {
    0% { opacity: 0; transform: translate(-50%, -40%); }
    15%, 75% { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, -55%); }
}
.pslot-busy {
    position: absolute; left: 50%; top: 2.2rem; transform: translateX(-50%); z-index: 7; pointer-events: none;
    display: flex; align-items: center; gap: 0.4rem; max-width: 92%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    background: rgba(17,12,30,0.9); border: 1px solid rgba(168,85,247,0.8); color: #f3e8ff; border-radius: 999px;
    padding: 0.25rem 0.8rem; font-size: 0.78rem; font-weight: 600;
    animation: ttd-busy-glow 1.8s ease-in-out infinite;
}
.pslot-busy[hidden] { display: none; }
.pslot-busy.activity { animation: ttd-activity-in 0.25s ease-out; border-color: rgba(168,85,247,0.55); box-shadow: 0 0 8px rgba(168,85,247,0.35); }
@keyframes ttd-activity-in { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translateX(-50%); } }
.pslot-busy > i { color: var(--accent); }
.busy-dots { display: inline-flex; gap: 2px; }
.busy-dots i { width: 4px; height: 4px; border-radius: 50%; background: #d8b4fe; animation: ttd-busy-dot 1.2s infinite ease-in-out; }
.busy-dots i:nth-child(2) { animation-delay: 0.2s; }
.busy-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes ttd-busy-glow {
    0%, 100% { box-shadow: 0 0 6px rgba(168,85,247,0.35); }
    50% { box-shadow: 0 0 16px rgba(168,85,247,0.8); }
}
@keyframes ttd-busy-dot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) { .pslot-busy, .pslot-busy.activity, .busy-dots i { animation: none; } }
.pslot.empty i { font-size: 2rem; }
.pslot-head {
    display: flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.35rem; flex-wrap: nowrap; overflow: hidden;
    background: rgba(0,0,0,0.35); min-height: 1.8rem; position: relative; z-index: 3; flex-shrink: 0;
}
.pslot-head > span:not(.player-name-tag) { min-width: 0; overflow: hidden; white-space: nowrap; flex-shrink: 1; }
.player-name-tag {
    font-weight: 700; font-size: 0.8rem; text-shadow: 0 1px 4px rgba(0,0,0,0.9); flex-shrink: 0; max-width: 45%; overflow: hidden; white-space: nowrap;
    background: rgba(0,0,0,0.5); padding: 0.1rem 0.45rem; border-radius: 0.4rem;
    display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; user-select: none;
}
.player-name-tag .host-badge { font-size: 0.65rem; color: var(--yellow); }
.player-name-tag .deck-name { font-weight: 400; color: var(--text-muted); font-size: 0.72rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-counters { display: flex; gap: 0.25rem; flex-wrap: nowrap; margin-left: auto; flex-shrink: 0; }
.counter-badge {
    background: rgba(0,0,0,0.65); padding: 0.1rem 0.4rem; border-radius: 0.35rem;
    font-size: 0.78rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.25rem;
    will-change: transform; /* stays on its own layer, so the change animation doesn't nudge the text */
}
.counter-badge.life { color: #4ade80; }
.life-float {
    position: fixed; z-index: 280; pointer-events: none; transform: translate(-50%, -20%);
    font-weight: 900; font-size: 1.35rem; text-shadow: 0 2px 6px rgba(0,0,0,0.9);
    animation: lifeFloat 1.3s ease-out forwards;
}
.life-float.up { color: #4ade80; text-shadow: 0 0 10px rgba(74,222,128,0.8), 0 2px 6px rgba(0,0,0,0.9); }
.life-float.down { color: #f87171; text-shadow: 0 0 10px rgba(248,113,113,0.8), 0 2px 6px rgba(0,0,0,0.9); }
@keyframes lifeFloat {
    0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
    15% { opacity: 1; transform: translate(-50%, -60%) scale(1.25); }
    70% { opacity: 1; transform: translate(-50%, -160%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -230%) scale(0.95); }
}
.counter-badge.poison { color: #a78bfa; }
.counter-badge.energy { color: #facc15; }
.counter-badge.experience { color: #38bdf8; }
.counter-badge.rad { color: #f87171; }
.counter-badge.cmdr-dmg { color: #fb923c; }
.counter-badge.custom-counter { color: #94a3b8; }
.counter-badge.hand-count { color: #e5e7eb; }
.game-status-badge {
    background: rgba(0,0,0,0.65); padding: 0.1rem 0.4rem; border-radius: 0.35rem;
    font-size: 0.7rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.25rem;
}
.game-status-badge.day { color: #fbbf24; }
.game-status-badge.night { color: #93c5fd; }
.game-status-badge.citys-blessing { color: #34d399; }
.game-status-badge.monarch { color: #fbbf24; }
.commander-tags { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.commander-tag {
    font-size: 0.7rem; color: #e9d5ff; background: rgba(168,85,247,0.2); border: 1px solid rgba(168,85,247,0.4);
    border-radius: 0.3rem; padding: 0 0.35rem; display: inline-flex; align-items: center; gap: 0.2rem;
}
.cmdr-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255,255,255,0.4); }

.pboard { flex: 1; display: flex; gap: 4px; padding: 4px; min-height: 0; position: relative; }
.piles { display: flex; flex-direction: column; gap: 3px; width: 64px; flex-shrink: 0; overflow-y: auto; overflow-x: hidden; }
.piles .pile { flex-shrink: 0; }
.piles .pile[data-zone="command"] { margin-top: 10px; }
.piles .card-back { width: calc(var(--pch, 44px) * 0.7176); }
.pile-media { margin-top: auto; display: flex; gap: 4px; justify-content: center; padding-top: 4px; flex-shrink: 0; }
.pm-btn {
    width: 26px; height: 26px; border-radius: 50%; border: 1px solid #7f1d1d; background: rgba(127,29,29,0.35); color: #fca5a5;
    display: flex; align-items: center; justify-content: center; font-size: 0.75rem; cursor: pointer; padding: 0;
}
.pm-btn.on { border-color: #166534; background: rgba(22,101,52,0.35); color: #86efac; }
.pm-btn:hover { border-color: var(--accent); }
.pile[data-zone="command"] .pile-label { flex-direction: column; gap: 0; line-height: 1.15; text-align: center; }
.cmd-tax { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 0.55rem; color: var(--text-muted); text-transform: uppercase; }
.cmd-tax b { color: #fbbf24; font-size: 0.7rem; min-width: 12px; text-align: center; }
.cmd-tax button {
    width: 14px; height: 14px; padding: 0; border: 1px solid var(--border); border-radius: 3px; background: var(--bg-card);
    color: var(--text); font-size: 0.65rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cmd-tax button:hover { border-color: var(--accent); }
.piles.compact .pile[data-zone="command"] { flex-wrap: wrap; }
.piles.compact .cmd-tax { flex-basis: 100%; }
/* Short boards (e.g. 4 players): label + count only; click a pile to view it. */
.piles.compact .pile { min-height: 0; padding: 3px 4px; flex-direction: row; justify-content: space-between; align-items: center; }
.piles.compact .pile-label { font-size: 0.5rem; }
.piles.compact .pile-cards, .piles.compact .pile-cmd-cards { display: none; }
.pile {
    background: rgba(255,255,255,0.04); border: 1px dashed #4b5563; border-radius: 0.4rem;
    padding: 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer;
    min-height: 48px; position: relative;
}
.pile:hover { border-color: var(--accent); }
.pile.drop-hover { border-color: var(--accent); background: rgba(168,85,247,0.15); }
.pile-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); display: flex; gap: 0.2rem; align-items: center; }
.pile-count { font-size: 0.65rem; font-weight: 700; color: var(--text); }
.pile-thumb { width: 52px; aspect-ratio: 488 / 680; border-radius: 4.75% / 3.5%; overflow: hidden; }
.pile-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pile-cmd-cards { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.card-back {
    width: 40px; aspect-ratio: 488 / 680; border-radius: 4.75% / 3.5%;
    background: linear-gradient(135deg, #2D1B69 0%, #4C1D95 50%, #2D1B69 100%);
    border: 2px solid #1F1332; position: relative;
}
.card-back::after {
    content: ''; position: absolute; inset: 4px; border: 1px solid #6366F1; border-radius: 4px;
    background: radial-gradient(circle at center, rgba(139,92,246,0.35) 0%, transparent 70%);
}

.battlefield { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 0; }
.bf-row {
    flex: 1; min-height: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
    overflow-x: hidden; overflow-y: hidden; padding: 2px 4px; border-radius: 0.4rem;
    background: rgba(255,255,255,0.025); --ch: 80px;
}
.bf-row.lands { flex: 0.8; }
.pslot.top-row .bf-row.lands { order: -1; }
.bf-row.drop-hover { background: rgba(168,85,247,0.15); outline: 1px dashed var(--accent); }
.bf-empty { color: #4b5563; font-size: 0.75rem; margin: auto; pointer-events: none; }

/* ── Cards (never crop, cover, or distort Scryfall images) ── */
.dcard {
    position: relative; flex-shrink: 0; height: var(--ch); aspect-ratio: 488 / 680;
    border-radius: 4.75% / 3.5%; transition: transform 0.15s; cursor: pointer;
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
    background: #1a1a1a;
}
.dcard img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; pointer-events: none; }
.dcard.tapped { transform: rotate(90deg); margin: 0 calc(var(--ch) * 0.142); }
.dcard.own:hover { box-shadow: 0 0 0 2px var(--accent); }
.dcard.borrowed { box-shadow: 0 0 0 2px #38bdf8; }
.dcard.dragging { opacity: 0.4; }
.bf-row > .dcard.drop-before, .hand-zone > .dcard.drop-before { box-shadow: -5px 0 0 -1px #facc15; }
.bf-row > .dcard.drop-after, .hand-zone > .dcard.drop-after { box-shadow: 5px 0 0 -1px #facc15; }
.drag-count {
    position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 5px;
    background: #facc15; color: #111; font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
}
.dcard.selected, .dcard.own.selected:hover { box-shadow: 0 0 0 3px #facc15, 0 0 10px rgba(250,204,21,0.6); }
/* Attachments sit just before their host; the host overlaps all but a sliver (ATTACH_OVERLAP in JS). */
.bf-row > .dcard { z-index: 1; }
.bf-row > .dcard { width: var(--cw); }
.bf-row > .dcard.tapped { margin: 0 var(--tm, calc(var(--ch) * 0.142)); }
.bf-row > .dcard.attached { z-index: 0; margin-right: calc(-1 * var(--ah, calc(var(--ch) * 0.5))); }
.bf-row > .dcard.attached.tapped { margin: 0 calc(var(--tm, calc(var(--ch) * 0.142)) - var(--ah, calc(var(--ch) * 0.5))) 0 var(--tm, calc(var(--ch) * 0.142)); }
.bf-row > .dcard.attached:hover { z-index: 2; }
.fd-back {
    width: 100%; height: 100%; border-radius: inherit; display: flex; align-items: flex-end; justify-content: center;
    background: linear-gradient(135deg, #2D1B69 0%, #4C1D95 50%, #2D1B69 100%);
    border: 2px solid #1F1332; color: #c4b5fd; font-size: 0.6rem; font-weight: 700; padding-bottom: 6%;
    text-transform: uppercase; letter-spacing: 0.05em; box-shadow: inset 0 0 0 3px rgba(99,102,241,0.6);
}
.dcard.facedown-own img { filter: brightness(0.6) saturate(0.6); }
.dcard-token-tag.fd {
    color: #c4b5fd; border-color: #6366f1; white-space: nowrap; letter-spacing: 0.02em;
    font-size: clamp(0.38rem, calc(var(--ch) * 0.08), 0.65rem);
}
.fd-back { font-size: clamp(0.38rem, calc(var(--ch) * 0.08), 0.65rem); }
.sel-marquee {
    position: fixed; z-index: 9000; pointer-events: none;
    border: 1px dashed #facc15; background: rgba(250,204,21,0.08);
}
body.targeting .dcard[data-zone="battlefield"] { cursor: crosshair; }
body.targeting .dcard[data-zone="battlefield"]:hover { box-shadow: 0 0 0 3px #38bdf8; }
.shortcut-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .shortcut-cols { grid-template-columns: 1fr; } }
.shortcut-list { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.6rem; margin: 0; font-size: 0.85rem; align-items: center; }
.shortcut-list dt { white-space: nowrap; color: var(--text-muted); }
.shortcut-list dd { margin: 0; }
.shortcut-list dt:first-child { color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: 0.75rem; }
kbd {
    display: inline-block; min-width: 1.4em; padding: 0 0.35em; border: 1px solid var(--border); border-bottom-width: 2px;
    border-radius: 0.3rem; background: var(--bg-card); color: var(--text); font: 600 0.75rem/1.5 ui-monospace, monospace; text-align: center;
}
.sb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sb-cols h4 { margin: 0 0 0.4rem; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; }
.sb-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 60vh; }
.sb-grid .zone-cell { cursor: pointer; }
.sb-grid .zone-cell:hover .dcard { outline: 2px solid var(--accent); }
@media (max-width: 640px) { .sb-cols { grid-template-columns: 1fr; } }
#undoBtn:disabled, #redoBtn:disabled { opacity: 0.45; cursor: default; }
.patt-chip {
    display: inline-flex; align-items: center; gap: 0.2rem; margin-left: 0.25rem; padding: 0 0.4rem; border-radius: 0.6rem;
    font-size: 0.65rem; font-weight: 700; line-height: 1.5; cursor: pointer; white-space: nowrap;
    background: rgba(255,255,255,0.06); border: 1px solid #4b5563; color: var(--text);
}
.patt-chip:hover { border-color: var(--accent); }
.patt-chip.initiative { border-color: #f59e0b; color: #fde68a; }
.patt-chip.dungeon { border-color: #6b7280; }
.patt-chip.ring { border-color: #eab308; color: #fef08a; }
.patt-chip.emblem { border-color: #a855f7; }
.dcard.ring-bearer::after {
    content: '💍'; position: absolute; top: 2px; left: 2px; font-size: 0.8rem; line-height: 1; pointer-events: none;
    background: rgba(17,24,39,0.85); border: 1px solid #eab308; border-radius: 50%; padding: 2px;
}
.pick-results img { cursor: pointer; }
body.targeting .dcard.own[data-zone="battlefield"] { cursor: crosshair; }
.pile-cards.shuffling .card-back { animation: ttd-shuffle 0.6s ease-in-out; }
@keyframes ttd-shuffle {
    0%, 100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-6px) rotate(-8deg); }
    40% { transform: translateX(6px) rotate(8deg); }
    60% { transform: translateX(-4px) rotate(-5deg); }
    80% { transform: translateX(3px) rotate(3deg); }
}
#deckBtn.attention { animation: ttd-pulse 1.6s ease-in-out infinite; border-color: var(--accent); }
@keyframes ttd-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0.6); } 50% { box-shadow: 0 0 0 5px rgba(168,85,247,0); } }
.mull-grid .zone-cell { cursor: pointer; }
.mull-grid .dcard.mull-bottom { opacity: 0.45; outline: 3px solid #f59e0b; outline-offset: -3px; }
.mull-tag {
    position: absolute; left: 50%; top: 40%; transform: translateX(-50%); pointer-events: none;
    background: rgba(17,24,39,0.9); color: #fde68a; border: 1px solid #f59e0b; border-radius: 0.3rem;
    font-size: 0.75rem; font-weight: 800; padding: 0.1rem 0.4rem; white-space: nowrap;
}
.mull-footer { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; flex-wrap: wrap; }
.mull-free { display: flex; gap: 0.35rem; align-items: center; font-size: 0.8rem; color: var(--text-muted); cursor: pointer; }
/* Lower-left stack (+1/+1 at the bottom), kept above the artist/copyright line per Scryfall's image guidelines. */
.dcard-overlay {
    position: absolute; left: 4%; bottom: 12%;
    display: flex; flex-direction: column; gap: 2px; align-items: flex-start; pointer-events: none;
}
.dcard-chip {
    background: rgba(15,10,30,0.88); border: 1px solid #fbbf24; color: #fff; border-radius: 0.3rem;
    padding: 0 0.35rem; font-size: 0.85rem; font-weight: 800; white-space: nowrap; line-height: 1.25;
    display: inline-flex; align-items: center; gap: 0.25rem;
}
.dcard-chip .chip-label { font-size: 0.7em; font-weight: 700; }
.dcard-chip .chip-count { color: #ffd166; }
.dcard-chip.p1p1 .chip-label, .dcard-chip.neg .chip-label { font-size: 1em; font-weight: 800; }
.dcard-chip.p1p1 { border-color: #a855f7; }
.dcard-chip.neg { border-color: #ef4444; }
.dcard-chip.loyalty { border-color: #38bdf8; }
.dcard-chip.shield { border-color: #93c5fd; }
.dcard-chip.stun { border-color: #fbbf24; }
.dcard-chip.charge { border-color: #facc15; }
.dcard-chip.poison { border-color: #a78bfa; }
.dcard-chip.custom, .dcard-chip.generic { border-color: #94a3b8; }
/* +/- buttons appear when hovering a chip on your own card. */
.dcard.own .dcard-chip { pointer-events: auto; cursor: default; }
.dcard-chip .chip-btn {
    display: none; width: 1.05rem; height: 1.05rem; padding: 0; border-radius: 0.25rem; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.12); color: #fff;
    font-size: 0.8rem; font-weight: 800; line-height: 1; align-items: center; justify-content: center;
}
.dcard-chip .chip-btn:hover { background: rgba(168,85,247,0.55); border-color: var(--accent); }
.dcard-chip .chip-btn.clear { color: #fca5a5; }
.dcard-chip:hover .chip-btn, .dcard-chip.hold .chip-btn { display: inline-flex; }
.dcard-chip:hover, .dcard-chip.hold { z-index: 5; position: relative; }
@media (hover: none) { .dcard.own .dcard-chip .chip-btn { display: inline-flex; } .dcard-chip .chip-btn.clear { display: none !important; } }
/* Coloured dot markers, straddling the top edge of the card so they sit above the name. */
.dcard-dots {
    position: absolute; top: 0; left: 50%; transform: translate(-50%, -30%); z-index: 3;
    display: flex; gap: 3px; pointer-events: none;
}
.dcard-dot {
    width: 0.7rem; height: 0.7rem; border-radius: 50%; flex: none;
    border: 2px solid rgba(255,255,255,0.9); box-shadow: 0 1px 4px rgba(0,0,0,0.75);
}
.dcard-owner {
    position: absolute; top: -2px; right: -2px; background: #0369a1; color: #fff; border-radius: 0.25rem;
    font-size: 0.55rem; padding: 0 0.2rem; pointer-events: none; max-width: 90%; overflow: hidden; white-space: nowrap;
}
.token-face {
    width: 100%; height: 100%; border-radius: inherit; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; padding: 4px; overflow: hidden;
    border: 2px solid rgba(255,255,255,0.35); color: #111; font-weight: 700; font-size: 0.98rem; line-height: 1.1;
    overflow-wrap: anywhere;
}
.token-face .tk-pt { font-size: 1.28rem; margin-top: 2px; }
.token-face .tk-label { font-size: 0.75rem; text-transform: uppercase; opacity: 0.75; }
/* Sits over the art box so it never covers the artist / copyright line. */
.dcard-token-tag {
    position: absolute; left: 50%; top: 14%; transform: translateX(-50%); pointer-events: none;
    background: rgba(17,24,39,0.85); color: #fde68a; border: 1px solid #f59e0b; border-radius: 0.3rem;
    font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 0.3rem;
}

/* Disconnected overlay */
.pslot-disconnected {
    position: absolute; inset: 0; background: rgba(0,0,0,0.6); z-index: 6; display: flex;
    flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; text-align: center;
    color: var(--text-muted); font-size: 0.9rem;
}
.pslot-disconnected i { font-size: 1.6rem; color: var(--yellow); }

/* ── Hand dock ────────────────────────────────── */
.hand-dock {
    flex-shrink: 0; height: 176px; display: flex; gap: 6px; padding: 6px; background: #1a1030;
    border-top: 1px solid #4c1d95;
}
.hand-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 300px; flex-shrink: 0; align-content: start; }
/* Untap & Draw sits alone on the first row, above Untap. */
.hand-actions-first { grid-column: 1; }
.hand-actions-first + .btn { grid-column: 1; }
.hand-actions .btn { padding: 0.3rem 0.4rem; font-size: 0.72rem; justify-content: center; }
.hand-zone {
    flex: 1; display: flex; gap: 6px; align-items: center; overflow-x: auto; overflow-y: hidden;
    padding: 2px 4px; border-radius: 0.4rem; background: rgba(255,255,255,0.03); --ch: 132px; min-width: 0;
}
.hand-zone.drop-hover { background: rgba(168,85,247,0.15); outline: 1px dashed var(--accent); }
.hand-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.hand-pop-btn { flex-shrink: 0; width: 24px; background: rgba(255,255,255,0.05); border: 1px solid #4c1d95; border-radius: 0.35rem; color: var(--text-muted); cursor: pointer; font-size: 0.7rem; }
.hand-pop-btn:hover { color: #fff; background: rgba(168,85,247,0.25); }
.hand-popped-note { display: none; flex: 1; align-items: center; justify-content: center; gap: 0.6rem; font-size: 0.8rem; color: var(--text-muted); }
.hand-dock.popped .hand-popped-note { display: flex; }
.hand-dock.popped .hand-pop-btn { display: none; }
.hand-window {
    position: fixed; z-index: 130; display: flex; flex-direction: column; overflow: hidden;
    min-width: 320px; min-height: 220px; background: #1a1030; border: 1px solid #6d28d9; border-radius: 0.6rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.hand-window-head {
    flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0.6rem;
    background: #2e1065; font-size: 0.8rem; font-weight: 700; cursor: move; user-select: none; touch-action: none;
}
.hand-window-head button { background: none; border: 1px solid #6d28d9; color: #ddd; border-radius: 0.35rem; font-size: 0.72rem; padding: 0.15rem 0.5rem; cursor: pointer; }
.hand-window-head button:hover { background: rgba(168,85,247,0.25); }
.hand-zoom { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: auto; font-variant-numeric: tabular-nums; }
.hand-zoom button { width: 24px; padding: 0.1rem 0; font-size: 0.85rem; line-height: 1; }
.hand-zoom span { min-width: 3em; text-align: center; font-size: 0.72rem; color: #ddd; }
.hand-window-body { flex: 1; min-height: 0; display: flex; padding: 6px; }
/* Two times the docked card size (--ch 132px). */
.hand-window .hand-zone { --ch: 264px; flex-wrap: wrap; align-content: flex-start; overflow: auto; height: 100%; }
.hand-window[hidden] { display: none; }

/* ── Sidebar ──────────────────────────────────── */
.game-sidebar { background: var(--bg-secondary); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.sidebar-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-tab {
    flex: 1; padding: 0.6rem 0.3rem; background: none; border: none; color: var(--text-muted);
    font-size: 0.8rem; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
}
.sidebar-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.sidebar-panel { display: none; flex: 1; overflow-y: auto; padding: 0.75rem; min-height: 0; }
.sidebar-panel.active { display: flex; flex-direction: column; }
.sidebar-panel h4 { font-size: 0.85rem; color: var(--text-muted); margin: 0.6rem 0 0.4rem; }
.attribution { flex-shrink: 0; font-size: 0.62rem; line-height: 1.35; color: #6b7280; padding: 0.4rem 0.6rem; border-top: 1px solid var(--border); }
.attribution a { color: #9ca3af; }
#countersPanel:not(.active) ~ .attribution { display: none; }
/* Sidebar ads (non-supporters only). Negative side margins give the 300px unit room inside the padded panel. */
.ttd-ad { flex-shrink: 0; margin: 0.75rem -0.75rem 0; padding-top: 0.5rem; border-top: 1px solid var(--border); text-align: center; }
.ttd-ad[hidden] { display: none; }
.ttd-ad-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; color: #6b7280; margin-bottom: 4px; }
.ttd-ad-slot { min-height: 250px; display: flex; justify-content: center; }
.ttd-ad.preview .ttd-ad-slot::before {
    content: 'Ad space (300\00d7 250) \2014 ads don\2019t load on localhost'; width: 300px; height: 250px; box-sizing: border-box;
    border: 1px dashed #4b5563; border-radius: 0.4rem; display: flex; align-items: center; justify-content: center;
    padding: 1rem; color: #6b7280; font-size: 0.75rem;
}
#controlsPanel .ttd-ad, #toolsPanel .ttd-ad { margin-top: auto; padding-top: 0.75rem; }
body.ads-on .chat-box { flex: 1 1 0; min-height: 220px; }
body.ads-on #cardSearchPreviewImg { max-width: 150px; }

.my-counters { display: flex; flex-direction: column; gap: 0.6rem; }
.counter-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border-radius: 0.5rem; padding: 0.4rem 0.6rem; }
.counter-label { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; }
.counter-controls { display: flex; align-items: center; gap: 0.3rem; }
.counter-controls button {
    background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text);
    border-radius: 0.3rem; min-width: 1.8rem; height: 1.8rem; cursor: pointer; font-weight: 700; font-size: 0.8rem;
}
.counter-controls button:hover { border-color: var(--accent); color: var(--accent); }
.counter-value { min-width: 2.2rem; text-align: center; font-size: 1.25rem; font-weight: 800; will-change: transform; }
.counter-pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.counter-row.compact { flex-direction: column; align-items: stretch; gap: 0.25rem; padding: 0.35rem; }
.counter-row.compact .counter-label { font-size: 0.75rem; justify-content: center; }
.counter-row.compact .counter-controls { justify-content: center; gap: 0.15rem; }
.counter-row.compact .counter-controls button { min-width: 1.5rem; height: 1.5rem; }
.counter-row.compact .counter-value { font-size: 1rem; min-width: 1.6rem; }
.custom-counter-add { display: flex; gap: 0.3rem; margin-top: 0.3rem; }
.custom-counter-add input, .sidebar-input {
    flex: 1; padding: 0.35rem 0.5rem; border-radius: 0.4rem; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-size: 0.8rem; min-width: 0;
}

.emoji-picker-bar { display: flex; flex-wrap: wrap; gap: 0.15rem; justify-content: center; }
.emoji-picker-bar button {
    background: none; border: 1px solid transparent; border-radius: 0.35rem; font-size: 1.15rem;
    cursor: pointer; padding: 0.1rem 0.2rem; transition: transform 0.1s;
}
.emoji-picker-bar button:hover { transform: scale(1.2); border-color: var(--border); }
.emoji-picker-bar button.locked, .draw-tool-btn.locked { opacity: 0.35; filter: grayscale(1); cursor: not-allowed; }

/* Invite modal */
.invite-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.3rem; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0.5rem; border-radius: 0.4rem; background: var(--bg-card); border: 1px solid var(--border); }
.invite-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-sent { color: #4ade80; font-size: 0.8rem; font-weight: 600; }

/* Turn clock */
.seat-clock { display: none; }
.seat-clock:not(:empty) {
    display: inline-flex; align-items: center; gap: 0.3rem; flex-shrink: 0; font-weight: 700; font-size: 0.78rem;
    padding: 0.1rem 0.45rem; border-radius: 0.4rem; background: rgba(0,0,0,0.5); font-variant-numeric: tabular-nums;
}
.seat-clock.running { background: rgba(59,130,246,0.35); box-shadow: inset 0 0 0 1px #60a5fa; }
.seat-clock.low { color: #fbbf24; }
.seat-clock.out { color: #f87171; animation: clockPulse 1s ease-in-out infinite; }
@keyframes clockPulse { 50% { opacity: 0.45; } }
.clock-pass { margin-left: 0.15rem; background: var(--accent); color: #fff; border: none; border-radius: 0.3rem; font-size: 0.7rem; font-weight: 700; padding: 0.05rem 0.4rem; cursor: pointer; }
.clock-setup { display: flex; flex-direction: column; gap: 0.4rem; }
.clock-setup select, .clock-setup input { width: 100%; }
.clock-fields { display: flex; gap: 0.4rem; }
.clock-fields label { flex: 1; font-size: 0.72rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 0.15rem; }

.chat-box { margin-top: 0.75rem; border-top: 1px solid var(--border); background: #1e2433; border-radius: 0.5rem; padding: 0.6rem; flex: 1; display: flex; flex-direction: column; min-height: 180px; }

/* Spectators: public table view only */
[data-spectator-only] { display: none; }
body.spectating [data-spectator-only] { display: block; }
body.spectating .sidebar-tabs, body.spectating .my-counters, body.spectating .chat-input-row, body.spectating .hand-dock,
body.spectating .cast-zone, body.spectating #toolsPanel .ttd-ad, body.spectating #controlsPanel .ttd-ad, body.spectating #stackOverlay { display: none !important; }
body.spectating .player-name-tag { cursor: default; }
.spectator-panel { background: rgba(139,92,246,0.15); border: 1px solid rgba(139,92,246,0.4); border-radius: 0.5rem; padding: 0.7rem 0.85rem; font-size: 0.8rem; }
.spectator-sound { margin-top: 0.6rem; }
.spectator-panel > * + * { margin-top: 0.45rem; }
.spectator-title { font-size: 1.05rem; font-weight: 700; color: #a78bfa; }
.spectator-info { background: var(--bg-secondary); border-radius: 0.4rem; padding: 0.45rem 0.6rem; }
.chat-subtabs { display: flex; gap: 0.25rem; margin-bottom: 0.4rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-subtab { background: none; border: none; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.5rem; cursor: pointer; border-bottom: 2px solid transparent; }
.chat-subtab.active { color: var(--accent); border-bottom-color: var(--accent); }
.chat-subpanel { display: none; flex: 1; flex-direction: column; min-height: 0; }
.chat-subpanel.active { display: flex; }
.chat-messages { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 0.25rem; padding-bottom: 0.3rem; }
.chat-msg { font-size: 0.8rem; line-height: 1.35; word-wrap: break-word; }
.chat-msg .chat-user { font-weight: 700; color: var(--accent); }
.chat-msg .chat-system { color: var(--yellow); font-style: italic; }
.chat-msg .chat-ts { color: var(--text-muted); font-size: 0.68rem; margin-right: 0.3rem; }
.chat-input-row { display: flex; gap: 0.3rem; flex-shrink: 0; }
.log-export-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 0.3rem; font-size: 0.7rem; padding: 0.15rem 0.4rem; cursor: pointer; }

.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.dice-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border); border-radius: 0.4rem; padding: 0.25rem 0.35rem; }
.dice-roll-btn { background: none; border: none; color: var(--text); cursor: pointer; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; gap: 0.3rem; }
.dice-roll-btn:hover { color: var(--accent); }
.dice-roll-btn img { width: 20px; height: 20px; opacity: 0.85; }
.dice-qty { display: flex; align-items: center; gap: 0.15rem; }
.dice-qty-btn { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-muted); width: 1.2rem; height: 1.2rem; border-radius: 0.25rem; font-size: 0.55rem; cursor: pointer; padding: 0; }
.dice-qty-val { min-width: 1rem; text-align: center; font-size: 0.8rem; font-weight: 700; }
.draw-tool-row { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.draw-tool-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); border-radius: 0.35rem; padding: 0.25rem 0.45rem; font-size: 0.72rem; cursor: pointer; }
.draw-tool-btn:hover { border-color: var(--accent); color: var(--accent); }
.draw-tool-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(168,85,247,0.15); }
.color-swatch { width: 1.3rem; height: 1.3rem; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.tool-wide-btn {
    flex: 1; padding: 0.4rem; border-radius: 0.4rem; border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text); font-size: 0.8rem; cursor: pointer; font-weight: 600;
}
.tool-wide-btn:hover, .tool-wide-btn.active { border-color: var(--accent); color: var(--accent); }
.info-box { background: var(--bg-card); border-radius: 0.5rem; padding: 0.6rem 0.75rem; font-size: 0.82rem; }
.player-list-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.4rem; border-radius: 0.4rem; background: var(--bg-card); margin-bottom: 0.3rem; font-size: 0.82rem; }
.player-list-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.player-list-item .dot.off { background: var(--yellow); }
.player-list-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-search-item { padding: 0.35rem 0.6rem; cursor: pointer; font-size: 0.8rem; border-bottom: 1px solid var(--border); }
.card-search-item:hover { background: rgba(168,85,247,0.15); }

/* ── Drawing / emoji / overlays ───────────────── */
.draw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 7; }
.draw-canvas.active { pointer-events: auto; cursor: crosshair; touch-action: none; }
.draw-canvas.text-mode { cursor: text; }
.emoji-float { position: absolute; bottom: 10%; font-size: 2.4rem; pointer-events: none; z-index: 9; animation: emojiFloat 4s ease-out forwards, emojiWiggle 0.7s ease-in-out infinite alternate; }
/* Uses the separate `translate` property so the sway combines with the rise's transform. */
@keyframes emojiWiggle { from { translate: -14px 0; } to { translate: 14px 0; } }
@keyframes emojiFloat { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 8% { opacity: 1; transform: translateY(-10px) scale(1.15); } 80% { opacity: 1; } 100% { transform: translateY(calc(-1 * var(--rise, 160px))) scale(1); opacity: 0; } }

.dice-anim-overlay { position: absolute; inset: 0; z-index: 30; pointer-events: none; display: none; }
.dice-anim-overlay.active { display: block; }
.dice-anim-overlay canvas { width: 100% !important; height: 100% !important; }
.dice-anim-label { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity 0.3s; text-shadow: 0 2px 8px #000; }
.dice-anim-label.visible { opacity: 1; }
.dice-anim-label .anim-who { font-size: 0.95rem; color: var(--text-muted); }
.dice-anim-label .anim-result { font-family: 'Cinzel', serif; font-size: 2.2rem; font-weight: 700; color: #fff; }

/* Cast drop zone: shown only while dragging a card that isn't on the battlefield. */
.cast-zone {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.9);
    width: 190px; height: 190px; border-radius: 50%; z-index: 15; display: none;
    align-items: center; justify-content: center;
    background: radial-gradient(circle, rgba(168,85,247,0.35) 0%, rgba(126,34,206,0.25) 55%, rgba(76,29,149,0.15) 100%);
    border: 3px dashed rgba(216,180,254,0.85); box-shadow: 0 0 30px rgba(168,85,247,0.55);
    transition: transform 0.15s, background 0.15s;
}
.cast-zone.visible { display: flex; animation: castPulse 1.6s ease-in-out infinite; }
.cast-zone.drop-hover { transform: translate(-50%, -50%) scale(1.08); background: radial-gradient(circle, rgba(192,132,252,0.6) 0%, rgba(147,51,234,0.4) 60%, rgba(88,28,135,0.25) 100%); }
.cast-ring { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; color: #f5f3ff; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; pointer-events: none; text-shadow: 0 2px 8px rgba(0,0,0,0.8); }
.cast-ring i { font-size: 2.4rem; }
.cast-icon { width: 2.6rem; height: 2.6rem; object-fit: contain; display: block; pointer-events: none; }
/* Second, smaller zone beside Play for cards that enter the battlefield tapped. */
.cast-zone.tapped {
    left: calc(50% + 170px); width: 140px; height: 140px;
    background: radial-gradient(circle, rgba(245,158,11,0.32) 0%, rgba(180,83,9,0.22) 55%, rgba(120,53,15,0.12) 100%);
    border-color: rgba(253,230,138,0.85); box-shadow: 0 0 26px rgba(245,158,11,0.45); animation-name: castPulseTapped;
}
.cast-zone.tapped.drop-hover { background: radial-gradient(circle, rgba(251,191,36,0.6) 0%, rgba(217,119,6,0.4) 60%, rgba(120,53,15,0.25) 100%); }
.cast-zone.tapped .cast-ring { font-size: 0.8rem; text-align: center; }
.cast-zone.tapped .cast-ring i { font-size: 1.8rem; transform: rotate(90deg); }
@keyframes castPulseTapped { 0%, 100% { box-shadow: 0 0 18px rgba(245,158,11,0.4); } 50% { box-shadow: 0 0 36px rgba(251,191,36,0.8); } }
@media (max-width: 600px) {
    .cast-zone.tapped { left: 50%; top: calc(50% + 165px); }
}
@keyframes castPulse { 0%, 100% { box-shadow: 0 0 22px rgba(168,85,247,0.45); } 50% { box-shadow: 0 0 42px rgba(192,132,252,0.85); } }

.shared-card-overlay { position: absolute; inset: 0; z-index: 25; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.55); cursor: pointer; overflow: hidden; }
/* Played or shown cards: keep the board visible and clickable around the card. */
.shared-card-overlay.no-dim { background: transparent; pointer-events: none; }
.shared-card-overlay.no-dim > * { pointer-events: auto; }
.shared-card-overlay img {
    height: min(415px, 75%); width: auto; border-radius: 4.75% / 3.5%; cursor: zoom-in; transition: transform 0.08s ease-out; user-select: none; touch-action: none;
    background: #2e1065;
    box-shadow: 0 0 14px 2px rgba(168,85,247,0.4), 0 12px 40px rgba(0,0,0,0.7);
    animation: sharedCardGlow 2.6s ease-in-out infinite;
}
@keyframes sharedCardGlow {
    0%, 100% { box-shadow: 0 0 12px 1px rgba(168,85,247,0.35), 0 12px 40px rgba(0,0,0,0.7); }
    50% { box-shadow: 0 0 20px 4px rgba(168,85,247,0.5), 0 12px 40px rgba(0,0,0,0.7); }
}
.shared-card-overlay img { aspect-ratio: 488 / 680; }

/* Card movement effects (graveyard / exile / draw) */
.fx-ghost { position: fixed !important; z-index: 240; pointer-events: none; margin: 0 !important; aspect-ratio: auto !important; box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.fx-ghost .dcard-destroy, .fx-ghost .dcard-flip { display: none !important; }
.fx-ash {
    position: fixed; z-index: 241; pointer-events: none; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%;
    background: #9ca3af; box-shadow: 0 0 4px rgba(156,163,175,0.8);
}
.fx-streak {
    position: fixed; z-index: 241; pointer-events: none; width: 34px; height: 2px; margin-top: -1px; border-radius: 2px;
    transform-origin: 0 50%;
    background: linear-gradient(90deg, rgba(255,255,255,0), #e0f2fe 60%, #fff);
    box-shadow: 0 0 8px 2px rgba(125,211,252,0.85);
}
.fx-cardback { position: fixed !important; left: 0; top: 0; z-index: 242; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,0.55), 0 0 10px rgba(168,85,247,0.5); }
.fx-swish {
    position: fixed; z-index: 239; pointer-events: none; border-radius: 50%;
    border: 3px solid transparent; border-top-color: rgba(233,213,255,0.95);
    filter: drop-shadow(0 0 6px rgba(192,132,252,0.9));
}
.fx-shimmer {
    position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit; overflow: hidden;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.55) 48%, rgba(216,180,254,0.45) 52%, transparent 70%);
    background-size: 250% 100%; animation: fxShimmer 0.75s ease-out forwards; mix-blend-mode: screen;
}
@keyframes fxShimmer { from { background-position: 120% 0; opacity: 1; } to { background-position: -30% 0; opacity: 0.2; } }
.fx-sparkle {
    position: fixed; z-index: 241; pointer-events: none; width: 7px; height: 7px; border-radius: 50%;
    background: #fef3c7; box-shadow: 0 0 8px 3px rgba(250,204,21,0.8);
}
.fx-tether {
    position: fixed; z-index: 240; pointer-events: none; height: 4px; margin-top: -2px; border-radius: 2px;
    transform-origin: 0 50%;
    background: linear-gradient(90deg, rgba(254,243,199,0.4), #fef3c7 50%, rgba(250,204,21,0.9));
    box-shadow: 0 0 10px 3px rgba(250,204,21,0.7);
}
.fx-confetti { position: fixed; z-index: 245; pointer-events: none; width: 8px; height: 12px; margin: -6px 0 0 -4px; border-radius: 2px; }
.fx-dust { position: fixed; z-index: 245; pointer-events: none; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, rgba(156,163,175,0.75), rgba(156,163,175,0) 70%); }
.fx-stack-fly {
    position: fixed; z-index: 242; pointer-events: none; border-radius: 4.75% / 3.5%; object-fit: cover;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
    background: linear-gradient(135deg, #3b1d5e, #1e1033); box-shadow: 0 6px 18px rgba(0,0,0,0.55), 0 0 14px rgba(168,85,247,0.75);
}
.fx-stack-ghost { position: fixed !important; z-index: 240; pointer-events: none; margin: 0 !important; background: var(--bg-card); }
.fx-smoke { position: fixed; z-index: 241; pointer-events: none; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, rgba(209,213,219,0.7), rgba(156,163,175,0) 70%); filter: blur(2px); }

/* Magic travelling from the source card to the centre viewer */
.magic-orb {
    position: fixed; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
    z-index: 270; pointer-events: none;
    background: radial-gradient(circle, #fff 0%, #e9d5ff 30%, rgba(192,132,252,0.9) 55%, rgba(168,85,247,0) 75%);
    box-shadow: 0 0 18px 8px rgba(192,132,252,0.75), 0 0 40px 14px rgba(168,85,247,0.45);
}
.magic-spark {
    position: fixed; z-index: 269; pointer-events: none; transform: translate(-50%, -50%);
    color: #f5d0fe; font-size: 0.85rem; text-shadow: 0 0 6px #c084fc, 0 0 12px #a855f7;
    animation: magicSpark 0.65s ease-out forwards;
}
@keyframes magicSpark {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 20px))) scale(0.3) rotate(90deg); }
}
.magic-burst {
    position: fixed; z-index: 268; pointer-events: none; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
    border: 2px solid rgba(233,213,255,0.9); box-shadow: 0 0 24px 6px rgba(192,132,252,0.7), inset 0 0 18px rgba(192,132,252,0.6);
    animation: magicBurst 0.55s ease-out forwards;
}
@keyframes magicBurst {
    from { opacity: 1; transform: scale(0.3); }
    to { opacity: 0; transform: scale(5); }
}
.shared-card-overlay.zoomed img { cursor: grab; position: relative; z-index: 1; }
.shared-card-overlay.zoomed img:active { cursor: grabbing; }
.shared-card-zoom {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 4px;
    background: rgba(17,12,30,0.9); border: 1px solid var(--border); border-radius: 0.5rem; padding: 3px 6px; cursor: default;
}
.shared-card-zoom button {
    width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 0.35rem; background: var(--bg-card); color: var(--text);
    font-size: 0.95rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.shared-card-zoom button:hover { border-color: var(--accent); }
.shared-card-zoom span { min-width: 44px; text-align: center; font-size: 0.75rem; font-weight: 700; }
.shared-card-who { margin-top: 0.6rem; font-weight: 700; text-shadow: 0 2px 6px #000; }
.shared-card-buy { display: flex; gap: 6px; margin-top: 0.4rem; min-height: 32px; cursor: default; }
.shared-card-buy a {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; text-decoration: none;
    background: rgba(45,45,58,0.9); transition: transform 0.15s, box-shadow 0.15s;
}
.shared-card-buy a:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(168,85,247,0.4); }
.shared-card-overlay .shared-card-buy img {
    width: 24px; height: auto; aspect-ratio: auto; border-radius: 0; background: none; box-shadow: none; animation: none; cursor: pointer;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.shared-card-buy span { font-size: 11px; font-weight: 800; color: #fff; }

.stack-overlay { position: fixed; z-index: 145; width: 280px; max-height: 70vh; display: flex; }
.stack-overlay.drop-hover .stack-panel { border-color: #facc15; box-shadow: 0 0 0 2px #facc15, 0 8px 24px rgba(0,0,0,0.6); }
.stack-panel-header { cursor: move; user-select: none; touch-action: none; }
.stack-panel-header .fa-grip-vertical { color: var(--text-muted); font-size: 0.75rem; }
.stack-item-thumb { width: 34px; aspect-ratio: 488 / 680; border-radius: 4.75% / 3.5%; flex-shrink: 0; object-fit: contain; }
.stack-panel { background: rgba(17,24,39,0.96); border: 1px solid var(--accent); border-radius: 0.6rem; display: flex; flex-direction: column; width: 100%; min-height: 0; }
.stack-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); }
.stack-panel-header h3 { margin: 0; font-size: 0.9rem; }
.stack-panel-body { flex: 1; overflow-y: auto; padding: 0.5rem; min-height: 0; }
.stack-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.45rem; border: 1px solid var(--border); border-radius: 0.4rem; margin-bottom: 0.3rem; font-size: 0.8rem; }
.stack-item:first-child { border-color: var(--accent); }
.stack-item-info { flex: 1; min-width: 0; }
.stack-item-owner { color: var(--text-muted); font-size: 0.7rem; }
.stack-item-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 0.3rem; cursor: pointer; padding: 0.1rem 0.35rem; }
.stack-item-btn.resolve { color: #22c55e; }
.stack-item-btn.fizzle { color: #ef4444; }
.stack-panel-footer { display: flex; gap: 0.3rem; padding: 0.5rem; border-top: 1px solid var(--border); }

.phase-bar { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 8; background: rgba(0,0,0,0.75); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.3rem; display: flex; flex-direction: column; gap: 2px; }
.phase-step { font-size: 0.65rem; padding: 0.15rem 0.4rem; border-radius: 0.25rem; color: var(--text-muted); text-align: center; }
.phase-step.current { background: var(--accent); color: #fff; font-weight: 700; }
.phase-step.clickable { cursor: pointer; }
.phase-step.clickable:hover { color: #fff; }
.phase-pass-btn { margin-top: 3px; font-size: 0.65rem; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); border-radius: 0.25rem; cursor: pointer; padding: 0.15rem; }

/* ── Webcam boxes (draggable / resizable) ─────── */
.cam-box {
    position: absolute; z-index: 10; width: 22%; min-width: 120px; min-height: 80px; aspect-ratio: 4 / 3;
    background: #000; border: 2px solid var(--accent); border-radius: 0.5rem; overflow: hidden;
    display: none; box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}
/* Resize grips in every corner of the floating windows. */
.corner-grip { position: absolute; width: 14px; height: 14px; z-index: 5; touch-action: none; }
.corner-grip.nw { top: 0; left: 0; cursor: nwse-resize; }
.corner-grip.se { bottom: 0; right: 0; cursor: nwse-resize; }
.corner-grip.ne { top: 0; right: 0; cursor: nesw-resize; }
.corner-grip.sw { bottom: 0; left: 0; cursor: nesw-resize; }
.corner-grip.se::after {
    content: ''; position: absolute; right: 3px; bottom: 3px; width: 7px; height: 7px;
    border-right: 2px solid rgba(255,255,255,0.55); border-bottom: 2px solid rgba(255,255,255,0.55); pointer-events: none;
}
.cam-box.collapsed .corner-grip { display: none; }
.cam-box.visible { display: block; }
#camLayer { position: fixed; inset: 0; pointer-events: none; z-index: 140; }
#camLayer .cam-box { pointer-events: auto; }
.cam-box video { width: 100%; height: calc(100% - 18px); object-fit: cover; display: block; background: #000; }
.cam-handle { height: 18px; background: rgba(168,85,247,0.85); font-size: 0.65rem; font-weight: 700; padding: 0 0.4rem; cursor: move; display: flex; align-items: center; gap: 0.3rem; touch-action: none; user-select: none; }
.cam-hide { margin-left: auto; background: none; border: none; color: #fff; cursor: pointer; font-size: 0.7rem; padding: 0 0.15rem; opacity: 0.85; }
.cam-hide:hover { opacity: 1; }
.cam-box.collapsed { height: 22px !important; min-height: 0; aspect-ratio: auto; }
.cam-box.collapsed video { display: none; }
.cam-view-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 0.3rem; cursor: pointer; font-size: 0.75rem; padding: 0.15rem 0.35rem; }
.cam-view-btn:hover { color: var(--accent); border-color: var(--accent); }
.bf-row.scroll { overflow-y: auto; overflow-x: auto; }
.bf-row { flex-wrap: wrap; align-content: center; row-gap: 4px; }
.bf-break { flex-basis: 100%; height: 0; }

/* ── Menus / modals / popups ──────────────────── */
.ctx-menu {
    position: fixed; z-index: 300; background: var(--bg-card); border: 1px solid var(--border); border-radius: 0.45rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6); min-width: 190px; padding: 0.25rem 0; font-size: 0.8rem; max-height: 80vh; overflow-y: auto;
}
.ctx-title { padding: 0.35rem 0.75rem; font-weight: 700; color: var(--accent); border-bottom: 1px solid var(--border); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item { padding: 0.38rem 0.75rem; cursor: pointer; display: flex; align-items: center; gap: 0.45rem; color: var(--text); background: none; border: none; width: 100%; text-align: left; font-size: 0.8rem; }
.ctx-item:hover { background: rgba(168,85,247,0.15); }
.ctx-item i { width: 1rem; text-align: center; color: var(--text-muted); }
.ctx-sep { height: 1px; background: var(--border); margin: 0.2rem 0; }
.ctx-item .ctx-sub-arrow { margin-left: auto; font-size: 0.7rem; }
.ctx-item.ctx-has-sub.open { background: rgba(168,85,247,0.15); }
.ctx-flyout { z-index: 301; }
.ctx-back { color: var(--text-muted); }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: none; align-items: center; justify-content: center; z-index: 200; padding: 1rem; }
.modal-bg.active { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 0.75rem; width: 100%; max-width: 520px; padding: 1.25rem; position: relative; max-height: 90vh; overflow-y: auto; }
.modal.wide { max-width: 980px; }
.modal h2 { margin: 0 0 1rem; font-size: 1.15rem; color: var(--accent); }
.modal-close { position: absolute; top: 0.9rem; right: 0.9rem; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 0.45rem 0.65rem; border-radius: 0.45rem; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text); font-size: 0.88rem; margin-bottom: 0.75rem; }
.modal textarea { resize: vertical; font-family: inherit; line-height: 1.35; }
.modal label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.modal-tabs { display: flex; gap: 0.3rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.modal-tab { background: none; border: none; color: var(--text-muted); padding: 0.4rem 0.7rem; cursor: pointer; font-weight: 600; font-size: 0.82rem; border-bottom: 2px solid transparent; }
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.deck-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 50vh; overflow-y: auto; }
.deck-option { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.7rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 0.45rem; cursor: pointer; font-size: 0.85rem; text-align: left; color: var(--text); width: 100%; }
.deck-option:hover { border-color: var(--accent); }
.deck-option .fmt { font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize; }
.muted { color: var(--text-muted); font-size: 0.82rem; }

.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; max-height: 65vh; overflow-y: auto; padding: 0.25rem; }
.zone-grid .dcard { height: auto; width: 100%; }
.zone-grid .zone-cell { display: flex; flex-direction: column; gap: 0.25rem; position: relative; }
.zone-grid .dcard.stacked { box-shadow: 4px 4px 0 #3b2a63, 8px 8px 0 #251a40; margin: 0 8px 8px 0; width: calc(100% - 8px); }
.stack-count {
    position: absolute; top: -6px; right: -2px; background: var(--accent); color: #fff; font-weight: 800;
    font-size: 0.8rem; border-radius: 0.75rem; padding: 0.05rem 0.45rem; box-shadow: 0 2px 6px rgba(0,0,0,0.6); pointer-events: none;
}
.zone-cell-actions { display: flex; flex-wrap: wrap; gap: 0.2rem; justify-content: center; }
.zone-cell-actions button { font-size: 0.65rem; padding: 0.15rem 0.35rem; border-radius: 0.25rem; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text); cursor: pointer; }
.zone-cell-actions button:hover { border-color: var(--accent); color: var(--accent); }
.token-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.35rem; margin-bottom: 0.75rem; }
.token-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.4rem; margin-bottom: 0.75rem; }
.token-results img { width: 100%; border-radius: 4.75% / 3.5%; cursor: pointer; border: 2px solid transparent; display: block; }
.token-results img.selected { border-color: var(--accent); }
.form-row { display: flex; gap: 0.6rem; }
.form-row > * { flex: 1; min-width: 0; }

.card-hover-preview { position: fixed; z-index: 250; pointer-events: none; display: none; width: 312px; }
.card-hover-preview.visible { display: block; }
.card-hover-preview img { width: 100%; border-radius: 4.75% / 3.5%; box-shadow: 0 10px 30px rgba(0,0,0,0.75); display: block; }

.toast-stack { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 0.4rem; align-items: center; pointer-events: none; }
.toast { background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 0.5rem 0.9rem; border-radius: 0.45rem; font-size: 0.85rem; box-shadow: 0 6px 18px rgba(0,0,0,0.5); pointer-events: auto; max-width: 90vw; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.request-toast { display: flex; gap: 0.6rem; align-items: center; }
.request-toast img { width: 60px; border-radius: 4.75% / 3.5%; }

.player-ctx-menu { position: fixed; z-index: 300; }
.notepad-popup { position: fixed; z-index: 150; width: 280px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 0.5rem; box-shadow: 0 8px 24px rgba(0,0,0,0.6); }
.notepad-header { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0.6rem; background: rgba(168,85,247,0.25); cursor: move; border-radius: 0.5rem 0.5rem 0 0; font-size: 0.8rem; font-weight: 700; touch-action: none; }
.notepad-header button { background: none; border: none; color: var(--text-muted); cursor: pointer; }
.notepad-popup textarea { width: 100%; height: 180px; background: var(--bg-secondary); color: var(--text); border: none; padding: 0.5rem; font-size: 0.85rem; resize: vertical; border-radius: 0 0 0.5rem 0.5rem; }
.audio-unlock { position: fixed; bottom: 165px; left: 50%; transform: translateX(-50%); z-index: 120; }
#audioSinks { display: none; }

/* ── Responsive ───────────────────────────────── */
.sidebar-toggle {
    display: none; position: fixed; top: 50%; right: 0; transform: translateY(-50%); z-index: 195;
    width: 30px; height: 70px; border-radius: 0.6rem 0 0 0.6rem; border: 1px solid #6d28d9; border-right: none;
    background: rgba(46,16,101,0.95); color: #fff; align-items: center; justify-content: center; font-size: 0.95rem;
    box-shadow: -4px 0 14px rgba(0,0,0,0.45); cursor: pointer; transition: right 0.2s ease;
}
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 180; }

/* Small laptops and tablets in landscape: narrower sidebar */
@media (max-width: 1200px) {
    .game-container.active { grid-template-columns: 1fr 280px; }
    .hand-actions { width: 264px; }
    .hand-actions .btn { font-size: 0.68rem; padding: 0.28rem 0.3rem; }
}

/* Tablets in portrait and phones: the sidebar becomes a slide-out drawer */
@media (max-width: 900px) {
    .game-container.active { grid-template-columns: 1fr; height: 100vh; height: 100dvh; }
    .table-area { height: 100vh; height: 100dvh; }
    .game-sidebar {
        position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 92vw); z-index: 190;
        transform: translateX(100%); transition: transform 0.2s ease; box-shadow: -8px 0 30px rgba(0,0,0,0.5);
    }
    body.sidebar-open .game-sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .sidebar-toggle { display: flex; }
    body.sidebar-open .sidebar-toggle { right: min(360px, 92vw); }
    .hand-dock { height: auto; flex-direction: column; gap: 4px; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
    .hand-actions { width: 100%; grid-template-columns: repeat(7, 1fr); }
    .hand-actions-first, .hand-actions-first + .btn { grid-column: auto; }
    .hand-zone { --ch: 110px; height: 118px; flex: none; }
    .hand-pop-btn { width: 100%; height: 22px; }
    .hand-dock.popped .hand-popped-note { padding: 0.5rem 0; }
}

/* Phones */
@media (max-width: 600px) {
    .board-grid.players-4 { grid-template: repeat(4, minmax(250px, 1fr)) / 1fr; overflow-y: auto; }
    /* Your own seat sits last, right above your hand. */
    .board-grid.players-4 .pslot.is-me { order: 99 !important; }
    .hand-actions { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
    .hand-actions .btn { flex: 0 0 auto; white-space: nowrap; }
    .hand-zone { --ch: 96px; height: 104px; }
    .hand-pop-btn { display: none; }
    .piles { width: 52px; }
    .pslot-head { flex-wrap: wrap; row-gap: 0.15rem; }
    .player-name-tag { max-width: 70%; }
    .player-name-tag .deck-name { display: none; }
    .modal-bg { padding: 0.5rem; }
    .modal { padding: 1rem 0.8rem; max-height: 94vh; }
    .zone-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .stack-overlay { width: min(280px, 92vw); }
}

/* Touch screens: larger tap targets */
@media (pointer: coarse) {
    .ctx-item { padding: 0.62rem 0.9rem; font-size: 0.9rem; }
    .dcard-destroy, .dcard-flip { width: 26px; height: 26px; font-size: 0.75rem; }
    .cmd-tax button { width: 22px; height: 22px; }
    .hand-actions .btn { min-height: 34px; }
    .cam-handle { height: 26px; }
    .shared-card-zoom button { min-width: 36px; min-height: 36px; }
    .clock-pass { padding: 0.2rem 0.55rem; font-size: 0.8rem; }
    .pm-btn { width: 32px; height: 32px; }
}
.touch-ghost {
    position: fixed; z-index: 260; pointer-events: none; opacity: 0.92; margin: 0;
    transform: rotate(-3deg) scale(1.04); box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}
.dcard.touch-armed { outline: 2px solid var(--accent); outline-offset: 1px; }
