:root{
    /* Theme variables - tweak these to change the whole UI */
    --bg-1: #1a0836;
    --bg-2:   #2e0b4f;
    --accent-1: #8b5cf6; /* purple */
    --accent-2: #ffe46b; /* pink */
    --glass: rgba(255,255,255,0.06);
    --glass-strong: rgba(255,255,255,0.08);
    --card-bg: #0f1724;
    --card-face: #ffffff;
    --muted: rgba(255,255,255,0.7);
    --success: #3ee6b5;
}

*{box-sizing:border-box}

html,body{
    height:100%;
    margin:0;
    padding:0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: radial-gradient(1000px 6000px at 10% 10%, var(--bg-2)  0%, transparent 30%),
                radial-gradient(200px 5000px at 90% 90%,#2e0b4f  0%, transparent 30%),
                linear-gradient(180deg, var(--bg-1), #07020a);
    /* background: red; */
    color:var(--card-face);
    width:100%
}

/* Turn indicator overlay */
#turn-indicator {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(180, 220, 255, 0.25), rgba(200, 245, 255, 0.15));
    border: 1px solid rgba(150, 220, 255, 0.6);
    color: #e8f8ff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 4px 18px rgba(0, 180, 255, 0.2), inset 0 0 12px rgba(150, 220, 255, 0.2);
    backdrop-filter: blur(6px);
    z-index: 9999;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: none;
}

.tournament_badge{
    height: 40px;
}
.ladder-row .tournament_badge{
    height: 20px;
}

#turn-indicator.visible { display: inline-flex; align-items: center; gap: 8px; }

/* Turn countdown timer pill (below the turn indicator) */
#turn-timer {
    position: fixed;
    top: 58px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(30, 120, 80, 0.35), rgba(20, 90, 60, 0.25));
    border: 1px solid rgba(120, 230, 170, 0.6);
    color: #d8ffe8;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(0, 200, 120, 0.25);
    backdrop-filter: blur(6px);
    z-index: 9998;
    font-variant-numeric: tabular-nums;
}
#turn-timer.urgent {
    background: linear-gradient(135deg, rgba(200, 40, 40, 0.55), rgba(140, 20, 20, 0.4));
    border-color: rgba(255, 120, 120, 0.9);
    color: #ffe0e0;
    box-shadow: 0 4px 18px rgba(255, 60, 60, 0.5);
    animation: turnTimerPulse 0.8s ease-in-out infinite;
}
@keyframes turnTimerPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.06); }
}

/* Timeout / reconnect notice banner */
#turn-timeout-banner {
    display: none;
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90vw;
    padding: 10px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(220, 140, 30, 0.92), rgba(180, 90, 10, 0.92));
    border: 1px solid rgba(255, 200, 120, 0.9);
    color: #fff8ec;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
    z-index: 10000;
}

