:root {
    --bg-dark: #090915;
    --card-bg: #131320;
    --neon-blue: #00f0ff;
    --neon-pink: #ff003c;
    --neon-green: #05ff00;
    --neon-yellow: #fcee0a;
    --neon-orange: #ff9900;
    --neon-purple: #a200ff;
    --border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    height: -webkit-fill-available;
    background-color: var(--bg-dark);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    background-color: transparent;
    font-family: 'Rajdhani', sans-serif;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 90px;
    touch-action: pan-y;
    overscroll-behavior-y: auto;
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.15) 0%, transparent 60%), linear-gradient(0deg, #090915 0%, #1a1a2e 100%);
}

.grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    opacity: 0.3;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(40px) translateZ(-200px);
    }
}

#rotate-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}

#rotate-warning i {
    font-size: 50px;
    margin-bottom: 20px;
    animation: rotateIcon 2s infinite;
    color: var(--neon-blue);
}

@keyframes rotateIcon {

    0%,
    100% {
        transform: rotate(-90deg);
    }

    50% {
        transform: rotate(0deg);
    }
}

@media only screen and (orientation: landscape) and (max-height: 600px) {
    #rotate-warning {
        display: flex;
    }

    .modern-menu-container,
    .container-box,
    .bg-layer,
    .overlay,
    #toast,
    .menu-btn,
    .top-hud {
        display: none !important;
    }
}

.container-box {
    width: 95%;
    max-width: 460px;
    margin: 65px auto 95px auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
    transition: 0.4s ease;
}

.modern-menu-container {
    width: 92%;
    max-width: 420px;
    margin: auto;
    margin-top: calc(env(safe-area-inset-top) + 8vh);
    margin-bottom: 90px;
    background: rgba(18, 18, 28, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: 32px;
    padding: 40px 25px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
    transition: 0.4s ease;
}

.modern-modal {
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 30px 20px;
    width: 92%;
    max-width: 420px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-sizing: border-box;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.modern-modal::-webkit-scrollbar {
    width: 4px;
}

.modern-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.logo-area {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

.game-title {
    font-size: 4rem;
    line-height: 0.9;
    margin: 0;
    font-weight: 900;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
}

.game-subtitle {
    color: var(--neon-blue);
    font-size: 1rem;
    letter-spacing: 5px;
    margin-top: 5px;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

.play-btn {
    width: 100%;
    background: linear-gradient(135deg, #00f0ff, #0055ff);
    color: #000;
    border: none;
    padding: 20px;
    border-radius: 20px;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.4);
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    font-family: 'Rajdhani';
    position: relative;
    overflow: hidden;
}

.play-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.play-btn:hover::after {
    left: 150%;
}

.play-btn:active {
    transform: scale(0.96);
}

.leaderboard-btn,
.friends-btn,
.market-btn {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 18px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Rajdhani';
    margin-bottom: 12px;
}

.leaderboard-btn:hover {
    border-color: var(--neon-yellow);
    background: rgba(241, 196, 15, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(241, 196, 15, 0.2);
}

.leaderboard-btn i {
    color: var(--neon-yellow);
    font-size: 1.4rem;
}

.friends-btn:hover {
    border-color: var(--neon-purple);
    background: rgba(162, 0, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(162, 0, 255, 0.2);
}

.friends-btn i {
    color: var(--neon-purple);
    font-size: 1.4rem;
}

.market-btn:hover {
    border-color: var(--neon-gold, #ffd700);
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}

.market-btn i {
    color: var(--neon-gold, #ffd700);
    font-size: 1.4rem;
}

.friends-notif-dot {
    width: 10px;
    height: 10px;
    background: var(--neon-pink);
    border-radius: 50%;
    position: absolute;
    top: 12px;
    right: 20px;
    box-shadow: 0 0 8px var(--neon-pink);
    animation: blink 1s infinite;
    display: none;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.menu-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    text-decoration: none;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(18, 18, 28, 0.85);
    backdrop-filter: blur(15px);
    transition: 0.3s;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
}

.top-hud {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    z-index: 100;
    max-width: calc(100vw - 120px);
}

.points-hud,
.profile-badge {
    background: rgba(18, 18, 28, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    transition: 0.3s;
    white-space: nowrap;
}

.points-hud {
    gap: 6px;
    color: var(--neon-green);
    font-weight: 900;
    font-size: 1rem;
    box-shadow: 0 0 15px rgba(0, 255, 153, 0.1);
    border-color: rgba(0, 255, 153, 0.3);
}

.points-hud img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--neon-yellow);
    box-shadow: 0 0 5px var(--neon-yellow);
    object-fit: cover;
}

.coin-hud {
    color: var(--neon-gold, #ffd700) !important;
    border-color: rgba(255, 215, 0, 0.3) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1) !important;
}

.coin-hud i {
    color: var(--neon-gold, #ffd700);
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px #ffd700);
}

.profile-badge {
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.3);
}

.profile-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-blue);
}

.profile-badge img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--neon-blue);
    object-fit: cover;
}

.profile-badge span {
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Segoe UI', sans-serif;
}

@media (max-width: 480px) {
    .top-hud {
        top: 10px;
        right: 10px;
        gap: 5px;
        max-width: calc(100vw - 100px);
    }

    .menu-btn {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .points-hud,
    .profile-badge {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .profile-badge img {
        width: 28px;
        height: 28px;
    }

    .profile-badge span {
        font-size: 0.7rem;
        max-width: 55px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        vertical-align: middle;
    }

    .points-hud img {
        width: 18px;
        height: 18px;
    }

    .coin-hud i {
        font-size: 1rem;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(15px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 15px 15px 90px 15px;
    box-sizing: border-box;
}

.lb-modal {
    border-top: 2px solid var(--neon-yellow);
    padding: 25px 20px;
}

.lb-title {
    color: var(--neon-yellow);
    margin: 0 0 20px 0;
    font-size: 2.2rem;
    font-weight: 900;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
}

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    touch-action: pan-y;
    width: 100%;
    box-sizing: border-box;
}

.lb-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.lb-item.top-1 {
    border-color: var(--neon-yellow);
    background: rgba(241, 196, 15, 0.1);
    box-shadow: inset 0 0 10px rgba(241, 196, 15, 0.1);
}

.lb-item.top-2 {
    border-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.08);
}

.lb-item.top-3 {
    border-color: #cd7f32;
    background: rgba(205, 127, 50, 0.08);
}

.lb-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.lb-rank {
    font-weight: 900;
    font-size: 1.4rem;
    width: 30px;
    text-align: left;
    color: #888;
    flex-shrink: 0;
}

.top-1 .lb-rank {
    color: var(--neon-yellow);
}

.top-2 .lb-rank {
    color: #c0c0c0;
}

.top-3 .lb-rank {
    color: #cd7f32;
}

.lb-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #555;
    flex-shrink: 0;
}

.top-1 .lb-avatar {
    border-color: var(--neon-yellow);
}

.lb-name {
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    font-size: 1.1rem;
    font-family: 'Segoe UI', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-points {
    font-weight: 900;
    color: var(--neon-green);
    font-size: 1.3rem;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

.lb-points img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--neon-yellow);
    object-fit: cover;
}

@media (max-width: 400px) {
    .lb-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .lb-left {
        gap: 10px;
    }

    .lb-avatar {
        width: 36px;
        height: 36px;
    }

    .lb-rank {
        font-size: 1.1rem;
        width: 22px;
    }

    .lb-points {
        font-size: 1.1rem;
    }

    .lb-name {
        font-size: 0.95rem;
    }

    .lb-arena-badge {
        font-size: 0.65rem;
    }
}

#playerProfileOverlay {
    z-index: 10050 !important;
}

.player-profile-modal {
    border-top: 2px solid var(--neon-blue);
    text-align: center;
    padding: 30px 20px;
}

.trophies-section {
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.trophies-section h3 {
    color: var(--neon-yellow);
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
    font-weight: 900;
}

.trophies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px 10px;
}

.trophy-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.02);
    padding: 15px 5px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.trophy-item i {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 15px currentColor);
}

.trophy-item span {
    font-size: 0.65rem;
    color: #fff;
    font-weight: 900;
    text-align: center;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.trophy-item.locked {
    opacity: 0.7;
}

.trophy-item.locked i {
    color: transparent !important;
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.2);
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.8));
}

