/* Cartas de baralho compartilhadas (Spider, FreeCell, Buraco, Truco…).
   O contêiner define --cw (largura da carta). */
.cd-table { container-type: inline-size; background: #0e5a4e; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.2px); background-size: 5px 5px; border-radius: 14px; padding: 12px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
@media (max-width: 560px) { .cd-table { border-radius: 0; padding: 8px 6px; margin: 0 -8px; } }
.cd-slot { display: block; position: relative; width: var(--cw); aspect-ratio: 5 / 7; border-radius: calc(var(--cw) * .09); border: 2px dashed rgba(255,255,255,.25); }
.cd-col { position: relative; width: var(--cw); }
.cd-ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.35); font: 800 calc(var(--cw) * .32) var(--font-display); }
.cd { position: absolute; left: 0; top: 0; width: var(--cw); aspect-ratio: 5 / 7; background: #fffdf8; border-radius: calc(var(--cw) * .09); border: 1px solid #b9b3a4; box-shadow: 0 1px 2px rgba(0,0,0,.35); color: #14211e; cursor: pointer; overflow: hidden; }
.cd-col .cd { top: calc(var(--y, 0) * 1px); }
.cd.red { color: #c8323a; }
.cd.back { background: #c8323a; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 3px, transparent 3px 7px); border: 2px solid #fffdf8; cursor: default; }
.cd .cr { position: absolute; left: 7%; top: 3%; font: 800 calc(var(--cw) * .27)/1 var(--font-display); display: flex; align-items: baseline; gap: .06em; letter-spacing: -0.05em; }
.cd .cr i { font-style: normal; font-size: .82em; }
.cd .cs { position: absolute; right: 8%; bottom: 4%; font-size: calc(var(--cw) * .5); line-height: 1; }
.cd.sel { box-shadow: 0 0 0 3px var(--chip), 0 1px 2px rgba(0,0,0,.35); }
.cd.hint { animation: cd-hint .9s ease 2; }
@keyframes cd-hint { 50% { box-shadow: 0 0 0 4px #7fe0c2, 0 1px 2px rgba(0,0,0,.35); transform: translateY(-3px); } }
.cd.dragging { z-index: 50; box-shadow: 0 10px 20px rgba(0,0,0,.35); cursor: grabbing; transition: none; }
.cd.shake { animation: cd-shake .3s ease; }
@keyframes cd-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.cd-table.won .cd-found .cd { animation: cd-win 1s ease infinite alternate; }
@keyframes cd-win { to { transform: translateY(-6px); } }