/* Card click pulse (multiplayer: server-authoritative attack) */
.card.playing {
    animation: cardPlayPulse 0.45s ease-in-out;
    box-shadow: 0 0 18px rgba(255, 215, 80, 0.9);
}
@keyframes cardPlayPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

    /* <style> */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        .lobby-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        
        .lobby-header {
            text-align: center;
            color: white;
            margin-bottom: 40px;
        }
        
        .lobby-header h1 {
            font-size: 48px;
            margin-bottom: 10px;
            font-family: Oswald, sans-serif;
        }
        
        .lobby-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-top: 30px;
        }
        
        @media (max-width: 768px) {
            .lobby-grid {
                grid-template-columns: 1fr;
            }
        }
        
        .lobby-card {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 30px;
            border: 2px solid rgba(255, 255, 255, 0.2);
        }
        
        .lobby-card h2 {
            color: white;
            margin-bottom: 20px;
            font-size: 24px;
        }
        
        .create-room-section {
            text-align: center;
        }
        
        .bet-input-group {
            margin: 20px 0;
        }
        
        .bet-input-group label {
            display: block;
            color: white;
            margin-bottom: 10px;
            font-size: 14px;
        }
        
        .bet-input-group input {
            width: 100%;
            padding: 12px;
            border-radius: 10px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.1);
            color: white;
            font-size: 16px;
        }
        
        .bet-input-group input:focus {
            outline: none;
            border-color: #8b5cf6;
        }
        
        .create-room-btn {
            width: 100%;
            padding: 15px;
            background: linear-gradient(135deg, #8b5cf6, #3b82f6);
            border: none;
            border-radius: 12px;
            color: white;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            transition: transform 0.2s;
            font-family: Oswald, sans-serif;
        }
        
        .create-room-btn:hover {
            transform: translateY(-2px);
        }
        
        .create-room-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .room-list {
            max-height: 500px;
            overflow-y: auto;
        }
        
        .room-item {
            background: rgba(255, 255, 255, 0.05);
            padding: 20px;
            border-radius: 15px;
            margin-bottom: 15px;
            border: 2px solid rgba(255, 255, 255, 0.1);
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 15px;
            flex-wrap: wrap;
        }
        
        .room-item:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: #8b5cf6;
            transform: translateY(-2px);
        }
        
        .room-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: linear-gradient(135deg, #8b5cf6, #3b82f6);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            position: relative;
            flex-shrink: 0;
        }
        
        .online-indicator {
            position: absolute;
            bottom: 2px;
            right: 2px;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 2px solid #1a1a2e;
        }
        
        .online-indicator.online {
            background: #10b981;
            box-shadow: 0 0 8px #10b981;
        }
        
        .online-indicator.offline {
            background: #6b7280;
        }
        
        .room-details-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .room-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .room-id {
            color: #8b5cf6;
            font-weight: bold;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .room-code-badge {
            background: rgba(139, 92, 246, 0.2);
            padding: 4px 10px;
            border-radius: 6px;
            font-family: monospace;
            font-size: 14px;
        }
        
        .creator-name {
            color: rgba(255, 255, 255, 0.9);
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .room-stats {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
        }
        
        .stat-item {
            display: flex;
            align-items: center;
            gap: 6px;
            color: rgba(255, 255, 255, 0.8);
            font-size: 13px;
        }
        
        .stat-icon {
            color: #8b5cf6;
            font-size: 14px;
        }
        
        .room-status {
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: bold;
            text-transform: uppercase;
        }
        
        .status-waiting {
            background: rgba(251, 191, 36, 0.2);
            color: #fbbf24;
            border: 1px solid #fbbf24;
        }
        
        .status-ready {
            background: rgba(16, 185, 129, 0.2);
            color: #10b981;
            border: 1px solid #10b981;
        }
        
        .room-age {
            color: rgba(255, 255, 255, 0.5);
            font-size: 12px;
        }
        
        .room-info {
            color: white;
            margin-bottom: 15px;
        }
        
        .room-info p {
            margin: 5px 0;
            font-size: 14px;
        }
        
        .join-room-btn {
            padding: 12px 24px;
            background: #10b981;
            border: none;
            border-radius: 8px;
            color: white;
            font-weight: bold;
            cursor: pointer;
            transition: background 0.2s;
        }
        
        .join-room-btn:hover {
            background: #059669;
        }
        
        .join-room-btn:disabled {
            background: #6b7280;
            cursor: not-allowed;
        }
        
        .empty-state {
            text-align: center;
            padding: 40px;
            color: rgba(255, 255, 255, 0.6);
        }
        
        .empty-state i {
            font-size: 48px;
            margin-bottom: 15px;
            opacity: 0.5;
        }
        
        .status-indicator {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-right: 8px;
        }
        
        .status-online {
            background: #10b981;
            box-shadow: 0 0 10px #10b981;
        }
        
        .status-offline {
            background: #6b7280;
        }
        
        .player-count {
            color: rgba(255, 255, 255, 0.8);
            font-size: 14px;
            margin-top: 10px;
        }
        
        .back-link {
            display: inline-block;
            color: white;
            text-decoration: none;
            margin-bottom: 20px;
            padding: 10px 20px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            transition: background 0.2s;
        }
        
        .back-link:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .header-controls {
            position: absolute;
            top: 20px;
            right: 20px;
            display: flex;
            gap: 10px;
            align-items: center;
        }
        
        .login-btn {
            padding: 10px 20px;
            background: linear-gradient(135deg, #8b5cf6, #3b82f6);
            border: none;
            border-radius: 8px;
            color: white;
            font-weight: bold;
            cursor: pointer;
            text-decoration: none;
            transition: transform 0.2s;
            font-family: Oswald, sans-serif;
        }
        
        .login-btn:hover {
            transform: translateY(-2px);
        }
        
        .username-display {
            padding: 10px 20px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: white;
            font-weight: bold;
        }
        
        .logout-btn {
            padding: 10px 20px;
            background: rgba(255, 255, 255, 0.1);
            border: none;
            border-radius: 8px;
            color: white;
            font-weight: bold;
            cursor: pointer;
            text-decoration: none;
            transition: background 0.2s;
        }
        
        .logout-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        
        /* Login Modal */
        .login-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 9999;
            align-items: center;
            justify-content: center;
        }
        
        .login-modal-overlay.active {
            display: flex;
        }
        
        .login-modal {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(20px);
            border-radius: 20px;
            padding: 40px;
            border: 2px solid rgba(255, 255, 255, 0.2);
            max-width: 400px;
            width: 90%;
            text-align: center;
        }
        
        .login-modal h2 {
            color: white;
            margin-bottom: 20px;
            font-family: Oswald, sans-serif;
        }
        
        .login-modal p {
            color: rgba(255, 255, 255, 0.8);
            margin-bottom: 30px;
        }
        
        .modal-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
        }
        
        .modal-btn {
            padding: 12px 30px;
            border: none;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: transform 0.2s;
            text-decoration: none;
            display: inline-block;
        }
        
        .modal-btn-primary {
            background: linear-gradient(135deg, #8b5cf6, #3b82f6);
            color: white;
        }
        
        .modal-btn-secondary {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }
        
        .modal-btn:hover {
            transform: translateY(-2px);
        }
    /* </style> */

.brand{
    font-family: Oswald, sans-serif;
}
/* rgba(10,6,24,0.6) */
/* Top header */
.site-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 28px;
    gap:16px;
}

.skip-link{
    position:fixed;
    top:8px;
    left:8px;
    z-index:10000;
    padding:10px 14px;
    border-radius:8px;
    background:#fff;
    color:#111827;
    font-weight:800;
    transform:translateY(-160%);
}
.skip-link:focus{transform:translateY(0);outline:3px solid #EF4036;outline-offset:2px}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible{
    outline:3px solid #fbbf24;
    outline-offset:3px;
}

.brand{
    font-weight:700;
    letter-spacing:1px;
    font-size:18px;
    color:var(--accent-1);
}

.controls{display:flex;gap:10px}
.btn{
    background:#0ec387 ;
    color:#202020;
    padding:10px 14px;
    border-radius:15px;
    font-family: Oswald, sans-serif;
    border:none;
    cursor:pointer;
    box-shadow:0 6px 18px rgba(139,92,246,0.15);
}
.btn:hover{transform:translateY(-2px)}

.btn-glass{
    color:rgba(139,92,246,0.9);
    padding:7px 14px;
    border-radius:15px;
    font-family: Oswald, sans-serif;
    font-weight: 600;
    cursor:pointer;
    /* box-shadow:0 6px 18px rgba(139,92,246,0.15);    */
}
/* Main layout: left game area, right leaderboard */
/* .app-grid{
    display:grid;
    grid-template-columns: 1fr 320px;
    gap:24px;
    max-width:1200px;
    margin:24px auto;
    padding:0 20px 40px;
} */
.app-grid{
    gap:24px;
    max-width:1200px;
    margin:24px auto;
    padding:0 20px 40px; 
    width:100%;
    /* justify-content: flex-end;  */
    align-items: flex-start !important; 
    height: 100vh;
    overflow: auto;
}

@media (max-width: 1000px) {
        .app-grid{
 
            flex-wrap: wrap;
        }
        .leaderboard{
            max-width: 1000px !important;
        }
}

.leaderboard{
    max-width: 400px;
}

.panel{
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius:16px;
    padding:18px;
    box-shadow: 0 10px 30px rgba(4,4,8,0.6);
    border: 1px solid rgba(255,255,255,0.04);
    /* overflow: auto; */
    width:100%;
}

/* Game table */
.game-table{
    position:relative;
    height:420px;
    display:flex;
    align-items:center;
    justify-content:center;
    width: 100%;
    flex-direction: column;
    /* overflow:auto; */
}

.table-stage{
    width:100%;
    max-width:820px;
    height:100%;
    position:relative;
}
.score{
    gap:0px !important;
}
/* .attack-pile-cont{
    position:absolute;
    top:18%;
    left:50%;
    transform:translate(-50%,-50%);
    width: 100%;
} */
 .attack-pile-cont{

    width: 100%;
 }
/* Attack pile centered with subtle glass */
.attack-pile{
    position: relative;
    width:220px;
    height:100px;
    border-radius:14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border:1px solid rgba(255,255,255,0.08);
    display:flex;
    flex-direction:row;
    gap:8px;
    align-items:center;
    justify-content:center;
    padding:8px;
    pointer-events:none;
}
.game-table{
    gap:20px
}
.cont-narrative{
    /* margin-top: -55px; */
    width: 100% !important;
    /* background-color: #3ee6b5; */
    min-width: 300px;
    margin-left: auto !important;
    margin-right: auto !important;
}
.gen-flex{
    display:flex;align-items:center;justify-content:center;gap:8px
}
.gen-flex-col{
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px
}

/* Cards container (player cards) */
#player-cards{
    position: relative;
    height: 170px;
    width: max-content;
    min-width: 100%;
    display: block;
    pointer-events: auto;
    background: none !important;
}

.attack-confirm-actions .caption{
    color:#202020;
}

.ambience{
    background: rgba(29, 12, 68, 0.6);
    border:2px solid rgba(255, 209, 209, 0.09);  
    border-color: rgba(139,92,246,0.9);
    box-shadow: 0 0 28px rgba(139,92,246,0.1), 0 0 60px rgba(139,92,246,0.30);
}