.friends-modal {
    border-top: 2px solid var(--neon-purple);
}

.friends-modal-title {
    color: var(--neon-purple);
    margin: 0 0 20px 0;
    font-size: 1.8rem;
    font-weight: 900;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(162, 0, 255, 0.5);
}

.friends-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
}

.my-code-box {
    background: rgba(162, 0, 255, 0.08);
    border: 1px solid rgba(162, 0, 255, 0.4);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.my-code-label {
    color: #888;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.my-code-value {
    color: var(--neon-purple);
    font-size: clamp(1.5rem, 6vw, 2rem);
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(162, 0, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    word-break: break-all;
}

.my-code-copy {
    font-size: 0.8rem;
    color: #555;
    margin-top: 5px;
    font-weight: 600;
}

.add-friend-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.add-friend-input {
    flex: 1;
    min-width: 0;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    outline: none;
    text-transform: uppercase;
    box-sizing: border-box;
}

.add-friend-send-btn {
    background: var(--neon-purple);
    border: none;
    color: #fff;
    padding: 0 15px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    font-family: 'Rajdhani';
    white-space: nowrap;
    flex-shrink: 0;
}

.friends-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

.ftab {
    flex: 1;
    padding: 8px 2px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #888;
    font-weight: 800;
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    cursor: pointer;
    font-family: 'Rajdhani';
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.ftab.active {
    background: rgba(162, 0, 255, 0.2);
    color: #fff;
    box-shadow: inset 0 0 10px rgba(162, 0, 255, 0.5);
}

.ftab-badge {
    background: var(--neon-pink);
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.7rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.ftab-badge.show {
    display: flex;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 250px;
    width: 100%;
    box-sizing: border-box;
    padding-right: 5px;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}


.friend-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #444;
    flex-shrink: 0;
}

.frp-avatar {
    width: 55px !important;
    height: 55px !important;
    min-width: 55px !important;
    min-height: 55px !important;
    max-width: 55px !important;
    max-height: 55px !important;
    border-radius: 50%;
    border: 2px solid var(--neon-purple);
    object-fit: cover;
    flex-shrink: 0;
}

.clickable-profile {
    cursor: pointer;
    transition: 0.2s;
}

.clickable-profile:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.friend-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.friend-name {
    font-weight: 800;
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-family: 'Segoe UI', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-sub {
    color: #888;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.faction-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: 'Rajdhani';
    flex-shrink: 0;
}

.faction-btn.accept {
    background: rgba(5, 255, 0, 0.15);
    color: var(--neon-green);
    border: 1px solid rgba(5, 255, 0, 0.3);
}

.faction-btn.reject {
    background: rgba(255, 0, 60, 0.12);
    color: var(--neon-pink);
    border: 1px solid rgba(255, 0, 60, 0.3);
}

.faction-btn.remove {
    background: rgba(255, 255, 255, 0.07);
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-msg {
    color: #555;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    padding: 30px 0;
    width: 100%;
}

.market-modal {
    width: 95%;
    max-width: 550px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid rgba(255, 215, 0, 0.4);
    border-radius: 35px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.05);
    padding: 25px 20px;
}

.market-title {
    font-size: 2.8rem;
    font-weight: 900;
    text-align: center;
    background: -webkit-linear-gradient(#ffd700, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 25px 0;
    letter-spacing: 2px;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
}

.market-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    padding: 10px;
    max-height: 55vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.market-grid-new::-webkit-scrollbar {
    width: 6px;
}

.market-grid-new::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 10px;
}

.power-card {
    background: rgba(30, 30, 45, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 28px;
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.power-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.05);
    background: rgba(40, 40, 60, 0.8);
}

.power-card-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 80%);
    border: 2px dashed var(--pc-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    color: var(--pc-color);
    margin-bottom: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), inset 0 0 15px var(--pc-color);
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.power-card-title {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.power-card-desc {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 15px;
    line-height: 1.3;
    min-height: 32px;
}

.power-card-stock {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #00d2ff;
    margin-bottom: 25px;
    box-shadow: inset 0 0 10px rgba(0, 210, 255, 0.2);
}

.power-card-btn {
    width: 90%;
    padding: 14px 0;
    border-radius: 30px;
    border: none;
    background: linear-gradient(90deg, #ff8a00, #e52e71);
    color: white;
    font-size: 1.3rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(229, 46, 113, 0.4);
    transition: 0.3s;
    font-family: 'Rajdhani', sans-serif;
}

.power-card-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(229, 46, 113, 0.7);
    filter: brightness(1.1);
}

.friend-request-popup,
.custom-confirm-popup {
    position: fixed;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 18, 28, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--neon-purple);
    border-radius: 28px;
    padding: 20px 25px;
    z-index: 100000;
    display: none;
    flex-direction: column;
    gap: 15px;
    width: 92%;
    max-width: 360px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    animation: slideUpPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUpPop {
    from {
        transform: translateX(-50%) translateY(30px) scale(0.9);
        opacity: 0;
    }

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

.frp-top {
    display: flex;
    align-items: center;
    gap: 15px;
}

.frp-info {
    flex: 1;
    overflow: hidden;
}

.frp-title {
    color: var(--neon-purple);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.frp-name {
    color: white;
    font-weight: 900;
    font-size: 1.2rem;
    text-transform: uppercase;
    font-family: 'Segoe UI', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frp-btns {
    display: flex;
    gap: 10px;
    width: 100%;
}

.frp-btn {
    flex: 1;
    padding: 12px;
    border-radius: 30px;
    border: none;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: 'Rajdhani';
    transition: 0.2s;
}

.frp-btn.yes {
    background: var(--neon-green);
    color: #000;
}

.frp-btn.no {
    background: rgba(255, 0, 60, 0.1);
    color: var(--neon-pink);
    border: 1px solid var(--neon-pink);
}

.custom-confirm-popup {
    position: fixed;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 18, 28, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 25px;
    z-index: 100000;
    display: none;
    flex-direction: column;
    width: 92%;
    max-width: 400px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    animation: slideUpPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-confirm-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    text-align: center;
}

.custom-confirm-text {
    color: #ccc;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 22px;
    line-height: 1.4;
}

.custom-confirm-btns {
    display: flex;
    gap: 12px;
    width: 100%;
}

.custom-confirm-btn {
    flex: 1;
    padding: 14px;
    border-radius: 30px;
    border: none;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Rajdhani';
    transition: 0.2s;
}

.custom-confirm-btn.yes {
    background: rgba(5, 255, 0, 0.15);
    color: var(--neon-green);
    border: 1px solid rgba(5, 255, 0, 0.4);
}

.custom-confirm-btn.no {
    background: rgba(255, 0, 60, 0.15);
    color: var(--neon-pink);
    border: 1px solid rgba(255, 0, 60, 0.4);
}

.custom-confirm-popup.friend-remove {
    border-top: 2px solid var(--neon-orange);
}

.custom-confirm-popup.friend-remove .custom-confirm-title {
    color: var(--neon-orange);
    text-shadow: 0 0 15px rgba(255, 153, 0, 0.3);
}

.custom-confirm-popup.friend-remove .custom-confirm-btn.yes {
    background: rgba(255, 153, 0, 0.15);
    color: var(--neon-orange);
    border-color: rgba(255, 153, 0, 0.4);
}

.custom-confirm-popup.match-invite {
    border-top: 2px solid var(--neon-blue);
}

.custom-confirm-popup.match-invite .custom-confirm-title {
    color: var(--neon-blue);
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.custom-confirm-popup.match-invite .custom-confirm-btn.yes {
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon-blue);
    border-color: rgba(0, 240, 255, 0.4);
}

.game-container {
    display: none;
    padding: 45px 15px 15px 15px;
    border-top: 4px solid var(--neon-blue);
    margin-top: 90px;
    margin-bottom: 20px;
    width: 95%;
    max-width: 480px;
    box-sizing: border-box;
}

.searching-container {
    display: none;
    text-align: center;
    padding: 40px 20px;
    margin-top: 90px;
}

.radar-box {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(0, 243, 255, 0.2);
    position: relative;
    margin: 0 auto 30px auto;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.1) 0%, transparent 60%);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.1);
}

.radar-line {
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue));
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
    animation: radarSpin 1.5s linear infinite;
}

@keyframes radarSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.search-text {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

.search-sub {
    color: #666;
    font-size: 1rem;
    margin-top: 5px;
    font-weight: 500;
}

.cancel-btn {
    background: transparent;
    border: 2px solid var(--neon-pink);
    color: var(--neon-pink);
    padding: 10px 30px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 30px;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cancel-btn:hover {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 20px var(--neon-pink);
}

.match-timer-box {
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px rgba(252, 238, 10, 0.4);
    letter-spacing: 1px;
    background: rgba(252, 238, 10, 0.05);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(252, 238, 10, 0.2);
    display: inline-block;
}

.match-timer-box span {
    font-size: 1.4rem;
    margin-left: 5px;
}

.timer-badge {
    position: absolute !important;
    top: -38px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 75px !important;
    height: 75px !important;
    background-color: #0d0d1a !important;
    border: 4px solid var(--neon-blue) !important;
    border-radius: 50% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 2.4rem !important;
    font-weight: 900 !important;
    color: #fff !important;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.5), inset 0 0 10px rgba(0, 240, 255, 0.2) !important;
    z-index: 100 !important;
    transition: 0.3s !important;
}

@media (max-width: 400px) {
    .timer-badge {
        width: 65px !important;
        height: 65px !important;
        top: -32px !important;
        font-size: 2rem !important;
        border-width: 3px !important;
    }
}

.timer-badge.danger {
    border-color: var(--neon-pink) !important;
    color: var(--neon-pink) !important;
    box-shadow: 0 0 40px var(--neon-pink), inset 0 0 15px var(--neon-pink) !important;
    animation: pulseTimer 0.8s infinite !important;
}

.timer-badge.bonus {
    border-color: var(--neon-green) !important;
    color: var(--neon-green) !important;
    box-shadow: 0 0 40px var(--neon-green), inset 0 0 15px var(--neon-green) !important;
    animation: pulseBonus 0.5s ease-out !important;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 10px;
    box-sizing: border-box;
}

.player-badge {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px;
    position: relative;
    min-width: 0;
}

.player-badge.me {
    background: rgba(5, 255, 0, 0.05);
    border: 1px solid rgba(5, 255, 0, 0.2);
}

.player-badge.opp {
    background: rgba(255, 0, 60, 0.05);
    border: 1px solid rgba(255, 0, 60, 0.2);
}

.p-label {
    font-size: 0.75rem;
    font-weight: 800;
    opacity: 0.8;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.score-num {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.vs-middle {
    font-style: italic;
    font-weight: 900;
    font-size: 1.2rem;
    color: #444;
    margin: 0 10px;
    flex-shrink: 0;
}

.img-container {
    width: 100%;
    max-width: 340px;
    height: 20vh;
    min-height: 130px;
    max-height: 220px;
    flex-shrink: 1;
    background: #0c0c14;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 0 auto 12px auto;
    position: relative;
    z-index: 10;
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.5s;
}

.img-container.success {
    border-color: var(--neon-green);
    box-shadow: 0 0 30px rgba(0, 255, 153, 0.4);
}

.img-container.success img {
    transform: scale(1.03);
}

.lives-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.heart {
    font-size: 1.2rem;
    color: var(--neon-pink);
    transition: 0.3s;
    filter: drop-shadow(0 0 5px var(--neon-pink));
}

.heart.lost {
    color: #333;
    transform: scale(0.8);
    filter: none;
    opacity: 0.5;
}

.powerup-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
}

.pu-btn {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(5px);
    color: var(--item-color, #fff);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.pu-btn i {
    filter: drop-shadow(0 0 5px var(--item-color, #fff));
    transition: 0.3s;
}

.pu-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--item-color, #ffd700);
    box-shadow: 0 0 15px var(--item-color, #ffd700);
}

.pu-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
    pointer-events: none;
}

.pu-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--neon-pink);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 8px var(--neon-pink);
    font-family: 'Segoe UI', sans-serif;
}

.slots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
    min-height: 35px;
    width: 100%;
    gap: 4px;
    box-sizing: border-box;
}

.word-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0 12px 8px 12px;
}

.slot {
    width: clamp(22px, 5.5vw, 30px);
    height: clamp(30px, 7vh, 40px);
    background: #1a1a2e;
    border-bottom: 3px solid #333;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(1rem, 4vw, 1.3rem);
    font-weight: 800;
    color: #fff;
    transition: 0.2s;
    font-family: 'Segoe UI', sans-serif;
}

.slot.filled {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: clamp(3px, 1vw, 6px);
    width: 100%;
    padding-bottom: 5px;
    box-sizing: border-box;
}

.key {
    width: 100%;
    height: clamp(35px, 7.5vh, 45px);
    background: #252535;
    color: #ddd;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: clamp(1rem, 4vw, 1.2rem);
    cursor: pointer;
    box-shadow: 0 4px 0 #151520;
    transition: 0.1s;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.key.correct {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 4px 0 #00b300;
    pointer-events: none;
}

.key.wrong {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 10px var(--neon-pink);
    transform: scale(0.9);
    opacity: 0.5;
    pointer-events: none;
}


#keyboard {
    position: relative;
}

#imgBox {
    position: relative;
}

.ice-overlay {
    position: absolute;
    inset: -5px;
    background: rgba(0, 240, 255, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 20;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    color: white;
    cursor: pointer;
    text-shadow: 0 0 15px #00f0ff;
    border: 3px solid #00f0ff;
    box-shadow: inset 0 0 30px #00f0ff;
    touch-action: manipulation;
    user-select: none;
    flex-direction: column;
}

.ice-overlay span {
    font-size: 1rem;
    text-transform: uppercase;
    font-family: 'Rajdhani';
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #000;
    margin-top: 10px;
}

.effect-frozen-key {
    background: rgba(0, 240, 255, 0.8) !important;
    color: #fff !important;
    box-shadow: 0 0 15px #00f0ff, inset 0 0 10px #fff !important;
    border-color: #fff !important;
    position: relative;
    transition: 0.1s;
}

.effect-frozen-key::after {
    content: attr(data-ice);
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--neon-pink);
    color: #fff;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    box-shadow: 0 0 10px var(--neon-pink);
}

.blur-overlay {
    position: absolute;
    inset: -5px;
    z-index: 25;
    border-radius: 16px;
    cursor: pointer;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    transition: 0.2s;
    overflow: hidden;
    touch-action: manipulation;
}

.effect-flip-kb {
    transform: rotate(180deg);
    transition: 0.5s;
}

.locked-label {
    display: none;
    color: var(--neon-pink);
    font-size: 0.75rem;
    font-weight: 900;
    margin-top: 4px;
    animation: blink 1s infinite;
    letter-spacing: 1px;
}


#resultOverlay {
    padding-bottom: 90px;
    background: rgba(5, 5, 15, 0.85);
    backdrop-filter: blur(10px);
}

.res-card {
    background: linear-gradient(160deg, rgba(30, 30, 45, 0.95), rgba(15, 15, 25, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), inset 0 2px 15px rgba(255, 255, 255, 0.05);
    border-radius: 36px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 460px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.res-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.1), transparent 70%);
    pointer-events: none;
}

