/* 덤벼라! 카드 배틀 — 진행 화면·카드 목록 공용 스타일
   2026-09-13 신설 / 2026-09-14 진행 화면 전면 리메이크(무대·연출·부채꼴 손패)

   이 파일은 세 화면이 함께 쓴다.
     · 진행 화면 (cardbattle-play.html) — 아래 "무대" 이후가 전부 여기 쓰인다
     · 관리 화면 / 시청자 안내 (cardbattle.html · viewer-cardbattle.html) — 카드 목록(.cb-deck .cb-card)과 속성 안내(.cb-legend)만 쓴다
   그래서 .cb-card 기본형은 목록에서도 멀쩡하게 보이도록 두고, 진행 화면용 연출은 .cb-hand 아래에만 건다.
   모바일~4K 대응: 카드·플레이어 칸은 grid auto-fill, 부채꼴 손패는 900px 이상에서만. */

:root {
    --cb-line: #272a31;
    --cb-panel: #16181c;
    --cb-panel-2: #1b1e24;
    --cb-gold: var(--brand);
    --cb-red: #ff6b6b;
    --cb-blue: #7eb3ff;
    --cb-green: var(--ok);
}

/* ─────────────────────────────────────────────────────────
 * 0. 판 전체 틀 — 아레나와 연출 레이어
 * ───────────────────────────────────────────────────────── */

.cb-wrap { position: relative; }

.cb-arena {
    position: relative;
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px 16px 16px;
    border: 1px solid var(--cb-line); border-radius: 18px;
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(var(--brand-rgb), 0.06), transparent 60%),
        radial-gradient(90% 60% at 50% 110%, rgba(var(--brand-rgb), 0.05), transparent 60%),
        linear-gradient(180deg, #15171b 0%, #101114 100%);
    transition: box-shadow 0.4s ease;
}
.cb-arena.running { box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45); }
.cb-arena.cb-busy { pointer-events: none; opacity: 0.85; }

