@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Rajdhani:wght@500;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --neon-blue: #00f3ff;
    --neon-purple: #bd00ff;
    --neon-pink: #ff007f;
    --neon-green: #39ff14;
    --neon-yellow: #ffe600;
    
    --bg-dark: #07080d;
    --bg-card: rgba(18, 20, 32, 0.7);
    --border-glow: rgba(189, 0, 255, 0.2);
    
    --font-primary: 'Outfit', sans-serif;
    --font-display: 'Rajdhani', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at center, #111424 0%, var(--bg-dark) 100%);
    color: #f0f3ff;
    font-family: var(--font-primary);
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding-top: 70px;
    isolation: isolate;
}

/* Background Cyber Grid */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    z-index: -2;
    pointer-events: none;
}

/* Ambient Neon Globs on left and right sides of the screen */
body::after {
    content: '';
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0; left: 0;
    background: 
        radial-gradient(circle at 10% 30%, rgba(0, 243, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 70%, rgba(189, 0, 255, 0.08) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glowing-text-blue {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.2);
}

.glowing-text-purple {
    color: var(--neon-purple);
    text-shadow: 0 0 10px rgba(189, 0, 255, 0.5), 0 0 20px rgba(189, 0, 255, 0.2);
}

.glowing-text-pink {
    color: var(--neon-pink);
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.5), 0 0 20px rgba(255, 0, 127, 0.2);
}

.glowing-text-green {
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

/* Auth Page layout */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    position: relative;
    border: 1px solid rgba(0, 243, 255, 0.15);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.05);
    transition: all 0.3s ease;
}

.auth-card:hover {
    border-color: rgba(189, 0, 255, 0.3);
    box-shadow: 0 0 35px rgba(189, 0, 255, 0.1);
}

.auth-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #a0a5c4;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-blue) 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4), 0 0 10px rgba(189, 0, 255, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: #a0a5c4;
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--neon-blue);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Dashboard Lobby Layout */
.dashboard-container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    flex-grow: 1;
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 70px);
    overflow: hidden;
    box-sizing: border-box;
}

/* Scrollable sub-containers inside locked viewport */
.dashboard-container main {
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow: hidden;
    padding-right: 0;
}

.dashboard-container aside {
    height: 100%;
    width: 250px;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
}

.dashboard-container aside.collapsed {
    width: 60px;
}

@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
}
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 2rem;
    height: 70px;
    border-bottom: 2px solid rgba(0, 243, 255, 0.15);
    box-shadow: 0 5px 25px rgba(0, 243, 255, 0.08);
    background: rgba(10, 12, 22, 0.85);
    backdrop-filter: blur(16px);
    border-radius: 0;
}

.logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-name {
    font-weight: 600;
    color: #fff;
    background: rgba(189, 0, 255, 0.06);
    border: 1px solid rgba(189, 0, 255, 0.15);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
}

.logout-link {
    color: var(--neon-pink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 0, 127, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.logout-link:hover {
    background: rgba(255, 0, 127, 0.1);
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.2);
    text-decoration: none;
}

.dashboard-panel {
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg, rgba(16, 20, 36, 0.8) 0%, rgba(8, 10, 19, 0.9) 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.dashboard-panel::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px; bottom: -1px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.15) 0%, transparent 40%, transparent 60%, rgba(189, 0, 255, 0.15) 100%);
    z-index: -1;
    pointer-events: none;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-left: 4px solid var(--neon-blue);
    padding-left: 0.75rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.game-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.game-option-btn {
    padding: 1.75rem 1rem;
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1;
    overflow: hidden;
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
}

.game-option-btn::before {
    content: '';
    position: absolute;
    top: 1px; left: 1px; right: 1px; bottom: 1px;
    background: linear-gradient(180deg, rgba(20, 24, 43, 0.95) 0%, rgba(10, 12, 22, 0.98) 100%);
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    z-index: -1;
    transition: all 0.3s ease;
}

.game-option-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    z-index: -2;
    transition: all 0.3s ease;
}

.game-option-btn.white-btn::after {
    background: rgba(255, 255, 255, 0.1);
}
.game-option-btn.random-btn::after {
    background: rgba(0, 243, 255, 0.15);
}
.game-option-btn.black-btn::after {
    background: rgba(189, 0, 255, 0.15);
}

.game-option-btn:hover {
    transform: translateY(-6px) scale(1.03);
}

.game-option-btn.white-btn:hover {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
}
.game-option-btn.white-btn:hover::after {
    background: linear-gradient(135deg, #ffffff 0%, #777777 100%);
}

.game-option-btn.random-btn:hover {
    filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.3));
}
.game-option-btn.random-btn:hover::after {
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--neon-purple) 100%);
}

.game-option-btn.black-btn:hover {
    filter: drop-shadow(0 0 8px rgba(189, 0, 255, 0.3));
}
.game-option-btn.black-btn:hover::after {
    background: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-pink) 100%);
}

.game-option-btn i {
    font-size: 2.2rem;
    transition: transform 0.3s ease;
}

.game-option-btn:hover i {
    transform: scale(1.2) rotate(5deg);
}

.games-list, .users-list {
    list-style: none;
}