.res-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.res-icon {
    font-size: 4.5rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 25px currentColor);
}

.res-title {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    margin: 0 0 5px 0;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 25px currentColor;
    text-align: center;
}

.res-subtitle {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #aaa;
    font-family: 'Segoe UI', sans-serif;
    text-transform: uppercase;
}

.res-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 25px;
}

.scoreboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 25px 30px;
    border-radius: 24px;
    box-shadow: inset 0 5px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
    box-sizing: border-box;
}

.sb-box {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sb-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    font-family: 'Segoe UI', sans-serif;
}

.sb-score {
    font-size: clamp(3rem, 10vw, 4rem);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 25px currentColor;
    font-family: 'Anton', sans-serif;
}

.sb-vs {
    font-size: 1.2rem;
    font-weight: 900;
    font-style: italic;
    color: rgba(255, 255, 255, 0.3);
    margin: 0 10px;
    flex-shrink: 0;
}

.res-btn {
    margin-top: 30px;
    background: linear-gradient(45deg, #fff, #ddd);
    color: #000;
    border: none;
    padding: 16px 40px;
    font-weight: 900;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Rajdhani';
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.res-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.4);
    background: #fff;
}

.res-btn:active {
    transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
    .res-card {
        padding: 30px 20px;
    }

    .scoreboard {
        padding: 20px 15px;
    }

    .sb-score {
        font-size: 2.8rem;
    }

    .res-btn {
        width: 100%;
        padding: 15px;
        font-size: 1.1rem;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(18, 18, 28, 0.95);
    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 15px;
    position: fixed;
    z-index: 200000;
    left: 50%;
    bottom: 100px;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 700;
    border: 1px solid #444;
    opacity: 0;
    transition: 0.3s;
    backdrop-filter: blur(15px);
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 100px;
}

#toast.toast-invalid {
    border-color: var(--neon-pink) !important;
    color: var(--neon-pink) !important;
    box-shadow: 0 0 20px rgba(255, 0, 60, 0.4);
}