.game-over-modal-cont{
    position: fixed;
    top:0;left:0;right:0;bottom: 0;
    background-color: rgba(26, 8, 54,0.8);
    z-index: 1999;
    backdrop-filter: blur(10px);
    display: none;
    /* justify-content: flex-start !important; */
}

.game-over-modal{
    position:absolute;
    top:50%;left:50%;
    transform: translate(-50%,-50%);
    width:95%;
    max-width: 500px;
    min-height: 400px;
    z-index: 2000;
    border-radius: 20px;
    display: none;
    padding: 30px;
    justify-content: flex-start !important;
    overflow: auto !important;
    max-height: 90vh !important;
    background: linear-gradient(135deg, rgba(139,92,246,0.15) 0%, rgba(59,130,246,0.15) 100%);
    border: 2px solid rgba(139,92,246,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 80px rgba(139,92,246,0.2);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(231,76,60,0.8);
    border-color: rgba(231,76,60,1);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(231,76,60,0.5);
}

.game-over-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-over-icon {
    font-size: 64px;
    color: #fbbf24;
    margin-bottom: 15px;
    animation: trophy-bounce 1s ease-in-out infinite;
}

@keyframes trophy-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-over-title {
    font-size: 36px;
    font-weight: bold;
    margin: 0;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-over-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.winner-info {
    text-align: center;
}

.winner-badge {
    font-size: 28px;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 50px;
    margin-bottom: 15px;
    display: inline-block;
}

.winner-badge.player-win {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 0 30px rgba(16,185,129,0.5);
}

.winner-badge.opponent-win {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 0 30px rgba(239,68,68,0.5);
}

.win-type {
    font-size: 20px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
    background: rgba(139,92,246,0.2);
    border: 1px solid rgba(139,92,246,0.4);
}

.win-type.dealuxe-win {
    background: rgba(245,158,11,0.2);
    border-color: rgba(245,158,11,0.6);
    color: #fbbf24;
}

.win-type.escape-win {
    background: rgba(59,130,246,0.2);
    border-color: rgba(59,130,246,0.6);
    color: #60a5fa;
}

.win-type.crazy-win {
    background: rgba(236,72,153,0.2);
    border-color: rgba(236,72,153,0.6);
    color: #ec4899;
}

.win-type.trail-win {
    background: rgba(168,85,247,0.2);
    border-color: rgba(168,85,247,0.6);
    color: #a855f7;
}

.game-stats {
    background: rgba(0,0,0,0.3);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.stat-label {
    color: rgba(255,255,255,0.7);
}

.stat-value {
    font-weight: bold;
    font-size: 20px;
    color: #60a5fa;
}

.new-game-btn {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(139,92,246,0.8), rgba(59,130,246,0.8));
    border: 2px solid rgba(139,92,246,0.5);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.new-game-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(139,92,246,0.6);
}

.show-game-over{
    display:flex;
}

/* Embedded lobby/login modal styles moved from game.html */
.lobby-modal-overlay, .login-modal-overlay {
    display: none;
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    background: rgba(0,0,0,0.65);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lobby-modal-overlay.active, .login-modal-overlay.active {
    display: flex;
}
.lobby-modal, .login-modal {
    background: rgba(18,18,20,0.95);
    color: #fff;
    border-radius: 12px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    padding: 24px;
    width: 100%;
    max-width: 1100px;
    border: 1px solid rgba(255,255,255,0.06);
}
.lobby-modal .modal-close-btn, .login-modal .modal-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* Prize display in game over modal */
.prize-display {
    background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(245,158,11,0.2));
    border: 2px solid rgba(251,191,36,0.5);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    animation: prize-shine 2s ease-in-out infinite;
}

@keyframes prize-shine {
    0%, 100% {
        box-shadow: 0 0 20px rgba(251,191,36,0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(251,191,36,0.6), 0 0 60px rgba(245,158,11,0.4);
    }
}

.prize-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 32px;
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251,191,36,0.8);
    margin-bottom: 8px;
}

.prize-amount i {
    font-size: 36px;
    animation: coin-spin 3s linear infinite;
}

@keyframes coin-spin {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.prize-label {
    color: rgba(251,191,36,0.8);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-summary {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.balance-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.balance-summary-row span:first-child {
    color: rgba(255,255,255,0.7);
}

.balance-summary-row span:last-child {
    font-weight: bold;
    font-size: 20px;
    color: #60a5fa;
}

/* Tournament-mode game-over result section (Phase 3 result UX) */
.tournament-result-section {
    background: rgba(139, 92, 246, 0.10);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.tournament-result-msg {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px;
    line-height: 1.4;
}

.tournament-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.tournament-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #e9d5ff;
    text-decoration: none;
    font-family: Oswald, sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
}

.tournament-cta-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.9);
    color: #fff;
    transform: translateY(-2px);
}

.tournament-cta-btn.tournament-cta-primary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: transparent;
    color: #1a0836;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.tournament-cta-btn.tournament-cta-primary:hover {
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
    color: #1a0836;
}

/* Responsive modals */
@media (max-width: 600px) {
    .game-start-modal, .game-over-modal {
        width: 98%;
        padding: 25px 20px;
        max-height: 95vh;
    }
    
    .game-start-modal h2 {
        font-size: 32px;
    }
    
    .game-over-title {
        font-size: 28px;
    }
    
    .prize-amount {
        font-size: 24px;
    }
    
    .game_start_btn .btn {
        font-size: 18px;
    }
}

/* Game start modal (same styling as game over modal but visible by default) */
.game-start-modal-cont {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(10, 4, 25, 0.97);
    z-index: 2500;
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-start-modal {
    width: 95%;
    max-width: 550px;
    min-height: 400px;
    border-radius: 24px;
    padding: 35px;
    justify-content: flex-start !important;
    overflow: auto;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(75, 40, 150, 0.4) 0%, rgba(30, 64, 175, 0.4) 50%, rgba(150, 40, 100, 0.4) 100%);
    border: 3px solid rgba(139,92,246,0.6);
    box-shadow: 0 30px 80px rgba(0,0,0,0.9), 0 0 100px rgba(139,92,246,0.5), inset 0 0 60px rgba(0,0,0,0.3);
    position: relative;
    animation: modal-entrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-entrance {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.game-start-modal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #8b5cf6, #3b82f6, #ec4899, #8b5cf6);
    border-radius: 24px;
    z-index: -1;
    filter: blur(20px);
    opacity: 0.5;
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.game-start-modal h2 {
    font-size: 42px;
    font-weight: 900;
    margin: 0 0 8px 0;
    color: #fff;
    text-shadow: 0 0 30px rgba(139,92,246,0.8), 0 0 60px rgba(59,130,246,0.6);
    letter-spacing: 2px;
    animation: title-glow 2s ease-in-out infinite;
}

@keyframes title-glow {
    0%, 100% { text-shadow: 0 0 30px rgba(139,92,246,0.8), 0 0 60px rgba(59,130,246,0.6); }
    50% { text-shadow: 0 0 40px rgba(139,92,246,1), 0 0 80px rgba(59,130,246,0.8); }
}

.game-start-modal small {
    color: rgba(255,255,255,0.7);
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-start-modal h5 {
    color: #fbbf24;
    margin: 12px 0 20px 0;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(251,191,36,0.5);
}

.game-start-modal .group {
    margin-bottom: 15px;
}

.game-start-modal .acc-labels {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-bottom: 5px;
}

.game-start-modal .form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(139,92,246,0.3);
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

.game-start-modal .form-control:focus {
    outline: none;
    border-color: rgba(139,92,246,0.8);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 20px rgba(139,92,246,0.4), inset 0 2px 8px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.game_start_btn {
    width: 100%;
    margin-top: 25px;
    padding: 18px 0;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(139,92,246,0.4);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game_start_btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.game_start_btn:hover::before {
    width: 300px;
    height: 300px;
}

.game_start_btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(139,92,246,0.6), 0 0 40px rgba(59,130,246,0.4);
}

.game_start_btn:active {
    transform: translateY(-2px) scale(0.98);
}

.game_start_btn .btn {
    margin: 0;
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

/* Player balance display in game start modal */
.player-balance-display {
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(139,92,246,0.5);
}

.player-balance-display .balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.player-balance-display .balance-label {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.player-balance-display .balance-value {
    color: #60a5fa;
    font-weight: bold;
    font-size: 16px;
}

.player-balance-display .balance-value.expired {
    color: #ef4444;
    text-decoration: line-through;
}

.player-balance-display .balance-note {
    margin-top: 10px;
    padding: 8px;
    background: rgba(239,68,68,0.2);
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 12px;
    text-align: center;
}

.player-balance-display .balance-disclaimer {
    margin-top: 5px;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-style: italic;
    text-align: center;
}

.game-start-modal .bet-caption {
    color: rgba(139,92,246,0.9);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.bet-balance-display {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    border: 1px solid rgba(139,92,246,0.4);
}

.bet-balance-display .balance-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.bet-balance-display .balance-info-row span:first-child {
    color: rgba(255,255,255,0.6);
}

.bet-balance-display .balance-info-row span:last-child {
    font-weight: bold;
    color: #60a5fa;
}

.bet-balance-display .remaining-balance {
    transition: color 0.3s ease;
}

/* Hand glow states */
#player-cards.hand-attack{ 
    box-shadow: 0 0 0 rgba(255,0,0,0.0);
    animation: hand-attack-flash 1600ms ease-in-out infinite;
    background-color: rgba(244, 3, 3, 0) !important;
    /* border-radius: 14px; */
}
#player-cards.hand-draw{
    box-shadow: 0 0 36px rgba(34,197,94,0.35), 0 0 12px rgba(34,197,94,0.25);
    border: 1px solid rgba(34,197,94,0.22);
    border-radius: 14px;
}

/* Raised card for attack (click-to-raise mechanism) - just highlight, no pull-up */
.card.raised {
    box-shadow: 0 0 0 4px rgba(139,92,246,0.9), 0 0 30px rgba(139,92,246,0.7), 0 0 60px rgba(255,107,203,0.5) !important;
    border-color: rgba(255,255,255,0.9) !important;
    /* z-index: 1000 !important; */
    animation: raised-pulse 1.5s ease-in-out infinite;
    transition: all 0.3s ease;
    transform: scale(0.9);
}

@keyframes raised-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 4px rgba(139,92,246,0.9), 0 0 30px rgba(139,92,246,0.7), 0 0 60px rgba(255,107,203,0.5);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(139,92,246,1), 0 0 40px rgba(139,92,246,0.9), 0 0 80px rgba(255,107,203,0.7);
    }
}

/* Push button for attack */
.push-attack-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(139,92,246,0.9), rgba(255,107,203,0.8));
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    z-index: 999;
    z-index:1005;
    display: none;
    box-shadow: 0 8px 24px rgba(139,92,246,0.5), 0 0 20px rgba(255,107,203,0.3);
    transition: all 0.3s ease;
    animation: slideUpButton 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.push-attack-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 12px 32px rgba(139,92,246,0.7), 0 0 30px rgba(255,107,203,0.5);
    background: linear-gradient(135deg, rgba(139,92,246,1), rgba(255,107,203,0.9));
}

.push-attack-btn:active {
    transform: translateX(-50%) translateY(0);
}

@keyframes slideUpButton {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes hand-attack-flash{
    0%   { box-shadow: 0 0 12px rgba(255,99,71,0.25), 0 0 28px rgba(255,99,71,0.20); }
    50%  { box-shadow: 0 0 28px rgba(255,99,71,0.45), 0 0 60px rgba(255,0,0,0.30); }
    100% { box-shadow: 0 0 12px rgba(255,99,71,0.25), 0 0 28px rgba(255,99,71,0.20); }
}

.card{
    position:absolute;
    bottom:0;
    width:120px;
    height:170px;
    background:
        radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,1) 0%, rgba(246,248,252,1) 55%, rgba(226,231,240,1) 100%);
    border-radius:12px;
    border:1px solid rgba(190,200,216,0.9);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.65),
        inset 0 2px 5px rgba(255,255,255,0.75),
        0 16px 38px rgba(2,2,6,0.6);
    cursor:pointer;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    padding:10px;
    color:rgb(36, 36, 36);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    touch-action:none;
    overflow:hidden;
}

