.fight-wrap {
    margin: 0 auto;
    padding: 16px;
}

.card {
    background: #0f0f0f;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 14px;
}

.fight-top {
    position: relative;
    overflow: hidden;
}

.hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.hud-left,
.hud-right {
    width: 40%;
}

.hud-mid {
    width: 20%;
    text-align: center;
    color: #fff;
}

.name {
    font-weight: 900;
    color: #ddd;
    font-size: 12px;
    opacity: .9;
    margin-bottom: 6px
}

.round {
    font-weight: 900;
    letter-spacing: 1px;
    font-size: 13px;
    color: #ffd200
}

.timer {
    font-weight: 900;
    font-size: 22px;
    margin-top: 2px
}

.hp {
    height: 14px;
    background: #2b2b2b;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #1f1f1f
}

.hp-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(#4cff4c, #1ea61e);
    transition: width .18s linear
}

.hud-right .hp-bar {
    background: linear-gradient(#ff4c4c, #b81a1a)
}

.fight-text {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%) scale(.85);
    text-align: center;
    font-size: 46px;
    font-weight: 1000;
    color: #fff;
    text-shadow: 0 10px 25px rgba(0, 0, 0, .8);
    opacity: 0;
    pointer-events: none;
    transition: .18s;
    z-index: 10;
}

.fight-text.show {
    opacity: 1;
    transform: translateY(-50%) scale(1)
}

.fight-text.small {
    font-size: 32px
}

.fight-text.gold {
    color: #ffd200
}

.fight-text.red {
    color: #ff3d6a
}

.arena {
    position: relative;
    height: 240px;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .08), rgba(0, 0, 0, .65)),
        linear-gradient(#151515, #0b0b0b);
    border: 1px solid #222;
    overflow: hidden;
}

.fighter {
    position: absolute;
    bottom: 0;
    width: 160px;
    height: 220px;
    background: linear-gradient(#2a2a2a, #111);
    border: 1px solid #2b2b2b;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
}

.fighter.me {
    left: 26px
}

.fighter.enemy {
    right: 26px
}

.fighter.hit {
    animation: hit .16s ease
}

@keyframes hit {
    0% {
        transform: translateX(0)
    }

    30% {
        transform: translateX(-8px)
    }

    60% {
        transform: translateX(8px)
    }

    100% {
        transform: translateX(0)
    }
}

.controls {
    margin-top: 12px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid #222;
    border-radius: 10px;
    padding: 12px
}

.row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    color: #ddd
}

.row.small {
    font-size: 13px;
    opacity: .95
}

.lab {
    width: 60px;
    font-weight: 900;
    color: #ddd
}

.sel {
    flex: 1;
    height: 34px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #111;
    color: #fff;
    padding: 0 10px
}

.strength {
    display: flex;
    gap: 6px
}

.sbtn {
    width: 46px;
    height: 34px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #111;
    color: #ddd;
    font-weight: 900;
    cursor: pointer
}

.sbtn.on {
    background: #ff3d6a;
    border-color: #ff3d6a;
    color: #fff
}

.sound {
    margin-left: auto;
    width: 44px;
    height: 34px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #111;
    color: #fff;
    cursor: pointer
}

.vol {
    flex: 1
}

.vol-num {
    width: 34px;
    text-align: right;
    color: #fff;
    font-weight: 900
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff3d6a
}

.fight-btn {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(#ff3d6a, #d11945);
    color: #fff;
    font-weight: 1000;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 18px 30px rgba(0, 0, 0, .45);
}

.fight-btn:active {
    transform: scale(.99)
}

.fight-btn[disabled] {
    opacity: .55;
    cursor: not-allowed
}

.hint {
    margin-top: 8px;
    color: #bbb;
    font-size: 12px
}

.log {
    margin-top: 14px
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px
}

thead th {
    background: #3f464f;
    color: #fff;
    padding: 10px;
    border: 1px solid #2f353c;
    text-align: left
}

tbody td {
    padding: 10px;
    border: 1px solid #222;
    background: #111;
    color: #ddd
}

tbody tr:nth-child(even) td {
    background: #0d0d0d
}

.empty {
    text-align: center;
    color: #aaa;
    padding: 18px
}

.paging {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 14px 0;
}

.paging a {
    color: #fff;
}

.pg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #333;
    background: #111;
    color: #ddd;
    text-decoration: none;
    font-size: 13px;
}

.pg.on {
    background: #ddd;
    color: #111;
    border-color: #ddd;
}

tbody tr.just-added td {
    animation: flash 1.6s ease-out
}

@keyframes flash {
    0% {
        background: #3a3300
    }

    100% {
        background: inherit
    }
}

@media (max-width:860px) {

    .hud-left,
    .hud-right {
        width: 42%
    }

    .hud-mid {
        width: 16%
    }

    .fighter {
        width: 130px
    }
}

/* 배경 이미지 */
.arena {
    background-image: url("./assets/img/bg/fight_bg_clean_w.png?1");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

/* 살짝 게임 느낌 오버레이(선택) */
.arena::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 20%, rgba(0, 255, 255, .10), rgba(0, 0, 0, 0) 55%),
        linear-gradient(to bottom, rgba(0, 0, 0, .10), rgba(0, 0, 0, .35));
    z-index: 1;
}