#toast.toast-friend-removed {
    border-color: var(--neon-orange) !important;
    color: var(--neon-orange) !important;
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.4);
}






.trophy-hud {
    gap: 6px;
    color: var(--neon-green);
    font-weight: 900;
    font-size: 1rem;
    box-shadow: 0 0 15px rgba(0, 255, 153, 0.1);
    border-color: rgba(0, 255, 153, 0.3);
}

.trophy-hud i {
    color: var(--neon-green);
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px rgba(0, 255, 153, 0.6));
}





.cr-fullscreen-lobby {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    background: radial-gradient(ellipse at 50% 40%, rgba(20, 25, 40, 1) 0%, rgba(8, 10, 18, 1) 100%);
}


.cr-fullscreen-lobby::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(0, 200, 255, 0.03) 0%, transparent 40%),
        repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(255, 255, 255, 0.01) 60px, rgba(255, 255, 255, 0.01) 61px),
        repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(255, 255, 255, 0.01) 60px, rgba(255, 255, 255, 0.01) 61px);
    pointer-events: none;
    z-index: 0;
}

.cr-fullscreen-lobby::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, transparent 15%, transparent 75%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
    z-index: 1;
}


.cr-arena-viewer {
    flex: 1 0 auto;
    min-height: 450px;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    padding-top: 10px;
    padding-bottom: 20px;
}