/* 판 전체 규칙(라운드 이벤트)에 따라 배경 기운이 바뀐다 */
.cb-arena[data-event="storm"] { background-image: radial-gradient(120% 80% at 50% -10%, rgba(126, 179, 255, 0.13), transparent 62%), linear-gradient(180deg, #14171d 0%, #101114 100%); }
.cb-arena[data-event="fog"] { background-image: radial-gradient(120% 80% at 50% -10%, rgba(180, 190, 205, 0.12), transparent 62%), linear-gradient(180deg, #171920 0%, #111215 100%); }
.cb-arena[data-event="bleed"], .cb-arena[data-event="duel"] { background-image: radial-gradient(120% 80% at 50% -10%, rgba(255, 107, 107, 0.13), transparent 62%), linear-gradient(180deg, #1a1416 0%, #111012 100%); }
.cb-arena[data-event="harvest"] { background-image: radial-gradient(120% 80% at 50% -10%, rgba(154, 230, 110, 0.11), transparent 62%), linear-gradient(180deg, #151815 0%, #101210 100%); }
.cb-arena[data-event="ward"] { background-image: radial-gradient(120% 80% at 50% -10%, rgba(126, 179, 255, 0.11), transparent 62%), linear-gradient(180deg, #14171c 0%, #101114 100%); }
.cb-arena[data-event="chaos"] { background-image: radial-gradient(120% 80% at 50% -10%, rgba(208, 140, 255, 0.12), transparent 62%), linear-gradient(180deg, #17151c 0%, #111014 100%); }
.cb-arena[data-event="awaken"] { background-image: radial-gradient(120% 80% at 50% -10%, rgba(var(--brand-rgb), 0.13), transparent 62%), linear-gradient(180deg, #19171220 0%, #111114 100%); }

.cb-fxlayer {
    position: absolute; inset: 0; overflow: hidden;
    pointer-events: none; z-index: 40; border-radius: 18px;
}

/* ─────────────────────────────────────────────────────────
 * 1. 판 정보 띠
 * ───────────────────────────────────────────────────────── */

.cb-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--cb-line); border-radius: 12px; padding: 9px 13px;
}
.cb-head .cb-title { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.cb-badge { font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; border: 1px solid; }
.cb-badge.solo { color: var(--cb-blue); border-color: #7eb3ff55; background: #7eb3ff0f; }
.cb-badge.team { color: #ff9f6b; border-color: #ff9f6b55; background: #ff9f6b0f; }
.cb-badge.practice { color: #aaa; border-color: #55555588; }
.cb-badge.live { color: var(--brand); border-color: rgba(var(--brand-rgb), 0.33); }
.cb-head .cb-sub { font-size: 0.78rem; color: #8a8a8a; }
.cb-pot {
    font-size: 0.78rem; font-weight: 700; color: var(--cb-gold);
    border: 1px solid rgba(var(--brand-rgb), 0.27); background: rgba(var(--brand-rgb), 0.06); border-radius: 999px; padding: 2px 10px;
}
.cb-timer { font-size: 0.82rem; color: var(--cb-gold); font-variant-numeric: tabular-nums; }
.cb-timer.urgent { color: var(--cb-red); font-weight: 800; }

/* 차례 순서 띠 */
.cb-order { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.cb-order .dir { font-size: 0.68rem; color: #6d7178; margin-right: 3px; }
.cb-order .arw { font-size: 0.7rem; color: #4a4d53; }
.cb-order .pip { opacity: 0.55; transition: opacity 0.2s, transform 0.2s; }
.cb-order .pip.now { opacity: 1; transform: scale(1.18); }
.cb-order .pip.out { opacity: 0.18; filter: grayscale(1); }
@media (max-width: 900px) { .cb-order { display: none; } }

/* 라운드 이벤트 */
.cb-event {
    display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700;
    color: var(--cb-gold); border: 1px solid rgba(var(--brand-rgb), 0.27); background: #201d15; border-radius: 999px; padding: 3px 11px;
}
.cb-event i { font-style: normal; font-size: 0.7rem; color: #8a7a4a; font-weight: 500; }
/* 필드 — 사람이 깔아 둔 판 전체 효과(라운드 이벤트와 나란히 뜬다) */
.cb-event.field { color: #8fe08f; border-color: #8fe08f44; background: #16201a; }
.cb-event.field i { color: #5f8a5f; }

/* ─────────────────────────────────────────────────────────
 * 2. 참가자 칸
 * ───────────────────────────────────────────────────────── */

.cb-stage {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.12));
    border: 1px solid var(--cb-line); border-radius: 16px; padding: 12px 14px 14px;
    overflow: hidden;
}
.cb-stage::before {
    /* 무대 바닥 빛 */
    content: ""; position: absolute; left: 50%; bottom: -60%; width: 120%; height: 120%;
    transform: translateX(-50%);
    background: radial-gradient(50% 50% at 50% 50%, rgba(var(--brand-rgb), 0.06), transparent 70%);
    pointer-events: none;
}
.cb-stage.aiming { border-color: #ff6b6b55; }

.cb-stage-label {
    font-size: 0.72rem; font-weight: 700; color: #6f7278; letter-spacing: 0.04em;
    margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.cb-stage-label i { font-style: normal; font-weight: 500; color: #55585e; }
.cb-stage-label em.aim {
    font-style: normal; font-weight: 700; color: var(--cb-red); margin-left: auto;
    animation: cbBlink 1.1s ease-in-out infinite;
}
@keyframes cbBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.cb-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; position: relative; }
.cb-players.stage { grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 10px; }
.cb-players.stage.cnt-1 { grid-template-columns: minmax(0, 360px); justify-content: center; }
.cb-players.stage.cnt-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cb-player {
    position: relative; overflow: visible;
    background: linear-gradient(180deg, var(--cb-panel-2), var(--cb-panel));
    border: 1px solid var(--cb-line); border-radius: 13px; padding: 11px 12px;
    display: flex; flex-direction: column; gap: 8px;
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.25s, opacity 0.25s;
}
.cb-player.me { border-color: rgba(var(--brand-rgb), 0.33); }
.cb-player.turn {
    border-color: rgba(var(--brand-rgb), 0.67); transform: translateY(-3px);
    box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.2), 0 10px 26px -12px rgba(var(--brand-rgb), 0.55);
    animation: cbTurnPulse 2.1s ease-in-out infinite;
}
@keyframes cbTurnPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.22), 0 10px 24px -14px rgba(var(--brand-rgb), 0.4); }
    50% { box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.5), 0 12px 32px -10px rgba(var(--brand-rgb), 0.6); }
}
.cb-player.dead { opacity: 0.4; filter: grayscale(0.85); }
.cb-player.just-down { animation: cbFall 0.7s ease-out; }
@keyframes cbFall {
    0% { transform: translateY(0) rotate(0); filter: grayscale(0); }
    35% { transform: translateY(-6px) rotate(-2deg); }
    100% { transform: translateY(6px) rotate(2.5deg); filter: grayscale(0.85); }
}
.cb-player.targetable { cursor: crosshair; border-color: #ff6b6b55; }
.cb-player.targetable:hover { border-color: var(--cb-red); transform: translateY(-3px); box-shadow: 0 10px 26px -14px rgba(255, 107, 107, 0.7); }
.cb-player.picked { border-color: var(--cb-red); box-shadow: 0 0 0 1px #ff6b6b55, 0 0 24px -8px rgba(255, 107, 107, 0.6); }
.cb-reticle {
    position: absolute; top: 8px; right: 9px; width: 15px; height: 15px; border-radius: 50%;
    border: 1px dashed #ff6b6b99; pointer-events: none;
    animation: cbSpin 3.4s linear infinite;
}
.cb-reticle::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #ff6b6b88; }
@keyframes cbSpin { to { transform: rotate(360deg); } }

.cb-pl-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cb-pl-id { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.cb-player .cb-name { font-size: 0.88rem; font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.cb-player .cb-name span.nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-npc { font-size: 0.66rem; color: #9a8cff; border: 1px solid #9a8cff55; border-radius: 4px; padding: 0 4px; flex: none; }
.cb-team { font-size: 0.66rem; border-radius: 4px; padding: 0 5px; flex: none; }
.cb-team.t1 { color: var(--cb-blue); border: 1px solid #7eb3ff55; }
.cb-team.t2 { color: #ff9f6b; border: 1px solid #ff9f6b55; }
.cb-team.t3 { color: #9ae66e; border: 1px solid #9ae66e55; }

/* 얼굴 */
.cb-avatar {
    position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none;
    display: inline-grid; place-items: center; font-size: 1.15rem; line-height: 1;
    background: radial-gradient(circle at 34% 28%, #2c3138, #15171b);
    border: 1px solid #34383f; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.cb-avatar.xs { width: 22px; height: 22px; font-size: 0.68rem; }
.cb-avatar.sm { width: 30px; height: 30px; font-size: 0.9rem; }
.cb-avatar.lg { width: 62px; height: 62px; font-size: 1.7rem; }
.cb-avatar .face { font-weight: 800; color: #cfd3d9; font-variant-numeric: tabular-nums; }
.cb-avatar.npc { border-color: #9a8cff55; }
.cb-avatar.xs .face { font-size: 0.72rem; }
.cb-avatar.lg .face { font-size: 1.5rem; }
.cb-avatar.out { filter: grayscale(1); opacity: 0.55; }
.cb-avatar .x { position: absolute; inset: 0; display: grid; place-items: center; color: var(--cb-red); font-size: 0.95rem; font-weight: 800; }
.cb-player.turn .cb-avatar { box-shadow: 0 0 0 2px rgba(var(--brand-rgb), 0.33), inset 0 1px 0 rgba(255, 255, 255, 0.06); }

/* 체력 막대 — 방금 깎인 만큼이 잔상으로 늦게 따라 내려온다 */
.cb-hpbar { position: relative; height: 9px; background: #22262c; border-radius: 6px; overflow: hidden; }
.cb-hpbar > b.ghost {
    position: absolute; left: 0; top: 0; height: 100%; z-index: 1; border-radius: 6px;
    background: rgba(255, 107, 107, 0.55);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) 0.22s;
}
.cb-hpbar > i {
    position: absolute; left: 0; top: 0; height: 100%; z-index: 2; border-radius: 6px;
    background: linear-gradient(90deg, #00c8ff, var(--ok));
    transition: width 0.22s ease-out;
}
.cb-hpbar.low > i { background: linear-gradient(90deg, #ff9f6b, #ff6b6b); }
.cb-hpbar.over > i { background: linear-gradient(90deg, var(--ok), var(--brand)); }
.cb-hpbar > b.shield {
    position: absolute; left: 0; top: 0; height: 100%; z-index: 3; border-radius: 6px;
    background: repeating-linear-gradient(135deg, rgba(126, 179, 255, 0.9) 0 4px, rgba(126, 179, 255, 0.5) 4px 8px);
}
.cb-players.stage .cb-hpbar { height: 11px; }

.cb-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 0.72rem; color: #85888e; align-items: center; }
.cb-meta .hp-num { font-size: 0.9rem; font-weight: 800; color: #e8e8e8; font-variant-numeric: tabular-nums; }
.cb-meta .hp-num.hp-over { color: var(--cb-gold); }
.cb-meta .shield-num { color: var(--cb-blue); }
.cb-state-chip { font-size: 0.67rem; border-radius: 5px; padding: 0 5px; border: 1px solid #444; color: #bbb; cursor: help; }
.cb-state-chip.bad { color: #ff9f6b; border-color: #ff9f6b55; background: #ff9f6b0d; }
.cb-state-chip.good { color: var(--cb-green); border-color: rgba(var(--ok-rgb), 0.33); background: rgba(var(--ok-rgb), 0.05); }
/* 함정은 "무언가 깔려 있다"만 알린다 — 종류는 깐 사람만 안다 */
.cb-state-chip.trap { color: #ffa94d; border-color: #ffa94d55; background: #ffa94d12; }
.cb-state-chip.summon { color: #74d7ff; border-color: #74d7ff55; background: #74d7ff12; display: inline-flex; align-items: center; gap: 3px; }
.cb-chips { gap: 4px; }
.cb-rank { position: absolute; top: 8px; right: 10px; font-size: 0.74rem; color: var(--cb-gold); font-weight: 800; }
.cb-gear { gap: 4px; }
.cb-gear-chip {
    display: inline-flex; align-items: center; gap: 3px; font-size: 0.67rem;
    color: #c9b6ff; border: 1px solid #6a5aa855; background: #1a1726; border-radius: 5px; padding: 1px 6px;
}

/* 내 자리 */
.cb-myseat { margin-bottom: 2px; }
.cb-players.mine { grid-template-columns: minmax(0, 1fr); }
.cb-players.mine .cb-player { border-color: rgba(var(--brand-rgb), 0.33); padding: 12px 14px; }

/* ─────────────────────────────────────────────────────────
 * 3. 가운데 차례판
 * ───────────────────────────────────────────────────────── */

.cb-center {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 10px 14px; border-radius: 14px; text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.15));
    border: 1px solid var(--cb-line);
}
/* 넓은 화면에서는 가로 한 줄로 — [남은 시간 고리] [누구 차례] [방금 있었던 일] */
@media (min-width: 901px) {
    .cb-center:not(.duel) {
        flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px; text-align: left;
    }
    .cb-center:not(.duel) .cb-center-feed { align-items: flex-start; min-width: 0; }
    .cb-center:not(.duel) .cb-dial { order: 1; }
    .cb-center:not(.duel) .cb-center-turn { order: 2; }
    .cb-center:not(.duel) .cb-center-sub { order: 3; }
    .cb-center:not(.duel) .cb-center-feed { order: 4; padding-left: 14px; border-left: 1px solid var(--cb-line); }
    /* 직전 판 순위(한 판 더)는 가로 줄에 끼지 않고 아래로 내려간다 */
    .cb-center:not(.duel) .cb-center-prev { order: 5; flex-basis: 100%; }
}
.cb-center.duel { border-color: #ff6b6b44; background: linear-gradient(180deg, rgba(255, 107, 107, 0.07), rgba(0, 0, 0, 0.15)); }
.cb-center-turn { font-size: 1rem; color: #ddd; }
.cb-center-turn b { color: var(--cb-gold); }
.cb-center.duel .cb-center-turn b { color: var(--cb-red); }
.cb-center-sub { font-size: 0.8rem; color: #9a9a9a; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cb-center-feed { display: flex; flex-direction: column; gap: 2px; font-size: 0.78rem; }

.cb-dial { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.cb-dial .cb-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.cb-ring .bg { fill: none; stroke: #2a2e35; stroke-width: 4; }
.cb-ring .fg { fill: none; stroke: var(--cb-gold); stroke-width: 4; stroke-linecap: round; transition: stroke 0.3s; }
.cb-ring.urgent .fg { stroke: var(--cb-red); }
.cb-dial .cb-timer.sec {
    position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
    background: #14161a; border: 1px solid var(--cb-line); border-radius: 999px;
    min-width: 26px; padding: 0 6px; font-size: 0.76rem; font-weight: 800;
}
.cb-dial.mine .cb-avatar { box-shadow: 0 0 0 2px var(--brand), 0 0 26px -6px rgba(var(--brand-rgb), 0.8); }

/* 공격이 걸려 있는 순간 — 공격자 → 무기 → 대상 */
.cb-duel { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.cb-duel .side { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.76rem; color: #bbb; }
.cb-duel .side b { font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-duel .bolt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 130px; }
.cb-duel .bolt .wp { font-size: 1.1rem; }
.cb-duel .bolt .line {
    display: block; width: 120px; height: 3px; border-radius: 2px;
    background: repeating-linear-gradient(90deg, currentColor 0 8px, transparent 8px 14px);
    animation: cbFlow 0.75s linear infinite;
}
.cb-duel .bolt.k-physical { color: #ff8f8f; }
.cb-duel .bolt.k-pierce { color: #ffbf6b; }
.cb-duel .bolt.k-magic { color: var(--cb-blue); }
.cb-duel .bolt.k-blast { color: #d08cff; }
.cb-duel .bolt .dmg { font-size: 0.95rem; font-weight: 800; color: var(--cb-red); }
@keyframes cbFlow { to { background-position: 14px 0; } }

/* ─────────────────────────────────────────────────────────
 * 4. 카드 (목록·손패 공용 기본형)
 * ───────────────────────────────────────────────────────── */

.cb-card {
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, #1b1e23, #141619);
    border: 1px solid #2c3037; border-radius: 12px; padding: 9px 10px 9px 13px;
    cursor: pointer; display: flex; flex-direction: column; gap: 4px; text-align: left;
    transition: transform 0.14s, border-color 0.14s, background 0.14s, box-shadow 0.18s;
    /* 손패 카드는 <button>이라 글자색·글꼴이 상속되지 않는다 — 지정하지 않으면 어두운 배경에 검은 글씨가 된다 */
    color: #eee; font-family: inherit;
}
.cb-card:hover {
    transform: translateY(-2px); border-color: #4a4f57;
    /* 하버한 카드는 반투명을 걷어내고 배경을 한 단계 밝게 — 아래 카드가 비쳐 글자가 흐려지지 않게 */
    background: linear-gradient(180deg, #252932, #1a1d22);
    opacity: 1;
}
.cb-card.sel { border-color: var(--cb-green); background: linear-gradient(180deg, #16241e, #101a16); }
.cb-card.assist-sel { border-color: var(--cb-gold); background: linear-gradient(180deg, #221f15, #171410); }
.cb-card.disabled { opacity: 0.32; cursor: not-allowed; transform: none; filter: grayscale(0.6); }
.cb-card.disabled:hover { opacity: 1; filter: grayscale(0.35); transform: none; }
.cb-card .cb-c-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cb-card .cb-c-emoji { font-size: 1.05rem; }
/* 카드·판 상황 그림 (2026-11-14) — 그림이 없으면 이모지로 돌아가 위 글자 크기를 그대로 쓴다 */
img.cb-art { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; display: inline-block; }
.cb-card .cb-c-emoji img.cb-art { width: 44px; height: 44px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.cb-duel .bolt .wp img.cb-art { width: 48px; height: 48px; }
.cb-event img.cb-art { width: 22px; height: 22px; }
.cb-state-chip img.cb-art, .cb-gear-chip img.cb-art { width: 18px; height: 18px; }
.cb-avatar img.cb-art.npc { width: 1.6em; height: 1.6em; }
.cb-proj .mark img.cb-art { width: 26px; height: 26px; }
.cb-ribbon img.cb-ribbon-art { width: 64px; height: 64px; margin-right: 8px; vertical-align: middle; }
.cb-card .cb-c-name { font-size: 0.82rem; font-weight: 700; color: #f2f2f2; }
.cb-card .cb-c-kind {
    font-size: 0.65rem; border-radius: 4px; padding: 0 5px; border: 1px solid #3a3a3a; color: #999;
    margin-left: auto; white-space: nowrap;
}
.cb-card .cb-c-desc { font-size: 0.7rem; color: #9b9b9b; line-height: 1.45; }
.cb-card.t-weapon .cb-c-kind { color: #ff8f8f; border-color: #ff8f8f44; }
.cb-card.t-assist .cb-c-kind { color: var(--cb-gold); border-color: rgba(var(--brand-rgb), 0.27); }
.cb-card.t-defense .cb-c-kind { color: var(--cb-blue); border-color: #7eb3ff44; }
.cb-card.t-heal .cb-c-kind { color: var(--cb-green); border-color: rgba(var(--ok-rgb), 0.27); }
.cb-card.t-util .cb-c-kind { color: #c0a0ff; border-color: #c0a0ff44; }
.cb-card.t-curse .cb-c-kind { color: #b58cff; border-color: #b58cff44; }
.cb-card.t-gear .cb-c-kind { color: #c9b6ff; border-color: #c9b6ff44; }
.cb-card.t-trap .cb-c-kind { color: #ffa94d; border-color: #ffa94d44; }
.cb-card.t-summon .cb-c-kind { color: #74d7ff; border-color: #74d7ff44; }
.cb-card.t-field .cb-c-kind { color: #8fe08f; border-color: #8fe08f44; }
.cb-card.t-cursed { border-color: #5a2a2a; background: linear-gradient(180deg, #1f1616, #171010); }
.cb-card.t-cursed .cb-c-kind { color: #ff8f8f; border-color: #ff8f8f44; }

/* 카드 종류를 왼쪽 띠 색으로 — 훑어보기만 해도 무기/방어/회복이 구분된다.
   진행 화면 손패와 관리·시청자 카드 목록이 같은 마크업을 쓰도록 가상 요소로 만든다. */
.cb-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #3a3f47; }
.cb-card.t-weapon::before { background: linear-gradient(180deg, #ff8f8f, #b85a5a); }
.cb-card.t-assist::before { background: linear-gradient(180deg, var(--brand), #a8842a); }
.cb-card.t-defense::before { background: linear-gradient(180deg, #7eb3ff, #4c74ad); }
.cb-card.t-heal::before { background: linear-gradient(180deg, var(--ok), rgba(var(--ok-rgb), 0.45)); }
.cb-card.t-util::before { background: linear-gradient(180deg, #c0a0ff, #7b64ad); }
.cb-card.t-curse::before { background: linear-gradient(180deg, #b58cff, #6f52a8); }
.cb-card.t-gear::before { background: linear-gradient(180deg, #c9b6ff, #7f71ad); }
.cb-card.t-trap::before { background: linear-gradient(180deg, #ffa94d, #a86a1f); }
.cb-card.t-summon::before { background: linear-gradient(180deg, #74d7ff, #3a7fa8); }
.cb-card.t-field::before { background: linear-gradient(180deg, #8fe08f, #4f9150); }
.cb-card.t-cursed::before { background: linear-gradient(180deg, #ff6b6b, #6b2020); }

/* 위력·방어 숫자 — 카드 오른쪽 아래 */
.cb-c-num { position: absolute; right: 8px; bottom: 6px; display: flex; align-items: center; gap: 6px; }
.cb-c-num .pw { font-size: 0.92rem; font-weight: 800; color: #ffb0b0; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.cb-c-num .df { font-size: 0.72rem; font-weight: 700; color: var(--cb-blue); }

/* 속성 마크 — 무기의 공격 속성과 방어 카드가 막는 속성에 같은 색·같은 기호를 준다(상성을 눈으로 맞추라고).
   컬러 이모지가 아닌 텍스트 기호라 color가 그대로 먹으므로 .emoji-glyph를 붙이지 않는다. */
.cb-card .cb-c-kind.k-physical, .cb-attr.k-physical { color: #ff8f8f; border-color: #ff8f8f55; }
.cb-card .cb-c-kind.k-pierce, .cb-attr.k-pierce { color: #ffbf6b; border-color: #ffbf6b55; }
.cb-card .cb-c-kind.k-magic, .cb-attr.k-magic { color: var(--cb-blue); border-color: #7eb3ff55; }
.cb-card .cb-c-kind.k-blast, .cb-attr.k-blast { color: #d08cff; border-color: #d08cff55; }
.cb-card .cb-c-kind.k-any, .cb-attr.k-any { color: #aaa; border-color: #55555599; }
.cb-attr { font-size: 0.72rem; border: 1px solid #444; border-radius: 4px; padding: 0 5px; white-space: nowrap; }

/* 속성 안내 한 줄 */
.cb-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.74rem; color: #8d8d8d; margin: 6px 0 10px; }
.cb-legend .cb-attr { font-size: 0.74rem; }
.cb-legend b { color: #bbb; font-weight: 600; }

/* ─────────────────────────────────────────────────────────
 * 5. 손패 — 900px 이상에서는 부채꼴로 펼친다
 * ───────────────────────────────────────────────────────── */

.cb-hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cb-hand .cb-card .cb-key {
    position: absolute; top: 6px; right: 8px; font-size: 0.62rem; color: #5c5c5c;
    border: 1px solid #333; border-radius: 4px; padding: 0 4px; line-height: 1.4;
}
.cb-hand .cb-card.sel .cb-key, .cb-hand .cb-card.assist-sel .cb-key { color: #ccc; border-color: #666; }
.cb-hand .cb-card.is-new { animation: cbDeal 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards; }
.cb-hand .cb-card.able { border-color: #7eb3ff66; box-shadow: 0 0 0 1px #7eb3ff22; }
.cb-hand.defending .cb-card:not(.able):not(.sel) { opacity: 0.28; }
.cb-hand.defending .cb-card:not(.able):not(.sel):hover { opacity: 1; }

@keyframes cbDeal {
    from { opacity: 0; transform: translateY(46px) scale(0.82); }
    to { opacity: 1; }
}

.cb-hand.fan {
    display: block; position: relative; height: 196px; margin-top: 2px;
    /* 카드가 위로 떠오를 자리 */
    padding-top: 6px;
}
.cb-hand.fan .cb-card {
    position: absolute; top: 18px; width: 172px; height: 158px; gap: 5px;
    transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px));
    transform-origin: 50% 150%;
    box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.9);
    transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.3, 1), border-color 0.16s, box-shadow 0.2s, filter 0.16s;
}
/* 부채꼴에서는 카드의 **왼쪽 절반만** 보인다 — 이름·속성 마크·위력을 전부 왼쪽으로 모은다 */
.cb-hand.fan .cb-card .cb-c-top { flex-wrap: wrap; gap: 5px; }
.cb-hand.fan .cb-card .cb-c-emoji { order: 1; }
.cb-hand.fan .cb-card .cb-c-kind { order: 2; margin-left: 0; }
.cb-hand.fan .cb-card .cb-c-name { order: 3; flex: 1 0 100%; }
.cb-hand.fan .cb-card .cb-c-desc {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cb-hand.fan .cb-c-num { right: auto; left: 12px; bottom: 8px; }
.cb-hand.fan .cb-card.disabled { opacity: 0.5; filter: grayscale(0.45); }
.cb-hand.fan .cb-card:hover {
    transform: rotate(0deg) translateY(-18px) scale(1.06);
    z-index: 300 !important; border-color: #5a616b;
    box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.95);
}
.cb-hand.fan .cb-card.sel {
    transform: rotate(0deg) translateY(-22px) scale(1.05);
    z-index: 280 !important;
    box-shadow: 0 0 0 1px var(--cb-green), 0 22px 40px -18px rgba(var(--ok-rgb), 0.55);
}
.cb-hand.fan .cb-card.assist-sel {
    transform: rotate(0deg) translateY(-14px) scale(1.02);
    z-index: 270 !important;
    box-shadow: 0 0 0 1px var(--cb-gold), 0 20px 36px -18px rgba(var(--brand-rgb), 0.5);
}
.cb-hand.fan .cb-card.disabled:hover { transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px)); box-shadow: none; opacity: 1; filter: grayscale(0.3); z-index: 300; }
.cb-hand.fan .cb-card.is-new { animation: cbDealFan 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards; }
@keyframes cbDealFan {
    from { opacity: 0; transform: translate(120px, 90px) rotate(24deg) scale(0.7); }
    to { opacity: 1; }
}

/* ─────────────────────────────────────────────────────────
 * 6. 행동 바 · 방어 대기
 * ───────────────────────────────────────────────────────── */

.cb-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.12));
    border: 1px solid var(--cb-line); border-radius: 12px; padding: 10px 12px;
}
.cb-actions .btn.go:not([disabled]) { animation: cbReady 1.7s ease-in-out infinite; }
@keyframes cbReady {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0); }
    50% { box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.16); }
}
.cb-actions.need-target .btn.go[disabled] { opacity: 0.5; }
.cb-fuse { border-color: #c9b6ff55 !important; color: #c9b6ff !important; }
.cb-hint { font-size: 0.79rem; color: #9a9a9a; }
.cb-hint b { color: var(--cb-gold); }
.cb-hint.out { color: #777; padding: 10px 2px; }
.cb-damage { font-size: 0.82rem; color: #ff8f8f; font-weight: 800; }
.cb-damage s { color: #7a5a5a; font-weight: 500; margin-right: 2px; }
/* 연계기 — 정해진 보조 + 속성 조합이 맞으면 행동 줄에 뜬다 */
.cb-combo {
    display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; font-weight: 800;
    color: #ffd36b; border: 1px solid rgba(var(--brand-rgb), 0.33); background: #221d11; border-radius: 999px; padding: 2px 9px;
}
.cb-hint.sm { font-size: 0.73rem; color: #8a8a8a; }
.cb-hint.spectate { padding: 8px 2px; color: #9bbcd8; }
.cb-center-prev { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-size: 0.74rem; color: #9a9a9a; }
.cb-center-prev b { color: var(--cb-gold); font-size: 0.74rem; }
.cb-center-prev span { border: 1px solid #333; border-radius: 999px; padding: 1px 8px; }

.cb-defend {
    background: linear-gradient(180deg, rgba(255, 107, 107, 0.12), rgba(0, 0, 0, 0.2));
    border: 1px solid #ff6b6b66; border-radius: 12px; padding: 12px 14px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    animation: cbAlert 1.5s ease-in-out infinite;
}
@keyframes cbAlert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
    50% { box-shadow: 0 0 22px -6px rgba(255, 107, 107, 0.45); }
}
.cb-defend .t { font-size: 0.88rem; font-weight: 700; color: #ff9f6b; }
.cb-defend .t b { color: var(--cb-red); }

/* ─────────────────────────────────────────────────────────
 * 7. 기록 · 대화 · 정찰
 * ───────────────────────────────────────────────────────── */

.cb-log {
    background: rgba(0, 0, 0, 0.22); border: 1px solid var(--cb-line); border-radius: 12px; padding: 8px 10px;
    max-height: 190px; overflow-y: auto; display: flex; flex-direction: column-reverse; gap: 2px;
}
.cb-log-line {
    font-size: 0.78rem; color: #9a9a9a; line-height: 1.5;
    padding: 2px 6px; border-left: 2px solid transparent; border-radius: 0 4px 4px 0;
}
.cb-log-line.newest { animation: cbLogIn 0.45s ease-out; }
@keyframes cbLogIn {
    from { opacity: 0; transform: translateX(-8px); background: rgba(255, 255, 255, 0.06); }
    to { opacity: 1; transform: none; }
}
.cb-log-line.attack { color: #ddd; border-left-color: #ff8f8f66; }
.cb-log-line.block { color: var(--cb-blue); border-left-color: #7eb3ff66; }
.cb-log-line.heal { color: var(--cb-green); border-left-color: rgba(var(--ok-rgb), 0.4); }
.cb-log-line.down { color: var(--cb-red); font-weight: 600; border-left-color: var(--cb-red); }
.cb-log-line.poison, .cb-log-line.curse { color: #b58cff; border-left-color: #b58cff66; }
.cb-log-line.reflect, .cb-log-line.blast { color: #ff9f6b; border-left-color: #ff9f6b66; }
.cb-log-line.break { color: #ff9f6b; font-weight: 600; }
.cb-log-line.start, .cb-log-line.end { color: var(--cb-gold); font-weight: 600; border-left-color: rgba(var(--brand-rgb), 0.4); }
.cb-log-line.cover, .cb-log-line.util { color: #c0a0ff; border-left-color: #c0a0ff55; }

.cb-chat { background: rgba(0, 0, 0, 0.22); border: 1px solid var(--cb-line); border-radius: 12px; padding: 9px 11px; }
.cb-chat-log { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.cb-chat-line { font-size: 0.78rem; color: #bbb; line-height: 1.5; word-break: break-word; }
.cb-chat-line b { color: var(--cb-blue); font-weight: 600; margin-right: 4px; }
.cb-chat-empty { font-size: 0.78rem; color: #666; }
.cb-chat-input { display: flex; gap: 6px; }
.cb-chat-input input {
    flex: 1; min-width: 0; background: var(--bg-base); border: 1px solid #333; border-radius: 8px;
    color: #eee; font-family: inherit; font-size: 0.82rem; padding: 7px 10px; outline: none;
}
.cb-chat-input input:focus { border-color: rgba(var(--brand-rgb), 0.4); }

/* 정찰 결과 — 나에게만 보이는 상대 손패 */
.cb-peek {
    background: #141a20; border: 1px solid #2a3a4a; border-radius: 12px; padding: 9px 12px;
    font-size: 0.78rem; color: #9fc4e8; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.cb-peek b { color: var(--cb-blue); }
.cb-peek-card { background: #1b2430; border-radius: 6px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 4px; }
.cb-peek-card i { font-style: normal; }
.cb-peek-card i.k-physical { color: #ff8f8f; } .cb-peek-card i.k-pierce { color: #ffbf6b; }
.cb-peek-card i.k-magic { color: var(--cb-blue); } .cb-peek-card i.k-blast { color: #d08cff; }
.cb-peek-card i.k-any { color: #aaa; }

/* ─────────────────────────────────────────────────────────
 * 8. 결과
 * ───────────────────────────────────────────────────────── */

.cb-result {
    background: linear-gradient(180deg, rgba(var(--brand-rgb), 0.08), rgba(0, 0, 0, 0.2));
    border: 1px solid rgba(var(--brand-rgb), 0.33); border-radius: 14px; padding: 14px;
    animation: cbResultIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes cbResultIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.cb-result-crown { position: relative; text-align: center; padding: 10px 0 14px; overflow: hidden; }
.cb-result-crown .rays {
    position: absolute; left: 50%; top: 50%; width: 420px; height: 420px; transform: translate(-50%, -50%);
    background: conic-gradient(from 0deg, rgba(var(--brand-rgb), 0.26) 0 7deg, transparent 7deg 22deg);
    animation: cbSpin 16s linear infinite; pointer-events: none;
    -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%);
    mask-image: radial-gradient(circle, #000 0%, transparent 62%);
}
.cb-result-crown .txt {
    position: relative; font-size: 1.25rem; font-weight: 800; color: var(--cb-gold);
    text-shadow: 0 2px 14px rgba(var(--brand-rgb), 0.45);
}
.cb-result table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.cb-result th, .cb-result td { padding: 7px 8px; border-bottom: 1px solid #262626; text-align: left; white-space: nowrap; }
.cb-result th { color: #888; font-weight: 600; font-size: 0.75rem; }
.cb-result tbody tr, .cb-result tr { animation: cbRowIn 0.4s ease-out backwards; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes cbRowIn { from { opacity: 0; transform: translateX(-10px); } }
.cb-result tr.win td { color: var(--cb-gold); }
.medal { font-weight: 700; }
.medal.m1 { color: var(--cb-gold); } .medal.m2 { color: #cfd6de; } .medal.m3 { color: #d2a06a; }
.cb-scroll { overflow-x: auto; }

.cb-highlights { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cb-highlights span {
    display: flex; flex-direction: column; gap: 2px; flex: 1 1 160px;
    background: rgba(0, 0, 0, 0.25); border: 1px solid var(--cb-line); border-radius: 10px; padding: 8px 10px;
}
.cb-highlights i { font-style: normal; font-size: 0.7rem; color: #82858b; }
.cb-highlights b { font-size: 0.84rem; color: #eee; }
.cb-highlights em { font-style: normal; font-size: 0.78rem; color: var(--cb-gold); font-weight: 700; }

.cb-empty { padding: 34px 12px; text-align: center; color: #6a6d73; font-size: 0.86rem; line-height: 1.8; }

/* ─────────────────────────────────────────────────────────
 * 9. 아래 두 단
 * ───────────────────────────────────────────────────────── */

.cb-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; align-items: start; }
/* 관전 중에는 내 자리·손패가 없으므로 기록·대화가 한 단을 다 쓴다 */
.cb-bottom.watch { grid-template-columns: minmax(0, 1fr); }
.cb-bottom-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cb-bottom-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cb-bottom-side .cb-log { max-height: 240px; }

/* ─────────────────────────────────────────────────────────
 * 10. 연출 — 소리는 /js/cardbattle-fx.js
 * ───────────────────────────────────────────────────────── */

/* 떠오르는 숫자 */
.cb-float {
    position: absolute; left: 50%; top: 4px; transform: translateX(-50%);
    font-size: 1.2rem; font-weight: 800; pointer-events: none; z-index: 5;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    animation: cbFloat 1.25s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.cb-float.dmg { color: var(--cb-red); }
.cb-float.crit { color: #ff3d3d; font-size: 1.7rem; text-shadow: 0 0 14px rgba(255, 61, 61, 0.7), 0 2px 6px rgba(0, 0, 0, 0.9); }
.cb-float.heal { color: var(--cb-green); }
.cb-float.block { color: var(--cb-blue); }
@keyframes cbFloat {
    0% { opacity: 0; transform: translate(-50%, 8px) scale(0.7); }
    18% { opacity: 1; transform: translate(-50%, -8px) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -40px) scale(1); }
}

/* 칸 위에 찍히는 글자 */
.cb-stamp {
    position: absolute; left: 50%; top: 74%; transform: translate(-50%, -50%) rotate(-8deg);
    font-size: 0.95rem; font-weight: 900; letter-spacing: 0.02em; pointer-events: none; z-index: 6;
    padding: 1px 9px; border-radius: 6px; white-space: nowrap;
    color: #fff; background: rgba(10, 10, 12, 0.72); border: 2px solid #ffffff55;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}
.cb-stamp.block { color: var(--cb-blue); border-color: #7eb3ffaa; }
.cb-stamp.crit { color: #ff5a5a; border-color: #ff5a5aaa; }

/* 피격 흔들림 */
@keyframes cbShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-3px, 2px); }
    55% { transform: translate(3px, -2px); }
    80% { transform: translate(-2px, 1px); }
}
@keyframes cbShakeStrong {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(-7px, 4px) scale(1.035); }
    45% { transform: translate(7px, -4px) scale(1.035); }
    70% { transform: translate(-4px, 2px) scale(1.01); }
}
.fx-shake { animation: cbShake 0.4s ease; }
.fx-shake-strong { animation: cbShakeStrong 0.55s ease; border-color: var(--cb-red) !important; }

/* 회복·방어 반짝임 */
@keyframes cbFlashHeal {
    0% { box-shadow: 0 0 0 0 rgba(var(--ok-rgb), 0.55); }
    100% { box-shadow: 0 0 0 16px rgba(var(--ok-rgb), 0); }
}
@keyframes cbFlashBlock {
    0% { box-shadow: 0 0 0 0 rgba(126, 179, 255, 0.55); }
    100% { box-shadow: 0 0 0 16px rgba(126, 179, 255, 0); }
}
.fx-flash-heal { animation: cbFlashHeal 0.85s ease-out; }
.fx-flash-block { animation: cbFlashBlock 0.85s ease-out; }

/* 날아가는 공격 */
.cb-proj {
    position: absolute; width: 26px; height: 10px; border-radius: 999px; pointer-events: none;
    background: linear-gradient(90deg, transparent, #fff 60%, #fff);
    filter: drop-shadow(0 0 10px currentColor);
    color: #ff8f8f;
}
.cb-proj.small { width: 16px; height: 7px; }
.cb-proj.k-physical { color: #ff8f8f; background: linear-gradient(90deg, transparent, #ffd9d9 55%, #fff); }
.cb-proj.k-pierce { color: #ffbf6b; width: 40px; height: 4px; background: linear-gradient(90deg, transparent, #ffe3b0 40%, #fff); }
.cb-proj.k-magic { color: #7eb3ff; border-radius: 50%; width: 18px; height: 18px; background: radial-gradient(circle at 35% 35%, #fff, #7eb3ff 60%, #3d6bb0); }
.cb-proj.k-blast { color: #d08cff; border-radius: 50%; width: 22px; height: 22px; background: radial-gradient(circle at 35% 35%, #fff, #ffb86b 45%, #d0603c); }
.cb-proj .mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 0.95rem; filter: none; }

/* 맞는 순간 */
.cb-impact {
    position: absolute; width: 46px; height: 46px; border-radius: 50%;
    border: 6px solid var(--c, #ff8f8f); pointer-events: none;
    box-shadow: 0 0 24px -4px var(--c, #ff8f8f);
}
.cb-spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; pointer-events: none; }
.cb-slash {
    position: absolute; width: 86px; height: 4px; border-radius: 3px; pointer-events: none;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.7);
}
.cb-slash.pierce { width: 130px; height: 2px; }
.cb-rune {
    position: absolute; width: 78px; height: 78px; border-radius: 50%; pointer-events: none;
    border: 2px solid #7eb3ff; box-shadow: 0 0 22px -2px #7eb3ff99, inset 0 0 18px -4px #7eb3ff99;
}
.cb-rune::after {
    content: ""; position: absolute; inset: 12px; border-radius: 50%;
    border: 1px dashed #cfe1ff88;
}
.cb-confetti { position: absolute; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; }

/* 무대를 훑는 빛 */
.cb-sweep {
    position: absolute; left: 0; top: 0; bottom: 0; width: 40%; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

/* 화면 테두리 번쩍임 */
.cb-vignette {
    position: fixed; inset: 0; pointer-events: none; z-index: 8999; opacity: 0;
    box-shadow: inset 0 0 120px 20px rgba(255, 60, 60, 0.55);
}
.cb-vignette.heal { box-shadow: inset 0 0 120px 20px rgba(var(--ok-rgb), 0.45); }

/* 화면 가운데 알림 */
.cb-banner {
    position: fixed; left: 50%; top: 18%; transform: translate(-50%, -6px) scale(0.9);
    background: rgba(18, 18, 18, 0.94); border: 1px solid #333; border-radius: 12px;
    padding: 12px 22px; font-size: 1.05rem; font-weight: 800; color: #eee;
    opacity: 0; pointer-events: none; z-index: 9000; transition: opacity 0.18s, transform 0.18s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); max-width: 90vw; text-align: center;
}
.cb-banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.cb-banner.turn { color: var(--cb-gold); border-color: rgba(var(--brand-rgb), 0.4); }
.cb-banner.warn { color: #ff9f6b; border-color: #ff9f6b66; }
.cb-banner.down { color: var(--cb-red); border-color: #ff6b6b66; }
.cb-banner.end { color: var(--brand); border-color: rgba(var(--brand-rgb), 0.4); font-size: 1.25rem; }

/* 판 전체 규칙이 바뀔 때 훑고 지나가는 띠 */
.cb-ribbon {
    position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 14px 46px; border-radius: 4px; opacity: 0; pointer-events: none; z-index: 9000;
    background: linear-gradient(90deg, transparent, rgba(20, 20, 20, 0.96) 12%, rgba(20, 20, 20, 0.96) 88%, transparent);
    border-top: 1px solid rgba(var(--brand-rgb), 0.4); border-bottom: 1px solid rgba(var(--brand-rgb), 0.4);
    max-width: 96vw; text-align: center;
}
.cb-ribbon.show { opacity: 1; }
.cb-ribbon b { font-size: 1.35rem; font-weight: 900; color: var(--cb-gold); letter-spacing: 0.02em; }
.cb-ribbon i { font-style: normal; font-size: 0.84rem; color: #bdb190; }

/* 움직임 끄기 — 상태 표시는 그대로 두고 흔들림·반짝임만 멈춘다 */
body.cb-no-motion .cb-player.turn,
body.cb-no-motion .cb-defend,
body.cb-no-motion .cb-actions .btn.go:not([disabled]),
body.cb-no-motion .cb-reticle,
body.cb-no-motion .cb-result-crown .rays,
body.cb-no-motion .cb-stage-label em.aim,
body.cb-no-motion .cb-duel .bolt .line { animation: none !important; }
body.cb-no-motion .cb-hand .cb-card.is-new,
body.cb-no-motion .cb-log-line.newest,
body.cb-no-motion .cb-result,
body.cb-no-motion .cb-result tr { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
    .cb-player.turn, .cb-defend, .cb-reticle, .cb-result-crown .rays, .cb-duel .bolt .line { animation: none !important; }
    /* 데미지 숫자는 움직임 없이 나타났다 사라지기만 — 길이는 !important(공용 0.01ms 축소에 눌리면 안 보였다, 2026-10-29) */
    .cb-float { animation-name: cbFadeRM; animation-duration: 1.25s !important; }
}
@keyframes cbFadeRM { 0% { opacity: 0; } 15%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* ─────────────────────────────────────────────────────────
 * 11. 좁은 화면
 * ───────────────────────────────────────────────────────── */

@media (max-width: 1000px) {
    .cb-bottom { grid-template-columns: minmax(0, 1fr); }
    .cb-bottom-side .cb-log { max-height: 170px; }
}
@media (max-width: 900px) {
    .cb-hand { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}
@media (max-width: 700px) {
    .cb-arena { padding: 10px 10px 12px; border-radius: 14px; }
    .cb-players.stage { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .cb-players.stage .cb-player { padding: 9px 10px; }
    .cb-stage { padding: 10px; }
    /* 손패를 아래에 고정해 스크롤 없이 낼 수 있게 */
    .cb-hand.sticky {
        position: sticky; bottom: 0; z-index: 20;
        background: linear-gradient(180deg, transparent 0%, var(--bg-base) 18%);
        padding: 10px 0 8px; margin-bottom: -8px;
        max-height: 46vh; overflow-y: auto;
    }
    .cb-dial { width: 72px; height: 72px; }
    .cb-avatar.lg { width: 54px; height: 54px; font-size: 1.45rem; }
}
@media (max-width: 560px) {
    .cb-players { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .cb-hand { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
    .cb-hand .cb-card .cb-c-desc { display: none; }
    /* 설명을 감춘 좁은 카드에서는 위력 숫자가 속성 배지와 겹친다 — 흐름 안으로 내린다 */
    .cb-hand .cb-card .cb-c-num { position: static; margin-left: auto; }
    .cb-duel .bolt { min-width: 90px; }
    .cb-duel .bolt .line { width: 80px; }
}

/* ─────────────────────────────────────────────────────────
   한봇 게임즈 화면 (/cardbattle — 2026-11-13 누구나 하는 게임 개편)
   배치·단추·탭은 공용 public/css/boardgame/room.css(.bg-*) — 여기선 이 게임의 토큰과 방 목록·방 막대·규칙 칸만.
   토큰은 진행 화면 그대로: 밤 무대 #0e1218 · 판 #16181c · 선 #272a31 · 금빛 #f5b70a(내 차례·강조) · 상처 #ff6b6b
   ───────────────────────────────────────────────────────── */
.cb-root, .cb-root ~ .chat-fab, .cb-root ~ .chat-panel {
    --bg-bg: #0e1218;
    --bg-panel: #16181c;
    --bg-line: #272a31;
    --bg-ink: #e8e8ea;
    --bg-dim: #8a8d93;
    --bg-accent: #f5b70a;
    --bg-accent-ink: #1c1405;
    --bg-warn: #ff6b6b;
    --chat-accent: #f5b70a;
    --chat-accent-ink: #1c1405;
}
.cb-root .page-sub b { color: var(--bg-accent); font-weight: 700; }
.cb-root .cb-free { font-size: 0.76rem; color: var(--bg-dim); border: 1px dashed var(--bg-line-2); border-radius: 999px; padding: 2px 10px; }

/* 대기실 — 방 카드 */
.cb-root .cb-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.cb-root .cb-room {
    display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%;
    background: linear-gradient(180deg, #1b1e24, #16181c); border: 1px solid var(--bg-line); border-radius: 13px;
    padding: 12px 13px; color: var(--bg-ink); font-family: inherit; cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.cb-root .cb-room:hover { border-color: #4a515c; transform: translateY(-2px); }
.cb-root .cb-room.joined { border-color: color-mix(in srgb, var(--bg-accent) 55%, transparent); }
.cb-root .cb-room .rc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cb-root .cb-room .rc-host { font-weight: 700; font-size: 0.9rem; overflow-wrap: anywhere; }
.cb-root .cb-room .rc-meta { font-size: 0.76rem; color: var(--bg-dim); display: flex; gap: 10px; flex-wrap: wrap; }
.cb-root .cb-room .rc-meta b { color: var(--bg-ink); }
.cb-root .cb-tag { font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; border: 1px solid; }
.cb-root .cb-tag.solo { color: #7eb3ff; border-color: #7eb3ff55; }
.cb-root .cb-tag.team { color: #ff9f6b; border-color: #ff9f6b55; }
.cb-root .cb-tag.waiting { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.cb-root .cb-tag.running, .cb-root .cb-tag.finished { color: var(--bg-accent); border-color: color-mix(in srgb, var(--bg-accent) 40%, transparent); }
.cb-root .cb-tag.watch { color: #9bbcd8; border-color: #9bbcd855; }
.cb-root .cb-empty-rooms { padding: 22px 12px; text-align: center; color: var(--bg-dim); font-size: 0.86rem; line-height: 1.8; }
.cb-root .cb-code-input { text-transform: uppercase; letter-spacing: 0.16em; }

/* 지금 방 — 위 막대·규칙 */
.cb-root .cb-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.cb-root .cb-toolbar .spacer { flex: 1; }
.cb-root .cb-toolbar .bg-mini.off { color: #ff9f6b; border-color: #ff9f6b66; }
.cb-root .cb-roombar { display: grid; gap: 8px; margin-bottom: 12px; }
.cb-root .cb-roombar .bg-row { row-gap: 8px; }
.cb-root .cb-roomcode { font-weight: 800; color: var(--bg-accent); border: 1px solid color-mix(in srgb, var(--bg-accent) 40%, transparent); border-radius: 8px; padding: 4px 10px; letter-spacing: 0.16em; font-variant-numeric: tabular-nums; }
.cb-root .cb-rules > summary { cursor: pointer; font-weight: 700; color: var(--bg-ink); font-size: 0.9rem; }
.cb-root .cb-rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px 14px; margin-top: 10px; }
.cb-root .cb-rules-grid label { display: grid; gap: 4px; font-size: 0.8rem; color: var(--bg-dim); }
.cb-root .cb-rules-grid .input { width: 100%; box-sizing: border-box; }
.cb-root .cb-help { font-size: 0.8rem; color: var(--text-sub); line-height: 1.7; }
.cb-root .cb-help .cb-legend { margin: 6px 0; }
.cb-root .cb-keys b { color: var(--bg-ink); background: #1c2026; border: 1px solid #2e333a; border-radius: 5px; padding: 1px 6px; margin: 0 2px; font-weight: 600; }
.cb-root .cb-hand:empty { display: none; }
.cb-root .cb-name .pf-badge { margin-right: 0; }

/* 순위·내 기록 */
.cb-root .cb-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; color: var(--bg-ink); }
.cb-root .cb-table th, .cb-root .cb-table td { padding: 7px 8px; border-bottom: 1px solid var(--bg-line); text-align: left; }
.cb-root .cb-table th { color: var(--bg-dim); font-weight: 600; font-size: 0.76rem; }
.cb-root .cb-table td.n { font-variant-numeric: tabular-nums; text-align: right; }
.cb-root .cb-table tr.me td { color: var(--bg-accent); font-weight: 700; }
.cb-root .cb-tablewrap { overflow-x: auto; }
.cb-root .cb-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 8px; margin-bottom: 12px; }
.cb-root .cb-stat { background: var(--bg-soft); border: 1px solid var(--bg-line); border-radius: 10px; padding: 10px; }
.cb-root .cb-stat b { display: block; font-size: 1.2rem; color: var(--bg-ink); font-variant-numeric: tabular-nums; }
.cb-root .cb-stat span { font-size: 0.74rem; color: var(--bg-dim); }

@media (pointer: coarse) {
    .cb-root .bg-mini, .cb-root .bg-chip { min-height: 38px; }
    .cb-root .cb-keys { display: none; }
    .cb-root .input { font-size: 16px; }
}
@media (max-width: 900px) {
    .cb-root .cb-hand .cb-card .cb-c-num { position: static; margin-left: auto; }
    .cb-root .cb-actions, .cb-root .cb-defend { position: sticky; bottom: 0; z-index: 25; background: var(--bg-card); box-shadow: 0 -6px 16px var(--bg-bg); }
}
@media (max-width: 640px) {
    .cb-root .cb-players.stage:not(.cnt-1) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .cb-root .cb-players.stage .cb-player { padding: 8px; gap: 6px; }
    .cb-root .cb-players.stage .cb-avatar { width: 32px; height: 32px; font-size: 0.95rem; }
    .cb-root .cb-players.stage .cb-name { font-size: 0.82rem; }
    .cb-root .cb-center { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .cb-root .cb-room { transition: none; }
    .cb-root .cb-room:hover { transform: none; }
}