/* 캐릭터/이펙트가 배경 위로 오도록 z-index 정리 */
#me,
#enemy,
#spark,
#particles,
.wall-spark,
.wall-scratch,
.shield-layer,
#koFlash,
#bonusPop {
    position: absolute;
    z-index: 10;
}

/* 실루엣 */
.fighter {
    background: none;
    border: 0;
    box-shadow: none;
    opacity: .92;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55));
}

.fighter.me {
    width: 220px;
    height: 240px;
    left: 18px;
    background: url("./assets/img/fight_silhouette_left.png") bottom left/contain no-repeat;
}

.fighter.enemy {
    width: 220px;
    height: 240px;
    right: 18px;
    background: url("./assets/img/fight_silhouette_right.png") bottom right/contain no-repeat;
}

/* KO 플래시 */
.ko-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0));
    opacity: 0;
    pointer-events: none;
}

.ko-flash.on {
    animation: flash .35s ease;
}

@keyframes flash {
    0% {
        opacity: 0
    }

    25% {
        opacity: 1
    }

    100% {
        opacity: 0
    }
}

/* 화면 쉐이크 */
.arena.shake {
    animation: shake .35s ease;
}

@keyframes shake {
    0% {
        transform: translate(0, 0)
    }

    15% {
        transform: translate(-6px, 2px)
    }

    30% {
        transform: translate(6px, -2px)
    }

    45% {
        transform: translate(-5px, -1px)
    }

    60% {
        transform: translate(5px, 1px)
    }

    100% {
        transform: translate(0, 0)
    }
}

/* 보너스 팝업 */
.bonus-pop {
    position: absolute;
    left: 50%;
    top: 20px;
    transform: translateX(-50%) translateY(-10px) scale(.95);
    opacity: 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .15);
    color: #fff;
    font-weight: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.bonus-pop.show {
    animation: pop 1.4s ease forwards;
}

@keyframes pop {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px) scale(.95)
    }

    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1)
    }

    70% {
        opacity: 1
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px) scale(.98)
    }
}

.bonus-pop .coins {
    font-size: 18px
}

.bonus-pop .amt {
    color: #ffd200
}

/* ===== Moving Game Animations ===== */
.arena {
    position: relative;
    overflow: hidden;
}

.fighter {
    will-change: transform, filter;
    transform: translateX(var(--x, 0px)) translateY(var(--y, 0px)) scale(var(--s, 1));
    transition: transform .12s linear, filter .12s linear;
}

/* 대시/백스텝 */
.fighter.dash {
    animation: dash .22s ease;
}

@keyframes dash {
    0% {
        transform: translateX(var(--x, 0px)) translateY(0)
    }

    45% {
        transform: translateX(calc(var(--x, 0px) + var(--dash, 22px))) translateY(0)
    }

    100% {
        transform: translateX(var(--x, 0px)) translateY(0)
    }
}

.fighter.back {
    animation: back .22s ease;
}

@keyframes back {
    0% {
        transform: translateX(var(--x, 0px))
    }

    60% {
        transform: translateX(calc(var(--x, 0px) - var(--dash, 18px)))
    }

    100% {
        transform: translateX(var(--x, 0px))
    }
}

/* 펀치/킥 */
.fighter.punch {
    animation: punch .26s ease;
}

@keyframes punch {
    0% {
        transform: translateX(var(--x, 0px))
    }

    35% {
        transform: translateX(calc(var(--x, 0px) + var(--atk, 16px)))
    }

    55% {
        transform: translateX(calc(var(--x, 0px) + var(--atk, 22px)))
    }

    100% {
        transform: translateX(var(--x, 0px))
    }
}

.fighter.kick {
    animation: kick .30s ease;
}

@keyframes kick {
    0% {
        transform: translateX(var(--x, 0px))
    }

    30% {
        transform: translateX(calc(var(--x, 0px) + var(--atk, 14px)))
    }

    55% {
        transform: translateX(calc(var(--x, 0px) + var(--atk, 26px)))
    }

    100% {
        transform: translateX(var(--x, 0px))
    }
}

/* 피격: 뒤로 밀림 + 번쩍 */
.fighter.hit {
    animation: hit .22s ease;
    filter: brightness(1.25) contrast(1.1);
}

@keyframes hit {
    0% {
        transform: translateX(var(--x, 0px))
    }

    40% {
        transform: translateX(calc(var(--x, 0px) + var(--kb, 18px)))
    }

    100% {
        transform: translateX(var(--x, 0px))
    }
}

/* KO: 쓰러짐 느낌 */
.fighter.ko {
    animation: koFall .7s ease forwards;
    filter: brightness(.9);
}

@keyframes koFall {
    0% {
        transform: translateX(var(--x, 0px)) translateY(0) rotate(0deg)
    }

    40% {
        transform: translateX(var(--x, 0px)) translateY(0) rotate(10deg)
    }

    100% {
        transform: translateX(var(--x, 0px)) translateY(38px) rotate(18deg) scale(.95)
    }
}