.cr-scene {
    flex: 1 0 auto;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 65px 20px 0 20px;
    z-index: 2;
}


.cr-scene-glow {
    position: absolute;
    top: 38%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, var(--arena-glow, rgba(139, 105, 20, 0.35)) 0%, transparent 60%);
    pointer-events: none;
    transition: background 0.5s;
    animation: sceneGlowPulse 4s ease-in-out infinite;
}

@keyframes sceneGlowPulse {

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

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


.cr-scene-ring {
    position: absolute;
    top: 38%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1.5px solid rgba(255, 215, 0, 0.05);
    pointer-events: none;
    z-index: 0;
    animation: ringPulse 5s ease-in-out infinite;
}

.cr-scene::before {
    content: '';
    position: absolute;
    top: 38%;
    left: 50%;
    width: 280px;
    height: 280px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.03);
    pointer-events: none;
    z-index: 0;
    animation: ringPulse 5s ease-in-out infinite 1.5s;
}

@keyframes ringPulse {

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

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


.cr-scene-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.cr-particle {
    position: absolute;
    bottom: -20px;
    left: var(--x);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.7);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), 0 0 2px rgba(255, 215, 0, 0.8);
    animation: particleRise var(--d) ease-in-out infinite;
    opacity: var(--s);
}

@keyframes particleRise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    15% {
        opacity: var(--s, 0.5);
    }

    85% {
        opacity: var(--s, 0.5);
    }

    100% {
        transform: translateY(-85vh) scale(0.2);
        opacity: 0;
    }
}


.arena-shield {
    width: 200px;
    height: 130px;
    margin: 0 auto 10px auto;
    position: relative;
    filter: drop-shadow(0 10px 30px var(--arena-glow, rgba(255, 255, 255, 0.25)));
    animation: floatArena 3.5s ease-in-out infinite;
    z-index: 2;
    border-radius: 24px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

@keyframes floatArena {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.arena-shield-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
    filter: brightness(1.1) contrast(1.1);
}


.cr-arena-title {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: 18px;
}

.cr-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.cr-title-line {
    flex: 0 0 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--arena-glow, rgba(255, 215, 0, 0.35)));
    border-radius: 2px;
}

.cr-title-row .cr-title-line:last-child {
    background: linear-gradient(90deg, var(--arena-glow, rgba(255, 215, 0, 0.35)), transparent);
}

.arena-name {
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 25px var(--arena-glow, rgba(255, 255, 255, 0.3)), 0 3px 6px rgba(0, 0, 0, 0.7);
    transition: color 0.5s;
    line-height: 1.1;
    color: #fff;
    flex-shrink: 0;
}

.arena-subtitle {
    color: rgba(255, 215, 0, 0.5);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-top: 5px;
}

.cr-arena-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    margin: 10px auto 0 auto;
    background: linear-gradient(90deg, transparent, var(--arena-glow, rgba(255, 215, 0, 0.3)), transparent);
    border-radius: 2px;
}


.cr-trophy-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 80%;
    max-width: 300px;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 14px;
    border-radius: 30px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(5px);
}

.cr-trophy-num {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--neon-green);
    flex-shrink: 0;
    min-width: 45px;
    text-shadow: 0 0 10px rgba(0, 255, 153, 0.5);
}

.cr-trophy-num i {
    font-size: 0.95rem;
    filter: drop-shadow(0 0 6px rgba(0, 255, 153, 0.6));
}

.cr-strip-track {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cr-strip-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #008f55, var(--neon-green));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 2px;
    box-shadow: 0 0 10px rgba(0, 255, 153, 0.4);
}

.cr-strip-fill::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 6px;
}

.cr-trophy-next {
    font-weight: 900;
    font-size: 0.85rem;
    color: #777;
    flex-shrink: 0;
    min-width: 30px;
    text-align: right;
}