.game-item, .user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.25rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 0.85rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-item:hover {
    border-color: rgba(189, 0, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.game-players {
    font-weight: 600;
}

.game-status {
    font-size: 0.8rem;
    color: #a0a5c4;
}

.btn-sm {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.user-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6e7282;
}

.status-dot.online {
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
}

.empty-state {
    color: #a0a5c4;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Chess Arena Layout */
.arena-container {
    max-width: 1250px;
    width: 95%;
    margin: 0 auto;
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    height: calc(100vh - 70px);
    overflow: hidden;
}

/* Board Layout Wrapper */
.board-layout-wrapper {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    justify-content: center;
    width: 100%;
    max-width: calc(min(640px, calc(100vh - 210px)) + 80px);
}

.side-hud {
    width: 260px;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid rgba(0, 243, 255, 0.12);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    transition: all 0.3s ease;
}

.side-hud-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.5rem;
    margin-bottom: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive sidebars */
@media (max-width: 1024px) {
    .side-hud {
        display: none !important;
    }
    .arena-container {
        max-width: 680px;
        flex-direction: column;
    }
}

.game-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.player-bar {
    width: 100%;
    max-width: min(640px, calc(100vh - 210px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    margin: 0.5rem 0;
    border-radius: 12px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    font-family: var(--font-display);
}

.player-avatar.white {
    background: #fff;
    color: #000;
}

.player-avatar.black {
    background: var(--neon-purple);
    color: #fff;
}

.player-name {
    font-weight: 600;
}

.player-timer {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-timer.active-timer {
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

/* Chessboard Wrapper with Screen-shake */
.chess-board-wrapper {
    width: 100%;
    max-width: min(640px, calc(100vh - 210px));
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    border: 3px solid var(--neon-purple);
    box-shadow: 0 0 25px rgba(189, 0, 255, 0.2), inset 0 0 15px rgba(189, 0, 255, 0.1);
    background: #000;
}

.chess-board-wrapper.white-turn-border {
    border-color: var(--neon-blue);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.25);
}

.chess-board-wrapper.black-turn-border {
    border-color: var(--neon-purple);
    box-shadow: 0 0 25px rgba(189, 0, 255, 0.25);
}

/* Glowing Chess Board Grid */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    height: 100%;
    position: relative;
    transform-origin: var(--zoom-origin, 50% 50%);
    transform: scale(var(--zoom-scale, 1));
    transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.square {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
    transition: background-color 0.2s ease;
}

/* Cyber Neon Grid Squares */
.square.light {
    background: rgba(18, 30, 49, 0.45);
    border: 1px solid rgba(0, 243, 255, 0.05);
}

.square.dark {
    background: rgba(8, 10, 22, 0.7);
    border: 1px solid rgba(189, 0, 255, 0.05);
}

/* Highlight & Glowing overlay */
.square::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Selected square glow */
.square.selected::after {
    background: radial-gradient(circle, rgba(57, 255, 20, 0.3) 0%, rgba(57, 255, 20, 0.05) 100%);
    border: 2px solid var(--neon-green);
    box-shadow: inset 0 0 15px rgba(57, 255, 20, 0.3);
    opacity: 1;
    z-index: 1;
}

/* Valid moves glow full outline (cyan) */
.square.valid-dest::after {
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 12px var(--neon-blue), inset 0 0 8px rgba(0, 243, 255, 0.2);
    opacity: 1;
    z-index: 3;
    transform: scale(1);
}

/* Valid capture glow full outline (red/pink) */
.square.valid-dest.has-piece::after {
    border: 2px solid var(--neon-pink);
    box-shadow: 0 0 15px var(--neon-pink), inset 0 0 10px rgba(255, 0, 127, 0.3);
    border-radius: 0; /* solid box outline */
    opacity: 1;
    z-index: 3;
    transform: scale(1);
}

/* Last move glowing trails - subtle dashed border */
.square.last-move-src::after {
    background: rgba(255, 230, 0, 0.05);
    border: 1.5px dashed rgba(255, 230, 0, 0.35);
    opacity: 0.8;
}

.square.last-move-dest::after {
    background: rgba(255, 230, 0, 0.08);
    border: 1.5px solid rgba(255, 230, 0, 0.45);
    box-shadow: inset 0 0 8px rgba(255, 230, 0, 0.15);
    opacity: 0.8;
}

/* Random glowing grid animation for board squares */
@keyframes board-square-glow {
    0%, 100% { background-color: transparent; }
    50% { 
        background-color: rgba(0, 243, 255, 0.1);
        box-shadow: inset 0 0 12px rgba(0, 243, 255, 0.3);
    }
}

.square.neon-random-glow {
    animation: board-square-glow 2s ease-in-out;
}

/* King check emergency pulse */
.square.king-check::after {
    background: radial-gradient(circle, rgba(255, 0, 127, 0.4) 0%, rgba(255, 0, 127, 0.1) 100%);
    border: 2px solid var(--neon-pink);
    box-shadow: inset 0 0 20px rgba(255, 0, 127, 0.5);
    opacity: 1;
    z-index: 2;
    animation: pulse-red 1s infinite alternate;
}

@keyframes pulse-red {
    0% { box-shadow: inset 0 0 10px rgba(255, 0, 127, 0.3), 0 0 5px rgba(255, 0, 127, 0.2); }
    100% { box-shadow: inset 0 0 25px rgba(255, 0, 127, 0.7), 0 0 15px rgba(255, 0, 127, 0.4); }
}

/* Chess Pieces layer */
.piece {
    width: 12.5%;
    height: 12.5%;
    z-index: 5;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), top 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.2s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.piece:active {
    cursor: grabbing;
    transform: scale(1.15);
    z-index: 6;
}

/* Piece SVG specific glows */
.piece svg {
    width: 82%;
    height: 82%;
    display: block;
}

/* Side Panel Controls & Move Logs */
.game-sidebar {
    height: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    max-height: 650px;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.game-status-label {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-playing {
    background: rgba(0, 243, 255, 0.15);
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
}

.status-finished {
    background: rgba(57, 255, 20, 0.15);
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
}

.status-waiting {
    background: rgba(255, 230, 0, 0.15);
    color: var(--neon-yellow);
    border: 1px solid var(--neon-yellow);
}

.move-log-container {
    flex-grow: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    display: grid;
    grid-template-columns: 0.5fr 1fr 1fr;
    gap: 0.5rem;
    align-content: start;
    max-height: 350px;
}

.move-log-row {
    grid-column: span 3;
    display: contents;
}

.move-num {
    color: #6e7282;
}

.move-white, .move-black {
    color: #fff;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
}

.move-white:hover, .move-black:hover {
    background: rgba(255, 255, 255, 0.1);
}

.game-actions {
    display: flex;
    gap: 1rem;
}

/* Animations classes toggled in JS */
.camera-shake {
    animation: screen-shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes screen-shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

.flash-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 0, 127, 0.3);
    pointer-events: none;
    opacity: 0;
    z-index: 99;
}

.flash-active {
    animation: capture-flash 0.45s ease-out;
}

@keyframes capture-flash {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

/* Particle debris */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--neon-pink);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 6px var(--neon-pink);
    transform: translate(-50%, -50%);
}

.particle.white-p {
    background: var(--neon-blue);
    box-shadow: 0 0 6px var(--neon-blue);
}

/* Info Alert Overlays */
.overlay-alert {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    padding: 1.5rem 2.5rem;
    background: rgba(7, 8, 13, 0.95);
    border: 2px solid var(--neon-pink);
    box-shadow: 0 0 30px rgba(255, 0, 127, 0.4);
    border-radius: 12px;
    text-align: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay-alert.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.overlay-alert-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.overlay-alert-desc {
    color: #a0a5c4;
    margin-bottom: 1.5rem;
}

/* Custom Neon scrollbar styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(7, 8, 13, 0.4);
}
::-webkit-scrollbar-thumb {
    background: var(--neon-purple);
    border-radius: 10px;
    box-shadow: 0 0 6px var(--neon-purple);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
    box-shadow: 0 0 6px var(--neon-blue);
}


/* Dynamic Background Grid */
.bg-grid-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -3;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(12, 1fr);
    gap: 8px;
    padding: 8px;
    opacity: 0.15;
    pointer-events: none;
    overflow: hidden;
}

.bg-grid-tile {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.02);
    background: rgba(18, 20, 32, 0.15);
    border-radius: 4px;
    transition: background-color 1.5s ease, border-color 1.5s ease, box-shadow 1.5s ease;
}

.bg-grid-tile.glow-blue {
    background: rgba(0, 243, 255, 0.12);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4), inset 0 0 8px rgba(0, 243, 255, 0.2);
}

.bg-grid-tile.glow-purple {
    background: rgba(189, 0, 255, 0.12);
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(189, 0, 255, 0.4), inset 0 0 8px rgba(189, 0, 255, 0.2);
}

.bg-grid-tile.glow-pink {
    background: rgba(255, 0, 127, 0.12);
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.4), inset 0 0 8px rgba(255, 0, 127, 0.2);
}


/* Leaderboard Styling */
.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .leaderboard-grid {
        grid-template-columns: 1fr;
    }
}

.leaderboard-card {
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.leaderboard-card > * {
    position: relative;
    z-index: 2;
}

.leaderboard-card-other {
    background: rgba(10, 12, 22, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-card-other:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 243, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 243, 255, 0.15);
}

/* Luxury Rotating Conic Gradient Frames for Top 3 Ranks */
.leaderboard-card-rank1, .leaderboard-card-rank2, .leaderboard-card-rank3 {
    background: transparent !important;
    border: 1.5px solid transparent !important;
}

.leaderboard-card-rank1 {
    animation: gold-back-glow 3s infinite alternate ease-in-out;
}

.leaderboard-card-rank2 {
    animation: silver-back-glow 3s infinite alternate ease-in-out;
}

.leaderboard-card-rank3 {
    animation: bronze-back-glow 3s infinite alternate ease-in-out;
}

@keyframes gold-back-glow {
    0% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.2), inset 0 0 8px rgba(255, 215, 0, 0.05);
    }
    100% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.25), inset 0 0 15px rgba(255, 215, 0, 0.1);
    }
}

