/* 카드 게임 공통 (Klondike · FreeCell · Spider · Hearts · Crazy Eights · Gin Rummy · 연습 테이블)
 * 카드 크기는 판(.felt)에 붙은 --cw / --ch 로 정한다(DenaCards.fit 이 화면 폭에 맞춰 계산). */
.cardpage main { max-width: 1040px; }
.cardpage .wrap { grid-template-columns: minmax(0, 1fr) 240px; }
@media (max-width: 820px) {
  .cardpage main { padding-left: 12px; padding-right: 12px; }
  .cardpage .stage { padding: 6px; }
  .cardpage .wrap { grid-template-columns: 1fr; gap: 16px; }
}
.felt { --cw: 64px; --ch: 90px; --gap: 6px; position: relative; border-radius: 10px; padding: 10px; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  background: radial-gradient(circle at 50% 28%, #1C3A3A, #12262A 62%, #0E1C22); box-shadow: inset 0 0 0 1px rgba(210,172,71,0.35), inset 0 0 40px rgba(0,0,0,0.35); }
@media (max-width: 820px) { .felt { padding: 6px; border-radius: 8px; } }
.felt .row { display: flex; gap: var(--gap); align-items: flex-start; }
.felt .row.sp { justify-content: space-between; }
.felt .col { position: relative; width: var(--cw); flex: 0 0 var(--cw); min-height: var(--ch); }
.felt .col > .cd, .felt .col > .slot { position: absolute; left: 0; }
.felt .hint { font: 12.5px/1.5 'Segoe UI', sans-serif; color: #8C94A3; text-align: center; margin: 8px 0 0; min-height: 1.5em; }

/* 카드 앞면 */
.cd { position: relative; width: var(--cw); height: var(--ch); box-sizing: border-box; border-radius: calc(var(--cw) * 0.1); flex: 0 0 auto;
  background: linear-gradient(180deg, #FBF8EE, #EEE8D5); border: 1px solid #C9BF9F; color: #17202E; cursor: default;
  box-shadow: 0 1px 2px rgba(0,0,0,0.45); font-family: 'Segoe UI', sans-serif; overflow: hidden; transition: transform .14s ease, box-shadow .14s ease; }
.cd.red { color: #B3392F; }
.cd .ix { position: absolute; left: 7%; top: 3%; font-weight: 800; font-size: max(10px, calc(var(--cw) * 0.3)); line-height: 1; letter-spacing: -0.05em; white-space: nowrap; }
.cd .ix i { font-style: normal; font-weight: 400; margin-left: 1px; }
.cd .pip { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; font-size: calc(var(--cw) * 0.52); line-height: 1; }
.cd .fc { position: absolute; left: 16%; right: 16%; top: 34%; bottom: 8%; display: grid; place-items: center; border: 1px solid #D2AC47; border-radius: 4px;
  background: linear-gradient(160deg, #FFF9E6, #EADBB0); font: italic 400 calc(var(--cw) * 0.4)/1 Georgia, serif; }
.cd .fc::before { content: ''; position: absolute; inset: 2px; border: 1px solid rgba(210,172,71,0.45); border-radius: 3px; }
/* 카드 뒷면 — 금 테두리 + 육각형 무늬 */
.cd.bk { background-color: #14223B; border: 1px solid #D2AC47; box-shadow: inset 0 0 0 2px #14223B, inset 0 0 0 3px rgba(210,172,71,0.55), 0 1px 2px rgba(0,0,0,0.45);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='24' viewBox='0 0 14 24'%3E%3Cpath d='M7 0l7 4v8l-7 4-7-4V4zM7 16v8' fill='none' stroke='%23D2AC47' stroke-opacity='.28' stroke-width='1'/%3E%3C/svg%3E");
  background-size: calc(var(--cw) * 0.22) auto; background-position: center; }
.cd.bk::after { content: ''; position: absolute; left: 50%; top: 50%; width: 42%; aspect-ratio: 1 / 1.1547; transform: translate(-50%, -50%);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: radial-gradient(circle at 50% 40%, #F3D98A, #D2AC47 55%, #8E7128); opacity: .9; }
/* 상태 */
.cd.up { cursor: pointer; }
.cd.sel { transform: translateY(-4px); box-shadow: 0 0 0 2px #D2AC47, 0 0 14px rgba(210,172,71,0.75); z-index: 50; }
.cd.dst, .slot.dst { box-shadow: 0 0 0 2px #6FA383, 0 0 12px rgba(111,163,131,0.6); cursor: pointer; }
.cd.dim { filter: brightness(0.72) saturate(0.7); }
.cd.new { animation: cdIn .28s ease-out; } @keyframes cdIn { from { transform: translateY(-10px) scale(1.06); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cd, .cd.new { transition: none; animation: none; } }
/* 빈 자리 */
.slot { width: var(--cw); height: var(--ch); box-sizing: border-box; border-radius: calc(var(--cw) * 0.1); border: 1.5px dashed rgba(210,172,71,0.38);
  display: grid; place-items: center; color: rgba(210,172,71,0.55); font: 400 calc(var(--cw) * 0.36)/1 Georgia, serif; background: rgba(0,0,0,0.12); }
.slot.tap { cursor: pointer; }
.slot small { font: 700 calc(var(--cw) * 0.16)/1 'Segoe UI', sans-serif; letter-spacing: .08em; text-transform: uppercase; }
/* 손패(부채꼴 없이 겹쳐 펼침) */
.hand { position: relative; height: calc(var(--ch) + 8px); margin: 0 auto; }
.hand .cd { position: absolute; top: 6px; }
.hand .cd.ok { cursor: pointer; }
.hand .cd.ok:hover { transform: translateY(-5px); }
.hand .cd.pick { transform: translateY(-12px); box-shadow: 0 0 0 2px #D2AC47, 0 6px 14px rgba(0,0,0,0.5); }
.seat { display: flex; align-items: center; gap: 8px; font: 700 11px 'Segoe UI', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #8C94A3; }
.seat b { color: #E9E5D6; font-variant-numeric: tabular-nums; letter-spacing: 0; font-size: 13px; }
.seat.on { color: #D2AC47; }
.backs { position: relative; height: calc(var(--ch) * 0.62); }
.backs .cd { position: absolute; top: 0; --cw: calc(var(--cwx, 64px) * 0.62); width: var(--cw); height: calc(var(--cw) * 1.4); }
.cbtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 0; }
.cbtns button { width: auto; flex: 0 1 auto; margin: 0; padding: 9px 16px; font-size: 14px; }
.cbtns button.alt { background: #1C2A40; color: #E9E5D6; border-color: #33425E; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 700 11.5px 'Segoe UI', sans-serif; letter-spacing: .05em; background: #26314A; color: #A8AEB9; }
.badge.gold { background: #D2AC47; color: #0C1420; }
.practice { margin: 0 0 18px; padding: 10px 14px; border: 1px solid #5C4A1E; border-radius: 10px; background: rgba(92,74,30,0.18); font-size: 13px; line-height: 1.6; color: #CFC6A6; }
.practice b { color: #F3D98A; }
.stage .statusbox { margin: 0 0 10px; min-height: 0; padding: 9px 12px; font-size: 13.5px; }
@media (max-width: 820px) { .stage .statusbox { font-size: 13px; padding: 8px 10px; } }