.cr-trophy-hint {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
    margin-top: 6px;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
}


.cr-bottom-section {
    flex-shrink: 0;
    width: 100%;
    padding: 20px 20px calc(env(safe-area-inset-bottom, 12px) + 85px) 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 5;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
}


.cr-battle-btn {
    width: 100%;
    max-width: 360px;
    margin-bottom: 30px;
    background: linear-gradient(180deg, #45e85f 0%, #2bb842 30%, #1d9432 70%, #157a25 100%);
    border: none;
    border-radius: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.25);
    padding: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 7px 0 #0d5c18,
        0 10px 30px rgba(30, 200, 60, 0.5),
        inset 0 -2px 6px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.15);
    transition: 0.1s;
    font-family: 'Rajdhani';
}

.cr-battle-btn:active {
    transform: translateY(5px);
    box-shadow: 0 2px 0 #0d5c18, 0 4px 10px rgba(30, 150, 40, 0.3);
}

.cr-battle-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px 30px;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.1);
}

.cr-battle-content i {
    font-size: 1.6rem;
    animation: crBallSpin 4s linear infinite;
}

@keyframes crBallSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.cr-battle-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg);
    animation: crShine 2.5s ease-in-out infinite;
}

@keyframes crShine {
    0% {
        left: -100%;
    }

    40%,
    100% {
        left: 150%;
    }
}


.cr-dock {
    display: flex;
    justify-content: center;
    gap: 25px;
    width: 100%;
    max-width: 360px;
}

.cr-dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.65rem;
    font-weight: 800;
    font-family: 'Rajdhani';
    letter-spacing: 0.5px;
    position: relative;
    padding: 2px;
    transition: 0.2s;
}

.cr-dock-item:active {
    transform: scale(0.9);
}

.cr-dock-item span {
    text-transform: uppercase;
}

.cr-dock-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.05);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cr-dock-item:active .cr-dock-icon {
    transform: translateY(4px) scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.dock-market {
    color: #f1c40f;
    border-color: rgba(241, 196, 15, 0.3);
}

.dock-arena {
    color: #e67e22;
    border-color: rgba(230, 126, 34, 0.3);
}

.dock-lb {
    color: #00d2ff;
    border-color: rgba(0, 210, 255, 0.3);
}

.dock-friends {
    color: #a200ff;
    border-color: rgba(162, 0, 255, 0.3);
}

.cr-dock-icon i {
    filter: drop-shadow(0 0 6px currentColor);
    transition: 0.3s;
}

.cr-dock-item:hover .dock-market {
    background: rgba(241, 196, 15, 0.15);
    border-color: #f1c40f;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.3);
}

.cr-dock-item:hover .dock-arena {
    background: rgba(230, 126, 34, 0.15);
    border-color: #e67e22;
    box-shadow: 0 0 20px rgba(230, 126, 34, 0.3);
}

.cr-dock-item:hover .dock-lb {
    background: rgba(0, 210, 255, 0.15);
    border-color: #00d2ff;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.cr-dock-item:hover .dock-friends {
    background: rgba(162, 0, 255, 0.15);
    border-color: #a200ff;
    box-shadow: 0 0 20px rgba(162, 0, 255, 0.3);
}

.cr-dock-item .friends-notif-dot {
    position: absolute;
    top: -2px;
    right: calc(50% - 30px);
}





.arena-map-modal {
    border-top: none;
    padding: 0;
    max-height: 90vh;
    background: linear-gradient(180deg, #0a0e1a 0%, #0d1222 50%, #0a0e1a 100%);
    border-radius: 24px 24px 0 0;
}


.arena-map-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 20px 20px 14px 20px;
    background: linear-gradient(180deg, #0d1222 0%, rgba(13, 18, 34, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 215, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.arena-map-title {
    color: #ffd700;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.arena-map-title i {
    font-size: 1.1rem;
}

.arena-map-close-hint {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}


.arena-map-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding: 20px 0 30px 0;
    min-height: 200px;
}


.arena-map-list::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: linear-gradient(180deg,
            rgba(255, 215, 0, 0.15) 0%,
            rgba(255, 215, 0, 0.06) 50%,
            rgba(255, 255, 255, 0.03) 100%);
    z-index: 0;
}


.arena-path-connector {
    height: 28px;
    position: relative;
    z-index: 1;
}


.arena-path-node {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    position: relative;
    z-index: 2;
}

.arena-path-node.side-left {
    justify-content: flex-start;
    padding-right: 52%;
}

.arena-path-node.side-right {
    justify-content: flex-end;
    padding-left: 52%;
}


.arena-node-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
    width: 100%;
    position: relative;
}

.side-right .arena-node-card {
    flex-direction: row-reverse;
    text-align: right;
}


.arena-path-node.is-current .arena-node-card {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.25);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.08);
}

.arena-path-node.is-locked .arena-node-card {
    opacity: 0.4;
}

.arena-path-node.is-unlocked .arena-node-card {
    opacity: 0.7;
}


.arena-node-orb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}


.arena-path-node.is-current .arena-node-orb {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4);
    animation: orbGlow 2s ease-in-out infinite;
}

.arena-path-node.is-current .arena-node-orb::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.15);
    animation: orbRing 2s ease-in-out infinite;
}

@keyframes orbGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.15);
    }
}

@keyframes orbRing {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.15);
        opacity: 0;
    }
}


.arena-path-node.is-locked .arena-node-orb {
    filter: grayscale(0.7) brightness(0.5);
    border-color: rgba(255, 255, 255, 0.05);
}


.arena-node-info {
    flex: 1;
    min-width: 0;
}

.arena-node-name {
    font-weight: 900;
    font-size: 0.85rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}

.arena-path-node.is-locked .arena-node-name {
    color: #444;
}

.arena-node-trophies {
    font-size: 0.7rem;
    color: #666;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.side-right .arena-node-trophies {
    justify-content: flex-end;
}

.arena-node-trophies i {
    font-size: 0.6rem;
    color: var(--neon-green);
}


.arena-node-badge {
    position: absolute;
    top: -6px;
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}

.side-left .arena-node-badge {
    right: 10px;
}

.side-right .arena-node-badge {
    left: 10px;
}