@keyframes silver-back-glow {
    0% {
        box-shadow: 0 0 15px rgba(224, 224, 224, 0.2), inset 0 0 8px rgba(224, 224, 224, 0.05);
    }
    100% {
        box-shadow: 0 0 40px rgba(224, 224, 224, 0.5), 0 0 20px rgba(255, 255, 255, 0.25), inset 0 0 15px rgba(224, 224, 224, 0.1);
    }
}

@keyframes bronze-back-glow {
    0% {
        box-shadow: 0 0 15px rgba(205, 127, 50, 0.2), inset 0 0 8px rgba(205, 127, 50, 0.05);
    }
    100% {
        box-shadow: 0 0 40px rgba(205, 127, 50, 0.5), 0 0 20px rgba(255, 170, 102, 0.25), inset 0 0 15px rgba(205, 127, 50, 0.1);
    }
}


/* Rank 1 - Golden Champion Card */
.leaderboard-card-rank1::before {
    content: '';
    position: absolute;
    width: 170%;
    height: 340%;
    top: -120%;
    left: -35%;
    background: conic-gradient(
        transparent, 
        #ffd700, 
        #ffa500, 
        #ffe875, 
        transparent 35%
    );
    z-index: 0;
    animation: rotate-laser 4s infinite linear;
}

.leaderboard-card-rank1::after {
    content: '';
    position: absolute;
    top: 1.5px; left: 1.5px; right: 1.5px; bottom: 1.5px;
    background-image: 
        radial-gradient(circle, rgba(255, 215, 0, 0.12) 12%, transparent 12%),
        linear-gradient(135deg, rgba(28, 22, 8, 0.98) 0%, rgba(12, 9, 3, 0.99) 100%);
    background-size: 8px 8px;
    z-index: 1;
    border-radius: 10px;
    animation: grid-pulse 2.5s infinite alternate;
}

.leaderboard-card-rank1:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.leaderboard-card-rank1 .leaderboard-name {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.leaderboard-card-rank1 .leaderboard-wins {
    color: #ffe666 !important;
}

.leaderboard-card-rank1 .leaderboard-avatar {
    border-color: #ffd700 !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

/* Rank 2 - Silver Challenger Card */
.leaderboard-card-rank2::before {
    content: '';
    position: absolute;
    width: 170%;
    height: 340%;
    top: -120%;
    left: -35%;
    background: conic-gradient(
        transparent, 
        #e0e0e0, 
        #8a8a8a, 
        #ffffff, 
        transparent 35%
    );
    z-index: 0;
    animation: rotate-laser 4s infinite linear;
}

.leaderboard-card-rank2::after {
    content: '';
    position: absolute;
    top: 1.5px; left: 1.5px; right: 1.5px; bottom: 1.5px;
    background-image: 
        radial-gradient(circle, rgba(224, 224, 224, 0.12) 12%, transparent 12%),
        linear-gradient(135deg, rgba(16, 18, 22, 0.98) 0%, rgba(8, 9, 11, 0.99) 100%);
    background-size: 8px 8px;
    z-index: 1;
    border-radius: 10px;
    animation: grid-pulse 2.5s infinite alternate;
}

.leaderboard-card-rank2:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(224, 224, 224, 0.4);
}

.leaderboard-card-rank2 .leaderboard-name {
    color: #e0e0e0;
    text-shadow: 0 0 8px rgba(224, 224, 224, 0.4);
}

.leaderboard-card-rank2 .leaderboard-wins {
    color: #ffffff !important;
}

.leaderboard-card-rank2 .leaderboard-avatar {
    border-color: #e0e0e0 !important;
    box-shadow: 0 0 12px rgba(224, 224, 224, 0.4);
}

/* Rank 3 - Bronze Contender Card */
.leaderboard-card-rank3::before {
    content: '';
    position: absolute;
    width: 170%;
    height: 340%;
    top: -120%;
    left: -35%;
    background: conic-gradient(
        transparent, 
        #cd7f32, 
        #8c521f, 
        #ffaa66, 
        transparent 35%
    );
    z-index: 0;
    animation: rotate-laser 4s infinite linear;
}

.leaderboard-card-rank3::after {
    content: '';
    position: absolute;
    top: 1.5px; left: 1.5px; right: 1.5px; bottom: 1.5px;
    background-image: 
        radial-gradient(circle, rgba(205, 127, 50, 0.12) 12%, transparent 12%),
        linear-gradient(135deg, rgba(22, 16, 12, 0.98) 0%, rgba(10, 7, 5, 0.99) 100%);
    background-size: 8px 8px;
    z-index: 1;
    border-radius: 10px;
    animation: grid-pulse 2.5s infinite alternate;
}

.leaderboard-card-rank3:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(205, 127, 50, 0.4);
}

.leaderboard-card-rank3 .leaderboard-name {
    color: #ffb875;
    text-shadow: 0 0 8px rgba(205, 127, 50, 0.4);
}