/* Glossy sheen across the card face (real playing-card shine) */
.card::before{
    content:"";
    position:absolute;
    inset:0;
    border-radius:inherit;
    background: linear-gradient(125deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.14) 34%, rgba(255,255,255,0) 55%);
    pointer-events:none;
    z-index:2;
}

/* Pile cards should flow horizontally inside .attack-pile instead of stacking */
.attack-pile .card{
    position:static; /* allow flexbox layout */
    width: auto; /* size controlled by JS */
    height: auto;
    box-shadow: 0 8px 20px rgba(2,2,6,0.45);
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Enter animation for cards appended into the pile */
.card.entering{
    transform: translateY(-12px) scale(0.95);
    opacity: 0;
}
.attack-pile .card{
    transition: transform 260ms cubic-bezier(.2,.9,.2,1), opacity 260ms ease;overflow: hidden;
}

.card .rank{font-size:20px;font-weight:700; color: #da1212 !important;}
.card .suit{font-size:18px; color: #da1212 !important;} /*color:rgb(36, 36, 36);*/
.card .center{font-size:44px;text-align:center; color: #da1212 !important;}

/* Keep card rank/suit text above the gloss sheen (fixes text loss on proxy browsers like Opera Mini) */
.card .rank,
.card .center,
.card .suit {
    position: relative;
    z-index: 3;
}

/* Player cards - warm gold face so your hand is instantly recognisable */
.card.player-card-old{
    border-color: rgba(218, 18, 18,0.35) ;
    background:
        linear-gradient(120% 85% at 22% 0%, #ffffff 0%, #fdfaf3 52%, #f7ecd4 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.75),
        inset 0 0 16px rgba(250,204,21,0.16),
        0 16px 38px rgba(2,2,6,0.6);
}
.card-old.player-card .rank,
.card-old.player-card .suit,
.card-old.player-card .center {
    color: #da1212 !important;
    text-shadow:0 1px 2px rgba(218, 218, 218, 0.35) 0 1px 2px rgba(218, 18, 18,0.35) ;
    /* -webkit-text-stroke: 1px #f52020 !important; */
}

/* Test New Look */
.card.player-card {
    /* position: relative; */
    overflow: hidden;

    /* Warm playing-card stock */
    background:
        radial-gradient(
            ellipse at 22% 8%,
            rgba(255,255,255,0.95) 0%,
            rgba(255,255,255,0.35) 35%,
            transparent 65%
        ),
        linear-gradient(
            135deg,
            #fffef9 0%,
            #faf7ee 48%,
            #f3ead8 100%
        );

    border: 1px solid rgba(68, 67, 67, 0.32);
    border-radius: 10px;

    /* Physical card depth */
    box-shadow:
        0 1px 1px rgba(255,255,255,0.9),
        0 2px 3px rgba(177, 87, 2, 0.18),
        0 8px 18px rgba(0,0,0,0.28),
        0 18px 38px rgba(247, 7, 7, 0.42),
        inset 0 0 0 1px rgba(255,255,255,0.7),
        inset 0 0 14px rgba(7, 247, 187, 0.06);

    /* Very subtle physical-paper appearance */
    filter: saturate(0.96);
}

/* Themed player card faces for J/Q/K (PNGs in /static/images; all other ranks
   keep the plain warm gradient face). Added by playerCardBgClass() in
   game.js / game-core.js. */
.card.player-card.player-card-j-bg{
    background:
        url('/static/images/card-j-bg.png') center / cover no-repeat,
        radial-gradient(ellipse at 22% 8%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.35) 35%, transparent 65%),
        linear-gradient(135deg, #fffef9 0%, #faf7ee 48%, #f3ead8 100%);
}
.card.player-card.player-card-q-bg{
    background:
        url('/static/images/card-q-bg.png') center / cover no-repeat,
        radial-gradient(ellipse at 22% 8%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.35) 35%, transparent 65%),
        linear-gradient(135deg, #fffef9 0%, #faf7ee 48%, #f3ead8 100%);
}
.card.player-card.player-card-k-bg{
    background:
        url('/static/images/card-k-bg.png') center / cover no-repeat,
        radial-gradient(ellipse at 22% 8%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.35) 35%, transparent 65%),
        linear-gradient(135deg, #fffef9 0%, #faf7ee 48%, #f3ead8 100%);
}


/* Fine inner edge — similar to the edge of printed card stock */
.card.player-card::before {
    content: "";
    position: absolute;
    inset: 3px;

    border: 1px solid rgba(120, 20, 20, 0.10);
    border-radius: 7px;

    pointer-events: none;
}




/* Card typography / suits */
.card.player-card .rank,
.card.player-card .suit
{
    color: #c91414 !important;

    /* Printed ink — not neon/glowing red */
    text-shadow:
        0 0.5px 0 rgba(255,255,255,0.35),
        0 1px 1px rgba(0, 0, 0, 0.18);

    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

.card.player-card .center {
    color: rgba(201, 20, 20,0)
}
/* Test New Look */

/* Opponent cards - dark navy face, unmistakably different from your hand */
.card.opponent-card{
    border-color: rgba(99,179,237,0.9);
    background:
        linear-gradient(160deg, #2c3b60 0%, #1e2944 58%, #16203a 100%);
    box-shadow:
        inset 0 0 0 1px rgba(122,180,255,0.28),
        inset 0 0 24px rgba(8,12,32,0.55),
        0 16px 38px rgba(2,2,6,0.6);
}
.card.opponent-card .rank,
.card.opponent-card .suit,
.card.opponent-card .center {
    color: #c2e2ff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}

.card.focused{transform:translateY(-18%);box-shadow:0 28px 70px rgba(139,92,246,0.5);z-index:80}
.card.selected{outline:3px solid rgba(255,255,255,0.06);box-shadow:0 22px 50px rgba(2,2,6,0.7)}

.card.dragging{transition:none;z-index:999;cursor:grabbing}

.player-cards-box{
    width: 100%;
    overflow: visible; /* Allow raised cards to overflow */
    height: max-content;
    position: relative;
    /* Space for raised cards */
    /* Space for push button */
}

/* Inner wrapper handles the scrolling */
.player-cards-scroll-wrapper {
    width: 100%;
    overflow-x: auto; /* Enable horizontal scrolling */
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep scroll functionality */
.player-cards-scroll-wrapper::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Webkit browsers */
}

.player-cards-scroll-wrapper {
    -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

/* Scroll buttons for hand - positioned relative to game-table */
.hand-scroll-btn {
    position: absolute;
    top: auto;
    bottom: 100px; /* Position above the hand */
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(139,92,246,0.9), rgba(255,107,203,0.8));
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 1009;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(139,92,246,0.5);
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.hand-scroll-btn.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.hand-scroll-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 24px rgba(139,92,246,0.7);
    background: linear-gradient(135deg, rgba(139,92,246,1), rgba(255,107,203,0.9));
}

.hand-scroll-btn:active {
    transform: scale(0.95);
}

.hand-scroll-left {
    left: 10px;
}

.hand-scroll-right {
    right: 10px;
}

/* Attack zone (top center) */
.attack-zone{
    position:absolute;
    top:0;
    left:0;
    bottom: 0;
    right:0;
    border-radius:12px;
    text-align: center;
    z-index:500;
    display:flex;align-items:center;justify-content:center;
    pointer-events:none;
    background: rgba(251, 193, 67, 0.05);;
    opacity:0;transition:opacity .18s ease, border-color .18s ease;
    border:2px dashed rgba(255, 209, 209, 0.09);
}
.attack-zone.active{opacity:1;pointer-events:auto}
.attack-zone.hover{border-color: rgba(139,92,246,0.9);background:linear-gradient(90deg, rgba(139,92,246,0.06), rgba(255,107,203,0.04))}
.attack-zone.flash{
    opacity: 1 !important;
    animation: attack-zone-flash 0.6s ease;
}

@keyframes attack-zone-flash {
    0%, 100% { 
        background: rgba(251, 193, 67, 0.05);
        box-shadow: 0 0 0 rgba(139,92,246,0);
        border-color: rgba(255, 209, 209, 0.09);
    }
    50% { 
        background: linear-gradient(90deg, rgba(139,92,246,0.35), rgba(255,107,203,0.25));
        box-shadow: 0 0 50px rgba(139,92,246,0.8), inset 0 0 40px rgba(139,92,246,0.4);
        border-color: rgba(139,92,246,1);
        border-style: solid;
    }
}

/* Narrative / tracking */
.cont-narrative{display:flex;flex-direction:column;gap:8px}
.game-comments{background:rgba(0,0,0,0.25);padding:8px;border-radius:8px;color:var(--muted);font-size:13px;max-height:70px;overflow:hidden}
.game-comments div{padding:4px 6px;border-radius:6px;background:rgba(255,255,255,0.02);margin-bottom:4px}
.game-comments.flash{animation:comment-flash 900ms ease both}

@keyframes comment-flash{
    0% { transform: translateY(-3px) scale(1); background-color: rgba(255,255,255,0.02); box-shadow: 0 0 0 rgba(0,0,0,0); }
    20% { transform: translateY(-6px) scale(1.02); background-color: rgba(255,255,255,0.05); box-shadow: 0 12px 30px rgba(139,92,246,0.3); }
    80% { transform: translateY(-2px) scale(1.01); background-color: rgba(255,255,255,0.03); box-shadow: 0 6px 18px rgba(139,92,246,0.1); }
 100% { transform: translateY(0) scale(1); background-color: rgba(0,0,0,0.25); box-shadow: 0 0 0 rgba(0,0,0,0); }
}

/* Attack confirm modal */
.attack-confirm-modal{
    position:absolute;
    left:50%;
    top:42%;
    transform:translateX(-50%);
    width:280px;
    height: 100px;
    /* max-width:90%; */
    padding:14px;
    border-radius:12px;
    background:rgba(255,255,255,0.7);
    border:1px solid rgba(255,255,255,0.8);
    box-shadow:0 18px 60px rgba(4,4,8,0.6);
    z-index:1200;
    display:flex;
    flex-direction:column;
    gap:10px;
    align-items:center;
    border-radius: 15px;
}
.attack-confirm-card{color:var(--muted);font-size:14px}
.attack-confirm-actions{display:flex;gap:8px}
.attack-confirm-actions .btn{padding:8px 12px;transform: scale(0.2);}

/* Flash/pulse for the proceed button in attack confirm modal */
.attack-confirm-modal #attack-confirm-proceed{
    animation: attack-proceed-flash 1200ms ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(139,92,246,0.14);
}

@keyframes attack-proceed-flash{
    0% { transform: translateY(0); box-shadow: 0 6px 18px rgba(139,92,246,0.06); }
    50% { transform: translateY(-6px); box-shadow: 0 18px 44px rgba(139,92,246,0.18); }
 100% { transform: translateY(0); box-shadow: 0 6px 18px rgba(139,92,246,0.06); }
}
.tracking-badge{display:inline-block;padding:8px 10px;border-radius:999px;color:#111;font-weight:700;text-align:center;background:linear-gradient(90deg,#fff8cc,#ffd98a);box-shadow:0 6px 18px rgba(255,213,102,0.12);border:1px solid rgba(255,255,255,0.6)}
.tracking-badge.attack{background:linear-gradient(90deg,#ffd7d7,#ff9b9b);border-color:rgba(255,100,100,0.6)}
.tracking-badge.defend{background:linear-gradient(90deg,#d7fff5,#9bffd1);border-color:rgba(3,218,197,0.6)}
.tracking-badge.draw{background:linear-gradient(90deg,#e6e6ff,#bdb8ff);border-color:rgba(139,92,246,0.6)}
.tracking-badge.info{background:linear-gradient(90deg,#ffffff,#f1f1f1);border-color:rgba(255,255,255,0.4)}

/* Leaderboard (right column) */
.leaderboard{
    display:flex;flex-direction:column;gap:12px
}
.leaderboard .title{font-weight:700;color:var(--muted);margin-bottom:6px}
.leaderboard .row{display:flex;align-items:center;justify-content:space-between;padding:10px;border-radius:10px;background:rgba(255,255,255,0.02);border:1px solid rgba(255,255,255,0.03);margin-bottom:8px}
.leaderboard .row .player-left{display:flex;align-items:center;gap:10px}
.leaderboard .row .player-left .icon{width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,0.02)}
.leaderboard .row.attacker{background:linear-gradient(90deg, rgba(139,92,246,0.06), rgba(255,107,203,0.03));border-color:rgba(139,92,246,0.12)}
.leaderboard .row.defender{background:linear-gradient(90deg, rgba(3,218,197,0.03), rgba(139,92,246,0.02));border-color:rgba(3,218,197,0.08)}
.leaderboard .row .role-badge{font-size:12px;padding:6px 8px;border-radius:8px;background:rgba(255,255,255,0.03);color:var(--muted)}

/* Agent panel under cards */
.agent-panel{max-width:560px;width:90%;display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:12px;background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));border:1px solid rgba(255,255,255,0.04);box-shadow:0 10px 30px rgba(2,2,6,0.6)}
.agent-panel .agent-icon{font-size:22px;color:var(--accent-1);background:rgba(255,255,255,0.02);padding:8px;border-radius:10px}
.agent-panel .agent-text{color:var(--muted);font-size:14px}
/* .agent-panel{display: none;} */
.agent-panel{
    margin-bottom: -20px;
}
/* Defense selection visuals - highlight only, no raise */
.card.defense-first {
    box-shadow: 0 0 0 4px rgba(16,185,129,0.9), 0 0 30px rgba(16,185,129,0.7), 0 0 60px rgba(52,211,153,0.5) !important;
    border-color: rgba(255,255,255,0.9) !important;
    transform: scale(0.9);
    animation: defense-first-pulse 1.5s ease-in-out infinite;
}

.card.defense-second {
    box-shadow: 0 0 0 4px rgba(139,92,246,0.9), 0 0 30px rgba(139,92,246,0.7), 0 0 60px rgba(168,85,247,0.5) !important;
    border-color: rgba(255,255,255,0.9) !important;
    transform: scale(0.9);
    animation: defense-second-pulse 1.5s ease-in-out infinite;
}

.card.defense-third {
    box-shadow: 0 0 0 4px rgba(245,158,11,0.95), 0 0 30px rgba(245,158,11,0.7), 0 0 60px rgba(251,191,36,0.45) !important;
    border-color: rgba(255,255,255,0.95) !important;
    transform: scale(0.9);
    animation: defense-third-pulse 1.5s ease-in-out infinite;
}

@keyframes defense-first-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 4px rgba(16,185,129,0.9), 0 0 30px rgba(16,185,129,0.7), 0 0 60px rgba(52,211,153,0.5);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(16,185,129,1), 0 0 40px rgba(16,185,129,0.9), 0 0 80px rgba(52,211,153,0.7);
    }
}

@keyframes defense-second-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 4px rgba(139,92,246,0.9), 0 0 30px rgba(139,92,246,0.7), 0 0 60px rgba(168,85,247,0.5);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(139,92,246,1), 0 0 40px rgba(139,92,246,0.9), 0 0 80px rgba(168,85,247,0.7);
    }
}

@keyframes defense-third-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 4px rgba(245,158,11,0.95), 0 0 30px rgba(245,158,11,0.7), 0 0 60px rgba(251,191,36,0.45);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(245,158,11,1), 0 0 40px rgba(245,158,11,0.9), 0 0 80px rgba(251,191,36,0.7);
    }
}

/* Defend confirm button positioned above hand at bottom */
#defend-confirm-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(16,185,129,0.9), rgba(52,211,153,0.8));
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    z-index: 999;
    display: none;
    box-shadow: 0 8px 24px rgba(16,185,129,0.5), 0 0 20px rgba(52,211,153,0.3);
    transition: all 0.3s ease;
    animation: slideUpButton 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#defend-confirm-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 12px 32px rgba(16,185,129,0.7), 0 0 30px rgba(52,211,153,0.5);
    background: linear-gradient(135deg, rgba(16,185,129,1), rgba(52,211,153,0.9));
}

#defend-confirm-btn:active {
    transform: translateX(-50%) translateY(0);
}


/* Utility */
.muted{color:var(--muted)}
.user-progress-fill{min-width:25px}
/* Progress / winning trackers */
#leader-progess-bars-cont{display:flex;gap:12px;align-items:center;justify-content:center;margin-bottom:12px}
.user-progress-bar-cont,.opponent-progress-bar-cont{display:flex;align-items:center;gap:10px;background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));padding:8px;border-radius:12px;border:1px solid rgba(255,255,255,0.04);width:320px;overflow:hidden}
.user-progress-bar-cont .user-icon,.opponent-progress-bar-cont .user-icon{width:44px;height:44px;border-radius:10px;background:linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));display:flex;align-items:center;justify-content:center;color:var(--muted)}

.score h3 {
    transition: all 0.3s ease;
}

.score h3.flash-update {
    animation: card-count-flash 0.5s ease;
}

@keyframes card-count-flash {
    0%, 100% { 
        transform: scale(1);
        color: inherit;
        text-shadow: none;
    }
    50% { 
        transform: scale(1.3);
        color: #8b5cf6;
        text-shadow: 0 0 20px rgba(139,92,246,0.8), 0 0 40px rgba(139,92,246,0.4);
    }
}
.user-progress-fill{flex:1;height:18px;border-radius:999px;background:linear-gradient(90deg,#ffd7d7,#ff9b9b);transition:width 600ms cubic-bezier(.2,.9,.2,1), box-shadow 350ms ease;display:block;position:relative;overflow:hidden}
.user-progress-text{width:48px;text-align:right;font-weight:700;color:var(--muted);margin-left:6px}

/* Winner style (green + shiny) */
.user-progress-fill.winner{background:linear-gradient(90deg,#7bed9f,#34d399);box-shadow:0 10px 30px rgba(52,211,153,0.3)}
.user-progress-fill.loser{background:linear-gradient(90deg,#ffb3b3,#ff6b6b);box-shadow:0 10px 30px rgba(255,99,71,0.3);}

/* container-level loser/winner accent */
.user-progress-bar-cont.winner .user-icon, .opponent-progress-bar-cont.winner .user-icon{box-shadow:0 8px 24px rgba(52,211,153,0.08);border:1px solid rgba(52,211,153,0.12)}
.user-progress-bar-cont.loser .user-icon, .opponent-progress-bar-cont.loser .user-icon{box-shadow:0 8px 24px rgba(255,99,71,0.08);border:1px solid rgba(255,99,71,0.12)}
.user-progress-bar-cont.loser{outline:2px solid rgba(255,99,71,0.06)}

/* small shimmer overlay */
.user-progress-fill::after{content:'';position:absolute;right:-40%;top:0;bottom:0;width:40%;background:linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));transform:skewX(-18deg);opacity:0.6;pointer-events:none}

@media(max-width:900px){
    .app-grid{grid-template-columns:1fr;}
    .leaderboard{order:2}
}

pre{
    visibility: hidden;
}

/* Floating Draw Button */
.draw-button{
    position:fixed;
    right:20px;
    bottom:20px;
    width:92px;
    height:118px;            /* keeps draw-card-bg.png aspect ratio (277x355) */
    border-radius:12px;
    z-index:3000;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    background:url('/static/images/draw-card-bg.png') center / cover no-repeat;
    border:1px solid rgba(255,255,255,0.12);
    box-shadow:0 18px 50px rgba(255,184,77,0.18), 0 6px 18px rgba(0,0,0,0.35);
    cursor:pointer;
    font-weight:800;
}
.draw-button-wrapper{position:fixed;right:20px;bottom:20px;display:flex;flex-direction:column;align-items:center;gap:6px;z-index:3000}
.draw-label{display:none;font-size:12px;color:var(--muted);background:rgba(0,0,0,0.22);padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,0.03)}
/* The yellow round "Draw" circle sits centred ON TOP of the card image */
.draw-button .icon{
    position:relative;
    z-index:1;
    width:46px;
    height:46px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
    color:#111;
    background:linear-gradient(180deg,#ffd54d,#ffb84d);
    box-shadow:0 6px 16px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.55);
}
.draw-button.flash{animation:draw-flash 1800ms ease-in-out infinite}
.draw-button.disabled{opacity:0.5;pointer-events:none;transform:scale(0.98)}
.mode-key{
    display: block !important;
}

.mode-caption-cont{
    position: relative;
    top:auto;
    left:auto;
    width:100%;
    margin-bottom:12px;
    padding:12px 14px;
    align-items:stretch !important;
    border:1px solid rgba(255,255,255,0.08);
    border-radius:14px;
    background:linear-gradient(135deg, rgba(139,92,246,0.12), rgba(59,130,246,0.06));
}
.mode-value{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    align-items:center;
    gap:12px;
    font-size:14px;
    color:#f8fafc;
}
.mode-key{
    color:#c4b5fd;
    font-size:12px;
    font-weight:800;
    letter-spacing:.06em;
    text-transform:uppercase;
}
.matchup-player{display:flex;flex-direction:column;min-width:0}
.matchup-player-me{align-items:flex-start;text-align:left}
.matchup-player-opponent{align-items:flex-end;text-align:right}
.matchup-player strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px}
.matchup-role{color:var(--muted);font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.matchup-vs{padding:4px 7px;border-radius:999px;background:rgba(239,64,54,.2);color:#ffaaa5;font-size:11px;font-weight:900}
.match-context{display:flex;flex-wrap:wrap;gap:7px 14px;margin-top:4px;color:var(--muted);font-size:11px}
.match-context span,.match-context a{display:inline-flex;align-items:center;gap:5px}
.match-context a{color:#c4b5fd;text-decoration:none}
.match-context a:hover,.match-context a:focus-visible{color:#fff;text-decoration:underline}
.match-connection-status i{color:#fbbf24;font-size:7px}
.match-connection-status.connected i{color:#34d399}
.match-connection-status.reconnecting i{color:#fb7185}

.player-avatar-frame{position:relative;overflow:hidden}
.player-avatar{width:100%;height:100%;display:block;object-fit:cover}
.player-avatar[hidden],.player-avatar-fallback[hidden]{display:none}
.score-avatar{width:48px;height:48px;margin-bottom:3px;border:2px solid rgba(255,255,255,.25);border-radius:50%;background:rgba(255,255,255,.06);display:flex;align-items:center;justify-content:center}
.score-avatar .player-avatar-fallback{color:var(--muted);font-size:20px}
.score-player-name{display:block;max-width:86px;overflow:hidden;color:#f8fafc;font-size:10px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}

@media(max-width:600px){
    .site-header{padding:10px 12px;flex-wrap:wrap}
    .site-header .controls{flex-wrap:wrap;justify-content:flex-end}
    .app-grid{height:auto;min-height:100vh;overflow:visible;margin:10px auto;padding:0 8px 28px;gap:12px}
    .app-grid>.panel{padding:10px}
    .game-table{height:auto;min-height:410px;gap:12px}
    .attack-pile{width:min(150px,42vw);height:86px}
    .attack-pile-cont{justify-content:space-between;gap:4px}
    .score-avatar{width:40px;height:40px}
    .score-player-name{max-width:72px}
    .player-cards-box{width:100%}
    .mode-caption-cont{padding:10px}
    .match-context{gap:6px 10px}
    .matchup-player strong{font-size:14px}
    #leader-progess-bars-cont{gap:6px}
    .user-progress-bar-cont,.opponent-progress-bar-cont{width:50%;padding:6px;gap:6px}
    .user-progress-bar-cont .user-icon,.opponent-progress-bar-cont .user-icon{width:36px;height:36px;flex:0 0 36px}
    .user-progress-text{width:38px;font-size:11px}
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior:auto !important;
        animation-duration:0.01ms !important;
        animation-iteration-count:1 !important;
        transition-duration:0.01ms !important;
    }
}
@keyframes draw-flash{
    0%{transform:translateY(0) scale(1); box-shadow:0 10px 30px rgba(255,184,77,0.14)}
    50%{transform:translateY(-6px) scale(1.04); box-shadow:0 26px 60px rgba(255,184,77,0.22)}
 100%{transform:translateY(0) scale(1); box-shadow:0 10px 30px rgba(255,184,77,0.14)}
}

/* Ghost card animations (transient flying visuals) */
.card.ghost{
    position:fixed;
    width:120px;
    height:170px;
    border-radius:12px;
    pointer-events:none;
    color: #8b4513 !important;
    z-index:4000;
    box-shadow:0 26px 60px rgba(2,2,6,0.55);
    transition: transform 520ms cubic-bezier(.2,.9,.2,1), opacity 420ms ease;
    will-change: transform, opacity;
}

/* Ghost cards - opponent cards are purple-blue */
.card.ghost.opponent-card .rank, 
.card.ghost.opponent-card .suit, 
.card.ghost.opponent-card .center,
.ghost.opponent-card .rank, 
.ghost.opponent-card .suit, 
.ghost.opponent-card .center {
    color: #1a1a70 !important;
    text-shadow: 0 1px 2px rgba(5, 5, 5, 0.5) !important;
    font-weight: 700 !important;
}

/* Ghost cards - player cards are brown */
.card.ghost.player-card .rank, 
.card.ghost.player-card .suit, 
.card.ghost.player-card .center,
.ghost.player-card .rank, 
.ghost.player-card .suit, 
.ghost.player-card .center {
    color: #8b4513 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    font-weight: 700 !important;
}
.card.ghost.entering{opacity:0.01;transform:translateY(-12px) scale(0.8)}
.card.ghost.visible{opacity:1}
.card.ghost.fade-out{opacity:0;transform:scale(0.9) translateY(6px)}

/* small easing for subtle bounce when arriving */
@keyframes ghost-arrive-bounce{
    0%{transform: translateY(-6px) scale(0.98)}
    60%{transform: translateY(2px) scale(1.02)}
    100%{transform: translateY(0) scale(1)}
}

/* ============================================================ */
/* RULES MODAL STYLES */
/* ============================================================ */

.rules-modal-cont {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rules-modal-cont.active {
    display: flex;
}

.rules-modal {
    background: linear-gradient(135deg, rgba(46, 11, 79, 0.95) 0%, rgba(26, 8, 54, 0.95) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.rules-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-1);
    letter-spacing: 1px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: rgba(255, 255, 255, 1);
}

.rules-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.rules-content::-webkit-scrollbar {
    width: 8px;
}

.rules-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.rules-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 10px;
}

.rules-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

.rule-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.rule-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(139, 92, 246, 0.4);
}

.rule-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-1);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rule-body p {
    margin: 10px 0;
    line-height: 1.6;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.card-badge {
    display: inline-block;
    background: rgba(139, 92, 246, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--accent-1);
    font-family: 'Courier New', monospace;
}

.card-example {
    display: inline-block;
    background: rgba(255, 228, 107, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--accent-2);
    white-space: nowrap;
}

.rule-note {
    background: rgba(62, 230, 181, 0.1);
    padding: 12px;
    border-left: 3px solid var(--success);
    border-radius: 6px;
    margin-top: 12px;
    font-size: 13px;
    color: rgba(62, 230, 181, 0.9);
}

.winning-ways-header {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-2);
    margin: 30px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 228, 107, 0.3);
}

.win-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(62, 230, 181, 0.05) 100%);
    border: 2px solid rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.win-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-1), transparent);
}

.win-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.win-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-2);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.win-description p {
    margin: 10px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.win-description p strong {
    color: var(--accent-2);
}

.win-flow {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.2s ease;
}

.flow-step:hover {
    background: rgba(255, 255, 255, 0.04);
    padding-left: 16px;
}

.flow-step.highlight {
    background: rgba(62, 230, 181, 0.15);
    border-left: 3px solid var(--success);
    color: var(--success);
    font-weight: 600;
}

.step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    font-size: 16px;
}

.info-card {
    background: linear-gradient(135deg, rgba(62, 230, 181, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 2px solid rgba(62, 230, 181, 0.3);
    text-align: center;
}

.info-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.info-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
    margin: 10px 0 15px 0;
}

.info-card p {
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 600px) {
    .rules-modal {
        max-height: 90vh;
        border-radius: 15px;
    }

    .rules-header {
        padding: 20px;
    }

    .rules-header h2 {
        font-size: 24px;
    }

    .rules-content {
        padding: 20px;
    }

    .rule-card {
        padding: 15px;
    }

    .flow-step {
        font-size: 13px;
        padding: 8px 10px;
    }

    .win-icon {
        font-size: 24px;
    }
}

/* Real-deck coloring — clubs & spades render black (hearts/diamonds stay red).
   Placed LAST so it outranks the per-theme card-face rules that also use
   `!important` and appear above (e.g. `.card.player-card .rank/.suit`,
   `.card.opponent-card ...`, `.card.ghost.player-card/opponent-card ...`).
   The `.black-suit` class is added wherever a card face is built in
   game.js / game-core.js. */
.card.black-suit .rank,
.card.black-suit .suit,
.card.black-suit .center,
.card.ghost.black-suit .rank,
.card.ghost.black-suit .suit,
.card.ghost.black-suit .center {
    color: #111827 !important;
    text-shadow: 0 1px 2px rgba(17, 24, 39, 0.18) !important;
    font-weight: 700 !important;
}