.arena-node-badge.badge-current {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.arena-node-badge.badge-locked {
    background: rgba(255, 255, 255, 0.06);
    color: #444;
}

.arena-node-badge.badge-done {
    background: rgba(5, 255, 0, 0.1);
    color: #0f0;
    border: 1px solid rgba(5, 255, 0, 0.2);
}


.arena-path-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.04);
    z-index: 3;
}

.arena-path-node.is-current .arena-path-dot {
    background: #ffd700;
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    width: 12px;
    height: 12px;
}

.arena-path-node.is-unlocked .arena-path-dot {
    background: rgba(5, 255, 0, 0.4);
    border-color: rgba(5, 255, 0, 0.2);
}

.arena-path-node.is-locked .arena-path-dot {
    background: rgba(255, 255, 255, 0.04);
    border-color: transparent;
}


.arena-change-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
}

.arena-change-overlay.show {
    display: flex;
    animation: fadeInArena 0.5s ease;
}

@keyframes fadeInArena {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.arena-change-content {
    text-align: center;
    animation: arenaPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes arenaPopIn {
    0% {
        transform: scale(0.3) translateY(50px);
        opacity: 0;
    }

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

.arena-change-badge {
    width: 220px;
    height: 140px;
    margin: 0 auto 20px auto;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.arena-change-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.arena-change-label {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.arena-change-label.promote {
    color: var(--neon-green);
    text-shadow: 0 0 20px rgba(5, 255, 0, 0.5);
}

.arena-change-label.demote {
    color: var(--neon-pink);
    text-shadow: 0 0 20px rgba(255, 0, 60, 0.5);
}

.arena-change-name {
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 0 25px var(--arena-glow, rgba(255, 255, 255, 0.3));
    margin-bottom: 30px;
}

.arena-change-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 16px 50px;
    font-weight: 900;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Rajdhani';
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

.arena-change-btn:active {
    transform: scale(0.95);
}


.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200001;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}


.result-trophy-change {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 900;
    padding: 6px 20px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    animation: slideUp 0.5s ease-out 0.2s both;
}

.result-trophy-change i {
    font-size: 1.2rem;
}

.result-trophy-change.gain {
    color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 153, 0.2);
    border-color: rgba(0, 255, 153, 0.3);
    text-shadow: 0 0 10px rgba(0, 255, 153, 0.4);
}

.result-trophy-change.loss {
    color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.2);
    border-color: rgba(255, 0, 60, 0.3);
    text-shadow: 0 0 10px rgba(255, 0, 60, 0.4);
}

.result-arena-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--neon-yellow);
    margin-bottom: 15px;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.2);
    animation: slideUp 0.5s ease-out 0.25s both;
}

.result-arena-badge i {
    font-size: 1rem;
    filter: drop-shadow(0 0 5px currentColor);
}


.lb-arena-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3px;
    color: #aaa;
}

.lb-arena-badge i {
    font-size: 0.65rem;
}


.arena-1 {
    --arena-color1: #8B6914;
    --arena-color2: #a07828;
    --arena-glow: rgba(139, 105, 20, 0.5);
}

.arena-2 {
    --arena-color1: #cc6600;
    --arena-color2: #ff8800;
    --arena-glow: rgba(255, 136, 0, 0.5);
}

.arena-3 {
    --arena-color1: #8a8a8a;
    --arena-color2: #c0c0c0;
    --arena-glow: rgba(192, 192, 192, 0.5);
}

.arena-4 {
    --arena-color1: #c8a200;
    --arena-color2: #ffd700;
    --arena-glow: rgba(255, 215, 0, 0.5);
}

.arena-5 {
    --arena-color1: #008b8b;
    --arena-color2: #00d2d2;
    --arena-glow: rgba(0, 210, 210, 0.5);
}

.arena-6 {
    --arena-color1: #0055cc;
    --arena-color2: #0088ff;
    --arena-glow: rgba(0, 136, 255, 0.5);
}

.arena-7 {
    --arena-color1: #6600aa;
    --arena-color2: #a200ff;
    --arena-glow: rgba(162, 0, 255, 0.5);
}

.arena-8 {
    --arena-color1: #aa0022;
    --arena-color2: #ff003c;
    --arena-glow: rgba(255, 0, 60, 0.5);
}

.arena-9 {
    --arena-color1: #228B22;
    --arena-color2: #44cc44;
    --arena-glow: rgba(68, 204, 68, 0.5);
}

.arena-10 {
    --arena-color1: #cc0000;
    --arena-color2: #ffd700;
    --arena-glow: rgba(255, 215, 0, 0.6);
}


@keyframes pulseArena {

    0%,
    100% {
        box-shadow: 0 0 15px var(--arena-glow);
    }

    50% {
        box-shadow: 0 0 30px var(--arena-glow);
    }
}

.arena-map-card.current {
    animation: pulseArena 2s ease-in-out infinite;
}


.bot-diff-badge {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 8px;
    margin-top: 3px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid currentColor;
    text-transform: uppercase;
    animation: blink 1.5s ease-in-out infinite;
}




.cr-scene.intro-reveal .arena-shield {
    position: relative;
    overflow: hidden;
}


.cr-scene.intro-reveal .arena-shield::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.7) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 215, 0, 0.7) 100%);
    background-size: 200% 200%;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: goldHologramFlow 1s linear infinite, goldHologramFade 0.4s ease-in-out 0.8s forwards;
    border-radius: 26px;
    pointer-events: none;
}


.cr-scene.intro-reveal .arena-shield-image {
    opacity: 0;
    transform: scale(1.05);
    animation: elegantImageReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
    z-index: 1;
}


.cr-scene.intro-reveal .cr-arena-title,
.cr-scene.intro-reveal .cr-trophy-strip,
.cr-scene.intro-reveal .cr-trophy-hint {
    opacity: 0;
    transform: translateY(15px);
    animation: elegantTextReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.9s forwards;
}



@keyframes goldHologramFlow {
    0% {
        background-position: 200% 0%;
    }

    100% {
        background-position: -200% 0%;
    }
}

@keyframes goldHologramFade {
    0% {
        opacity: 1;
        filter: brightness(1);
    }

    100% {
        opacity: 0;
        filter: brightness(1.3);
    }
}