.leaderboard-card-rank3 .leaderboard-wins {
    color: #ff9955 !important;
}

.leaderboard-card-rank3 .leaderboard-avatar {
    border-color: #cd7f32 !important;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.4);
}

/* Me/Self Highlight override for leaderboard cards */
.leaderboard-card.leaderboard-card-me {
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3), inset 0 0 10px rgba(0, 243, 255, 0.05);
}

.leaderboard-card.leaderboard-card-me:hover {
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.5), inset 0 0 15px rgba(0, 243, 255, 0.1) !important;
}

.leaderboard-card-rank1.leaderboard-card-me {
    animation: gold-me-back-glow 3s infinite alternate ease-in-out;
}

.leaderboard-card-rank1.leaderboard-card-me:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 45px rgba(255, 215, 0, 0.65), 0 0 25px rgba(0, 243, 255, 0.45) !important;
}

.leaderboard-card-rank2.leaderboard-card-me {
    animation: silver-me-back-glow 3s infinite alternate ease-in-out;
}

.leaderboard-card-rank2.leaderboard-card-me:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 45px rgba(224, 224, 224, 0.65), 0 0 25px rgba(0, 243, 255, 0.45) !important;
}

.leaderboard-card-rank3.leaderboard-card-me {
    animation: bronze-me-back-glow 3s infinite alternate ease-in-out;
}

.leaderboard-card-rank3.leaderboard-card-me:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 45px rgba(205, 127, 50, 0.65), 0 0 25px rgba(0, 243, 255, 0.45) !important;
}

@keyframes gold-me-back-glow {
    0% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.2), 0 0 10px rgba(0, 243, 255, 0.15);
    }
    100% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.5), 0 0 20px rgba(0, 243, 255, 0.35);
    }
}

@keyframes silver-me-back-glow {
    0% {
        box-shadow: 0 0 15px rgba(224, 224, 224, 0.2), 0 0 10px rgba(0, 243, 255, 0.15);
    }
    100% {
        box-shadow: 0 0 40px rgba(224, 224, 224, 0.5), 0 0 20px rgba(0, 243, 255, 0.35);
    }
}

@keyframes bronze-me-back-glow {
    0% {
        box-shadow: 0 0 15px rgba(205, 127, 50, 0.2), 0 0 10px rgba(0, 243, 255, 0.15);
    }
    100% {
        box-shadow: 0 0 40px rgba(205, 127, 50, 0.5), 0 0 20px rgba(0, 243, 255, 0.35);
    }
}


.rank-badge {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    font-family: var(--font-display);
}

.rank-1 {
    background: linear-gradient(135deg, #ffe600 0%, #b3a200 100%);
    color: #000;
    box-shadow: 0 0 12px rgba(255, 230, 0, 0.4);
}
.rank-2 {
    background: linear-gradient(135deg, #e0e0e0 0%, #9e9e9e 100%);
    color: #000;
    box-shadow: 0 0 10px rgba(224, 224, 224, 0.3);
}
.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #8c521f 100%);
    color: #fff;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
}
.rank-other {
    background: rgba(255, 255, 255, 0.08);
    color: #a0a5c4;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    word-break: break-all;
    max-width: 100%;
}

.leaderboard-wins {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--neon-green);
    font-weight: bold;
}

.leaderboard-bio {
    font-size: 0.75rem;
    color: #6e7282;
    margin-top: 0.5rem;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* --- CYBERPUNK GAMER COMPONENTS --- */
.cyber-btn {
    --btn-color: var(--neon-blue);
    --btn-glow-start: var(--neon-blue);
    --btn-glow-end: #0077aa;
    --btn-bg: rgba(10, 12, 22, 0.85);
    
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.55rem 1.25rem;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1;
    overflow: hidden;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    text-decoration: none;
}

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 1px; left: 1px; right: 1px; bottom: 1px;
    background: var(--btn-bg);
    clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
    z-index: -1;
    transition: all 0.3s ease;
}

.cyber-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--btn-glow-start) 0%, var(--btn-glow-end) 100%);
    z-index: -2;
    transition: all 0.3s ease;
}

.cyber-btn:hover {
    color: #fff !important;
    filter: drop-shadow(0 0 8px var(--btn-glow-start));
    transform: translateY(-2px);
    text-shadow: 0 0 8px var(--btn-color);
}

.cyber-btn:hover::before {
    background: rgba(20, 24, 40, 0.65);
}

.cyber-btn:active {
    transform: translateY(0);
}

/* Filled State */
.cyber-btn.filled {
    color: #05060a;
}
.cyber-btn.filled::before {
    background: linear-gradient(135deg, var(--btn-glow-start) 0%, var(--btn-glow-end) 100%);
    opacity: 0.9;
}
.cyber-btn.filled:hover {
    color: #fff !important;
}
.cyber-btn.filled:hover::before {
    background: transparent;
    opacity: 0;
}

