@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Space+Grotesk:wght@600;700&display=swap');
        
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body { 
            background: #0a0a0f; 
            color: white; 
            min-height: 100vh; 
            font-family: 'Inter', system-ui, sans-serif;
            -webkit-user-select: none;
            user-select: none;
            overscroll-behavior: none;
        }
        
        .screen { 
            display: flex; 
            flex-direction: column; 
            justify-content: center; 
            align-items: center; 
            min-height: 100vh; 
            padding: 20px; 
        }
        
        .home-container, .game-header { 
            width: 95vw; 
            max-width: 520px; 
            background: #121218; 
            border-radius: 28px; 
            padding: 30px; 
            box-shadow: 0 0 60px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.06); 
            text-align: center; 
            position: relative; 
            overflow: hidden; 
        }
        
        .home-container::before, .game-header::before { 
            content: ''; 
            position: absolute; 
            inset: 0; 
            background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), 
                             linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px); 
            background-size: 42px 42px; 
            pointer-events: none; 
            z-index: 0; 
        }
        
        .home-container > *, .game-header > * { position: relative; z-index: 1; }
        
        .logo { 
            font-family: 'Space Grotesk', sans-serif; 
            font-size: 76px; 
            font-weight: 700; 
            letter-spacing: 6px; 
            margin-bottom: 6px; 
            line-height: 1; 
            display: flex; 
            justify-content: center; 
            gap: 4px; 
        }
        
        .logo span { 
            display: inline-block; 
            transition: transform 0.3s ease; 
            -webkit-text-stroke: 1.5px rgba(255,255,255,0.08); 
        }
        
        .logo span:nth-child(1) { color: #ff4d6b; text-shadow: 0 0 6px #ff4d6b, 0 0 14px #ff4d6b, 0 0 24px rgba(255,77,107,0.7); }
        .logo span:nth-child(2) { color: #00e5ff; text-shadow: 0 0 6px #00e5ff, 0 0 14px #00e5ff, 0 0 24px rgba(0,229,255,0.7); }
        .logo span:nth-child(3) { color: #00ff9d; text-shadow: 0 0 6px #00ff9d, 0 0 14px #00ff9d, 0 0 24px rgba(0,255,157,0.7); }
        .logo span:nth-child(4) { color: #4d9eff; text-shadow: 0 0 6px #4d9eff, 0 0 14px #4d9eff, 0 0 24px rgba(77,158,255,0.7); }
        .logo span:nth-child(5) { color: #c266ff; text-shadow: 0 0 6px #c266ff, 0 0 14px #c266ff, 0 0 24px rgba(194,102,255,0.7); }
        .logo span:nth-child(6) { color: #7fff00; text-shadow: 0 0 6px #7fff00, 0 0 14px #7fff00, 0 0 24px rgba(127,255,0,0.7); }
        
        .logo:hover span { transform: translateY(-3px); }

        .subtitle { color: #888; font-size: 17px; margin-bottom: 32px; letter-spacing: 0.5px; }
        
        .user-section { margin-bottom: 32px; width: 100%; }
        
        #loginForm { display: flex; flex-direction: column; gap: 12px; align-items: center; width: 100%; }

        .auth-actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            width: 100%;
            max-width: 280px;
            margin: 0 auto;
        }
        
        #usernameInput, #emailInput, #passwordInput { 
            width: 100%; 
            max-width: 280px; 
            padding: 16px 20px; 
            border: 2px solid #2a2a35; 
            border-radius: 16px; 
            background: #1a1a22; 
            color: white; 
            font-size: 18px; 
            outline: none; 
            transition: all 0.2s; 
        }
        
        #usernameInput:focus, #emailInput:focus, #passwordInput:focus { 
            border-color: #00e5ff; 
            box-shadow: 0 0 0 4px rgba(0,229,255,0.15); 
            background: #1f1f28; 
        }
        
        #loginForm button { 
            width: 100%; 
            max-width: 280px; 
            padding: 16px; 
            background: linear-gradient(90deg,#0066cc,#0099ff); 
            border: none; 
            border-radius: 16px; 
            color: white; 
            font-size: 17px; 
            font-weight: 600; 
            cursor: pointer; 
            transition: all 0.2s; 
            box-shadow: 0 4px 15px rgba(0,102,204,0.4); 
        }
        
        #loginForm button:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,102,204,0.5); }
        .auth-actions button { width: 100%; max-width: none; min-width: 0; }

        #battleBtn:disabled { opacity: 1; cursor: not-allowed; filter: none; transform: none !important; box-shadow: 0 4px 15px rgba(239,68,68,.28); }
        
        #userDisplay { 
            background: #1a1a22; 
            border-radius: 16px; 
            padding: 14px 20px; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            gap: 12px; 
            flex-wrap: wrap; 
        }

        .game-container { 
            width: 95vw; 
            max-width: 600px; 
            background: #121218; 
            border-radius: 24px; 
            padding: 20px; 
            display: flex; 
            flex-direction: column; 
            align-items: center; 
            box-shadow: 0 0 40px rgba(0,0,0,0.6); 
            position: relative; 
        }
        
        .status-bar { 
            width: 100%; 
            display: flex; 
            justify-content: space-between; 
            margin-bottom: 18px; 
            flex-wrap: wrap; 
            gap: 8px; 
        }
        
        .status-box { 
            background: #1f1f28; 
            padding: 10px 16px; 
            border-radius: 12px; 
            font-size: 15px; 
            min-width: 78px; 
            text-align: center; 
            flex: 1;
        }
        
        .board { 
            display: grid; 
            grid-template-columns: repeat(11, 1fr); 
            gap: 5px; 
            width: 100%; 
            max-width: 560px; 
            aspect-ratio: 11/5; 
            background: #0a0a0f; 
            padding: 10px; 
            border-radius: 18px; 
            touch-action: none;
        }
        
        .cell { 
            background: #22222a; 
            border-radius: 50%; 
            border: 2px solid #33333a; 
            aspect-ratio: 1; 
            transition: all 0.15s; 
        }
        
        .hint-cell { 
            box-shadow: 0 0 22px #00f0ff, 0 0 40px #00f0ff !important; 
            animation: hintPulse 1.5s infinite; 
            border-color: #00f0ff !important;
        }
        
        @keyframes hintPulse { 
            0% { box-shadow: 0 0 22px #00f0ff, 0 0 40px #00f0ff; } 
            50% { box-shadow: 0 0 35px #00f0ff, 0 0 60px #00f0ff; }
        }

        .piece-area { 
            margin-top: 24px; 
            width: 100%; 
            min-height: 170px; 
            background: #1a1a22; 
            border-radius: 18px; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            gap: 14px; 
            flex-wrap: wrap; 
            padding: 14px; 
            touch-action: none;
        }
        
        .piece { 
            display: grid; 
            gap: 4px; 
            padding: 8px; 
            cursor: grab; 
            user-select: none; 
            position: relative; 
            border: 2px solid rgba(255,255,255,0.12); 
            border-radius: 16px;
            background: rgba(40,40,50,0.6);
            transition: all 0.2s;
            touch-action: none;
        }
        
        .piece:active { cursor: grabbing; }
        
        .piece.selected { 
            transform: scale(1.1); 
            border-color: rgba(255,255,255,0.5);
            box-shadow: 0 0 20px currentColor;
        }

        .piece-circle { 
            width: 26px;
            height: 26px;
            border-radius: 50%;
            position: relative;
            border: 2.5px solid rgba(255,255,255,0.35);
            box-shadow: 
                inset 0 3px 6px rgba(255,255,255,0.5),
                inset 0 -3px 6px rgba(0,0,0,0.4),
                0 2px 4px rgba(0,0,0,0.3);
            background: radial-gradient(circle at 40% 40%, rgba(255,255,255,0.6) 10%, transparent 50%);
        }

        .piece-circle::after {
            content: '';
            position: absolute;
            top: 18%;
            left: 22%;
            width: 35%;
            height: 35%;
            background: radial-gradient(circle, rgba(255,255,255,0.85) 20%, transparent 60%);
            border-radius: 50%;
        }

        .piece-pattern {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            position: relative;
            box-shadow: 0 2px 6px rgba(0,0,0,0.5);
            transition: transform 0.1s;
        }

        .controls { 
            margin-top: 18px; 
            display: flex; 
            gap: 8px; 
            flex-wrap: wrap; 
            justify-content: center; 
            width: 100%;
            position: relative;
        }
        
        button { 
            padding: 14px 18px; 
            border: none; 
            border-radius: 14px; 
            background: #2a2a35; 
            color: white; 
            font-size: 15px; 
            font-weight: 600; 
            cursor: pointer; 
            transition: all 0.2s; 
            flex: 1;
            min-width: 72px;
        }
        
        button:hover { background: #3a3a45; transform: translateY(-2px); }

        .menu-button { 
            background: #2a2a35; 
            border: none; 
            color: white; 
            font-size: 24px; 
            width: 52px; 
            height: 52px; 
            border-radius: 50%; 
            cursor: pointer; 
            display: flex; 
            align-items: center; 
            justify-content: center;
            box-shadow: 0 4px 12px rgba(0,0,0,0.4); 
            flex: 0 0 52px;
        }

        .dropdown { 
            position: absolute; 
            bottom: 80px; 
            right: 20px; 
            background: #1a1a22; 
            border-radius: 18px; 
            padding: 8px 0; 
            box-shadow: 0 10px 40px rgba(0,0,0,0.7); 
            display: none; 
            flex-direction: column; 
            min-width: 200px; 
            z-index: 200; 
        }
        
        .dropdown button { 
            padding: 14px 20px; 
            background: none; 
            border: none; 
            color: white; 
            text-align: left; 
            cursor: pointer; 
            font-size: 16px; 
            font-weight: 500; 
            width: 100%; 
        }
        
        .dropdown button:hover { background: #2a2a35; }

        .levels-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
            gap: 12px;
            padding: 10px 0;
            max-height: 58vh;
            overflow-y: auto;
        }
        
        .level-btn {
            aspect-ratio: 1;
            border-radius: 16px;
            background: #1f1f28;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
            padding: 8px 4px;
            border: 2px solid transparent;
        }
        
        .level-btn:hover { transform: scale(1.08); }
        .level-btn.completed { 
            background: #00ff9d22; 
            border-color: #00ff9d; 
        }
        .level-btn.current { 
            background: #00e5ff22; 
            border-color: #00e5ff; 
            box-shadow: 0 0 20px rgba(0,229,255,0.4); 
        }
        .level-btn.locked { 
            opacity: 0.45; 
            cursor: not-allowed; 
            background: #1a1a22; 
            color: #666;
        }
        
        .level-btn .check { 
            position: absolute; 
            top: 6px; 
            right: 6px; 
            font-size: 18px; 
            color: #00ff9d; 
            line-height: 1;
        }
        .level-btn .stars { 
            font-size: 13px; 
            color: #ffd700; 
            margin-top: 2px; 
            line-height: 1; 
            letter-spacing: 1px; 
        }

        .modal { 
            display: none; 
            position: fixed; 
            top: 0; 
            left: 0; 
            width: 100%; 
            height: 100%; 
            background: rgba(0,0,0,0.92); 
            z-index: 300; 
            justify-content: center; 
            align-items: center; 
        }
        
        .modal-content { 
            background: #121218; 
            padding: 30px; 
            border-radius: 24px; 
            width: 92%; 
            max-width: 480px; 
            text-align: center; 
            max-height: 92vh; 
            overflow-y: auto; 
        }
        
        .skin-option { 
            position: relative; 
            padding: 14px; 
            border-radius: 16px; 
            cursor: pointer; 
            background: #1f1f28; 
            transition: all 0.2s; 
            text-align: center; 
        }
        
        .skin-option:hover { transform: scale(1.06); background: #2a2a35; }
        
        .skin-preview { 
            width: 88px; 
            height: 88px; 
            margin: 0 auto 12px; 
            border-radius: 14px; 
            background: #22222a; 
            position: relative; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            overflow: hidden; 
        }
        
        .skin-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
        
        .selected-dot { 
            position: absolute; 
            top: 8px; 
            right: 8px; 
            width: 22px; 
            height: 22px; 
            background: #00ff9d; 
            border-radius: 50%; 
            display: none; 
            align-items: center; 
            justify-content: center; 
            font-size: 14px; 
            color: #000; 
            font-weight: bold; 
        }
        
        .section-header {
            grid-column: 1 / -1;
            font-size: 15px;
            font-weight: 700;
            text-align: left;
            padding: 8px 0 6px;
            border-bottom: 1px solid #333;
            margin-bottom: 12px;
        }
        
        .hint-pack {
            background: #1f1f28;
            border-radius: 18px;
            padding: 18px 14px;
            text-align: center;
            border: 1px solid #333;
            transition: all 0.2s;
        }
        
        .hint-pack:hover {
            transform: translateY(-3px);
            border-color: #00e5ff;
        }
        
        .hint-pack .price {
            font-size: 26px;
            font-weight: 800;
            color: #ffd700;
            margin: 6px 0;
        }
        
        .hint-pack button {
            background: #00c853;
            color: white;
            font-weight: 700;
            padding: 12px;
            width: 100%;
            border-radius: 12px;
            margin-top: 10px;
        }
        
        .free-badge {
            position: absolute;
            top: 6px;
            left: 6px;
            background: #00ff9d;
            color: #111;
            font-size: 9px;
            font-weight: 800;
            padding: 1px 7px;
            border-radius: 999px;
            letter-spacing: 0.5px;
        }

        .palette-dots {
            display: flex;
            gap: 6px;
            justify-content: center;
            margin-top: 6px;
        }
        .palette-dot {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 1.5px solid rgba(255,255,255,0.4);
            box-shadow: 0 1px 3px rgba(0,0,0,0.4);
        }

/* ==================== CUSTOMIZATION CLEANUP ==================== */
.customization-modal {
    max-width: 620px;
    padding: 22px;
    text-align: left;
    background: linear-gradient(180deg, #15151d 0%, #101017 100%);
    border: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 24px 70px rgba(0,0,0,.65);
}
.customization-top {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:18px;
}
.modal-kicker { font-size:10px; letter-spacing:1.8px; color:#777; font-weight:800; margin-bottom:3px; }
.customization-top h2 { font-size:25px; margin:0; }
.customization-top p { color:#777; font-size:12px; margin-top:4px; }
.star-balance {
    flex:0 0 auto;
    padding:9px 12px;
    border:1px solid rgba(255,215,0,.22);
    background:rgba(255,215,0,.08);
    color:#ffd700;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}
.custom-section { margin-top:22px; }
.custom-section-title {
    display:flex;
    align-items:baseline;
    gap:7px;
    margin-bottom:10px;
    padding-bottom:8px;
    border-bottom:1px solid rgba(255,255,255,.08);
}
.custom-section-title > span:nth-child(2) { font-size:14px; font-weight:800; }
.custom-section-title small { color:#6f6f7a; font-size:10px; font-weight:600; }
.colors-title > span:nth-child(2) { color:#6ee7f9; }
.standard-title > span:nth-child(2) { color:#86efac; }
.premium-title > span:nth-child(2) { color:#fde68a; }
.custom-grid {
    display:grid;
    grid-template-columns:repeat(4, minmax(0,1fr));
    gap:10px;
}
.custom-card {
    position:relative;
    min-width:0;
    min-height:126px;
    padding:10px 8px 9px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:15px;
    background:#1a1a23;
    color:white;
    cursor:pointer;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    gap:5px;
    transition:transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
    overflow:hidden;
}
.custom-card:hover:not(:disabled) { transform:translateY(-2px); background:#20202a; border-color:rgba(255,255,255,.15); }
.custom-card:disabled { cursor:pointer; opacity:1; filter:none; }
.custom-card.is-selected { border-color:rgba(0,255,157,.62); box-shadow:0 0 0 1px rgba(0,255,157,.14), 0 7px 20px rgba(0,0,0,.25); }
.custom-card.premium-card:not(.is-selected) { border-color:rgba(255,215,0,.11); }
.custom-preview {
    width:82px;
    height:76px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:11px;
    background:#111118;
    border:1px solid rgba(255,255,255,.05);
    overflow:hidden;
}
.color-piece-preview, .skin-piece-preview {
    display:grid;
    grid-template-columns:repeat(2, var(--preview-cell, 24px));
    grid-template-rows:repeat(2, var(--preview-cell, 24px));
    gap:4px;
    align-content:center;
    justify-content:center;
    width:70px;
    height:64px;
    max-width:70px;
    max-height:64px;
    min-width:0;
    min-height:0;
    overflow:visible;
}
.preview-2x2 { --preview-cell:24px; }
.preview-piece-cell {
    width:var(--preview-cell, 24px);
    height:var(--preview-cell, 24px);
    min-width:0;
    min-height:0;
    border-radius:5px;
    border:1px solid rgba(255,255,255,.25);
    box-shadow:0 2px 4px rgba(0,0,0,.35);
    box-sizing:border-box;
}
.skin-piece-preview .preview-piece-cell { width:var(--preview-cell, 24px); height:var(--preview-cell, 24px); }
.preview-piece-cell.empty { visibility:hidden; }
.custom-name { font-size:12px; font-weight:800; line-height:1.15; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.custom-meta { font-size:9px; color:#858592; font-weight:800; letter-spacing:.5px; }
.custom-card.is-selected .custom-meta { color:#00ff9d; }
.item-badge { font-size:9px; }
.selected-check {
    position:absolute;
    top:7px;
    right:7px;
    width:21px;
    height:21px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#00ff9d;
    color:#07130e;
    font-size:13px;
    font-weight:900;
    box-shadow:0 2px 7px rgba(0,0,0,.35);
}
.customization-note { margin:18px 2px 0; color:#656572; font-size:10px; line-height:1.5; text-align:center; }
.modal-close { display:block; margin:16px auto 0; padding:11px 34px; background:#ff4d6b; flex:none; }

/* Make the level label readable instead of clipping long tier names. */
.level-status { min-width:58px !important; }
.level-tier { display:inline-flex; align-items:center; justify-content:center; margin:0 auto 10px; padding:6px 12px; border:1px solid color-mix(in srgb, var(--tier-color, #22c55e) 38%, transparent); border-radius:999px; background:color-mix(in srgb, var(--tier-color, #22c55e) 10%, #121218); color:var(--tier-color, #22c55e); font-size:11px; font-weight:900; letter-spacing:1.2px; }

/* Cleaner piece cells; each skin can supply its own silhouette. */
.piece-cell { width:26px; height:26px; position:relative; }
.piece-cell.empty { visibility:hidden; }

@media (max-width: 560px) {
    .game-container { width:96vw; padding:14px; }
    .game-header { width:100%; padding:14px 12px !important; margin-bottom:12px !important; }
    .game-header .logo { font-size:38px !important; letter-spacing:3px; }
    .status-bar { gap:6px; margin-bottom:12px; }
    .status-box { min-width:0; padding:8px 5px; font-size:11px; }
    .level-status { min-width:48px !important; }
    .board { gap:3px; padding:7px; border-radius:14px; }
    .piece-area { margin-top:14px; min-height:132px; gap:6px; padding:8px; }
    .piece { gap:3px; padding:6px; }
    .piece-cell { width:22px; height:22px; }
    .customization-modal { width:96%; padding:16px; }
    .customization-top { align-items:flex-start; }
    .custom-grid { grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; }
    .custom-card { min-height:118px; padding:8px 5px; }
    .custom-preview { width:70px; height:66px; }
    .preview-2x2 { --preview-cell:21px; }
    .preview-piece-cell { width:var(--preview-cell, 21px); height:var(--preview-cell, 21px); }
    .skin-piece-preview .preview-piece-cell { width:var(--preview-cell, 21px); height:var(--preview-cell, 21px); }
}

@media (max-width: 380px) {
    .custom-grid { grid-template-columns:repeat(2, minmax(0,1fr)); }
    .star-balance { font-size:10px; padding:7px 9px; }
    .level-status { min-width:44px !important; }
}

/* ==================== BATTLE UI ==================== */
.battle-screen { padding:16px; overflow:auto; }
.battle-container { width:96vw; max-width:620px; min-height:640px; background:#121218; border-radius:26px; padding:22px; box-shadow:0 20px 70px rgba(0,0,0,.65); border:1px solid rgba(255,255,255,.06); }
.battle-topbar,.battle-match-header,.battle-race-head { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.battle-topbar h1 { margin:0; font-size:32px; }
.battle-subtitle { color:#999; margin:8px 0 22px; font-size:14px; }
.battle-tier-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.battle-tier-card { min-height:175px; border:1px solid #2b2b35; border-radius:18px; background:#1a1a22; color:white; padding:14px 8px; cursor:pointer; transition:.18s; }
.battle-tier-card:hover:not(:disabled) { transform:translateY(-3px); border-color:#ef4444; background:#20202a; }
.battle-tier-card:disabled { opacity:.45; cursor:not-allowed; }
.battle-tier-icon { font-size:30px; margin-bottom:8px; }
.battle-tier-name { font-size:16px; font-weight:900; letter-spacing:.8px; }
.battle-tier-lock { color:#aaa; font-size:12px; margin-top:8px; }
.battle-tier-stake { color:#ffd700; font-size:13px; font-weight:800; margin-top:10px; }
.battle-tier-disabled { color:#ff9aa8; font-size:10px; margin-top:10px; }
.battle-rule-note,.battle-help { color:#777; font-size:11px; line-height:1.5; text-align:center; margin:14px 0; }
.battle-queue-status { min-height:22px; text-align:center; color:#00e5ff; font-size:13px; margin:14px 0; }
.battle-back,.battle-secondary { border:1px solid #333; background:#1a1a22; color:#aaa; border-radius:12px; padding:11px 18px; font-size:12px; cursor:pointer; }
.battle-back { display:block; margin:14px auto 0; }
.battle-step-title { margin:20px 0 7px; font-size:14px; font-weight:900; color:#eee; }
.battle-board-label { text-align:center; color:#888; font-size:11px; margin-bottom:8px; }
.battle-board { display:grid; grid-template-columns:repeat(11,1fr); gap:4px; width:100%; aspect-ratio:11/5; background:#0a0a0f; padding:8px; border-radius:16px; }
.battle-cell { background:#22222a; border:1px solid #33333a; border-radius:50%; min-width:0; }
.battle-cell.filled { border-color:rgba(255,255,255,.28); box-shadow:inset 0 2px 5px rgba(255,255,255,.2),0 2px 5px rgba(0,0,0,.3); }
.battle-cell.battle-locked { box-shadow:0 0 0 2px #ffd700,0 0 13px rgba(255,215,0,.45); }
.battle-secondary { display:block; margin:10px auto 0; color:#ddd; }
.battle-piece-tray {
  margin-top:18px;
  width:100%;
  min-height:190px;
  box-sizing:border-box;
  background:#1a1a22;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  align-content:center;
  flex-wrap:wrap;
  gap:18px 24px;
  padding:18px 20px;
  touch-action:none;
}
.battle-piece-card {
  display:grid;
  gap:4px;
  padding:8px;
  cursor:grab;
  user-select:none;
  position:relative;
  border:2px solid rgba(255,255,255,.12);
  border-radius:16px;
  background:rgba(40,40,50,.6);
  color:#bbb;
  min-height:0;
  width:max-content;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
  touch-action:none;
}
.battle-piece-card:active { cursor:grabbing; }
.battle-piece-card:hover,.battle-piece-card.selected {
  border-color:rgba(255,255,255,.5);
  background:rgba(45,45,56,.72);
  box-shadow:0 0 20px rgba(0,229,255,.16);
}
.battle-piece-card.selected { transform:scale(1.06); }
/* Battle race tray deliberately reuses the single-player .piece renderer.
   Keep the battle tray as the zone/container only; do not resize individual cells. */
.battle-piece-tray {
  min-height:170px;
  gap:14px;
  padding:14px;
}
.battle-piece-tray .piece {
  flex:0 0 auto;
}
.battle-piece-tray .piece.selected {
  border-color:rgba(255,255,255,.5);
  box-shadow:0 0 20px currentColor;
}

.battle-piece-mini { display:none; }
.battle-piece-mini i.empty { visibility:hidden; }
.battle-ready-status { text-align:center; color:#ffd700; font-weight:800; font-size:12px; margin:13px 0; }
.battle-ready-btn { width:100%; border:0; border-radius:14px; padding:15px; background:linear-gradient(90deg,#dc2626,#ef4444); color:#fff; font-weight:900; letter-spacing:1px; cursor:pointer; }
.battle-ready-btn:disabled { opacity:.35; cursor:not-allowed; }
.battle-wait-card,.battle-result-card { text-align:center; padding:60px 20px 30px; }
.battle-wait-icon { font-size:48px; animation:battlePulse 1.4s infinite; }
.battle-wait-card h2 { margin:12px 0 8px; }
.battle-wait-card p { color:#888; }
.battle-loader { width:100%; height:4px; background:#25252e; border-radius:4px; overflow:hidden; margin:26px auto; }
.battle-loader:before { content:''; display:block; width:35%; height:100%; background:#ef4444; animation:battleLoad 1.2s infinite ease-in-out; }
@keyframes battleLoad { 0%{transform:translateX(-120%)} 100%{transform:translateX(330%)} }
@keyframes battlePulse { 50%{transform:scale(1.08);opacity:.65} }
.battle-label { display:block; font-size:9px; letter-spacing:1.5px; color:#666; font-weight:900; margin-bottom:3px; }
.battle-match-header strong,.battle-race-head strong { font-size:15px; }
.battle-ready-btn + .battle-back { margin-top:10px; }
.battle-instruction { text-align:center; color:#aaa; font-size:12px; margin:12px 0; }
.battle-stake-label { color:#ffd700; font-size:11px; font-weight:900; }
.battle-timer { font-size:18px; font-weight:900; min-width:48px; text-align:right; }
.battle-win { color:#00ff9d; font-size:32px; font-weight:900; }
.battle-loss { color:#ff6b7d; font-size:32px; font-weight:900; }
.battle-result-stars { color:#ffd700; font-size:30px; font-weight:900; margin:18px 0; }
.battle-result-card p { color:#aaa; margin-bottom:18px; }

@media(max-width:520px){
  .battle-container{padding:16px;border-radius:22px;}
  .battle-tier-grid{gap:7px;}
  .battle-tier-card{min-height:155px;padding:10px 4px;}
  .battle-tier-name{font-size:13px;}
  .battle-piece-tray{min-height:155px;gap:10px 12px;padding:12px;}
  .battle-piece-card{padding:6px;}
  .battle-piece-mini{gap:3px;}
  .battle-piece-mini i{width:22px;height:22px;}
  .battle-board{gap:3px;padding:6px;}
}
.battle-race-controls { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:14px 0 0; }
.battle-race-controls .battle-control { margin:0; }

/* Battle polish */
.battle-lock-hint{min-height:28px;text-align:center;color:#70707c;font-size:10px;line-height:1.4;margin:8px 4px 4px}
.battle-piece-card{position:relative;min-height:0;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.battle-piece-card.focused{border-color:#ffd700;box-shadow:0 0 0 2px rgba(255,215,0,.16),0 8px 24px rgba(0,0,0,.28);transform:translateY(-2px)}
.battle-piece-card small{font-size:8px;color:#686875;font-weight:700;letter-spacing:.3px}
.battle-piece-card.selected small{color:#ffd700}
.battle-piece-mini{display:grid;gap:4px;justify-content:center;align-content:center}
.battle-piece-mini i{width:26px;height:26px;border-radius:50%;display:block;background:var(--piece-color,#00e5ff);border:2px solid var(--piece-accent,#fff);box-sizing:border-box;box-shadow:inset 0 3px 6px rgba(255,255,255,.5),inset 0 -3px 6px rgba(0,0,0,.4),0 2px 4px rgba(0,0,0,.3)}
.battle-piece-mini i.empty{visibility:hidden}
.battle-cell{padding:0;appearance:none;-webkit-appearance:none;cursor:pointer;overflow:hidden}
.battle-cell:disabled{cursor:default}
.battle-cell.battle-piece-focus{box-shadow:0 0 0 2px #ffd700,0 0 16px rgba(255,215,0,.6)!important;transform:scale(.94);z-index:2}
.battle-countdown{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;background:rgba(7,7,12,.88);backdrop-filter:blur(8px);border-radius:18px;text-align:center;pointer-events:none}
.battle-countdown-label{font-size:11px;font-weight:900;letter-spacing:3px;color:#aaa;margin-bottom:8px}
#battleCountdownNumber{font-size:92px;line-height:.95;font-weight:1000;color:#fff;text-shadow:0 0 30px rgba(255,255,255,.2);animation:battleCountdownPop .82s ease-out}
.battle-countdown-sub{font-size:12px;color:#777;margin-top:12px}
@keyframes battleCountdownPop{0%{transform:scale(1.5);opacity:.1}35%{transform:scale(1);opacity:1}100%{transform:scale(.96);opacity:1}}
.battle-race-head{padding-bottom:4px;border-bottom:1px solid rgba(255,255,255,.06)}
.battle-instruction{margin:13px 0;color:#8c8c98}

/* Battle uses the same direct manipulation feel as the main Koodle board. */
.battle-race-controls{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0 0}
.battle-piece-card{touch-action:none;user-select:none;-webkit-user-select:none}
.battle-piece-mini{grid-template-columns:repeat(var(--piece-cols),10px);grid-template-rows:repeat(auto-fit,10px);width:max-content;height:max-content;}
.battle-piece-mini i{width:10px;height:10px;box-sizing:border-box}
.battle-cell{touch-action:none}
.battle-cell.battle-preview-valid{outline:2px solid #00ff9d;box-shadow:0 0 14px rgba(0,255,157,.65)!important;transform:scale(.94);}
.battle-cell.battle-preview-invalid{outline:2px solid #ff4d67;box-shadow:0 0 12px rgba(255,77,103,.55)!important;transform:scale(.94);}
.battle-piece-card.selected{border-color:#00e5ff!important;box-shadow:0 0 0 2px rgba(0,229,255,.35),0 8px 24px rgba(0,229,255,.18)!important;transform:translateY(-2px)}
.battle-piece-card.selected .battle-piece-mini{filter:drop-shadow(0 0 5px rgba(0,229,255,.75))}
.battle-dragging{cursor:grabbing!important}


/* Battle race mirrors the single-player layout: status cards -> board -> pieces -> controls. */
.battle-status-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin:10px 0 16px;
}
.battle-status-box{
  min-height:76px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  border-radius:18px;
  background:#1a1a22;
  color:#c9c9d2;
  font-size:13px;
  line-height:1.35;
  border:1px solid rgba(255,255,255,.04);
}
.battle-status-box span{
  display:block;
  margin-top:2px;
  color:#fff;
  font-size:25px;
  line-height:1;
  font-weight:900;
}
#battleHints{color:#00e5ff}
.battle-race-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0 4px 8px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.battle-race-meta strong{font-size:14px}
.battle-instruction{margin:10px 0 12px}
.battle-match .race-board,
.race-board{margin-top:0}
.battle-race-controls .battle-control{
  border:1px solid #333;
  background:#292934;
  color:#eee;
  border-radius:14px;
  min-height:58px;
  padding:10px 6px;
  font-size:12px;
  font-weight:900;
  letter-spacing:.7px;
  cursor:pointer;
}
.battle-race-controls .battle-control:hover:not(:disabled){
  border-color:#00e5ff;
  background:#30303c;
}
.battle-race-controls .battle-reset{background:#292934}
.battle-race-controls .battle-hint{background:#00bcd4;color:#111;border-color:#00bcd4}
.battle-race-controls .battle-hint:hover:not(:disabled){background:#19c9df;border-color:#19c9df}
.battle-race-controls .battle-control:disabled{opacity:.35;cursor:not-allowed}
.battle-hint-preview{
  outline:3px solid #ffd700!important;
  box-shadow:0 0 18px rgba(255,215,0,.85)!important;
  transform:scale(.92);
  z-index:3;
}
@media (max-width:520px){
  .battle-status-grid{gap:7px;margin-bottom:12px}
  .battle-status-box{min-height:68px;border-radius:15px;font-size:11px}
  .battle-status-box span{font-size:21px}
  .battle-race-controls{gap:7px}
  .battle-race-controls .battle-control{min-height:54px;font-size:10px}
}

/* ===== Battle: inherit the single-player visual system ===== */
.battle-container{
  width:95vw;
  max-width:600px;
  min-height:0;
  box-sizing:border-box;
  background:#121218;
  border-radius:24px;
  padding:20px;
  box-shadow:0 0 40px rgba(0,0,0,.6);
  border:0;
}
.battle-status-grid{
  width:100%;
  display:flex;
  justify-content:space-between;
  margin:0 0 18px;
  flex-wrap:wrap;
  gap:8px;
}
.battle-status-box{
  background:#1f1f28;
  padding:10px 16px;
  border-radius:12px;
  font-size:15px;
  min-width:78px;
  min-height:0;
  text-align:center;
  flex:1;
  border:0;
  line-height:1.35;
}
.battle-status-box span{font-size:18px;line-height:1;font-weight:700;margin-top:2px}
#battleHints{color:#00e5ff}
.battle-race-meta{display:none}
.battle-instruction{margin:0 0 12px;color:#aaa}
.battle-board.race-board{
  display:grid;
  grid-template-columns:repeat(11,1fr);
  gap:5px;
  width:100%;
  max-width:560px;
  aspect-ratio:11/5;
  background:#0a0a0f;
  padding:10px;
  border-radius:18px;
  box-sizing:border-box;
  margin:0;
}
.battle-board.race-board .battle-cell{
  aspect-ratio:1;
  min-width:0;
  border-radius:50%;
  border:2px solid #33333a;
}
/* The tray is the same single-player .piece-area. Child pieces are untouched. */
.battle-piece-tray{
  margin-top:24px;
  width:100%;
  min-height:170px;
  background:#1a1a22;
  border-radius:18px;
  display:flex;
  justify-content:center;
  align-items:center;
  align-content:center;
  gap:14px;
  flex-wrap:wrap;
  padding:14px;
  box-sizing:border-box;
  touch-action:none;
}
.battle-piece-tray .piece{
  display:grid;
  gap:4px;
  padding:8px;
  cursor:grab;
  user-select:none;
  position:relative;
  border:2px solid rgba(255,255,255,.12);
  border-radius:16px;
  background:rgba(40,40,50,.6);
  transition:all .2s;
  touch-action:none;
  flex:0 0 auto;
}
.battle-piece-tray .piece.selected{
  transform:scale(1.1);
  border-color:rgba(255,255,255,.5);
  box-shadow:0 0 20px currentColor;
}
.battle-lock-tray{margin-top:10px}
.battle-lock-tray .piece{cursor:pointer}
.battle-lock-tray .piece.battle-lock-focused{border-color:#00e5ff;box-shadow:0 0 0 2px rgba(0,229,255,.18),0 0 18px rgba(0,229,255,.14)}
.battle-race-controls{
  margin-top:18px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:center;
  width:100%;
}
.battle-race-controls .battle-control{
  padding:14px 18px;
  border:0;
  border-radius:14px;
  background:#2a2a35;
  color:white;
  font-size:15px;
  font-weight:600;
  cursor:pointer;
  transition:all .2s;
  flex:1;
  min-width:72px;
  min-height:0;
  letter-spacing:0;
}
.battle-race-controls .battle-control:hover:not(:disabled){background:#3a3a45;transform:translateY(-2px);border-color:transparent}
.battle-race-controls .battle-reset{background:#2a2a35}
.battle-race-controls .battle-hint{background:#00bcd4;color:#111;border-color:transparent}
.battle-race-controls .battle-hint:hover:not(:disabled){background:#00bcd4}

/* Remove the old miniature/card presentation from battle trays. */
.battle-piece-card,.battle-piece-mini{display:none!important}

@media(max-width:520px){
  .battle-container{width:95vw;padding:20px;border-radius:24px}
  .battle-status-grid{gap:6px;margin-bottom:12px}
  .battle-status-box{min-width:0;padding:8px 5px;font-size:11px;border-radius:12px}
  .battle-status-box span{font-size:18px}
  .battle-board.race-board{gap:3px;padding:7px;border-radius:14px}
  .battle-piece-tray{min-height:170px;gap:14px;padding:14px}
  .battle-race-controls{gap:8px;margin-top:18px}
  .battle-race-controls .battle-control{font-size:12px;padding:12px 8px}
}


/* ==================== BATTLE PASS — HORIZONTAL TIMELINE ==================== */
.battle-pass-modal{
  width:min(96vw,1120px)!important;
  max-width:1120px!important;
  max-height:94vh!important;
  padding:18px!important;
  box-sizing:border-box;
  overflow:hidden!important;
  background:#0f1016;
  border:1px solid #282b36;
  text-align:left;
}
.battle-pass-modal .modal-close{display:block!important;margin:16px auto 0!important;padding:11px 34px!important;background:#ff4d6b!important;}
.bp-modal-top{display:block!important;margin:0 0 10px!important}
.bp-modal-title h2{display:none!important}
.bp-hero-clean{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:center;
  padding:17px 18px;
  border:1px solid #292d38;
  border-radius:18px;
  background:linear-gradient(135deg,#171922 0%,#111219 70%,#15131d 100%);
  box-shadow:0 12px 35px rgba(0,0,0,.22);
}
.bp-hero-copy{min-width:0}
.bp-kicker{font-size:9px!important;font-weight:900!important;letter-spacing:2px!important;color:#00d9ef!important;margin-bottom:4px}
.bp-title-row{display:flex;align-items:center;gap:9px}
.bp-title-row h3{margin:0;font-size:27px;letter-spacing:-.7px;color:#f7f8fb}
.bp-season-pill{font-size:8px;font-weight:900;letter-spacing:1px;padding:5px 8px;border-radius:999px;background:#222632;border:1px solid #333845;color:#89919f}
.bp-level-line{display:flex;align-items:center;gap:10px;margin:9px 0 7px;font-size:12px}
.bp-level-line strong{font-size:14px;color:#fff}
.bp-level-line span{color:#7f8795}
.bp-progress-clean{height:8px;background:#292c36;border-radius:99px;overflow:hidden}
.bp-progress-clean i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#00d9ef,#7866ff,#d8ae4d);box-shadow:0 0 12px rgba(0,217,239,.18);transition:width .35s ease}
.bp-wallet-clean{display:flex;gap:8px}
.bp-wallet-clean>div{min-width:98px;padding:9px 11px;border-radius:12px;background:#1a1c25;border:1px solid #2b2f3a}
.bp-wallet-clean small{display:block;font-size:8px;font-weight:900;letter-spacing:.8px;color:#747d8c;margin-bottom:4px}
.bp-wallet-clean strong{font-size:13px;color:#f5f6f8}
.bp-actions-clean{display:flex;align-items:center;gap:8px;margin:10px 0}
.bp-pass-status-chip,.bp-next-chip{height:34px;display:flex;align-items:center;padding:0 12px;border-radius:10px;border:1px solid #2b2e39;background:#181a22;color:#8c94a2;font-size:9px;font-weight:900;letter-spacing:.7px;white-space:nowrap}
.bp-pass-status-chip.owned{color:#e1bf67;border-color:#5a4921;background:#1d1a12}
.bp-golden-cta{height:34px;padding:0 14px;border:0;border-radius:10px;background:linear-gradient(100deg,#b48627,#f0cc68);color:#17130a;font-size:10px;font-weight:950;letter-spacing:.5px;cursor:pointer;box-shadow:0 5px 16px rgba(217,173,72,.12)}
.bp-golden-cta span{opacity:.72;margin-left:5px}
.bp-next-chip{margin-left:auto;color:#687180}
.bp-next-chip b{color:#dfe2e8;margin-left:5px}
.bp-next-chip.complete{color:#59cf99}
.bp-jumpbar{display:flex;align-items:center;gap:6px;margin:4px 0 9px;overflow-x:auto;scrollbar-width:none}
.bp-jumpbar::-webkit-scrollbar{display:none}
.bp-jump-label{font-size:8px;font-weight:900;letter-spacing:1.3px;color:#606875;margin-right:2px;white-space:nowrap}
.bp-jump{height:27px;min-width:42px;padding:0 9px;border:1px solid #2a2e38;border-radius:8px;background:#171921;color:#747d8b;font-size:8px;font-weight:900;cursor:pointer}
.bp-jump.active{color:#fff;border-color:#00aeca;background:#13272d}
.bp-jump.current{color:#d4b45e;border-color:#5d4b21;background:#211d13}
.bp-rail-shell{border:1px solid #272b35;border-radius:16px;background:#101219;overflow:hidden}
.bp-rail-head{height:42px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 12px;border-bottom:1px solid #252933;background:#14161d}
.bp-rail-head>div:first-child{display:flex;align-items:baseline;gap:9px}
.bp-rail-head strong{font-size:11px;letter-spacing:1px;color:#e8eaf0}
.bp-rail-head span{font-size:9px;color:#626b79}
.bp-legend{display:flex;align-items:center;gap:5px;font-size:8px;font-weight:900;color:#737b88;white-space:nowrap}
.free-dot,.gold-dot{width:6px;height:6px;border-radius:50%;display:inline-block}
.free-dot{background:#00d9ef;box-shadow:0 0 7px rgba(0,217,239,.35)}
.gold-dot{background:#d8ae4d;box-shadow:0 0 7px rgba(216,174,77,.3);margin-left:5px}
.bp-rail{
  display:flex;
  gap:8px;
  overflow-x:auto;
  overflow-y:hidden;
  padding:12px;
  scroll-snap-type:x proximity;
  scrollbar-width:thin;
  scrollbar-color:#343946 transparent;
  -webkit-overflow-scrolling:touch;
}
.bp-rail::-webkit-scrollbar{height:7px}
.bp-rail::-webkit-scrollbar-track{background:#11131a}
.bp-rail::-webkit-scrollbar-thumb{background:#343946;border-radius:99px}
.bp-tier{
  position:relative;
  flex:0 0 166px;
  scroll-snap-align:start;
  padding:0 0 5px;
}
.bp-tier:not(:last-child)::after{
  content:"";position:absolute;top:23px;right:-8px;width:8px;height:2px;background:#2b2f39;z-index:0
}
.bp-tier.completed:not(:last-child)::after{background:#35535a}
.bp-tier-head{height:45px;display:flex;align-items:center;justify-content:center;gap:5px;position:relative;z-index:2}
.bp-tier-head span{font-size:8px;letter-spacing:1.1px;font-weight:900;color:#606978}
.bp-tier-head b{font-size:17px;color:#dfe3ea}
.bp-tier.completed .bp-tier-head b{color:#65d3a4}
.bp-tier.milestone .bp-tier-head b{color:#e2bc5b}
.bp-tier-node{height:0;position:relative;z-index:3}
.bp-tier-node span{position:absolute;left:50%;top:-5px;transform:translate(-50%,-50%);width:10px;height:10px;border-radius:50%;background:#2b303a;border:2px solid #111219;box-shadow:0 0 0 1px #3a3f4b}
.bp-tier.completed .bp-tier-node span{background:#55c997;box-shadow:0 0 0 1px #4c8e74,0 0 9px rgba(85,201,151,.22)}
.bp-tier.next-tier .bp-tier-node span{background:#00d9ef;box-shadow:0 0 0 1px #00d9ef,0 0 12px rgba(0,217,239,.45)}
.bp-tier.milestone .bp-tier-node span{background:#d8ae4d;box-shadow:0 0 0 1px #9e7d30,0 0 10px rgba(216,174,77,.28)}
.bp-reward-card{
  min-height:88px;
  margin-top:7px;
  padding:9px;
  border:1px solid #292d37;
  border-radius:12px;
  background:#161820;
  transition:transform .16s ease,border-color .16s ease,opacity .16s ease;
}
.bp-reward-card:hover{transform:translateY(-1px)}
.bp-reward-card.free{border-color:#29313a}
.bp-reward-card.golden{border-color:#40371f;background:linear-gradient(145deg,#1b1913,#15161d)}
.bp-reward-card.major{border-color:#625021}
.bp-reward-card.ready{border-color:#315347}
.bp-reward-card.golden.ready{border-color:#765d25}
.bp-reward-card.locked{opacity:.55}
.bp-reward-top{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:7px}
.bp-track-label,.bp-reward-status{font-size:7px;font-weight:950;letter-spacing:.9px;color:#697280}
.bp-reward-card.golden .bp-track-label{color:#c3a252}
.bp-reward-card.ready .bp-reward-status{color:#59cf99}
.bp-reward-card.golden.ready .bp-reward-status{color:#dfbd63}
.bp-reward-main{display:flex;align-items:center;gap:9px;min-width:0}
.bp-reward-icon{width:30px;height:30px;flex:0 0 30px;position:relative;display:block}
/* Koodle reward currency artwork */
.koodle-star-icon,.koodle-coin-icon{display:inline-block;vertical-align:middle;background-repeat:no-repeat;background-position:center;background-size:contain;flex:0 0 auto;}
.koodle-star-icon{width:24px;height:24px;background-image:url('../assets/koodle-star.png');filter:drop-shadow(0 0 4px rgba(255,215,0,.48));}
.koodle-coin-icon{width:24px;height:24px;background-image:url('../assets/koodle-coin.png');filter:drop-shadow(0 0 3px rgba(0,220,255,.3));}
.koodle-star-icon.small{width:18px;height:18px;}
.koodle-star-icon.tiny{width:14px;height:14px;}
.koodle-star-icon.large{width:38px;height:38px;}
.koodle-star-icon.level-star{width:18px;height:18px;margin:0; flex:0 0 18px;}
.koodle-star-icon.level-star.is-empty{opacity:.22;filter:grayscale(1);}
.star-balance .koodle-star-icon{width:25px;height:25px;}
.battle-result-stars .koodle-star-icon{width:34px;height:34px;}
.custom-meta .koodle-star-icon{width:18px;height:18px;}
.reward-total-stars{font-size:26px;color:#ffd700;font-weight:700;display:flex;align-items:center;gap:6px;}
.bp-wallet-clean strong .koodle-star-icon,.bp-wallet-clean strong .koodle-coin-icon{width:22px;height:22px;}

.bp-reward-copy{min-width:0;display:flex;flex-direction:column;gap:3px}
.bp-reward-copy strong{font-size:10px;line-height:1.12;color:#edf0f4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bp-reward-copy span{font-size:8px;line-height:1.15;color:#737c89;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.bp-icon-star{width:30px;height:30px;}
.bp-icon-coin{width:30px;height:30px;}
.bp-icon-coin::after{display:none}
.bp-icon-hint{width:30px;height:30px;background-image:url('../assets/koodle-hint.png');background-repeat:no-repeat;background-position:center;background-size:contain;filter:drop-shadow(0 0 5px rgba(255,220,40,.42));}
.koodle-hint-icon{display:inline-block;width:20px;height:20px;background:url('../assets/koodle-hint.png') center/contain no-repeat;vertical-align:-5px;filter:drop-shadow(0 0 4px rgba(255,220,40,.45));margin-right:4px;flex:0 0 auto;}
.koodle-hint-icon.small{width:18px;height:18px;vertical-align:-4px;}

.bp-icon-skin{width:25px;height:25px;margin:1px 0 0 2px;border-radius:8px;transform:rotate(45deg);background:linear-gradient(135deg,#eefaff,#7dd3fc 45%,#6129a9);border:1px solid rgba(255,255,255,.4);box-shadow:0 0 8px rgba(125,211,252,.16)}
.bp-icon-color{width:27px;height:27px;border-radius:8px;background:var(--reward-color);border:2px solid rgba(255,255,255,.28);box-shadow:inset 3px 3px 7px rgba(255,255,255,.22),0 3px 7px rgba(0,0,0,.25)}
.bp-icon-bundle{width:28px;height:24px;border:2px solid #d9ad48;border-radius:6px;background:linear-gradient(90deg,#e8c25a 0 22%,transparent 22% 39%,#e8c25a 39% 61%,transparent 61% 78%,#e8c25a 78%);box-shadow:0 0 8px rgba(217,173,72,.2)}
.bp-icon-box{border:2px solid #596171;border-radius:6px}
.bp-footnote{padding:8px 3px 0;text-align:center;font-size:8px;color:#565f6d}
@media(max-width:700px){
  .battle-pass-modal{width:97vw!important;max-height:95vh!important;padding:11px!important}
  .bp-hero-clean{grid-template-columns:1fr;gap:10px;padding:13px}
  .bp-title-row h3{font-size:23px}
  .bp-wallet-clean{display:grid;grid-template-columns:1fr 1fr}
  .bp-wallet-clean>div{min-width:0}
  .bp-actions-clean{flex-wrap:wrap}
  .bp-next-chip{margin-left:0}
  .bp-golden-cta{flex:1;min-width:150px}
  .bp-rail{padding:10px}
  .bp-tier{flex-basis:156px}
  .bp-rail-head{height:auto;min-height:42px;padding:9px 10px;align-items:flex-start}
  .bp-rail-head>div:first-child{display:block}
  .bp-rail-head>div:first-child span{display:block;margin-top:3px}
}
@media(max-width:420px){
  .bp-wallet-clean>div{padding:8px}
  .bp-wallet-clean small{font-size:7px}
  .bp-wallet-clean strong{font-size:12px}
  .bp-tier{flex-basis:150px}
  .bp-reward-card{padding:8px;min-height:84px}
  .bp-reward-copy strong{font-size:9.5px}
  .bp-reward-copy span{font-size:7.5px}
}


/* ==================== CLEAN GAME UI PASS ==================== */
.battle-pass-modal{
  border-radius:22px!important;
  background:
    radial-gradient(circle at 90% 0%, rgba(0,217,239,.055), transparent 32%),
    #0d0f14!important;
}
.bp-hero-clean{border-radius:16px;background:#14171e;border-color:#252a34;box-shadow:none}
.bp-kicker{display:none}
.bp-title-row h3{font-size:25px;letter-spacing:-.5px}
.bp-season-pill{font-size:8px;padding:4px 7px}
.bp-level-line{margin:7px 0 6px}
.bp-progress-clean{height:6px;background:#242832}
.bp-wallet-clean>div{background:#171a21;border-color:#262b35}
.bp-actions-clean{margin:9px 0}
.bp-pass-status-chip,.bp-next-chip{height:32px;border-radius:9px}
.bp-jumpbar{margin:3px 0 8px}
.bp-jump-label{display:none}
.bp-jump{height:29px;border-radius:9px}
.bp-rail-shell{border-radius:15px;background:#0f1117;border-color:#242933}
.bp-rail-head{
  height:38px;
  padding:0 12px;
  background:#13161d;
  border-bottom-color:#222630;
}
.bp-rail-head>strong{font-size:10px;letter-spacing:1.2px}
.bp-rail-head>div:first-child{display:contents}
.bp-rail-head .bp-legend{margin-left:auto}
.bp-tier{flex-basis:158px}
.bp-tier-head{height:42px}
.bp-tier-head span{font-size:7px}
.bp-tier-head b{font-size:16px}
.bp-reward-card{
  min-height:72px;
  margin-top:6px;
  padding:8px;
  border-radius:11px;
  background:#15181f;
}
.bp-reward-card.golden{background:#181713}
.bp-reward-top{margin-bottom:6px}
.bp-track-label,.bp-reward-status{font-size:7px}
.bp-reward-main{gap:8px}
.bp-reward-icon{width:27px;height:27px;flex-basis:27px}
.bp-reward-copy{gap:0}
.bp-reward-copy strong{font-size:10px}
.bp-reward-copy span{font-size:8px;margin-top:2px}
.bp-reward-card.locked{opacity:.42}
.bp-reward-card.ready{box-shadow:inset 2px 0 0 #59cf99}
.bp-reward-card.golden.ready{box-shadow:inset 2px 0 0 #d8ae4d}
.bp-reward-card.major{box-shadow:inset 2px 0 0 #d8ae4d}
.bp-footnote{display:none}

.customization-modal .custom-section-title small{display:none}
.customization-modal .customization-top p{display:none}

@media(max-width:700px){
  .bp-title-row h3{font-size:22px}
  .bp-hero-clean{padding:12px}
  .bp-tier{flex-basis:148px}
  .bp-reward-card{min-height:70px}
}

/* Battle Pass cosmetic previews */
.bp-reward-card { min-height:118px; padding:8px; }
.bp-reward-card.locked { opacity:1; }
.bp-reward-top { margin-bottom:6px; }
.bp-reward-visual { height:54px; border-radius:9px; display:flex; align-items:center; justify-content:center; background:linear-gradient(145deg,#11131a,#191c25); border:1px solid rgba(255,255,255,.05); margin-bottom:7px; overflow:hidden; }
.bp-reward-visual .custom-preview { width:58px; height:48px; background:transparent; border:0; }
.bp-reward-visual .color-piece-preview, .bp-reward-visual .skin-piece-preview { width:54px; height:45px; }
.bp-reward-visual .preview-piece-cell { border-width:1px; }
.bp-bundle-preview { display:flex; gap:10px; align-items:center; justify-content:center; }
.bp-bundle-preview .bundle-half { width:48px; height:42px; display:flex; align-items:center; justify-content:center; border-radius:8px; background:#151821; border:1px solid rgba(255,255,255,.06); overflow:hidden; }
.bp-reward-copy { gap:0; }
.bp-reward-copy strong { font-size:10px; }
.bp-reward-copy span { display:none; }
.bp-reward-card.golden { background:linear-gradient(145deg,#1b1913,#15161d); }
.bp-reward-card.free .bp-reward-visual { border-color:rgba(0,217,239,.10); }
.bp-reward-card.golden .bp-reward-visual { border-color:rgba(216,174,77,.12); }


/* Combined Rewards + Battle Pass */
.embedded-battle-pass{margin-top:26px;padding-top:22px;border-top:1px solid #252a34;}
.embedded-battle-pass #battlePassContent{width:100%;}
.embedded-battle-pass .bp-hero-clean{margin-top:0;}
.embedded-battle-pass .bp-modal-top{display:none;}
@media (max-width:600px){.embedded-battle-pass{margin-top:20px;padding-top:18px;}}


/* Continuous Battle Pass timeline — no tier pages/jump navigation */
.bp-jumpbar{display:none!important;}
.bp-rail{
  display:flex;
  flex-wrap:nowrap;
  width:max-content;
  min-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-behavior:smooth;
  scroll-snap-type:none;
  padding:12px;
}
.bp-tier{scroll-snap-align:none;}

/* Rewards cadence polish — clean Koodle timeline */
.bp-rail-head>div:first-child{display:flex!important;flex-direction:column;gap:2px;}
.bp-rail-head>div:first-child span{font-size:8px;color:#596270;}
.bp-tier.milestone{flex-basis:172px;}
.bp-tier.milestone .bp-tier-head{background:linear-gradient(180deg,rgba(216,174,77,.08),transparent);border-radius:12px 12px 0 0;}
.bp-tier.milestone .bp-tier-head span{color:#b79748;}
.bp-tier.milestone .bp-reward-card.golden{border-color:#765d25;background:linear-gradient(145deg,#211c11,#161611);box-shadow:0 0 0 1px rgba(216,174,77,.06),0 8px 24px rgba(0,0,0,.16);}
.bp-tier.milestone .bp-reward-card.golden .bp-track-label{color:#e1bf67;}
.bp-tier.milestone .bp-reward-card.free{border-style:dashed;opacity:.78;}
.bp-reward-card.golden .bp-reward-copy strong{color:#f1e2b4;}
.bp-reward-card.free .bp-track-label{color:#65cddd;}
.bp-reward-card .bp-reward-visual{background:#11141b;}
.bp-tier.completed .bp-reward-card{border-color:#315347;}
.bp-tier.completed .bp-reward-card.golden{border-color:#6b5625;}
@media(max-width:700px){.bp-rail-head>div:first-child span{display:none!important}.bp-tier.milestone{flex-basis:162px;}}

.level-btn .stars{display:flex;justify-content:center;align-items:center;gap:0;min-height:18px;}
.bp-reward-icon.koodle-star-icon,.bp-reward-icon.koodle-coin-icon{background-size:contain;}

/* Koodle trophy + Shop */
.koodle-trophy-icon{display:inline-block;width:30px;height:30px;background:url('../assets/koodle-trophy.png') center/contain no-repeat;vertical-align:middle;filter:drop-shadow(0 0 5px rgba(255,215,0,.45));flex:0 0 auto;}
.koodle-trophy-icon.tiny{width:18px;height:18px;vertical-align:-4px;margin-right:4px;}
.koodle-trophy-icon.large{width:86px;height:86px;}
.koodle-shop-icon{display:inline-block;width:30px;height:30px;background:url('../assets/koodle-shop.png') center/contain no-repeat;vertical-align:middle;filter:drop-shadow(0 0 5px rgba(255,215,0,.45));flex:0 0 auto;}
.koodle-shop-icon.tiny{width:18px;height:18px;vertical-align:-4px;margin-right:4px;}
.koodle-shop-icon.large{width:86px;height:86px;}
.rewards-title{display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:16px;}
.shop-modal-content{max-width:760px;}
.shop-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:18px;}
.shop-header h2{display:flex;align-items:center;gap:8px;margin:3px 0 4px;}
.shop-header p{margin:0;color:#7f8794;font-size:13px;}
.shop-kicker{font-size:10px;letter-spacing:1.5px;font-weight:900;color:#ffd54a;}
.shop-section{margin-top:18px;}
.shop-section>h3{display:flex;align-items:center;gap:5px;margin:0 0 12px;color:#00e5ff;}
.shop-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.shop-pass-card{display:flex;gap:20px;align-items:center;padding:18px;border:1px solid #3a3220;border-radius:18px;background:linear-gradient(145deg,#211c11,#15161d);}
.shop-pass-art{width:120px;min-width:120px;height:120px;border-radius:18px;display:flex;align-items:center;justify-content:center;background:#11141b;border:1px solid rgba(255,215,0,.14);}
.shop-pass-copy{min-width:0;text-align:left;}
.shop-pass-badge{display:inline-block;font-size:9px;font-weight:900;letter-spacing:1px;color:#111;background:#ffd54a;border-radius:999px;padding:5px 8px;}
.shop-pass-copy h3{margin:7px 0 4px;font-size:22px;}
.shop-pass-copy p{margin:0;color:#858d99;font-size:12px;line-height:1.45;}
.shop-pass-price{font-size:30px;font-weight:900;color:#ffd54a;margin-top:10px;}
.shop-pass-price span{font-size:13px;color:#9a8c68;font-weight:700;}
.shop-pass-status{font-size:11px;color:#65cddd;margin-top:3px;}
.shop-pass-button{margin-top:11px;background:linear-gradient(90deg,#ffd54a,#ffb300);color:#17130a;font-weight:900;border-radius:12px;padding:12px 16px;}
.shop-pass-button:disabled{opacity:.65;cursor:default;}
@media(max-width:620px){.shop-grid{grid-template-columns:1fr;}.shop-pass-card{flex-direction:column;text-align:center;}.shop-pass-copy{text-align:center;}.shop-pass-art{width:100px;min-width:100px;height:100px;}.shop-pass-button{width:100%;}}


/* Koodle Rewards Pass label layout polish — preserve existing functionality */
.rewards-pass-actions,
.rewards-actions,
.reward-actions,
.rewards-cta-row,
.rewards-track-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px auto 22px;
}

.rewards-pass-actions > *,
.rewards-actions > *,
.reward-actions > *,
.rewards-cta-row > *,
.rewards-track-actions > * {
  min-width: 0;
}

.free-track,
.open-shop,
.next-tier,
.free-track-label,
.open-shop-label,
.next-tier-label {
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.rewards-pass-header,
.rewards-header,
.reward-header {
  padding-top: 18px;
  padding-bottom: 12px;
}

.rewards-tabs,
.reward-tabs,
.rewards-track-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 14px;
  margin-top: 6px;
}

@media (max-width: 600px) {
  .rewards-pass-actions,
  .rewards-actions,
  .reward-actions,
  .rewards-cta-row,
  .rewards-track-actions {
    gap: 10px;
    margin-top: 14px;
    margin-bottom: 18px;
  }

  .rewards-tabs,
  .reward-tabs,
  .rewards-track-tabs {
    gap: 8px;
    min-height: 50px;
    padding: 7px 10px;
  }
}


/* ==================== REWARDS PASS LAYOUT POLISH ==================== */
/* Give the three controls breathing room and make the shop CTA feel like the
   primary action instead of three cramped inline chips. */
.bp-actions-clean{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(150px,1.25fr) minmax(0,1fr);
  align-items:stretch;
  gap:10px;
  margin:14px 0 16px;
}
.bp-pass-status-chip,
.bp-golden-cta,
.bp-next-chip{
  min-height:42px;
  height:42px;
  box-sizing:border-box;
  justify-content:center;
  text-align:center;
}
.bp-pass-status-chip{
  padding:0 14px;
  background:#171b21;
  border-color:#2d333d;
}
.bp-golden-cta{
  width:100%;
  min-width:0;
  padding:0 16px;
  border:1px solid rgba(67,220,132,.5);
  border-radius:12px;
  background:linear-gradient(135deg,#159447,#25c968);
  color:#07170d;
  font-size:11px;
  font-weight:950;
  letter-spacing:.65px;
  box-shadow:0 7px 18px rgba(25,190,92,.18), inset 0 1px 0 rgba(255,255,255,.14);
}
.bp-golden-cta:hover{
  background:linear-gradient(135deg,#18a04e,#2bd774);
  transform:translateY(-1px);
  box-shadow:0 9px 22px rgba(25,190,92,.24), inset 0 1px 0 rgba(255,255,255,.16);
}
.bp-golden-cta span{
  opacity:.78;
  margin-left:7px;
}
.bp-next-chip{
  margin-left:0!important;
  padding:0 14px;
  background:#17191f;
  border-color:#2d313a;
}
.bp-next-chip b{margin-left:6px}

/* The rewards/tabs header gets a proper vertical rhythm so it doesn't hug
   the top edge of the horizontal rail. */
.bp-rail-head{
  min-height:58px;
  height:auto;
  box-sizing:border-box;
  padding:10px 16px;
  align-items:center;
}
.bp-rail-head>div:first-child{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start;
  justify-content:center;
  gap:3px!important;
  min-height:38px;
}
.bp-rail-head>div:first-child strong{
  display:block;
  line-height:1.15;
  font-size:12px;
}
.bp-rail-head>div:first-child span{
  display:block!important;
  line-height:1.2;
  font-size:8px;
}
.bp-legend{
  align-self:center;
  padding:7px 9px;
  border:1px solid #252a33;
  border-radius:9px;
  background:#10131a;
}

/* More breathing room between the header, tier labels and reward cards. */
.bp-rail{
  padding:14px 14px 16px;
}
.bp-tier-head{
  height:48px;
  margin-bottom:2px;
}
.bp-reward-card{
  margin-top:8px;
}
@media(max-width:700px){
  .bp-actions-clean{
    grid-template-columns:1fr 1.2fr 1fr;
    gap:7px;
    margin:12px 0 14px;
  }
  .bp-pass-status-chip,
  .bp-golden-cta,
  .bp-next-chip{
    min-height:44px;
    height:44px;
    padding-left:8px;
    padding-right:8px;
  }
  .bp-golden-cta{
    font-size:10px;
  }
  .bp-golden-cta span{
    display:block;
    margin:1px 0 0;
    font-size:8px;
  }
  .bp-rail-head{
    min-height:62px;
    padding:10px 12px;
  }
  .bp-rail-head>div:first-child{
    min-height:40px;
  }
  .bp-legend{
    padding:6px 7px;
  }
  .bp-rail{
    padding:13px 11px 15px;
  }
}
@media(max-width:420px){
  .bp-actions-clean{
    grid-template-columns:1fr;
    gap:7px;
  }
  .bp-pass-status-chip,
  .bp-golden-cta,
  .bp-next-chip{
    width:100%;
  }
  .bp-golden-cta span{
    display:inline;
    margin-left:5px;
  }
}


/* =========================================================
   KOODLE BATTLE — MAIN-BRAND VISUAL SYSTEM
   Carries the same neon logo + perspective grid language
   from the home screen into the Battle experience.
   ========================================================= */

.battle-screen{
  position:relative;
  isolation:isolate;
  overflow-x:hidden;
  overflow-y:auto;
  min-height:100vh;
  padding:28px 16px 40px;
  justify-content:flex-start;
  background:
    radial-gradient(circle at 50% 4%, rgba(0,229,255,.09), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(255,77,107,.06), transparent 32%),
    #0a0a0f !important;
}

.battle-screen::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-2;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.027) 1px, transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(to bottom, black 0%, rgba(0,0,0,.85) 55%, transparent 100%);
  -webkit-mask-image:linear-gradient(to bottom, black 0%, rgba(0,0,0,.85) 55%, transparent 100%);
}

.battle-screen::after{
  content:"";
  position:fixed;
  left:50%;
  bottom:-25vh;
  width:140vw;
  height:62vh;
  z-index:-1;
  pointer-events:none;
  transform:translateX(-50%) perspective(520px) rotateX(62deg);
  transform-origin:center top;
  background-image:
    linear-gradient(rgba(0,229,255,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,.10) 1px, transparent 1px);
  background-size:52px 52px;
  opacity:.34;
  filter:drop-shadow(0 0 8px rgba(0,229,255,.10));
}

.battle-container{
  width:min(95vw,600px);
  background:rgba(18,18,24,.84);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border:1px solid rgba(0,229,255,.10);
  border-radius:28px;
  padding:20px;
  box-shadow:
    0 0 70px rgba(0,0,0,.72),
    0 0 35px rgba(0,229,255,.045),
    inset 0 0 0 1px rgba(255,255,255,.035);
}

.battle-brand-header{
  position:relative;
  text-align:center;
  padding:2px 4px 22px;
  margin-bottom:2px;
}

.battle-logo{
  font-family:'Space Grotesk',sans-serif;
  font-size:clamp(52px,13vw,72px);
  font-weight:700;
  letter-spacing:5px;
  line-height:.9;
  display:flex;
  justify-content:center;
  gap:2px;
  filter:drop-shadow(0 0 18px rgba(0,229,255,.08));
}

.battle-logo span{
  display:inline-block;
  -webkit-text-stroke:1.5px rgba(255,255,255,.08);
  transition:transform .3s ease;
}

.battle-logo span:nth-child(1){color:#ff4d6b;text-shadow:0 0 6px #ff4d6b,0 0 14px #ff4d6b,0 0 24px rgba(255,77,107,.7)}
.battle-logo span:nth-child(2){color:#00e5ff;text-shadow:0 0 6px #00e5ff,0 0 14px #00e5ff,0 0 24px rgba(0,229,255,.7)}
.battle-logo span:nth-child(3){color:#00ff9d;text-shadow:0 0 6px #00ff9d,0 0 14px #00ff9d,0 0 24px rgba(0,255,157,.7)}
.battle-logo span:nth-child(4){color:#4d9eff;text-shadow:0 0 6px #4d9eff,0 0 14px #4d9eff,0 0 24px rgba(77,158,255,.7)}
.battle-logo span:nth-child(5){color:#c266ff;text-shadow:0 0 6px #c266ff,0 0 14px #c266ff,0 0 24px rgba(194,102,255,.7)}
.battle-logo span:nth-child(6){color:#ff4d6b;text-shadow:0 0 6px #ff4d6b,0 0 14px #ff4d6b,0 0 24px rgba(255,77,107,.7)}

.battle-brand-subtitle{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-top:8px;
  color:#f3f3f7;
  font-family:'Space Grotesk',sans-serif;
  font-size:15px;
  font-weight:800;
  letter-spacing:5px;
  text-shadow:0 0 10px rgba(255,77,107,.35);
}

.battle-brand-line{
  width:42px;
  height:1px;
  background:linear-gradient(90deg,transparent,#ff4d6b);
  box-shadow:0 0 8px rgba(255,77,107,.45);
}
.battle-brand-line:last-child{
  background:linear-gradient(90deg,#ff4d6b,transparent);
}

.battle-brand-stars{
  position:absolute;
  right:0;
  top:4px;
  margin:0;
  font-size:12px;
  padding:8px 11px;
  background:rgba(10,10,15,.72);
  border:1px solid rgba(255,215,0,.15);
  border-radius:12px;
}

.battle-subtitle{
  color:#8f909b;
  text-align:center;
  margin:4px 0 22px;
}

.battle-tier-card{
  position:relative;
  overflow:hidden;
  background:linear-gradient(145deg,rgba(29,29,40,.96),rgba(18,18,26,.96));
  border-color:rgba(255,255,255,.08);
  box-shadow:inset 0 0 25px rgba(255,255,255,.012);
}
.battle-tier-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(135deg,rgba(0,229,255,.06),transparent 42%,rgba(255,77,107,.05));
}
.battle-tier-card:hover:not(:disabled){
  border-color:rgba(255,77,107,.7);
  box-shadow:0 12px 30px rgba(255,77,107,.10),0 0 22px rgba(255,77,107,.08);
}

.battle-step-title{
  color:#f2f2f6;
  letter-spacing:.7px;
}
.battle-board,
.battle-piece-tray,
.battle-status-box{
  border:1px solid rgba(255,255,255,.055);
  box-shadow:inset 0 0 28px rgba(0,0,0,.22);
}
.battle-board{
  background:#08090e;
  box-shadow:0 0 24px rgba(0,0,0,.45),inset 0 0 25px rgba(0,229,255,.025);
}
.battle-piece-tray{background:rgba(26,26,34,.88)}

.battle-ready-btn{
  background:linear-gradient(90deg,#ff4d6b,#ef4444);
  box-shadow:0 8px 24px rgba(255,77,107,.18);
}
.battle-queue-status{ text-shadow:0 0 10px rgba(0,229,255,.35); }

@media(max-width:520px){
  .battle-screen{padding:18px 10px 30px}
  .battle-container{padding:16px;border-radius:24px}
  .battle-brand-header{padding-bottom:18px}
  .battle-brand-stars{
    position:static;
    display:inline-flex;
    margin-top:12px;
  }
  .battle-logo{font-size:56px;letter-spacing:4px}
  .battle-brand-subtitle{font-size:13px;letter-spacing:4px}
}

/* ================================================================
   KOODLE BATTLE — MATCH THE MAIN MENU VISUAL SYSTEM
   The Battle screen intentionally uses the same neon logo, card,
   grid, spacing, and dark glass treatment as the home screen.
   ================================================================ */
.battle-screen {
  background:
    radial-gradient(circle at 50% 18%, rgba(30,30,48,.18), transparent 42%),
    #0a0a0f !important;
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.battle-container {
  width: 95vw !important;
  max-width: 600px !important;
  min-height: 0 !important;
  background: #121218 !important;
  border-radius: 28px !important;
  padding: 30px !important;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.06) !important;
  border: 0 !important;
}

.battle-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
  z-index: 0;
}

.battle-container > * {
  position: relative;
  z-index: 1;
}

.battle-brand-header {
  width: 100%;
  text-align: center;
  margin-bottom: 28px;
}

.battle-logo {
  margin-bottom: 7px !important;
  font-size: 76px !important;
  letter-spacing: 6px !important;
  gap: 4px !important;
}

.battle-title-subtitle {
  margin-bottom: 18px !important;
  color: #888 !important;
  font-size: 17px !important;
  letter-spacing: 2.5px !important;
  font-weight: 700;
}

.battle-brand-stars {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.battle-subtitle {
  color: #888 !important;
  margin: 0 0 22px !important;
  font-size: 14px !important;
  line-height: 1.5;
  text-align: center;
}

/* Main-menu-like controls: clean, rounded, saturated gradients. */
.battle-tier-card {
  min-height: 165px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  background: #1f1f28;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.015);
}

.battle-tier-card:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: rgba(0,229,255,.45);
  background: #252530;
  box-shadow: 0 0 24px rgba(0,229,255,.10);
}

.battle-ready-btn {
  background: linear-gradient(90deg,#0066cc,#00aaff) !important;
  border-radius: 14px;
  box-shadow: none;
}

.battle-ready-btn:not(:disabled):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.battle-secondary,
.battle-back,
.battle-race-controls .battle-control {
  background: #2a2a35;
  border-color: transparent;
  color: #fff;
  border-radius: 14px;
}

.battle-secondary:hover,
.battle-back:hover,
.battle-race-controls .battle-control:hover:not(:disabled) {
  background: #343440;
  border-color: rgba(255,255,255,.08);
}

.battle-queue-status { color: #00e5ff; }

.battle-rule-note,
.battle-help,
.battle-lock-hint {
  color: #666 !important;
}

.battle-board,
.battle-board.race-board {
  background: #0a0a0f;
  border: 1px solid rgba(255,255,255,.035);
  box-shadow: inset 0 0 24px rgba(0,0,0,.35);
}

.battle-status-box {
  background: #1f1f28;
  border: 0;
  border-radius: 12px;
}

.battle-piece-tray {
  background: #1f1f28;
  border: 0;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.battle-result-card,
.battle-wait-card {
  padding-top: 28px;
}

/* Keep the shared Koodle logo readable on narrower phones. */
@media (max-width: 520px) {
  .battle-container {
    width: 95vw !important;
    padding: 24px 20px !important;
    border-radius: 24px !important;
  }

  .battle-logo {
    font-size: 58px !important;
    letter-spacing: 4px !important;
    gap: 2px !important;
  }

  .battle-title-subtitle {
    font-size: 15px !important;
    margin-bottom: 15px !important;
  }

  .battle-brand-header {
    margin-bottom: 22px;
  }
}

@media (max-width: 380px) {
  .battle-logo {
    font-size: 49px !important;
    letter-spacing: 3px !important;
  }
}


/* ================================================================
   KOODLE FEATURE PAGES — SHARED MAIN-MENU VISUAL SYSTEM
   Shop • Skins & Colors • Rewards • Levels
   Matches the home screen: dark rounded panel, 42px grid, neon Koodle
   wordmark, restrained glass surfaces, and Koodle accent colors.
   ================================================================ */
.koodle-feature-modal{
  background:rgba(5,5,10,.90)!important;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  padding:20px;
}
.koodle-feature-modal .koodle-panel{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  background:#121218!important;
  border-radius:28px!important;
  border:1px solid rgba(255,255,255,.07);
  box-shadow:0 0 60px rgba(0,0,0,.72), inset 0 0 0 1px rgba(255,255,255,.025);
}
.koodle-feature-modal .koodle-panel::before{
  content:'';
  position:absolute;
  inset:0;
  background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);
  background-size:42px 42px;
  pointer-events:none;
  z-index:-1;
}
.koodle-feature-modal .koodle-panel > *{position:relative;z-index:1}
.modal-koodle-brand{
  text-align:center;
  padding:2px 0 18px;
  margin-bottom:4px;
}
.modal-logo{
  font-size:clamp(42px,9vw,64px)!important;
  letter-spacing:5px!important;
  gap:3px!important;
  margin:0!important;
  line-height:.96!important;
}
.modal-brand-title{
  margin-top:9px;
  color:#fff;
  font-size:19px;
  font-weight:800;
  letter-spacing:3px;
  text-shadow:0 0 8px rgba(255,255,255,.16);
}
.koodle-feature-modal .modal-close,
.koodle-feature-modal button[onclick*="close"]{
  border:0!important;
  border-radius:16px!important;
  background:#2a2a35!important;
  color:#fff!important;
  font-weight:700!important;
  box-shadow:none!important;
}
.koodle-feature-modal .modal-close:hover,
.koodle-feature-modal button[onclick*="close"]:hover{
  background:#343440!important;
  transform:translateY(-1px);
}

/* Skins & Colors */
.customization-modal{max-width:620px!important;padding:24px!important}
.customization-top{padding:14px 16px!important;border-radius:18px!important;background:rgba(31,31,40,.88)!important;border:1px solid rgba(255,255,255,.055)!important}
.modal-kicker{color:#777!important}
.custom-section-title{border-bottom-color:rgba(255,255,255,.08)!important}
.custom-section-title.colors-title > span:first-child{color:#00e5ff!important}
.custom-section-title.standard-title > span:first-child{color:#00ff9d!important}
.custom-section-title.premium-title > span:first-child{color:#c266ff!important}
.custom-card{background:#1f1f28!important;border:1px solid rgba(255,255,255,.07)!important;border-radius:16px!important}
.custom-card:hover:not(:disabled){background:#292933!important;border-color:rgba(0,229,255,.35)!important}
.custom-card.is-selected{border-color:rgba(0,255,157,.65)!important;box-shadow:0 0 0 1px rgba(0,255,157,.13),0 0 20px rgba(0,255,157,.08)!important}

/* Rewards */
.rewards-panel{max-width:760px!important;padding:24px!important}
.rewards-title{font-size:0!important;margin:0 0 12px!important;height:0;overflow:hidden}
#rewardsSummary{background:#1f1f28!important;border:1px solid rgba(255,255,255,.06)!important}
#rewardsLevelsGrid{background:rgba(10,10,15,.45);border-radius:18px;padding:12px!important}
.rewards-panel h3{color:#ffd700!important;text-shadow:0 0 8px rgba(255,215,0,.18)}
.embedded-battle-pass{background:rgba(18,18,24,.72)!important;border:1px solid rgba(255,255,255,.055)!important;border-radius:20px!important;margin-top:18px!important;padding:12px!important}
.bp-hero-clean{border-radius:18px!important;background:linear-gradient(145deg,rgba(31,31,40,.96),rgba(18,18,24,.94))!important;border:1px solid rgba(255,255,255,.06)!important}
.bp-rail-shell{border-radius:18px!important;background:#17171f!important;border-color:rgba(255,255,255,.07)!important}

/* Shop */
.shop-panel{max-width:760px!important;padding:24px!important}
.shop-header{padding:14px 16px;border-radius:18px;background:rgba(31,31,40,.82);border:1px solid rgba(255,255,255,.055);margin-bottom:18px!important}
.shop-kicker{color:#00e5ff!important}
.shop-header h2{font-size:27px!important}
.shop-header p{color:#888!important}
.shop-section>h3{color:#00e5ff!important}
.shop-grid{gap:12px!important}
.hint-pack{background:#1f1f28!important;border:1px solid rgba(255,255,255,.07)!important;border-radius:18px!important}
.hint-pack:hover{border-color:#00e5ff!important;box-shadow:0 0 18px rgba(0,229,255,.08)}
.hint-pack button{background:linear-gradient(90deg,#0066cc,#0099ff)!important;border-radius:14px!important;box-shadow:0 4px 15px rgba(0,102,204,.25)}
.shop-pass-card{background:linear-gradient(145deg,#1f1f28,#15151c)!important;border:1px solid rgba(255,255,255,.07)!important}
.shop-pass-button{background:linear-gradient(90deg,#0066cc,#0099ff)!important;color:#fff!important;box-shadow:0 4px 15px rgba(0,102,204,.25)!important}
.shop-pass-price{color:#ffd700!important}

.shop-intro{
  margin:2px auto 18px!important;
  max-width:520px;
  text-align:center;
  color:#858b98!important;
  font-size:13px!important;
  line-height:1.45;
}
.shop-section{margin-top:14px!important;}
.shop-section>h3{
  margin-bottom:10px!important;
  font-size:16px!important;
  letter-spacing:.2px;
}
.shop-grid{gap:10px!important;}
.hint-pack{padding:16px 14px!important;}
.shop-pass-card{margin-top:14px!important;padding:17px!important;}
.shop-pass-copy h3{font-size:21px!important;}
.shop-pass-copy p{max-width:520px;}

/* Levels */
.koodle-feature-modal #levelsGrid{padding:4px!important}
.koodle-feature-modal .level-btn{background:#1f1f28!important;border:1px solid rgba(255,255,255,.07)!important;border-radius:16px!important}
.koodle-feature-modal .level-btn:hover{background:#292933!important;border-color:rgba(0,229,255,.35)!important}

@media(max-width:620px){
  .koodle-feature-modal{padding:10px!important}
  .koodle-feature-modal .koodle-panel{border-radius:24px!important}
  .modal-koodle-brand{padding-bottom:13px}
  .modal-logo{font-size:43px!important;letter-spacing:4px!important}
  .modal-brand-title{font-size:16px;letter-spacing:2.5px}
  .customization-modal,.rewards-panel,.shop-panel{padding:17px!important}
}

/* ================================================================
   KOODLE FEATURE PAGES — MOBILE / DESKTOP SCROLL FIX
   Keep the Koodle card styling, but never trap long Shop, Skins,
   Rewards, or Levels screens inside a non-scrolling viewport.
   ================================================================ */
.koodle-feature-modal {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  align-items: flex-start !important;
  justify-content: center !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding: 20px 12px 28px !important;
}

.koodle-feature-modal .modal-content,
.koodle-feature-modal .koodle-panel {
  flex: 0 0 auto;
  width: min(760px, 100%) !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 auto;
}

/* Let the feature page itself handle vertical scrolling rather than
   creating a tiny nested scroll box inside the Koodle card. */
.koodle-feature-modal .levels-grid,
.koodle-feature-modal #rewardsLevelsGrid {
  max-height: none !important;
  overflow: visible !important;
}

@media (max-width: 620px) {
  .koodle-feature-modal {
    padding: 10px 8px 24px !important;
  }

  .koodle-feature-modal .modal-content,
  .koodle-feature-modal .koodle-panel {
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* ================================================================
   REWARDS — LEVEL STARS NESTED SCROLL WINDOW
   Keep the overall Rewards page scrollable, while the Level Stars
   list remains its own compact scroll area like the original layout.
   ================================================================ */
.koodle-feature-modal #rewardsLevelsGrid {
  max-height: 280px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
}

@media (max-width: 620px) {
  .koodle-feature-modal #rewardsLevelsGrid {
    max-height: 280px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
}

/* Koodle level completion graphic */
body.level-complete-open{overflow:hidden}.level-complete-modal{background:rgba(5,5,10,.88);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);z-index:500}.level-complete-card{width:min(92vw,430px);padding:28px 24px 24px;border:1px solid rgba(255,255,255,.08);border-radius:26px;text-align:center;position:relative;overflow:hidden;box-shadow:0 0 60px rgba(0,170,255,.12),0 24px 80px rgba(0,0,0,.6)}.level-complete-glow{position:absolute;width:260px;height:150px;left:50%;top:-90px;transform:translateX(-50%);background:radial-gradient(circle,rgba(0,190,255,.34),transparent 68%);pointer-events:none}.level-complete-brand{position:relative;display:flex;flex-direction:column;align-items:center;gap:3px;margin-bottom:8px}.level-complete-brand .modal-logo{font-size:42px;letter-spacing:3px}.level-complete-brand .modal-brand-title{font-size:11px;letter-spacing:2.5px;font-weight:900;color:#8d8d9b}.level-complete-badge{width:70px;height:70px;margin:8px auto 10px;border-radius:22px;display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,#173149,#12212f);border:1px solid rgba(0,190,255,.32);box-shadow:0 0 26px rgba(0,190,255,.16),inset 0 0 20px rgba(0,190,255,.08)}.level-complete-check{width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:27px;font-weight:900;color:#0a1218;background:#00c8ff;box-shadow:0 0 18px rgba(0,200,255,.45)}.level-complete-title{font-size:25px;line-height:1.08;font-weight:950;letter-spacing:1.2px;color:#f5f7fb}.level-complete-level{margin-top:7px;font-size:12px;font-weight:900;letter-spacing:2px;color:#777786}.level-complete-stars{display:flex;justify-content:center;gap:8px;margin:16px 0 18px}.completion-star{font-size:30px;line-height:1}.completion-star.earned{color:#ffd84d;text-shadow:0 0 14px rgba(255,216,77,.42)}.completion-star.empty{color:#34343f}.level-complete-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px}.level-complete-stat{background:#1f1f28;border:1px solid rgba(255,255,255,.045);border-radius:14px;padding:11px 8px}.level-complete-stat span{display:block;font-size:9px;font-weight:900;letter-spacing:1.6px;color:#777786;margin-bottom:4px}.level-complete-stat strong{font-size:19px;color:#f1f3f7}.level-complete-message{min-height:38px;padding:0 8px;color:#9999a7;font-size:12px;line-height:1.45}.level-complete-next{width:100%;margin-top:12px;padding:14px 18px;border:0;border-radius:13px;background:linear-gradient(90deg,#0066cc,#00aaff);color:white;font-size:15px;font-weight:900;letter-spacing:.7px;box-shadow:0 7px 22px rgba(0,102,204,.28)}@media(max-width:480px){.level-complete-card{padding:24px 18px 19px;border-radius:23px}.level-complete-title{font-size:21px}.level-complete-badge{width:64px;height:64px}.level-complete-brand .modal-logo{font-size:38px}}


/* Rewards Pass claim controls */
.bp-reward-copy { position: relative; }
.bp-claim-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 8px; padding: 7px 14px; border: 0; border-radius: 9px;
  background: #fff; color: #111; font: 800 11px/1 Arial, sans-serif;
  letter-spacing: .08em; cursor: pointer; box-shadow: 0 0 14px rgba(255,255,255,.22);
}
.bp-claim-btn:hover { transform: translateY(-1px); }
.bp-reward-card.claim-ready { box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 0 22px rgba(90,160,255,.16); }

/* Matchmaking timeout / fallback menu */
.battle-timeout-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(5,5,10,.82);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.battle-timeout-card{width:min(92vw,440px);padding:28px 24px 22px;border-radius:24px;background:#121218;border:1px solid rgba(0,229,255,.16);box-shadow:0 24px 90px rgba(0,0,0,.7),0 0 45px rgba(0,190,255,.08);text-align:center}
.battle-timeout-eyebrow{font-size:10px;letter-spacing:2.4px;font-weight:900;color:#00e5ff;margin-bottom:7px}
.battle-timeout-card h2{margin:0 0 9px;font-size:26px;letter-spacing:.5px;color:#f5f7fb}
.battle-timeout-card p{margin:0 auto 16px;max-width:360px;color:#90909f;font-size:13px;line-height:1.5}
.battle-timeout-timer{font-size:34px;font-weight:950;letter-spacing:2px;color:#00e5ff;text-shadow:0 0 18px rgba(0,229,255,.35);margin-bottom:18px}
.battle-timeout-actions{display:flex;flex-direction:column;gap:9px}
.battle-timeout-actions button{width:100%;margin:0}
.battle-timeout-note{margin-top:14px;color:#666674;font-size:10px;line-height:1.45}
@media(max-width:480px){.battle-timeout-card{padding:24px 18px 19px;border-radius:22px}.battle-timeout-card h2{font-size:22px}.battle-timeout-timer{font-size:30px}}


/* Koodle account-required access modal */
.koodle-access-modal{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.72);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.koodle-access-card{width:min(430px,94vw);padding:30px 26px 25px;background:#121218;border:1px solid rgba(255,255,255,.09);border-radius:24px;box-shadow:0 24px 70px rgba(0,0,0,.55),0 0 40px rgba(0,229,255,.08);text-align:center}
.koodle-access-logo{font-size:40px;line-height:1;font-weight:900;letter-spacing:3px;margin-bottom:10px;text-shadow:0 0 12px rgba(255,255,255,.15)}
.koodle-access-logo span:nth-child(1){color:#00e5ff}.koodle-access-logo span:nth-child(2){color:#ff3d81}.koodle-access-logo span:nth-child(3){color:#ffd740}.koodle-access-logo span:nth-child(4){color:#69f0ae}.koodle-access-logo span:nth-child(5){color:#7c4dff}.koodle-access-logo span:nth-child(6){color:#ff5252}
.koodle-access-label{font-size:10px;letter-spacing:2.4px;font-weight:800;color:#777;margin-top:4px}.koodle-access-card h2{margin:8px 0 8px;font-size:24px;letter-spacing:1px}.koodle-access-card p{margin:0 auto 20px;max-width:330px;color:#9a9aa5;font-size:14px;line-height:1.5}.koodle-access-actions{display:flex;gap:10px;justify-content:center}.koodle-access-actions button{flex:1;min-width:0}.koodle-access-primary{background:linear-gradient(90deg,#0066cc,#00aaff)!important}.koodle-access-secondary{background:#1f1f28!important}
@media(max-width:480px){.koodle-access-card{padding:25px 18px 20px}.koodle-access-logo{font-size:35px}.koodle-access-actions{flex-direction:column}}

/* Battle matchmaking controls */
.battle-tier-card.selected {
  transform: translateY(-2px);
  border-color: #00e5ff;
  box-shadow: 0 0 0 2px rgba(0,229,255,.22), 0 0 24px rgba(0,229,255,.16);
}
.battle-start-search-btn { margin-top: 10px; }
.battle-stop-search-btn {
  width: 100%;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
  background: rgba(255,255,255,.07);
  color: #fff;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
}
.battle-stop-search-btn:hover { background: rgba(255,255,255,.12); }

/* ==================== KOODLE MONTHLY REWARDS PASS ==================== */
.battle-pass-modal{
  background:
    radial-gradient(circle at 10% 0%, rgba(0,229,255,.10), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(124,92,255,.10), transparent 32%),
    linear-gradient(160deg,#080a10,#10131c 55%,#0b0d14)!important;
  border:1px solid #27303d!important;
  box-shadow:0 24px 80px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.035)!important;
}
.bp-hero-clean{
  background:
    radial-gradient(circle at 82% 20%,rgba(0,229,255,.12),transparent 25%),
    linear-gradient(135deg,#151b26,#10131b 62%,#171326)!important;
  border-color:#2c3948!important;
  box-shadow:0 10px 35px rgba(0,0,0,.24)!important;
}
.bp-title-row h3{
  font-size:27px!important;
  letter-spacing:-.8px!important;
  text-shadow:0 0 18px rgba(0,229,255,.13);
}
.bp-season-pill{
  color:#7eefff!important;
  border-color:#23505a!important;
  background:#10232a!important;
}
.bp-progress-clean{
  height:9px!important;
  background:#202631!important;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.55);
}
.bp-progress-clean i{
  background:linear-gradient(90deg,#00e5ff 0%,#6b5cff 55%,#ffcf4a 100%)!important;
  box-shadow:0 0 14px rgba(0,229,255,.35)!important;
}
.bp-rail-shell{
  background:#0b0e14!important;
  border-color:#27303b!important;
}
.bp-rail-head{
  background:linear-gradient(90deg,#121822,#15131f)!important;
}
.bp-tier{
  flex-basis:170px!important;
}
.bp-tier:not(:last-child)::after{
  background:linear-gradient(90deg,#293340,#00bcd455)!important;
}
.bp-tier-head b{
  font-size:18px!important;
}
.bp-tier.next-tier .bp-tier-head b{
  color:#7eefff!important;
  text-shadow:0 0 12px rgba(0,229,255,.4);
}
.bp-reward-card{
  min-height:124px!important;
  border-radius:14px!important;
  background:linear-gradient(145deg,#151a23,#10131a)!important;
  border-color:#28313e!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
.bp-reward-card.free{
  border-color:#1f3a42!important;
}
.bp-reward-card.golden{
  background:linear-gradient(145deg,#1e1a12,#13151b)!important;
  border-color:#554522!important;
}
.bp-reward-card.claim-ready{
  border-color:#00cfe8!important;
  box-shadow:0 0 0 1px rgba(0,207,232,.18),0 0 18px rgba(0,207,232,.08)!important;
}
.bp-reward-card.golden.claim-ready{
  border-color:#d9ad48!important;
  box-shadow:0 0 0 1px rgba(217,173,72,.18),0 0 18px rgba(217,173,72,.08)!important;
}
.bp-reward-card.major{
  border-color:#d9ad48!important;
  background:linear-gradient(145deg,#241d10,#12151b)!important;
}
.bp-reward-card.major .bp-reward-visual{
  border-color:rgba(255,207,74,.28)!important;
  box-shadow:0 0 18px rgba(255,207,74,.08);
}
.bp-reward-visual{
  background:linear-gradient(145deg,#0d1118,#171d28)!important;
}
.bp-track-label{
  color:#6ceaff!important;
}
.bp-reward-card.golden .bp-track-label{
  color:#e5c365!important;
}
.bp-claim-btn{
  margin-top:7px!important;
  width:100%!important;
  min-height:28px!important;
  padding:6px 9px!important;
  border-radius:9px!important;
  background:linear-gradient(100deg,#00cfe8,#6f63ff)!important;
  color:#071016!important;
  font-size:9px!important;
  font-weight:950!important;
  letter-spacing:.7px!important;
  box-shadow:0 5px 16px rgba(0,207,232,.14);
}
.bp-reward-card.golden .bp-claim-btn{
  background:linear-gradient(100deg,#b88b2e,#f2cf69)!important;
  color:#171108!important;
}
.bp-bundle-preview .bundle-half{
  border-color:rgba(255,255,255,.10)!important;
  background:#111722!important;
}
.bp-next-chip.complete{
  color:#72e7b0!important;
}
@media(max-width:700px){
  .bp-tier{flex-basis:156px!important;}
}


/* ================================================================
   KOODLE REWARDS PASS — NEON EDITION / 50-TIER SCROLL FIX
   Keep the full monthly track reachable on touch devices and give the
   pass the same neon-border language as Koodle's title treatment.
   ================================================================ */
.battle-pass-modal{
  position:relative!important;
  overflow:hidden!important;
  border:1px solid rgba(0,229,255,.42)!important;
  box-shadow:
    0 0 0 1px rgba(124,92,255,.12),
    0 0 22px rgba(0,229,255,.10),
    0 24px 80px rgba(0,0,0,.65)!important;
}
.battle-pass-modal::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:22px;
  padding:1px;
  background:linear-gradient(110deg,#00e5ff 0%,#6b5cff 38%,#ff4fd8 68%,#00e5ff 100%);
  background-size:220% 100%;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  opacity:.72;
  pointer-events:none;
  animation:bpNeonBorder 7s linear infinite;
  z-index:0;
}
.battle-pass-modal > *{position:relative;z-index:1}
@keyframes bpNeonBorder{to{background-position:220% 0}}

.bp-hero-clean{
  position:relative!important;
  overflow:hidden!important;
  border:1px solid rgba(0,229,255,.30)!important;
  background:
    radial-gradient(circle at 8% 100%,rgba(0,229,255,.15),transparent 34%),
    radial-gradient(circle at 90% 0%,rgba(255,79,216,.12),transparent 30%),
    linear-gradient(135deg,#101a25,#12131e 55%,#1b1222)!important;
  box-shadow:0 0 0 1px rgba(107,92,255,.08),0 0 30px rgba(0,229,255,.08)!important;
}
.bp-hero-clean::after{
  content:"";
  position:absolute;
  left:12px;right:12px;bottom:0;height:2px;
  background:linear-gradient(90deg,transparent,#00e5ff 18%,#6b5cff 50%,#ff4fd8 82%,transparent);
  box-shadow:0 0 12px rgba(0,229,255,.55);
  opacity:.9;
}
.bp-title-row h3{
  color:#f7fbff!important;
  text-shadow:0 0 7px rgba(0,229,255,.55),0 0 18px rgba(107,92,255,.28)!important;
}
.bp-season-pill{
  border-color:rgba(0,229,255,.45)!important;
  background:rgba(0,229,255,.08)!important;
  box-shadow:0 0 12px rgba(0,229,255,.10),inset 0 0 12px rgba(0,229,255,.04);
}

/* Make navigation visible so Tier 50 is never buried behind touch scrolling. */
.bp-jumpbar{
  display:flex!important;
  align-items:center;
  gap:7px;
  margin:12px 0 10px!important;
  padding:7px;
  overflow-x:auto;
  scrollbar-width:none;
  border:1px solid rgba(0,229,255,.14);
  border-radius:13px;
  background:linear-gradient(90deg,rgba(0,229,255,.045),rgba(107,92,255,.055),rgba(255,79,216,.04));
  box-shadow:inset 0 0 20px rgba(0,229,255,.025);
}
.bp-jumpbar::-webkit-scrollbar{display:none}
.bp-jump-label{display:none!important}
.bp-jump{
  flex:0 0 auto!important;
  height:30px!important;
  min-width:66px!important;
  padding:0 11px!important;
  border:1px solid rgba(0,229,255,.20)!important;
  border-radius:9px!important;
  background:#10161f!important;
  color:#788797!important;
  font-size:8px!important;
  font-weight:950!important;
  letter-spacing:.5px;
}
.bp-jump:hover,.bp-jump.active{
  color:#fff!important;
  border-color:#00e5ff!important;
  background:linear-gradient(100deg,rgba(0,229,255,.18),rgba(107,92,255,.16))!important;
  box-shadow:0 0 13px rgba(0,229,255,.16),inset 0 0 12px rgba(0,229,255,.05)!important;
}
.bp-jump.current{
  margin-left:auto;
  color:#ff86e9!important;
  border-color:rgba(255,79,216,.42)!important;
  background:rgba(255,79,216,.08)!important;
}

/* Hard-width every tier. This prevents flexbox from shrinking the track and
   fixes the iOS/WebKit case where the rail could stop around tier 28. */
.bp-rail-shell{overflow:hidden!important}
.bp-rail{
  display:flex!important;
  flex-wrap:nowrap!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  overflow-x:scroll!important;
  overflow-y:hidden!important;
  touch-action:pan-x!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-x:contain!important;
  scroll-behavior:smooth!important;
  padding:14px 14px 18px!important;
}
.bp-tier{
  width:170px!important;
  min-width:170px!important;
  max-width:170px!important;
  flex:0 0 170px!important;
}
.bp-tier:not(:last-child)::after{
  background:linear-gradient(90deg,#00bcd4,#6b5cff)!important;
  box-shadow:0 0 7px rgba(0,229,255,.18);
}
.bp-tier-head{
  border-radius:12px 12px 7px 7px;
  background:linear-gradient(180deg,rgba(0,229,255,.055),transparent);
}
.bp-tier-head b{text-shadow:0 0 8px rgba(0,229,255,.18)}
.bp-tier.next-tier .bp-tier-head b{text-shadow:0 0 10px rgba(0,229,255,.65),0 0 22px rgba(107,92,255,.35)!important}
.bp-tier.completed .bp-tier-head b{color:#69f0bd!important;text-shadow:0 0 9px rgba(105,240,189,.25)}

.bp-reward-card{
  position:relative!important;
  overflow:hidden!important;
  border-color:rgba(0,229,255,.22)!important;
  background:
    linear-gradient(145deg,rgba(17,28,39,.98),rgba(12,16,24,.98))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 0 0 1px rgba(107,92,255,.025)!important;
}
.bp-reward-card::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:14px;
  padding:1px;
  background:linear-gradient(135deg,rgba(0,229,255,.34),rgba(107,92,255,.12),rgba(255,79,216,.28));
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  opacity:.55;
  pointer-events:none;
}
.bp-reward-card.free .bp-track-label{color:#71f2ff!important;text-shadow:0 0 8px rgba(0,229,255,.30)}
.bp-reward-card.free .bp-reward-visual{border-color:rgba(0,229,255,.28)!important;box-shadow:0 0 14px rgba(0,229,255,.07)}
.bp-reward-card.golden{
  border-color:rgba(255,207,74,.34)!important;
  background:linear-gradient(145deg,#241d10,#13151b)!important;
}
.bp-reward-card.golden .bp-reward-visual{border-color:rgba(255,207,74,.28)!important}
.bp-reward-card.claim-ready{
  border-color:#00e5ff!important;
  box-shadow:0 0 0 1px rgba(0,229,255,.28),0 0 24px rgba(0,229,255,.14)!important;
}
.bp-reward-card.major,
.bp-tier.milestone .bp-reward-card.free{
  border-color:rgba(255,79,216,.48)!important;
  box-shadow:0 0 0 1px rgba(107,92,255,.18),0 0 25px rgba(255,79,216,.10)!important;
}
.bp-tier.milestone .bp-tier-head{
  background:linear-gradient(180deg,rgba(255,79,216,.12),rgba(107,92,255,.04),transparent)!important;
}

@media(max-width:700px){
  .bp-jumpbar{margin-top:10px!important;padding:6px}
  .bp-jump{min-width:62px!important;height:29px!important}
  .bp-rail{padding:12px 10px 16px!important}
  .bp-tier{width:158px!important;min-width:158px!important;max-width:158px!important;flex-basis:158px!important}
}
@media(max-width:420px){
  .bp-tier{width:152px!important;min-width:152px!important;max-width:152px!important;flex-basis:152px!important}
}


/* ================================================================
   KOODLE REWARDS PASS — TARGETED NEON FRAME
   The pass lives inside #embeddedBattlePass / .rewards-panel, not
   .battle-pass-modal. Keep this scoped so the rest of Rewards stays intact.
   ================================================================ */
#embeddedBattlePass{
  position:relative!important;
  margin-top:18px!important;
  padding:18px!important;
  border-radius:22px!important;
  background:
    radial-gradient(circle at 8% 0%,rgba(0,229,255,.10),transparent 28%),
    radial-gradient(circle at 92% 100%,rgba(255,79,216,.10),transparent 30%),
    linear-gradient(145deg,#0b1119,#11101b 55%,#0d1119)!important;
  border:1px solid rgba(0,229,255,.38)!important;
  box-shadow:
    0 0 0 1px rgba(107,92,255,.16),
    0 0 24px rgba(0,229,255,.10),
    inset 0 0 28px rgba(107,92,255,.035)!important;
  overflow:hidden!important;
}
#embeddedBattlePass::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:22px;
  padding:1px;
  background:linear-gradient(105deg,#00e5ff 0%,#6b5cff 34%,#ff4fd8 67%,#00e5ff 100%);
  background-size:220% 100%;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  opacity:.78;
  pointer-events:none;
  animation:bpNeonBorder 7s linear infinite;
}
#embeddedBattlePass > *{position:relative;z-index:1}
#embeddedBattlePass .bp-hero-clean{
  border:1px solid rgba(0,229,255,.32)!important;
  background:
    radial-gradient(circle at 8% 100%,rgba(0,229,255,.16),transparent 34%),
    radial-gradient(circle at 90% 0%,rgba(255,79,216,.14),transparent 30%),
    linear-gradient(135deg,#101a25,#12131e 55%,#1b1222)!important;
  box-shadow:0 0 22px rgba(0,229,255,.08)!important;
}
#embeddedBattlePass .bp-title-row h3{
  text-shadow:0 0 8px rgba(0,229,255,.60),0 0 20px rgba(107,92,255,.32)!important;
}
#embeddedBattlePass .bp-rail-shell{
  border:1px solid rgba(0,229,255,.20)!important;
  box-shadow:0 0 18px rgba(0,229,255,.05),inset 0 0 22px rgba(107,92,255,.025)!important;
}
#embeddedBattlePass .bp-rail{
  display:flex!important;
  flex-wrap:nowrap!important;
  width:100%!important;
  min-width:0!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  touch-action:pan-x!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-x:contain!important;
}
#embeddedBattlePass .bp-tier{
  width:158px!important;
  min-width:158px!important;
  max-width:158px!important;
  flex:0 0 158px!important;
}
#embeddedBattlePass .bp-reward-card{
  border-color:rgba(0,229,255,.24)!important;
  background:linear-gradient(145deg,rgba(17,28,39,.98),rgba(12,16,24,.98))!important;
}
#embeddedBattlePass .bp-reward-card.golden{
  border-color:rgba(255,207,74,.34)!important;
  background:linear-gradient(145deg,#241d10,#13151b)!important;
}
#embeddedBattlePass .bp-reward-card.claim-ready{
  border-color:#00e5ff!important;
  box-shadow:0 0 0 1px rgba(0,229,255,.28),0 0 24px rgba(0,229,255,.14)!important;
}
#embeddedBattlePass .bp-tier.milestone .bp-reward-card.free,
#embeddedBattlePass .bp-reward-card.major{
  border-color:rgba(255,79,216,.52)!important;
  box-shadow:0 0 0 1px rgba(107,92,255,.18),0 0 26px rgba(255,79,216,.12)!important;
}
@media(max-width:700px){
  #embeddedBattlePass{padding:12px!important;border-radius:18px!important}
  #embeddedBattlePass .bp-tier{width:150px!important;min-width:150px!important;max-width:150px!important;flex-basis:150px!important}
}


/* ===== Reward claim confirmation / live-sync UI ===== */
.koodle-reward-claimed-modal{
  z-index:10050!important;
  background:rgba(4,7,13,.78)!important;
  backdrop-filter:blur(10px);
  opacity:0;
  transition:opacity .16s ease;
}
.koodle-reward-claimed-modal.is-visible{opacity:1}
.reward-claimed-card{
  width:min(430px,calc(100vw - 32px));
  padding:30px 26px 26px;
  border-radius:26px;
  text-align:center;
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% -15%,rgba(0,229,255,.18),transparent 45%),
    linear-gradient(150deg,#141b27,#0d1119 70%,#171321);
  border:1px solid rgba(0,229,255,.38);
  box-shadow:0 22px 70px rgba(0,0,0,.55),0 0 45px rgba(0,229,255,.10);
  transform:translateY(8px) scale(.98);
  transition:transform .18s ease;
}
.koodle-reward-claimed-modal.is-visible .reward-claimed-card{
  transform:translateY(0) scale(1);
}
.reward-claimed-kicker{
  font-size:11px;
  font-weight:800;
  letter-spacing:.18em;
  color:#7defff;
  margin-bottom:12px;
}
.reward-claimed-check{
  width:54px;height:54px;
  margin:0 auto 12px;
  display:grid;place-items:center;
  border-radius:50%;
  border:2px solid rgba(0,229,255,.7);
  color:#7defff;
  font-size:28px;
  font-weight:900;
  box-shadow:0 0 28px rgba(0,229,255,.16);
}
.reward-claimed-card h2{
  margin:0;
  font-size:22px;
  letter-spacing:.08em;
}
.reward-claimed-visual{
  min-height:96px;
  margin:18px auto 8px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.reward-claimed-visual .custom-preview{
  transform:scale(1.12);
}
.reward-claimed-name{
  font-size:19px;
  font-weight:850;
  margin-top:8px;
}
.reward-claimed-detail{
  margin-top:6px;
  color:#aeb8c7;
  font-size:14px;
}
.reward-claimed-close{
  width:100%;
  margin-top:22px;
  padding:13px 18px;
  border:1px solid rgba(0,229,255,.5);
  border-radius:13px;
  background:linear-gradient(135deg,#123340,#1a2140);
  color:#fff;
  font-weight:850;
  letter-spacing:.08em;
  cursor:pointer;
  transition:transform .15s ease,filter .15s ease;
}
.reward-claimed-close:hover{filter:brightness(1.15);transform:translateY(-1px)}
.reward-claimed-close:active{transform:translateY(0)}


/* ================================================================
   SPORT SKIN CENTERING FIX
   Keep every skin exactly centered inside its Koodle cell.  The
   sports-ball skins use SVG/image artwork, so explicitly normalize
   the cell box model and alignment rather than relying on defaults.
   ================================================================ */
.cell,
.battle-cell,
.piece-cell {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    line-height: 0;
    min-width: 0;
    min-height: 0;
}

.cell,
.battle-cell,
.piece-cell:not(.empty) {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-origin: border-box;
    background-clip: border-box;
}

.piece-cell.empty {
    display: block;
}

.cell > svg,
.battle-cell > svg,
.piece-cell > svg {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    pointer-events: none;
}


/* Rewards Pass claim-all and explicit claimed state */
.bp-claim-all-btn{
  height:34px;display:inline-flex;align-items:center;justify-content:center;gap:7px;
  padding:0 12px;border:1px solid rgba(65,205,150,.42);border-radius:10px;
  background:rgba(27,105,78,.2);color:#76e0b2;font-size:9px;font-weight:950;
  letter-spacing:.65px;white-space:nowrap;cursor:pointer;
}
.bp-claim-all-btn span{
  min-width:17px;height:17px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:999px;background:#65d7a5;color:#10251c;font-size:9px;
}
.bp-claim-all-btn:disabled{opacity:.55;cursor:wait}
.bp-reward-status{font-size:7px;font-weight:950;letter-spacing:.65px;color:#59cf99;white-space:nowrap}
.bp-reward-card.golden .bp-reward-status{color:#dfbd63}
@media(max-width:560px){
  .bp-actions-clean{flex-wrap:wrap}
  .bp-next-chip{margin-left:auto}
}

/* Unified pointer-driven piece interaction */
.piece { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.piece.piece-dragging { opacity: .78; cursor: grabbing; }
.cell.placement-preview-valid { outline: 2px solid #00f59b; background-color: rgba(0,245,155,.38)!important; box-shadow: 0 0 13px rgba(0,245,155,.65); transform: scale(.94); }
.cell.placement-preview-invalid { outline: 2px solid #ff4d67; background-color: rgba(255,77,103,.38)!important; box-shadow: 0 0 13px rgba(255,77,103,.55); transform: scale(.94); }
#board, #battleRaceBoard { touch-action: none; }
.battle-cell.battle-fogged { filter: blur(4px); }
.battle-cell.battle-shaking { animation: koodleBattleShake .12s linear infinite; }
@keyframes koodleBattleShake { 0%,100%{transform:translate(0,0)} 25%{transform:translate(-2px,1px)} 50%{transform:translate(2px,-1px)} 75%{transform:translate(-1px,-2px)} }
.powerup-wallet { font-weight: 800; color: #f5c542; margin: 0 0 12px; }
.powerup-shop-grid .hint-pack p { min-height: 42px; font-size: 12px; color: #aaa; }
.battle-powerup { border-color: #c18cff!important; }