@keyframes elegantImageReveal {
    0% {
        opacity: 0;
        transform: scale(1.05);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes elegantTextReveal {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 10px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

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

.option-btn.correct {
    background: rgba(0, 255, 153, 0.2);
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 153, 0.3);
}

.option-btn.wrong {
    background: rgba(255, 0, 102, 0.2);
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.3);
}

.opt-letter {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    font-weight: 900;
    font-size: 0.8rem;
    color: #ccc;
}

.option-btn.correct .opt-letter {
    background: var(--neon-green);
    color: #000;
}

.option-btn.wrong .opt-letter {
    background: var(--neon-pink);
    color: #000;
}


/* Trivia Styles for Online */
.question-box {
    background: linear-gradient(145deg, var(--card-bg), #1a1a2e);
    border: 2px solid var(--neon-blue);
    border-radius: 20px;
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    margin-top: 15px;
}

.q-number {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--neon-blue);
    color: #000;
    font-weight: 900;
    padding: 4px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    margin: 0;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

@media (max-width: 450px) {
    .options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.option-btn {
    background: var(--card-bg);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.option-letter {
    color: var(--neon-gold, #ffd700);
    font-weight: 900;
    margin-right: 10px;
    font-size: 1rem;
    width: 20px;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.1);
}

.option-btn.selected {
    border-color: var(--neon-gold, #ffd700);
    background: rgba(255, 215, 0, 0.2);
}

.option-btn.correct {
    border-color: var(--neon-green);
    background: rgba(0, 255, 153, 0.2);
    animation: pulseGreen 1s;
}

.option-btn.wrong {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 60, 0.2);
    animation: shake 0.5s;
}

.option-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.option-btn.wrong:disabled {
    opacity: 0.6;
}

@keyframes pulseGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 153, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 255, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 153, 0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

.arena-6 {
    --arena-color1: #0055cc;
    --arena-color2: #0088ff;
    --arena-glow: rgba(0, 136, 255, 0.5);
}

.arena-7 {
    --arena-color1: #6600aa;
    --arena-color2: #a200ff;
    --arena-glow: rgba(162, 0, 255, 0.5);
}

.arena-8 {
    --arena-color1: #aa0022;
    --arena-color2: #ff003c;
    --arena-glow: rgba(255, 0, 60, 0.5);
}

.arena-9 {
    --arena-color1: #228B22;
    --arena-color2: #44cc44;
    --arena-glow: rgba(68, 204, 68, 0.5);
}

.arena-10 {
    --arena-color1: #cc0000;
    --arena-color2: #ffd700;
    --arena-glow: rgba(255, 215, 0, 0.6);
}


@keyframes pulseArena {

    0%,
    100% {
        box-shadow: 0 0 15px var(--arena-glow);
    }

    50% {
        box-shadow: 0 0 30px var(--arena-glow);
    }
}

.arena-map-card.current {
    animation: pulseArena 2s ease-in-out infinite;
}


.bot-diff-badge {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 8px;
    margin-top: 3px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid currentColor;
    text-transform: uppercase;
    animation: blink 1.5s ease-in-out infinite;
}




.cr-scene.intro-reveal .arena-shield {
    position: relative;
    overflow: hidden;
}


.cr-scene.intro-reveal .arena-shield::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.7) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 215, 0, 0.7) 100%);
    background-size: 200% 200%;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: goldHologramFlow 1s linear infinite, goldHologramFade 0.4s ease-in-out 0.8s forwards;
    border-radius: 26px;
    pointer-events: none;
}


.cr-scene.intro-reveal .arena-shield-image {
    opacity: 0;
    transform: scale(1.05);
    animation: elegantImageReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
    z-index: 1;
}


.cr-scene.intro-reveal .cr-arena-title,
.cr-scene.intro-reveal .cr-trophy-strip,
.cr-scene.intro-reveal .cr-trophy-hint {
    opacity: 0;
    transform: translateY(15px);
    animation: elegantTextReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.9s forwards;
}



@keyframes goldHologramFlow {
    0% {
        background-position: 200% 0%;
    }

    100% {
        background-position: -200% 0%;
    }
}

@keyframes goldHologramFade {
    0% {
        opacity: 1;
        filter: brightness(1);
    }

    100% {
        opacity: 0;
        filter: brightness(1.3);
    }
}

@keyframes elegantImageReveal {
    0% {
        opacity: 0;
        transform: scale(1.05);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes elegantTextReveal {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 10px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

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

.option-btn.correct {
    background: rgba(0, 255, 153, 0.2);
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 153, 0.3);
}

.option-btn.wrong {
    background: rgba(255, 0, 102, 0.2);
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.3);
}

.opt-letter {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    font-weight: 900;
    font-size: 0.8rem;
    color: #ccc;
}

.option-btn.correct .opt-letter {
    background: var(--neon-green);
    color: #000;
}

.option-btn.wrong .opt-letter {
    background: var(--neon-pink);
    color: #000;
}


/* Trivia Styles for Online */
.question-box {
    background: linear-gradient(145deg, var(--card-bg), #1a1a2e);
    border: 2px solid var(--neon-blue);
    border-radius: 20px;
    padding: 12px 16px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    margin-top: 8px;
}

.q-number {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--neon-blue);
    color: #000;
    font-weight: 900;
    padding: 4px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    margin: 0;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

@media (max-width: 450px) {
    .options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.option-btn {
    background: var(--card-bg);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.option-letter {
    color: var(--neon-gold, #ffd700);
    font-weight: 900;
    margin-right: 10px;
    font-size: 1rem;
    width: 20px;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.1);
}

.option-btn.selected {
    border-color: var(--neon-gold, #ffd700);
    background: rgba(255, 215, 0, 0.2);
}

.option-btn.correct {
    border-color: var(--neon-green);
    background: rgba(0, 255, 153, 0.2);
    animation: pulseGreen 1s;
}

.option-btn.wrong {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 60, 0.2);
    animation: shake 0.5s;
}

.option-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.option-btn.wrong:disabled {
    opacity: 0.6;
}

@keyframes pulseGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 153, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 255, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 153, 0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

transform: translateX(-5px);
}
}