/* Small Variant */
.cyber-btn.btn-sm {
    padding: 0.4rem 0.95rem;
    font-size: 0.75rem;
    letter-spacing: 1px;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.cyber-btn.btn-sm::before {
    clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

/* Colors styling */
.cyber-btn-cyan {
    --btn-glow-start: var(--neon-blue);
    --btn-glow-end: #0077aa;
    --btn-color: var(--neon-blue);
}
.cyber-btn-pink {
    --btn-glow-start: var(--neon-pink);
    --btn-glow-end: #aa004d;
    --btn-color: var(--neon-pink);
}
.cyber-btn-purple {
    --btn-glow-start: var(--neon-purple);
    --btn-glow-end: #5500aa;
    --btn-color: var(--neon-purple);
}
.cyber-btn-green {
    --btn-glow-start: var(--neon-green);
    --btn-glow-end: #1b8a05;
    --btn-color: var(--neon-green);
}
.cyber-btn-yellow {
    --btn-glow-start: var(--neon-yellow);
    --btn-glow-end: #9e8a00;
    --btn-color: var(--neon-yellow);
}

/* Cyber HUD Badges */
.cyber-hud-badge {
    --hud-color: var(--neon-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.45rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: rgba(10, 12, 22, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    position: relative;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cyber-hud-badge::before, .cyber-hud-badge::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-color: var(--hud-color);
    border-style: solid;
    pointer-events: none;
    transition: all 0.3s ease;
}

.cyber-hud-badge::before {
    top: -2px;
    left: -2px;
    border-width: 2px 0 0 2px;
}

.cyber-hud-badge::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 2px 2px 0;
}

/* Badge variants */
.cyber-hud-badge.status-waiting {
    --hud-color: var(--neon-yellow);
    border-color: rgba(255, 230, 0, 0.25);
    color: var(--neon-yellow);
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.05), inset 0 0 5px rgba(255, 230, 0, 0.02);
}

.cyber-hud-badge.status-playing {
    --hud-color: var(--neon-blue);
    border-color: rgba(0, 243, 255, 0.25);
    color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.05), inset 0 0 5px rgba(0, 243, 255, 0.02);
}

.cyber-hud-badge.status-finished {
    --hud-color: var(--neon-green);
    border-color: rgba(57, 255, 20, 0.25);
    color: var(--neon-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.05), inset 0 0 5px rgba(57, 255, 20, 0.02);
}

.cyber-hud-badge.cyber-hud-purple {
    --hud-color: var(--neon-purple);
    border-color: rgba(189, 0, 255, 0.25);
    color: #fff;
    box-shadow: 0 0 10px rgba(189, 0, 255, 0.05);
}

/* Animated Cyber Neon Fire Effect for Active Player Bar */
.player-bar.active-turn-fire {
    position: relative;
    border: 1.5px solid transparent !important;
    overflow: hidden;
    animation: border-flicker 2s infinite alternate;
    transition: all 0.3s ease;
}

.player-bar.active-turn-fire::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 300%;
    top: -100%;
    left: -25%;
    background: conic-gradient(
        transparent, 
        var(--fire-color-1, #00f3ff), 
        var(--fire-color-2, #bd00ff), 
        transparent 30%
    );
    z-index: -2;
    animation: rotate-laser 3s infinite linear;
}

.player-bar.active-turn-fire::after {
    content: '';
    position: absolute;
    top: 1.5px; left: 1.5px; right: 1.5px; bottom: 1.5px;
    background-image: 
        radial-gradient(circle, var(--dot-color, rgba(0, 243, 255, 0.15)) 12%, transparent 12%),
        linear-gradient(rgba(10, 12, 22, 0.98), rgba(10, 12, 22, 0.98));
    background-size: 8px 8px;
    z-index: -1;
    border-radius: 10px;
    animation: grid-pulse 2s infinite alternate;
}

@keyframes rotate-laser {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes grid-pulse {
    0% {
        opacity: 0.85;
    }
    100% {
        opacity: 1;
    }
}

@keyframes border-flicker {
    0%, 100% {
        box-shadow: 0 0 12px var(--fire-color-1, #00f3ff);
    }
    50% {
        box-shadow: 0 0 18px var(--fire-color-2, #bd00ff);
    }
}

/* Color themes for player bars (default glowing states) */
.player-bar.white-color-theme {
    border-color: rgba(0, 243, 255, 0.25) !important;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1), inset 0 0 5px rgba(0, 243, 255, 0.05);
}

.player-bar.black-color-theme {
    border-color: rgba(189, 0, 255, 0.25) !important;
    box-shadow: 0 0 15px rgba(189, 0, 255, 0.1), inset 0 0 5px rgba(189, 0, 255, 0.05);
}

/* Hit shock effect on player bar */
.player-bar.hit-shock {
    animation: shock-shake 0.4s ease-out !important;
}

@keyframes shock-shake {
    0% { transform: translate(0, 0) scale(1); filter: brightness(2.5); border-color: var(--neon-pink) !important; box-shadow: 0 0 35px var(--neon-pink) !important; }
    15% { transform: translate(-10px, -6px) scale(0.97); }
    30% { transform: translate(10px, 6px) scale(1.03); }
    45% { transform: translate(-8px, 4px) scale(0.98); }
    60% { transform: translate(8px, -4px) scale(1.02); }
    75% { transform: translate(-4px, 2px) scale(0.99); }
    90% { transform: translate(4px, -2px) scale(1.01); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Custom Profile Dropdown Menu & Avatar Styles */
.profile-menu-container {
    position: relative;
    display: inline-block;
}

.profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    background: rgba(10, 12, 22, 0.98);
    border: 1px solid var(--neon-purple);
    box-shadow: 0 10px 40px rgba(189, 0, 255, 0.35), inset 0 0 20px rgba(189, 0, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    z-index: 1000;
    display: none;
    transform-origin: top right;
    animation: dropdownFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 25px;
    width: 10px;
    height: 10px;
    background: rgba(10, 12, 22, 0.98);
    border-left: 1px solid var(--neon-purple);
    border-top: 1px solid var(--neon-purple);
    transform: rotate(45deg);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.profile-dropdown-menu.active {
    display: block;
}

.avatar-thumbnail-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--neon-purple);
    object-fit: cover;
    box-shadow: 0 0 8px rgba(189, 0, 255, 0.4);
}

.avatar-thumbnail-large {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    object-fit: cover;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
    display: block;
}

.avatar-upload-container {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.avatar-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--neon-cyan);
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.avatar-upload-container:hover .avatar-edit-overlay {
    opacity: 1;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dropdown-username {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-title {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

.form-group-sm {
    margin-bottom: 0.95rem;
}

.form-group-sm label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input-sm {
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.25s ease;
}

.form-input-sm:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-actions {
    margin-top: 1.35rem;
    display: flex;
    justify-content: flex-end;
}

.dropdown-actions button {
    width: 100%;
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--neon-purple);
    margin-bottom: 0.5rem;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(189, 0, 255, 0.2);
}

/* Luxury Top Leaderboard Panel Container Card */
.leaderboard-panel-card {
    position: relative;
    border: 2px solid transparent !important;
    background: transparent !important;
    animation: luxury-panel-pulse 4s infinite alternate ease-in-out;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.leaderboard-panel-card > * {
    position: relative;
    z-index: 2;
}

/* Rotating Gold-Purple Conic Laser Border */
.leaderboard-panel-card::before {
    content: '' !important;
    position: absolute !important;
    width: 160% !important;
    height: 320% !important;
    top: -110% !important;
    left: -30% !important;
    background: conic-gradient(
        transparent, 
        #ffd700 15%, 
        #bd00ff 30%, 
        transparent 45%
    ) !important;
    z-index: 0 !important;
    animation: rotate-laser 8s infinite linear !important;
    border-radius: 0 !important;
    pointer-events: none !important;
}

/* Luxury Dark Violet Base & Drifting Tech Grid Overlay */
.leaderboard-panel-card::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important; left: 2px; right: 2px; bottom: 2px;
    background-image: 
        radial-gradient(circle, rgba(255, 215, 0, 0.1) 12%, transparent 12%),
        linear-gradient(135deg, rgba(16, 10, 28, 0.98) 0%, rgba(8, 5, 15, 0.99) 100%) !important;
    background-size: 10px 10px, 100% 100% !important;
    z-index: 1 !important;
    border-radius: 14px !important;
    animation: grid-drift 25s infinite linear !important;
    pointer-events: none !important;
}

.leaderboard-panel-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 35px rgba(255, 215, 0, 0.35), 0 0 35px rgba(189, 0, 255, 0.25) !important;
}

.leaderboard-panel-card .panel-title {
    border-left-color: #ffd700 !important;
    color: #ffd700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4) !important;
}


@keyframes luxury-panel-pulse {
    0% {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 15px rgba(255, 215, 0, 0.08), 0 0 15px rgba(189, 0, 255, 0.08);
    }
    100% {
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(255, 215, 0, 0.22), 0 0 30px rgba(189, 0, 255, 0.18);
    }
}

@keyframes grid-drift {
    0% {
        background-position: 0px 0px, 0% 0%;
    }
    100% {
        background-position: 40px 40px, 0% 0%;
    }
}

/* Collapsible Sidebar Styles */
.sidebar-panel {
    padding: 1.25rem 1rem !important;
    transition: all 0.35s ease;
}

.dashboard-container aside.collapsed .sidebar-panel {
    padding: 1.25rem 0.5rem !important;
    align-items: center;
}

.sidebar-toggle-btn {
    position: absolute;
    top: 15px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: rgba(10, 12, 22, 0.95);
    border: 1px solid var(--neon-green);
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
    color: var(--neon-green);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.25s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.6);
}

.online-users-list-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    margin-top: 1rem;
    max-height: calc(100vh - 200px);
}

.sidebar-collapsed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.collapsed-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.collapsed-indicator:hover {
    border-color: var(--neon-green);
    background: rgba(57, 255, 20, 0.05);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.1);
}

.online-count-badge {
    background: var(--neon-green);
    color: #000;
    font-size: 0.72rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
    font-family: var(--font-mono);
}

/* Compact Leaderboard Layout Overrides */
.leaderboard-panel-card {
    height: 195px;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 1.15rem 1.25rem !important;
    margin-bottom: 0 !important;
}

.leaderboard-panel-card .panel-title {
    margin-bottom: 0.65rem !important;
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.85rem;
    margin-top: 0.5rem;
}

.leaderboard-card {
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    position: relative;
    overflow: hidden;
    height: 85px;
    box-sizing: border-box;
}

.leaderboard-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--neon-purple);
    margin-bottom: 0 !important;
    object-fit: cover;
    box-shadow: 0 0 8px rgba(189, 0, 255, 0.2);
    flex-shrink: 0;
}

.rank-badge {
    font-size: 1.1rem;
    margin-bottom: 0 !important;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    font-family: var(--font-display);
    flex-shrink: 0;
}

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

.leaderboard-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.leaderboard-wins {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-green);
    font-weight: bold;
}