/* 승리 포즈 */
.fighter.winpose {
    animation: winpose .9s ease infinite;
}

@keyframes winpose {
    0% {
        transform: translateX(var(--x, 0px)) translateY(0)
    }

    50% {
        transform: translateX(var(--x, 0px)) translateY(-6px)
    }

    100% {
        transform: translateX(var(--x, 0px)) translateY(0)
    }
}

/* 히트 스파크 */
.spark {
    position: absolute;
    width: 120px;
    height: 120px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.6);
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle, rgba(255, 255, 255, .95) 0 18%, rgba(255, 235, 59, .85) 18% 35%, rgba(255, 61, 106, .55) 35% 52%, transparent 52% 100%);
    filter: drop-shadow(0 10px 20px rgba(255, 255, 255, .35));
}

.spark.on {
    animation: spark .22s ease;
}

@keyframes spark {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.4)
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05)
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.35)
    }
}

/* 파티클(간단 DOM) */
.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particles i {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 235, 59, .9);
    box-shadow: 0 0 18px rgba(255, 235, 59, .65);
    animation: particle .55s ease-out forwards;
}

@keyframes particle {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1)
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(.6)
    }
}

/* KO 임팩트 더 강하게 */
.ko-flash.on {
    animation: flash .28s ease;
}

.arena.shake {
    animation: shake .32s ease;
}

.rlt-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.rlt-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.rlt-modal-box {
    background: #111;
    color: #fff;
    padding: 26px 28px;
    border-radius: 10px;
    min-width: 260px;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.18s ease;
}

@keyframes modalPop {
    from {
        transform: scale(0.85);
        opacity: 0.5;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.rlt-modal-msg {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 18px;
}

.rlt-modal-btn {
    background: #ff3d6a;
    border: 0;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.fighter {
    position: absolute;
    bottom: 0;
    width: 260px;
    height: 420px;
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform .25s ease;
}

.fighter.left {
    left: 80px;
}

.fighter.right {
    right: 80px;
    transform: scaleX(-1);
}

.fighter.win {
    transform: translateY(-10px) scale(1.05);
}

.fighter.lose {
    transform: translateY(40px) rotate(10deg);
    opacity: .8;
}

.superarmor {
    animation: armorFlash .18s ease;
}

@keyframes armorFlash {
    0% {
        filter: brightness(2) saturate(2);
    }

    100% {
        filter: none;
    }
}

.wallhit {
    animation: wallShake .12s;
}

@keyframes wallShake {
    0% {
        transform: translateX(0)
    }

    50% {
        transform: translateX(-6px)
    }

    100% {
        transform: translateX(0)
    }
}

.guard {
    filter: brightness(.7);
}

.guardSpark {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
    background: url('./img/guard_spark.png') center/contain no-repeat;
    animation: spark .25s ease;
}

@keyframes spark {
    0% {
        transform: scale(.4);
        opacity: 1
    }

    100% {
        transform: scale(1.4);
        opacity: 0
    }
}

/* ✅ Pick Side (2단 버튼형 라디오) */
.pick-wrap {
    margin: 10px 0 12px;
}

.pick-title {
    font-size: 12px;
    font-weight: 800;
    opacity: .9;
    margin: 0 0 8px;
    letter-spacing: .2px;
    color: #fff;
}

.pick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* ✅ 2단 */
    gap: 10px;
}

.pick-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    height: 48px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(0, 0, 0, .22);
    color: #fff;

    font-weight: 900;
    cursor: pointer;
    user-select: none;

    box-shadow: 0 10px 18px rgba(0, 0, 0, .18);
    transition: transform .06s ease, filter .12s ease, border-color .12s ease;
}

.pick-btn:active {
    transform: scale(.98);
}

.pick-btn input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pick-btn .pick-ico {
    font-size: 18px;
    line-height: 1;
}

.pick-btn .pick-txt {
    font-size: 13px;
}

/* ✅ 선택 상태 */
.pick-btn.on {
    border-color: rgba(255, 255, 255, .42);
    filter: brightness(1.08);
    background: linear-gradient(180deg, rgba(255, 0, 90, .28), rgba(0, 0, 0, .25));
}

.pick-grid .pick-btn.on:first-child {
    background: linear-gradient(rgba(76, 255, 76, .28), rgba(30, 166, 30, .25)) !important;
}


/* 모바일 폭 좁을 때도 2단 유지(요청대로) */
@media (max-width: 420px) {
    .pick-btn {
        height: 44px;
    }

    .pick-btn .pick-txt {
        font-size: 12px;
    }
}

.rankline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* 칩 전체 */
.rankchip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
    background: #0e0e0e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}

/* 랭크 번호 */
.rankchip .rk {
    background: linear-gradient(180deg, #1a1a1a, #0c0c0c);
    color: #ffb347;
    font-weight: 800;
    padding: 3px 7px;
    font-size: 11px;
    border-right: 1px solid #222;
}

/* 닉네임 */
.rankchip .nm {
    background: transparent;
    color: #fff;
    padding: 3px 10px;
    font-size: 12px;
    letter-spacing: .2px;
}