.leaderboard-bio {
    font-size: 0.7rem;
    color: #6e7282;
    margin-top: 2px;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* 3-Column Bottom Row Layout */
.lobby-bottom-grid {
    display: flex;
    gap: 1.25rem;
    height: calc(100% - 210px);
    width: 100%;
    overflow: hidden;
}

.lobby-col-panel {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.15rem 1.25rem !important;
    margin-bottom: 0 !important;
}

.lobby-col-panel .panel-scroll-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
    margin-top: 0.65rem;
}

.lobby-col-panel .games-list {
    margin-top: 0 !important;
}

/* Compact Create Arena Buttons override */
.lobby-col-panel .game-options-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    margin-bottom: 0 !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lobby-col-panel .game-option-btn {
    padding: 0.75rem 1.25rem !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 1rem !important;
    font-size: 0.92rem !important;
    height: 52px;
    box-sizing: border-box;
}

.lobby-col-panel .game-option-btn i {
    font-size: 1.15rem !important;
    width: 20px;
    text-align: center;
}

/* ==========================================
   Luxury Glowing Frames & Unique Tech Patterns 
   For Remaining Dashboard Panels (Custom Varied Styles)
   ========================================== */

/* Make panel contents sit on top of rotating elements and backdrops */
.online-challengers-panel-card > *,
.create-arena-panel-card > *,
.active-matches-panel-card > *,
.open-challenges-panel-card > * {
    position: relative;
    z-index: 2;
}

/* 1. Online Challengers Sidebar (Green Theme - Falling Data Stream Cascade) */
.online-challengers-panel-card {
    border: 1.5px solid rgba(57, 255, 20, 0.3) !important;
    background: transparent !important;
    animation: green-panel-pulse 4s infinite alternate ease-in-out;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

/* Falling Code Stream */
.online-challengers-panel-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background-image: linear-gradient(to bottom, rgba(57, 255, 20, 0) 0%, rgba(57, 255, 20, 0.15) 50%, rgba(57, 255, 20, 0) 100%) !important;
    background-size: 100% 250px !important;
    z-index: 2 !important;
    animation: falling-cascade 4s infinite linear !important;
    pointer-events: none !important;
}

.online-challengers-panel-card::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important; left: 2px; right: 2px; bottom: 2px;
    background-image: 
        linear-gradient(90deg, rgba(57, 255, 20, 0.04) 1px, transparent 1px),
        linear-gradient(135deg, rgba(8, 20, 15, 0.98) 0%, rgba(4, 10, 8, 0.99) 100%) !important;
    background-size: 16px 100%, 100% 100% !important;
    z-index: 1 !important;
    border-radius: 14px !important;
    pointer-events: none !important;
}

.online-challengers-panel-card:hover {
    border-color: rgba(57, 255, 20, 0.7) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 35px rgba(57, 255, 20, 0.4), 0 0 35px rgba(0, 255, 204, 0.25) !important;
}

/* 2. Create Arena Panel (Blue/Cyan Theme - Chessboard Grid & Spot Light Orbit) */
.create-arena-panel-card {
    border: 1.5px solid rgba(0, 243, 255, 0.3) !important;
    background: transparent !important;
    animation: blue-panel-pulse 4s infinite alternate ease-in-out;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

/* Orbiting Spotlight Source */
.create-arena-panel-card::before {
    content: '' !important;
    position: absolute !important;
    width: 150% !important;
    height: 150% !important;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.16) 0%, transparent 60%) !important;
    z-index: 2 !important;
    animation: spotlight-orbit 7s infinite linear !important;
    pointer-events: none !important;
}

.create-arena-panel-card::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important; left: 2px; right: 2px; bottom: 2px;
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.08) 1.5px, transparent 1.5px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.08) 1.5px, transparent 1.5px),
        linear-gradient(135deg, rgba(10, 16, 28, 0.98) 0%, rgba(5, 8, 15, 0.99) 100%) !important;
    background-size: 20px 20px, 20px 20px, 100% 100% !important;
    z-index: 1 !important;
    border-radius: 14px !important;
    pointer-events: none !important;
}

.create-arena-panel-card:hover {
    border-color: rgba(0, 243, 255, 0.7) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 35px rgba(0, 243, 255, 0.4), 0 0 35px rgba(0, 85, 255, 0.25) !important;
}

/* 3. Active Matches Panel (Purple/Violet Theme - Tactical Corner Brackets & Sonar Ripples) */
.active-matches-panel-card {
    border: 1px solid rgba(189, 0, 255, 0.2) !important;
    background: transparent !important;
    animation: purple-panel-pulse 4s infinite alternate ease-in-out;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

/* Corner HUD Target Brackets */
.active-matches-panel-card::before {
    content: '' !important;
    position: absolute !important;
    top: 6px !important; left: 6px; right: 6px; bottom: 6px;
    border: none !important;
    background: 
        linear-gradient(to right, var(--neon-purple) 2px, transparent 2px) 0 0,
        linear-gradient(to bottom, var(--neon-purple) 2px, transparent 2px) 0 0,
        linear-gradient(to left, var(--neon-purple) 2px, transparent 2px) 100% 0,
        linear-gradient(to bottom, var(--neon-purple) 2px, transparent 2px) 100% 0,
        linear-gradient(to right, var(--neon-purple) 2px, transparent 2px) 0 100%,
        linear-gradient(to top, var(--neon-purple) 2px, transparent 2px) 0 100%,
        linear-gradient(to left, var(--neon-purple) 2px, transparent 2px) 100% 100%,
        linear-gradient(to top, var(--neon-purple) 2px, transparent 2px) 100% 100% !important;
    background-size: 20px 20px !important;
    background-repeat: no-repeat !important;
    z-index: 2 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 0 5px var(--neon-purple)) !important;
    animation: bracket-pulse 3s infinite alternate ease-in-out !important;
}

/* Expanding Radar Sonar Waves */
.active-matches-panel-card::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important; left: 2px; right: 2px; bottom: 2px;
    background-image: 
        repeating-radial-gradient(circle at center, transparent, transparent 20px, rgba(189, 0, 255, 0.08) 22px, rgba(189, 0, 255, 0.08) 24px, transparent 26px, transparent 50px),
        linear-gradient(135deg, rgba(16, 10, 28, 0.98) 0%, rgba(8, 5, 15, 0.99) 100%) !important;
    background-size: 100% 100%, 100% 100% !important;
    background-position: center center, 0% 0% !important;
    z-index: 1 !important;
    border-radius: 14px !important;
    animation: sonar-wave 6s infinite linear !important;
    pointer-events: none !important;
}

.active-matches-panel-card:hover {
    border-color: rgba(189, 0, 255, 0.6) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 35px rgba(189, 0, 255, 0.4), 0 0 35px rgba(255, 0, 255, 0.25) !important;
}

/* 4. Open Challenges Panel (Pink Theme - Fast Conic Laser & Glitch Grid Checkerboard) */
.open-challenges-panel-card {
    border: 2px solid transparent !important;
    background: transparent !important;
    animation: pink-panel-pulse 4s infinite alternate ease-in-out;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

/* Dual Laser Frame Spinner */
.open-challenges-panel-card::before {
    content: '' !important;
    position: absolute !important;
    width: 250% !important;
    height: 250% !important;
    top: -75% !important;
    left: -75% !important;
    background: conic-gradient(
        transparent, 
        var(--neon-pink) 20%, 
        #bd00ff 40%, 
        transparent 60%
    ) !important;
    z-index: 0 !important;
    animation: rotate-laser 6s infinite linear !important;
    border-radius: 0 !important;
    pointer-events: none !important;
}

/* Flashing Glitch Checkerboard Backdrop */
.open-challenges-panel-card::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important; left: 2px; right: 2px; bottom: 2px;
    background-image: 
        linear-gradient(45deg, rgba(255, 0, 127, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 0, 127, 0.05) 75%),
        linear-gradient(45deg, rgba(255, 0, 127, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 0, 127, 0.05) 75%),
        linear-gradient(135deg, rgba(24, 10, 20, 0.98) 0%, rgba(12, 5, 10, 0.99) 100%) !important;
    background-size: 24px 24px, 24px 24px, 100% 100% !important;
    background-position: 0 0, 12px 12px, 0 0 !important;
    z-index: 1 !important;
    border-radius: 14px !important;
    animation: glitch-flash 0.5s infinite steps(2) !important;
    pointer-events: none !important;
}

.open-challenges-panel-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 35px rgba(255, 0, 127, 0.4), 0 0 35px rgba(189, 0, 255, 0.25) !important;
}

/* ==========================================
   Keyframe Animations for Drifts, Scans, Glitches & Glows
   ========================================== */

/* Green falling digital data stream cascade */
@keyframes falling-cascade {
    0% {
        background-position-y: 0px;
    }
    100% {
        background-position-y: 250px;
    }
}

/* Orbiting Spotlight sweep animation */
@keyframes spotlight-orbit {
    0% {
        top: -50%;
        left: -50%;
    }
    25% {
        top: -50%;
        left: 50%;
    }
    50% {
        top: 50%;
        left: 50%;
    }
    75% {
        top: 50%;
        left: -50%;
    }
    100% {
        top: -50%;
        left: -50%;
    }
}

/* Concentric expanding sonar wave ripple */
@keyframes sonar-wave {
    0% {
        background-size: 100% 100%, 100% 100%;
        opacity: 0.6;
    }
    50% {
        opacity: 0.95;
    }
    100% {
        background-size: 180% 180%, 100% 100%;
        opacity: 0.6;
    }
}

/* Digital glitch matrix flash */
@keyframes glitch-flash {
    0% {
        opacity: 0.75;
        background-position: 0 0, 12px 12px, 0 0;
    }
    50% {
        opacity: 1;
        background-position: 4px 4px, 16px 16px, 0 0;
    }
    100% {
        opacity: 0.85;
        background-position: -4px -4px, 8px 8px, 0 0;
    }
}

/* HUD Corner bracket pulse */
@keyframes bracket-pulse {
    0% {
        opacity: 0.4;
        transform: scale(0.99);
    }
    100% {
        opacity: 0.95;
        transform: scale(1.015);
    }
}

/* Unique Neon Panel Pulse Animations */
@keyframes green-panel-pulse {
    0% {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 15px rgba(57, 255, 20, 0.05), 0 0 15px rgba(0, 255, 204, 0.04);
    }
    100% {
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(57, 255, 20, 0.18), 0 0 30px rgba(0, 255, 204, 0.12);
    }
}

@keyframes blue-panel-pulse {
    0% {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 243, 255, 0.05), 0 0 15px rgba(0, 85, 255, 0.04);
    }
    100% {
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 243, 255, 0.18), 0 0 30px rgba(0, 85, 255, 0.12);
    }
}

@keyframes purple-panel-pulse {
    0% {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 15px rgba(189, 0, 255, 0.05), 0 0 15px rgba(255, 0, 255, 0.04);
    }
    100% {
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(189, 0, 255, 0.18), 0 0 30px rgba(255, 0, 255, 0.12);
    }
}

@keyframes pink-panel-pulse {
    0% {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 15px rgba(255, 0, 127, 0.05), 0 0 15px rgba(189, 0, 255, 0.04);
    }
    100% {
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(255, 0, 127, 0.18), 0 0 30px rgba(189, 0, 255, 0.12);
    }
}

/* ==========================================
   Avatar Cropper Modal Cyberpunk Overlay
   ========================================== */
.cropper-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 5, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cropper-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cropper-modal-card {
    width: 90%;
    max-width: 460px;
    padding: 1.5rem;
    border: 2px solid var(--neon-blue) !important;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3) !important;
    display: flex;
    flex-direction: column;
}

.cropper-modal-card .modal-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    border-left: 3px solid var(--neon-blue);
    padding-left: 0.50rem;
}

.cropper-image-container {
    width: 100%;
    height: 320px;
    background: #020205;
    border-radius: 8px;
    border: 1px solid rgba(0, 243, 255, 0.15);
    overflow: hidden;
    position: relative !important;
}

.cropper-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.25rem;
    position: relative !important;
    z-index: 100 !important;
}

.cropper-modal-actions button {
    pointer-events: auto !important;
    cursor: pointer !important;
}



/* Customized Cropper.js UI to match the cyberpunk theme */
.cropper-view-box,
.cropper-face {
    border-radius: 50% !important;
    outline: 2px dashed var(--neon-blue) !important;
}

.cropper-line {
    background-color: var(--neon-blue) !important;
}

.cropper-point {
    background-color: var(--neon-blue) !important;
    border-radius: 50% !important;
}

.cropper-view-box {
    outline: 2px solid var(--neon-blue) !important;
}

.cropper-modal {
    background-color: rgba(7, 8, 13, 0.75) !important;
}

/* ==========================================
   Mobile Compatibility Styles & Media Queries
   ========================================== */
.show-mobile-only {
    display: none !important;
}
.show-mobile-flex {
    display: none !important;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    .show-mobile-only {
        display: inline-block !important;
    }
    button.show-mobile-only, a.show-mobile-only {
        display: inline-flex !important;
    }
    .show-mobile-flex {
        display: flex !important;
    }
    
    body {
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto !important;
        padding-top: 60px !important;
    }
    .header {
        height: 60px !important;
        padding: 0.5rem 1rem !important;
    }
    .header .logo {
        font-size: 1.4rem !important;
    }
}

/* Auth Pages (Login/Register) */
@media (max-width: 480px) {
    .auth-container {
        padding: 1rem !important;
    }
    .auth-card {
        padding: 1.5rem !important;
    }
    .auth-title {
        font-size: 2rem !important;
        margin-bottom: 1.5rem !important;
    }
}

/* Dashboard / Lobby Page */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0.75rem !important;
        gap: 1rem !important;
    }
    .dashboard-container main {
        height: auto !important;
        overflow: visible !important;
        gap: 1rem !important;
    }
    
    /* Collapsible Sidebar Override on Mobile */
    #lobby-sidebar {
        width: 100% !important;
        height: auto !important;
    }
    #lobby-sidebar .online-challengers-panel-card {
        height: auto !important;
        min-height: 200px;
    }
    #sidebar-toggle-btn {
        display: none !important;
    }
    #sidebar-expanded-content {
        display: block !important;
    }
    #sidebar-collapsed-content {
        display: none !important;
    }
    .online-users-list-wrapper {
        max-height: 250px !important;
    }
    
    /* Bottom Grid Overrides */
    .lobby-bottom-grid {
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
        gap: 1rem !important;
    }
    .lobby-col-panel {
        height: auto !important;
        min-height: 250px !important;
        overflow: hidden !important;
    }
    .lobby-col-panel .panel-scroll-content {
        max-height: 300px;
    }
}

@media (max-width: 1200px) {
    .leaderboard-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 768px) {
    .leaderboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    .leaderboard-grid {
        grid-template-columns: 1fr !important;
    }
    .profile-dropdown-menu {
        width: 290px !important;
        right: -10px !important;
    }
    .profile-dropdown-menu::before {
        right: 35px !important;
    }
}

/* Game Room Arena Page */
@media (max-width: 1024px) {
    .arena-container {
        height: calc(100vh - 60px) !important;
        padding: 0.5rem !important;
        overflow: hidden !important;
        flex-direction: column !important;
        justify-content: space-around !important;
    }
    
    /* Board Layout Wrapper Stacking */
    .board-layout-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Captured Trophies Horizontal Stack */
    #left-board-captured, #right-board-captured {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: min(640px, calc(100vh - 210px)) !important;
        height: auto !important;
        padding: 6px 10px !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 4px !important;
    }
    #left-board-captured span, #right-board-captured span {
        writing-mode: unset !important;
        text-orientation: unset !important;
        margin: 0 8px 0 0 !important;
        font-size: 0.65rem !important;
    }
    #left-board-captured .trophy-piece, #right-board-captured .trophy-piece {
        margin-bottom: 0 !important;
    }

    /* HUD overlay drawers on mobile */
    .side-hud {
        display: none !important;
    }
    .side-hud.mobile-active {
        display: flex !important;
        position: fixed !important;
        top: 60px !important;
        bottom: 0 !important;
        z-index: 1200 !important;
        width: 300px !important;
        height: calc(100vh - 60px) !important;
        border-radius: 0 !important;
        border-top: none !important;
        border-bottom: none !important;
        background: rgba(10, 12, 22, 0.98) !important;
        box-shadow: 0 10px 40px rgba(0,0,0,0.95) !important;
    }
    #left-hud.mobile-active {
        left: 0 !important;
        border-left: none !important;
        border-right: 2px solid var(--neon-blue) !important;
        animation: slide-in 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) forwards !important;
    }
    #right-hud.mobile-active {
        right: 0 !important;
        border-right: none !important;
        border-left: 2px solid var(--neon-purple) !important;
        animation: slide-in-right 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) forwards !important;
    }
    
    .hud-overlay-backdrop {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1100;
    }

    .player-bar {
        padding: 0.5rem 0.75rem !important;
        margin: 0.25rem 0 !important;
    }
    .player-name {
        font-size: 0.85rem !important;
    }
    .player-bio-text {
        max-width: 140px !important;
    }
    .player-timer {
        font-size: 0.95rem !important;
        padding: 0.2rem 0.5rem !important;
    }
}

@keyframes slide-in {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Modals / Overlay Alerts */
@media (max-width: 480px) {
    .overlay-alert {
        max-width: 90% !important;
        width: 320px !important;
        padding: 1.5rem !important;
    }
    .overlay-alert-title {
        font-size: 1.5rem !important;
    }
}


