:root {
    /* Gaming Theme Colors - Purple & Green Neon */
    --primary-color: #a855f7;
    --primary-dark: #9333ea;
    --primary-light: #c084fc;
    --secondary-color: #10b981;
    --accent-color: #22d3ee;
    --success-color: #34d399;
    --danger-color: #f43f5e;
    --warning-color: #fbbf24;
    
    /* Dark Gaming Background */
    --bg-dark: #0f0a1e;
    --bg-dark-secondary: #1a1230;
    --bg-card: #1e1838;
    --bg-card-hover: #2a2348;
    
    /* Text Colors */
    --text-light: #f8fafc;
    --text-secondary: #c7d2fe;
    --text-muted: #94a3b8;
    
    /* Border & Shadows */
    --border-color: #312e81;
    --glow-primary: rgba(168, 85, 247, 0.3);
    --glow-secondary: rgba(16, 185, 129, 0.3);
    --glow-accent: rgba(34, 211, 238, 0.3);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-accent: linear-gradient(135deg, #22d3ee 0%, #0891b2 100%);
    --gradient-dark: linear-gradient(135deg, #0f0a1e 0%, #1a1230 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(34, 211, 238, 0.04) 0%, transparent 50%);
    color: var(--text-light);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(168, 85, 247, 0.02) 2px, rgba(168, 85, 247, 0.02) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(16, 185, 129, 0.02) 2px, rgba(16, 185, 129, 0.02) 4px);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Session Alert Overlay */
.session-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* ======================
   LOGIN SCREEN STYLES
   ====================== */

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(34, 211, 238, 0.08) 0%, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    animation: fadeIn 0.5s ease;
}

.login-container {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 500px;
    width: 90%;
    background: var(--bg-card);
    border-radius: 24px;
    border: 2px solid var(--border-color);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(168, 85, 247, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    box-shadow: 0 0 20px var(--glow-primary);
}

.login-logo {
    margin-bottom: 2rem;
}

.game-logo-large {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 0 20px var(--glow-primary));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.login-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.login-title .title-main {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    text-shadow: none;
}

.login-title .title-sub {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-secondary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.login-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.btn-login {
    width: 100%;
    max-width: 400px;
    padding: 1.25rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% { 
        box-shadow: 
            0 5px 20px var(--glow-primary),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    50% { 
        box-shadow: 
            0 8px 30px var(--glow-primary),
            0 0 40px var(--glow-primary),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
        transform: scale(1.02);
    }
}

/* ======================
   HOME SCREEN STYLES
   ====================== */

.home-screen {
    min-height: 100vh;
    display: none;
}

.home-screen.active {
    display: block;
}

.lobby-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    text-shadow: 0 0 20px var(--glow-primary);
}

.lobby-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
}

/* User Details in Navbar */
.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.user-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-light);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.user-full-name {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-logout {
    background: rgba(244, 63, 94, 0.1);
    border: 2px solid rgba(244, 63, 94, 0.3);
    color: var(--danger-color);
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.btn-logout:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    box-shadow: 0 5px 20px rgba(244, 63, 94, 0.4);
    transform: scale(1.05);
}

.btn-logout svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* Session Alert Overlay */
.session-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.session-alert-modal {
    background: var(--bg-card);
    border: 3px solid var(--primary-color);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--glow-primary);
    animation: slideUp 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.session-alert-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

.session-alert-modal h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
    text-shadow: 0 0 20px var(--glow-primary);
}

.session-alert-modal p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.2rem;
    line-height: 1.6;
}

.session-alert-modal .btn {
    min-width: 150px;
    font-size: 1.1rem;
}

/* Header Styles */
.header {
    background: rgba(30, 24, 56, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(168, 85, 247, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    box-shadow: 0 0 20px var(--glow-primary);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
    min-height: 60px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    gap: 30px;
    flex-direction: row-reverse;
}

/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    z-index: 99999999;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    flex-shrink: 0;
    position: fixed;
    top: 25px;
    right: 25px;
}

.burger-menu:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px var(--glow-primary);
    transform: scale(1.05);
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    border-radius: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px var(--glow-primary);
}

.burger-menu:hover span {
    background: var(--primary-light);
    box-shadow: 0 0 10px var(--glow-primary);
}

.burger-menu.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    box-shadow: 0 5px 25px var(--glow-primary);
}

.burger-menu.active span {
    background: white;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 12px;
    flex-direction: row-reverse;
}

.logo-container:hover {
    background: rgba(168, 85, 247, 0.1);
    transform: translateY(-2px);
}

.logo-container:hover .game-logo {
    animation: logoSpin 0.6s ease-in-out;
    filter: drop-shadow(0 0 20px var(--glow-primary));
}

.logo-container:hover .title-main,
.logo-container:hover .title-sub {
    text-shadow: 0 0 15px var(--glow-primary);
}

.logo-container:active {
    transform: translateY(0px);
}

@keyframes logoSpin {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(180deg); }
    100% { transform: translateY(0px) rotate(360deg); }
}

.game-logo {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 0 10px var(--glow-primary));
    animation: logoFloat 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

.game-title {
    display: flex;
    flex-direction: column;
    margin: 0;
    line-height: 1.2;
}

.title-main {
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    font-weight: 900;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.title-sub {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    font-weight: 700;
    background: var(--gradient-secondary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    z-index: 100000;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    flex-shrink: 0;
}

.burger-menu:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px var(--glow-primary);
    transform: scale(1.05);
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    border-radius: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px var(--glow-primary);
}

.burger-menu:hover span {
    background: var(--primary-light);
    box-shadow: 0 0 10px var(--glow-primary);
}

.burger-menu.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    box-shadow: 0 5px 25px var(--glow-primary);
}

.burger-menu.active span {
    background: white;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 25px;
    transition: all 0.3s ease;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 50px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 3px 15px rgba(168, 85, 247, 0.2);
}

.nav-link:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--primary-color);
    box-shadow: 
        0 8px 25px var(--glow-primary),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

/* User Profile in Navbar */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Nav Group - Container for Logo + Tournaments + Profile */
.nav-group {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: space-between;
    flex-direction: row-reverse;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
    box-shadow: 
        0 0 20px var(--glow-primary),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    background: var(--bg-card);
}

/* =====================
   Burger Menu & Mobile Navigation
   ===================== */

/* Burger Button */
.burger-btn {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
    gap: 5px;
    padding: 0;
}

.burger-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

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

.burger-line {
    width: 22px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

/* Burger Animation when active */
.burger-btn.active .burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-btn.active .burger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.burger-btn.active .burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -75%;
    width: 70%;
    height: 100vh;
    background: linear-gradient(180deg, rgba(30, 24, 56, 0.98) 0%, rgba(15, 10, 30, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-left: 2px solid var(--primary-color);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.8);
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-sidebar.active {
    right: 0;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
}

/* Sidebar Logo */
.sidebar-logo {
    display: none;
}

/* Sidebar User Info */
.sidebar-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 15px;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    margin-bottom: 20px;
}

.sidebar-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
    box-shadow: 0 0 15px var(--glow-primary);
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
    width: 100%;
}

.sidebar-username {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidebar-fullname {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(168, 85, 247, 0.05);
    border: 2px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sidebar-link:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--primary-color);
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.sidebar-link:active {
    transform: translateX(-3px) scale(0.98);
}

.sidebar-icon {
    font-size: 1.5rem;
    min-width: 30px;
    text-align: center;
}

/* Sidebar Logout */
.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background: rgba(244, 63, 94, 0.1);
    border: 2px solid rgba(244, 63, 94, 0.3);
    border-radius: 12px;
    color: #f43f5e;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.sidebar-logout:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: #f43f5e;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
}

.sidebar-logout:active {
    transform: scale(0.98);
}

/* Team Selection in Waiting Room */
.team-selection-area {
    margin: 25px 0;
    padding: 24px;
    background: rgba(168, 85, 247, 0.08);
    border-radius: 16px;
    border: 2px solid rgba(168, 85, 247, 0.25);
    transition: all 0.3s ease;
}

.team-selection-title {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: #a855f7;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.team-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.btn-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 20px;
    min-height: 140px;
    border: 3px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-team::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0;
    transition: opacity 0.35s ease;
    border-radius: 16px;
}

.btn-team:hover::before {
    opacity: 1;
}

.btn-team.team1 {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.06));
}

.btn-team.team1:hover:not(.selected):not(.disabled) {
    border-color: rgba(59, 130, 246, 0.8);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.12));
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.35);
}

.btn-team.team2 {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.06));
}

.btn-team.team2:hover:not(.selected):not(.disabled) {
    border-color: rgba(239, 68, 68, 0.8);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(220, 38, 38, 0.12));
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.35);
}

.btn-team.selected {
    border-width: 4px;
    transform: scale(1.02);
}

.btn-team.team1.selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(37, 99, 235, 0.2));
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 
                0 0 10px rgba(59, 130, 246, 0.3),
                inset 0 0 12px rgba(59, 130, 246, 0.15);
}

.btn-team.team2.selected {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(220, 38, 38, 0.2));
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4), 
                0 0 10px rgba(239, 68, 68, 0.3),
                inset 0 0 12px rgba(239, 68, 68, 0.15);
}

.btn-team.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.5);
}

.btn-team .team-icon {
    font-size: 2.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.btn-team:hover .team-icon {
    transform: scale(1.1);
}

.btn-team.selected .team-icon {
    transform: scale(1.15);
}

.btn-team .team-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.btn-team .team-count {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .team-selection-area {
        padding: 20px;
        margin: 20px 0;
    }
    
    .team-buttons {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .btn-team {
        padding: 20px 16px;
        min-height: 120px;
    }
    
    .btn-team .team-icon {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .team-selection-area {
        padding: 16px;
        margin: 16px 0;
    }
    
    .btn-team {
        padding: 18px 14px;
        min-height: 110px;
        gap: 10px;
    }
    
    .btn-team .team-icon {
        font-size: 2rem;
    }
    
    .btn-team .team-name {
        font-size: 0.95rem;
    }
}

/* Desktop Navigation - Show by default */
.desktop-nav {
    display: flex !important;
}

.desktop-logout {
    display: flex !important;
    flex-shrink: 0;
}

/* Mobile Logo - visible only on small screens */
.mobile-logo {
    display: none;
    flex-direction: row;
}

.mobile-logo .game-logo {
    width: 45px;
    height: 45px;
}

/* Desktop Full Logo with text */
.desktop-full-logo {
    display: flex;
}

/* Responsive Breakpoints */

/* Mobile: < 780px - Show burger + icon logo only */
@media (max-width: 780px) {
    .burger-btn {
        display: flex;
    }
    
    .mobile-logo {
        display: flex;
    }
    
    .desktop-nav {
        display: none !important;
    }
    
    .desktop-logout {
        display: none !important;
    }
}

/* Tablet: 780px - 1024px - Show burger + full logo */
@media (min-width: 780px) and (max-width: 1024px) {
    .burger-btn {
        display: flex;
    }
    
    .mobile-logo {
        display: none;
    }
    
    .desktop-nav {
        display: none !important;
    }
    
    .desktop-logout {
        display: none !important;
    }
    
    /* Show full logo on tablet */
    .desktop-full-logo {
        display: flex !important;
    }
}

/* Desktop: > 1024px - Show everything */
@media (min-width: 1024px) {
    .burger-btn {
        display: none;
    }
    
    .mobile-logo {
        display: none;
    }
}

.avatar:hover {
    transform: scale(1.15) rotate(8deg);
    box-shadow: 
        0 0 35px var(--glow-primary),
        0 5px 20px rgba(168, 85, 247, 0.4);
    border-color: var(--primary-light);
}

.btn-logout {
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 0 8px rgba(242, 91, 91, 0.8));
}

.screen {
    min-height: 60vh;
    display: none;
}

.screen.active {
    display: block;
}

#lobbyScreen.active {
    display: block;
}

.card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: clamp(20px, 5vw, 40px);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(168, 85, 247, 0.2);
    text-align: center;
    width: 100%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    box-shadow: 0 0 20px var(--glow-primary);
}



.card h2 {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: clamp(1.5rem, 4vw, 2rem);
    text-shadow: 0 0 20px var(--glow-primary);
    position: relative;
    display: inline-block;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
    box-shadow: 0 0 15px var(--glow-primary);
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.6;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: 2px solid;
    border-radius: 12px;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

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

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 
        0 5px 20px var(--glow-primary),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover::after {
    width: 400px;
    height: 400px;
}

.btn-primary:hover {
    box-shadow: 
        0 10px 35px var(--glow-primary),
        0 0 50px var(--glow-primary),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: var(--primary-light);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-light);
    border: 2px solid rgba(168, 85, 247, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(147, 51, 234, 0.2));
    transition: left 0.3s ease;
    z-index: 0;
}

.btn-secondary:hover::before {
    left: 0;
}

.btn-secondary:hover {
    color: var(--primary-light);
    box-shadow: 
        0 4px 16px rgba(168, 85, 247, 0.3),
        0 0 20px rgba(168, 85, 247, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Back Button Specific Styles */
.btn-secondary svg,
.btn-secondary span {
    position: relative;
    z-index: 1;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #e84118);
    color: white;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
    border: 2px solid var(--danger-color);
}

.btn-danger:hover {
    box-shadow: 
        0 4px 16px rgba(244, 63, 94, 0.5),
        0 0 20px rgba(244, 63, 94, 0.3);
    transform: translateY(-2px);
}

.btn-large {
    padding: clamp(16px, 3.5vw, 20px) clamp(35px, 7vw, 50px);
    font-size: clamp(1.1rem, 2.8vw, 1.3rem);
    font-weight: 700;
    animation: buttonGlow 2s ease-in-out infinite;
}

@keyframes buttonGlow {
    0%, 100% { 
        box-shadow: 
            0 5px 20px var(--glow-primary),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 8px 30px var(--glow-primary),
            0 0 40px var(--glow-primary),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

/* Game Container */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 15px;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-box {
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-label {
    font-size: 0.9em;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.timer {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--warning-color);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.combo {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--secondary-color);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: all 0.3s ease;
}

.combo.combo-boost {
    transform: scale(1.3);
    color: var(--warning-color);
}

.score {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--success-color);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.game-status {
    text-align: center;
    font-size: 3em;
    margin-bottom: 0;
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.8);
    animation: pulse 1s infinite;
}

/* Game Arena */
.game-arena {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    margin-bottom: 0;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3),
                inset 0 0 50px rgba(0, 0, 0, 0.5);
    cursor: crosshair;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.arena-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(99, 102, 241, 0.1) 49px, rgba(99, 102, 241, 0.1) 50px),
        repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(99, 102, 241, 0.1) 49px, rgba(99, 102, 241, 0.1) 50px);
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Targets */
.target {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: scale(0);
    transition: transform 0.2s ease;
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: targetPulse 0.8s ease-in-out infinite;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    user-select: none;
}

.target.active {
    transform: scale(1);
}

.target.hit {
    transform: scale(1.3);
    opacity: 0;
    transition: all 0.2s ease;
}

.target.missed {
    transform: scale(0.5);
    opacity: 0;
    transition: all 0.3s ease;
}

.target:hover {
    transform: scale(1.1);
}

/* Utility classes for mobile optimization */
.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.mobile-padding {
    padding-left: clamp(15px, 4vw, 30px);
    padding-right: clamp(15px, 4vw, 30px);
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    /* Mobile touch devices */
    .btn,
    .nav-link,
    .mode-card {
        min-height: 44px;
        min-width: 44px;
    }
    
    .burger-menu {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Disable hover effects on touch devices */
    .mode-card:hover::before,
    .card:hover {
        transform: none;
    }
    
    /* Active state for touch */
    .mode-card:active {
        transform: scale(0.98);
        border-color: var(--primary-color);
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}

/* Improved focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
    box-shadow: 0 0 20px var(--glow-primary);
}

/* Remove default focus outline */
button:focus,
a:focus,
input:focus {
    outline: none;
}

/* Keyboard navigation highlight */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.05);
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth Page Transitions */
.screen {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Spinner Enhancement */
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-right-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    box-shadow: 
        0 0 30px var(--glow-primary),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--glow-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
    box-shadow: 0 0 20px var(--glow-primary);
}

/* Responsive text utilities */
.text-responsive-lg {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.text-responsive-md {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.text-responsive-sm {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

/* Game Mode Selection */
.game-modes {
    display: flex !important;
    flex-direction: row !important;
    gap: 1.5rem;
    margin: 2rem 0;
}

.mode-card {
    background: var(--bg-card);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 200px;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(147, 51, 234, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.mode-card:hover::before {
    opacity: 1;
}

.mode-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 
        0 12px 28px rgba(0, 0, 0, 0.35),
        0 0 25px rgba(168, 85, 247, 0.3);
}

.mode-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(147, 51, 234, 0.15) 100%);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(168, 85, 247, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(1.03);
}

.mode-card.selected::before {
    opacity: 0.5;
}

.mode-card * {
    position: relative;
    z-index: 1;
}

.mode-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: iconFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(168, 85, 247, 0.3));
    transition: all 0.3s ease;
}

.mode-card:hover .mode-icon {
    animation: iconBounce 0.6s ease-in-out infinite;
    filter: drop-shadow(0 6px 18px rgba(168, 85, 247, 0.5));
    transform: scale(1.1);
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1.1) translateY(0); }
    50% { transform: scale(1.15) translateY(-5px); }
}

.mode-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.mode-card p {
    color: var(--text-gray);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.mode-badge {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: bold;
    box-shadow: 0 5px 15px var(--glow-primary);
    transition: all 0.3s ease;
}

.mode-card:hover .mode-badge {
    transform: scale(1.1);
    box-shadow: 0 8px 20px var(--glow-primary);
}

.divider {
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary-color) 20%, 
        var(--secondary-color) 50%, 
        var(--primary-color) 80%, 
        transparent 100%);
    margin: 2rem 0;
    box-shadow: 0 0 10px var(--glow-primary);
    animation: dividerGlow 3s ease-in-out infinite;
}

@keyframes dividerGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.current-mode {
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 30px var(--glow-primary);
}

.current-mode h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.current-mode span {
    color: var(--primary-color);
    font-weight: bold;
}

/* Waiting Room Enhancements */
/* Room Number Display */
.room-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.05));
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
}

.room-label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.room-id {
    font-size: 1.3rem;
    font-weight: 800;
    color: #a855f7;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    background: rgba(168, 85, 247, 0.1);
    padding: 4px 16px;
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.match-info {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.match-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.match-mode span {
    font-size: 3rem;
}

.match-mode h3 {
    color: var(--text-light);
    font-size: 1.5rem;
}

.match-details {
    color: var(--text-gray);
    font-size: 1rem;
}

.match-details strong {
    color: var(--primary-color);
}

.team-slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.team-slot {
    background: var(--bg-card);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.team-slot.filled {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.team-slot.filled.ready {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3),
                inset 0 0 10px rgba(16, 185, 129, 0.1);
    animation: readyGlow 2s ease-in-out infinite;
}

.team-slot.empty {
    border-style: dashed;
    border-color: var(--warning-color);
    opacity: 0.6;
}

.slot-avatar {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.slot-name {
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.slot-status {
    font-size: 0.875rem;
    color: var(--text-gray);
}

.team-slot.filled .slot-status {
    color: rgba(255, 255, 255, 0.7);
}

.team-slot.filled.ready .slot-status {
    color: #10b981;
    font-weight: 700;
}

.waiting-message {
    text-align: center;
    color: var(--text-gray);
    font-size: 1.1rem;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .game-modes {
        grid-template-columns: 1fr;
    }
    
    .team-slots-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mode-icon {
        font-size: 3rem;
    }
}
@media (hover: none) and (pointer: coarse) {
    .target:active {
        transform: scale(1.15);
    }
}

@keyframes targetPulse {
    0%, 100% { 
        box-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
    }
    50% { 
        box-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
    }
}

/* Floating Text */
.floating-text {
    position: fixed;
    font-size: 2em;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
    animation: floatUp 1s ease-out forwards;
    text-shadow: 0 0 10px currentColor;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0;
    }
}

/* Game Stats */
.game-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 15px;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 15px;
}

/* Team Cards Embedded Layout */
.team-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
}

.team-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 15px 18px;
    width: clamp(260px, 32%, 320px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: border-color .25s ease, box-shadow .25s ease;
}

.team-card.team1 { border-color: rgba(59,130,246,0.5); }
.team-card.team2 { border-color: rgba(239,68,68,0.5); }
.team-card.team1:hover { box-shadow: 0 0 18px rgba(59,130,246,0.35); }
.team-card.team2:hover { box-shadow: 0 0 18px rgba(239,68,68,0.35); }

.team-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.team-meta { display: flex; align-items: center; gap: 8px; }
.team-name { font-weight: 700; font-size: 1rem; }
.team-icon { font-size: 1.3rem; }

.team-actions { display: flex; align-items: center; gap: 10px; }
.team-actions .team-count { font-size: 0.85rem; padding: 4px 10px; background: rgba(255,255,255,0.05); border-radius: 20px; }

.team-players {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.player-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    min-height: 64px;
    position: relative;
    transition: background .25s ease, transform .25s ease, border-color .25s ease;
}
.player-slot.ready { border-color: var(--success-color); background: rgba(16,185,129,0.12); }
.player-slot.empty { opacity: .5; filter: grayscale(.6); }
.player-slot.empty:hover { opacity: .8; }
.player-slot:hover { background: rgba(255,255,255,0.08); transform: translateY(-2px); }

.player-avatar { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: #222; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,0.1); }
.player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.player-avatar.placeholder { background: repeating-linear-gradient(45deg,#333 0,#333 6px,#3d3d3d 6px,#3d3d3d 12px); border-style: dashed; }

.player-info { display: flex; flex-direction: column; gap: 4px; }
.player-name { font-weight: 600; font-size: 0.95rem; }
.player-status { font-size: 0.75rem; letter-spacing: .5px; color: var(--text-gray); }
.player-slot.ready .player-status { color: var(--success-color); font-weight: 700; }
.you-pill { background: var(--primary-color); color: #fff; font-size: 0.65rem; padding: 2px 6px; border-radius: 10px; margin-right: 4px; }

.btn-team { font-size: 0.75rem; padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.btn-team[disabled] { opacity: .5; cursor: not-allowed; }

/* Simplified clickable variant */
.team-cards.simplified { margin-bottom: 10px; }
.team-card { cursor: pointer; }
.team-card.selected { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(168,85,247,0.3); }
.team-card.full { opacity: .55; cursor: not-allowed; position: relative; }
.team-card.full::after { content: 'ممتلئ'; position: absolute; top: 6px; left: 10px; background: var(--danger-color); color:#fff; font-size:0.6rem; padding:3px 8px; border-radius:8px; letter-spacing:.5px; }
.team-card-top { text-align: center; display:flex; flex-direction:column; gap:4px; }
.team-title { margin:0; font-size:1.05rem; font-weight:700; }
.team-count-line { font-size:.85rem; font-weight:600; color:var(--text-gray); }

/* New player row layout */
.player-row { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border:1px solid rgba(255,255,255,0.08); border-radius:10px; background:rgba(255,255,255,0.04); margin-bottom:8px; transition:background .25s ease,border-color .25s ease; }
.player-row:last-child { margin-bottom:0; }
.player-row.ready { border-color: var(--success-color); background: rgba(16,185,129,0.12); }
.player-row.empty { opacity:.55; }
.player-row:hover { background: rgba(255,255,255,0.08); }
.player-status-icon { width:32px; text-align:center; font-weight:700; font-size:1.1rem; }
.player-row-name { flex:1; font-size:.95rem; font-weight:600; display:flex; align-items:center; gap:6px; }
.player-row-avatar { width:42px; height:42px; border:2px solid rgba(255,255,255,0.15); border-radius:50%; overflow:hidden; background:#222; display:flex; align-items:center; justify-content:center; }
.player-row-avatar img { width:100%; height:100%; object-fit:cover; }
.player-row-avatar.empty-circle { background: repeating-linear-gradient(45deg,#333 0,#333 6px,#3d3d3d 6px,#3d3d3d 12px); border-style:dashed; }
.team-card.full .player-row { filter: grayscale(.7); }
.team-card.full .player-row-name { color: var(--text-gray); }

@media (max-width: 900px) {
    .team-cards { flex-direction: column; align-items: stretch; }
    .team-card { width: 100%; }
    .team-players { grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); }
}

@media (max-width: 520px) {
    .player-slot { flex-direction: row; gap: 10px; }
    .player-avatar { width: 40px; height: 40px; }
    .player-name { font-size: 0.85rem; }
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
}

.stat-item span:first-child {
    color: var(--text-gray);
}

.stat-item span:last-child {
    font-weight: bold;
    color: var(--primary-color);
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Click Button - Removed as we now have targets */

/* Opponents - Hidden */
.opponents {
    display: none !important;
}

.opponent-card {
    background: var(--bg-card);
    padding: 15px 25px;
    border-radius: 10px;
    min-width: 150px;
    border: 2px solid var(--border-color);
}

.opponent-card.active {
    border-color: var(--success-color);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.opponent-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.opponent-score {
    font-size: 1.5em;
    color: var(--success-color);
}

/* Results */
.results-content {
    margin: 30px auto;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
}

/* Results Table Header */
.results-table-header {
    display: grid;
    grid-template-columns: 0.8fr 1.8fr 1fr 0.8fr 0.8fr 1fr;
    gap: 8px;
    padding: 15px 20px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 14px;
    margin-bottom: 15px;
    border: 1px solid rgba(168, 85, 247, 0.25);
    width: 100%;
    min-height: 60px;
}

.header-cell {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-color);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 8px;
}

.header-cell.rank-col {
    text-align: center;
}

.header-cell.username-col {
    text-align: center;
}

.header-cell.points-col {
    text-align: center;
}

.header-cell.stat-col {
    text-align: center;
    font-size: 0.85rem;
}

/* Result Item - Table Row */
.result-item {
    display: grid;
    grid-template-columns: 0.8fr 1.8fr 1fr 0.8fr 0.8fr 1fr;
    gap: 8px;
    background: var(--bg-dark);
    padding: 22px 20px;
    border-radius: 14px;
    margin-bottom: 16px;
    align-items: center;
    border-right: 4px solid var(--border-color);
    transition: all 0.3s ease;
    width: 100%;
    min-height: 80px;
}
/* Scroll hint styling */
.scroll-hint {
    font-size: 0.7rem;
    color: var(--text-gray);
    text-align: center;
    margin-top: 6px;
    opacity: 0.75;
    display: none;
}

/* الشاشات الصغيرة: sticky columns مع grid ثابت لمنع التزاحم */
@media (max-width: 900px) {
    .scroll-hint {
        display: block;
    }
    
    /* Grid ثابت بمسافات واضحة */
    .results-table-header,
    .result-item {
        grid-template-columns: 90px 150px 80px 80px 80px 100px;
        gap: 12px;
    }
    
    /* تثبيت عمود الترتيب */
    .results-table-header .header-cell.rank-col,
    .result-item .result-cell.rank-col {
        position: sticky;
        right: 0;
        z-index: 3;
        padding: 15px 20px;
        margin: -15px -20px -15px 0;
    }
    
    /* تثبيت عمود الاسم */
    .results-table-header .header-cell.username-col,
    .result-item .result-cell.username-col {
        position: sticky;
        right: 90px;
        z-index: 2;
        padding: 15px 10px;
        margin: -15px 0 -15px 0;
    }
    
    /* خلفية header columns - تطابق الجدول تماماً */
    .results-table-header .header-cell.rank-col,
    .results-table-header .header-cell.username-col {
        background: rgba(168, 85, 247, 0.1);
    }
    
    /* خلفية row columns - تطابق الجدول تماماً */
    .result-item .result-cell.rank-col,
    .result-item .result-cell.username-col {
        background: var(--bg-dark);
    }
    
    /* خلفية winner row */
    .result-item.winner .result-cell.rank-col,
    .result-item.winner .result-cell.username-col {
        background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-dark) 100%);
    }
}

/* Responsive adjustments للموبايل */
@media (max-width: 768px) {
    .results-content {
        padding: 0 10px;
    }
    
    .results-table-header,
    .result-item {
        padding: 12px 15px;
        gap: 10px;
        grid-template-columns: 80px 130px 70px 70px 70px 90px;
    }
    
    .header-cell {
        font-size: 0.75rem;
        padding: 0 4px;
    }
    
    .username-text {
        font-size: 0.85rem;
    }
    
    .stat-value {
        font-size: 0.9rem;
    }
    
    /* تعديل sticky positions */
    .results-table-header .header-cell.rank-col,
    .result-item .result-cell.rank-col {
        padding: 12px 15px;
        margin: -12px -15px -12px 0;
    }
    
    .results-table-header .header-cell.username-col,
    .result-item .result-cell.username-col {
        right: 80px;
        padding: 12px 8px;
        margin: -12px 0 -12px 0;
    }
}

@media (max-width: 480px) {
    .results-table-header,
    .result-item {
        padding: 10px 12px;
        gap: 8px;
        grid-template-columns: 70px 110px 60px 60px 60px 80px;
    }
    
    .header-cell {
        font-size: 0.65rem;
    }
    
    .username-text {
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 0.85rem;
    }
    
    /* تعديل sticky positions */
    .results-table-header .header-cell.rank-col,
    .result-item .result-cell.rank-col {
        padding: 10px 12px;
        margin: -10px -12px -10px 0;
    }
    
    .results-table-header .header-cell.username-col,
    .result-item .result-cell.username-col {
        right: 70px;
        padding: 10px 6px;
        margin: -10px 0 -10px 0;
    }
}

.result-item:hover {
    background: rgba(168, 85, 247, 0.05);
    transform: translateX(-5px);
}

.result-item.winner {
    border-right-color: var(--success-color);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
}

.result-item.winner:hover {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
}

/* Result Cells */
.result-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.result-cell.username-col {
    justify-content: center;
    gap: 10px;
}

.result-cell.rank-col {
    justify-content: center;
}

.result-cell.points-col {
    justify-content: center;
}

.result-cell.clicks-col {
    justify-content: center;
}

.result-cell.medal-col {
    justify-content: center;
    overflow: hidden;
}

.result-cell.stat-col {
    justify-content: center;
}

/* Rank Badge */
.rank-badge {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-gray);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.result-item.winner .rank-badge {
    color: var(--success-color);
    text-shadow: 0 0 10px var(--success-color);
}

/* Username Text */
.username-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-light);
}

.you-badge {
    font-size: 0.85rem;
    color: var(--primary-color);
    background: rgba(168, 85, 247, 0.15);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* Stat Values */
.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-light);
}

.stat-value.highlight {
    color: var(--success-color);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.stat-value.combo-value {
    color: var(--secondary-color);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* Medal now inside rank column */
.result-cell.rank-col svg {
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
    transition: transform 0.3s ease;
    max-width: 100%;
    height: auto;
    margin-left: 8px;
}
.result-item:hover .result-cell.rank-col svg { transform: scale(1.06) rotate(4deg); }

/* Old styles for backwards compatibility */
.result-rank {
    font-size: 2em;
    font-weight: bold;
    color: var(--text-gray);
    min-width: 50px;
}

.result-item.winner .result-rank {
    color: var(--success-color);
}

.result-info {
    flex: 1;
    text-align: right;
}

.result-score {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--success-color);
}

/* Waiting Room */
.waiting-animation {
    margin: 30px 0;
}
.waiting-animation.inline { margin: 10px 0 15px; display:flex; flex-direction:column; align-items:center; gap:10px; }
.waiting-animation.inline .spinner { margin:0; width:50px; height:50px; }
.team-selection-area .waiting-message { margin:0; font-size:0.85rem; color:var(--text-gray); }
/* Return to lobby button improved styling */
.return-btn {
    margin: 40px auto 10px;
    padding: 14px 42px;
    font-size: .95rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(168,85,247,0.9) 0%, rgba(139,92,246,0.85) 100%);
    color: #fff;
    border: none;
    border-radius: 32px;
    box-shadow: 0 6px 28px -8px rgba(168,85,247,0.45), 0 0 0 2px rgba(168,85,247,0.3);
    cursor: pointer;
    position: relative;
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.return-btn:hover {
    background: linear-gradient(135deg, rgba(168,85,247,1) 0%, rgba(139,92,246,0.95) 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 34px -10px rgba(168,85,247,0.55), 0 0 0 2px rgba(168,85,247,0.4);
}
.return-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 20px -6px rgba(168,85,247,0.55), 0 0 0 2px rgba(168,85,247,0.5);
}
.return-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.7), 0 0 0 6px rgba(168,85,247,0.6);
}

/* Unified Waiting Info Card */
.waiting-info-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 30px;
        padding: 28px 40px;
        background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.06) 60%, rgba(16,185,129,0.05) 100%);
        border: 2px solid rgba(168,85,247,0.3);
        border-radius: 22px;
        margin-bottom: 35px;
        position: relative;
}
.waiting-info-card::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 22px;
        padding: 2px;
        background: linear-gradient(120deg, rgba(168,85,247,0.5), rgba(99,102,241,0.4), rgba(16,185,129,0.4));
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor; mask-composite: exclude;
        pointer-events: none;
        opacity: .35;
}
.info-left { display:flex; align-items:center; gap:26px; }
.mode-icon-wrap { width:72px; height:72px; border-radius:18px; background: radial-gradient(circle at 35% 35%, rgba(168,85,247,0.6), rgba(39,18,64,0.4)); display:flex; align-items:center; justify-content:center; box-shadow:0 8px 24px -6px rgba(168,85,247,0.12); }
.mode-icon { font-size:2.2rem; }
.mode-text { display:flex; flex-direction:column; gap:10px; }
.mode-title { margin:0; font-size:1.9rem; font-weight:800; letter-spacing:.5px; }
.mode-meta { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.info-chip { background:rgba(255,255,255,0.07); padding:6px 14px; border-radius:14px; font-size:.85rem; font-weight:600; letter-spacing:.5px; color:var(--text-light); position:relative; }
.info-chip.type { background:rgba(99,102,241,0.25); }
.info-chip.duration { background:rgba(139,92,246,0.25); }
.info-chip#roomNumber { background:rgba(168,85,247,0.35); }
.info-sep { width:1px; height:18px; background:rgba(255,255,255,0.15); margin:0 4px; }
.info-right { display:flex; align-items:center; gap:30px; }

/* Progress Circle */
.players-progress { position:relative; width:74px; height:74px; display:flex; align-items:center; justify-content:center; }
.progress-ring { width:74px; height:74px; transform:rotate(-90deg); }
.ring-bg { fill:none; stroke:rgba(255,255,255,0.12); stroke-width:6; }
.ring-fg { fill:none; stroke:var(--primary-color); stroke-width:6; stroke-linecap:round; transition: stroke-dashoffset .4s ease; }
.progress-text { position:absolute; font-size:.8rem; font-weight:700; color:var(--text-light); letter-spacing:.5px; }

@media (max-width: 1100px) {
    .waiting-info-card { padding:24px 30px; }
    .mode-title { font-size:1.6rem; }
    .mode-icon-wrap { width:64px; height:64px; }
}
@media (max-width: 820px) {
    .waiting-info-card { flex-direction:column; text-align:center; padding:24px 28px; }
    .info-left { flex-direction:column; gap:18px; }
    .info-right { justify-content:center; }
    .mode-title { font-size:1.5rem; }
    .mode-meta { justify-content:center; }
}
@media (max-width: 520px) {
    .waiting-info-card { padding:20px 18px; gap:20px; }
    .mode-icon-wrap { width:56px; height:56px; }
    .mode-icon { font-size:2rem; }
    .mode-title { font-size:1.3rem; }
    .info-chip { font-size:.7rem; padding:5px 10px; }
    .players-progress { width:62px; height:62px; }
    .progress-ring { width:62px; height:62px; }
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.players-list {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

.player-item.ready {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3),
                inset 0 0 10px rgba(16, 185, 129, 0.1);
    animation: readyGlow 2s ease-in-out infinite;
}

@keyframes readyGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3),
                    inset 0 0 10px rgba(16, 185, 129, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.5),
                    inset 0 0 15px rgba(16, 185, 129, 0.2);
    }
}

.player-item .avatar {
    width: 35px;
    height: 35px;
}

.player-item .ready-badge {
    margin-right: auto;
    color: var(--success-color);
    font-weight: bold;
    font-size: 14px;
}

.waiting-actions {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
    align-items: center;
}

.waiting-actions .btn {
    flex: 0 1 auto;
    min-width: 160px;
    max-width: 220px;
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.3s ease;
}

#readyBtn {
    background: var(--gradient-secondary);
    border: 2px solid var(--secondary-color);
    color: white;
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 600;
}

#readyBtn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(16, 185, 129, 0.4),
        0 0 20px rgba(16, 185, 129, 0.3);
}

#readyBtn.ready {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
    }
}

#readyBtn:not(.ready) {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
}

#readyBtn:not(.ready):hover {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: white;
}

#readyBtn:disabled {
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(100, 100, 100, 0.4);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#readyBtn:disabled:hover {
    background: rgba(100, 100, 100, 0.3);
    transform: none;
    box-shadow: none;
}

.waiting-actions .btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    border: 2px solid var(--danger-color);
    color: white;
    padding: 12px 28px;
}

.waiting-actions .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(239, 68, 68, 0.4),
        0 0 20px rgba(239, 68, 68, 0.3);
}

.waiting-actions .btn-leave {
    background: var(--bg-card);
    border: 2px solid rgba(168, 85, 247, 0.3);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    transition: all 0.3s ease;
}

.waiting-actions .btn-leave:hover {
    border-color: var(--primary-color);
    background: rgba(168, 85, 247, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2);
}

.waiting-actions .btn-leave .btn-icon {
    font-size: 1.1rem;
}

.waiting-actions .btn-leave:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.waiting-actions .btn-leave:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .waiting-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .waiting-actions .btn {
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
}

/* Tournaments List */
#tournamentsList {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.tournament-item {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.tournament-item:hover {
    border-color: var(--primary-color);
    transform: translateX(-5px);
}

.tournament-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: var(--text-light);
}

.tournament-info {
    color: var(--text-gray);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.tournament-badge {
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 1024px) {
    /* Tablet & Mobile */
    .home-screen .header-content {
        gap: 20px;
        padding: 15px;
    }
    
    .nav-group {
        gap: 20px;
    }
    
    .lobby-content {
        padding: 2rem 1.5rem;
    }
    
    .lobby-title {
        font-size: 2rem;
    }
    
    .lobby-description {
        font-size: 1rem;
    }
    
    /* تحسين بطاقات الأوضاع في التابلت */
    .game-modes {
        flex-direction: row;
    }
}

@media (max-width: 900px) {
    /* Make game mode cards vertical on smaller screens */
    .game-modes {
        flex-direction: column !important;
        align-items: stretch;
    }
    
    .mode-card {
        width: 100%;
        max-width: 500px;
        margin: 0 auto 1.5rem auto;
    }
}

@media (max-width: 768px) {
    /* Mobile */
    .home-screen .header-content {
        padding: 12px 15px;
        gap: 15px;
    }
    
    .nav-group {
        gap: 15px;
    }
    
    .game-title {
        font-size: 0.9em;
    }
    
    .title-main {
        font-size: 1.1em;
    }
    
    .title-sub {
        font-size: 0.9em;
    }
    
    /* Login screen mobile */
    .login-container {
        padding: 2rem 1.5rem;
    }
    
    .game-logo-large {
        width: 100px;
        height: 100px;
    }
    
    .login-title .title-main {
        font-size: 2rem;
    }
    
    .login-title .title-sub {
        font-size: 1.4rem;
    }
    
    .login-description {
        font-size: 1rem;
    }
    
    .btn-login {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
    }
    
    .lobby-content {
        padding: 1.5rem 1rem;
    }
    
    .lobby-title {
        font-size: 1.75rem;
    }
    
    .lobby-description {
        font-size: 0.95rem;
    }
    
    .game-modes {
        flex-direction: row;
        gap: 1rem;
    }
    
    .mode-card {
        padding: 1.5rem;
    }
    
    .mode-icon {
        font-size: 3rem;
    }
    
    /* Results Table Mobile */
    .results-table-header,
    .result-item {
        grid-template-columns: 0.8fr 1.5fr 1fr 0.8fr 0.8fr 1fr !important;
        min-width: auto;
        padding: 15px 10px;
        font-size: 0.9rem;
    }
    
    .header-cell {
        font-size: 0.75rem;
        padding: 0 5px;
    }
    
    .result-cell {
        padding: 0 5px;
    }
    
    .rank-badge {
        font-size: 1.2em;
        min-width: 40px;
    }
    
    .username-text {
        font-size: 0.95rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .you-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    /* Small Mobile - Merged Section */
    .header {
        margin-bottom: 15px;
        border-radius: 15px;
    }
    
    .home-screen .header-content {
        padding: 10px 12px;
    }
    
    .home-screen .game-logo {
        width: 35px;
        height: 35px;
    }
    
    .container {
        padding: 8px;
    }
    
    .login-container {
        padding: 1.5rem 1rem;
    }
    
    .game-logo-large {
        width: 80px;
        height: 80px;
    }
    
    .login-title .title-main {
        font-size: 1.75rem;
    }
    
    .login-title .title-sub {
        font-size: 1.2rem;
    }
    
    .login-description {
        font-size: 0.9rem;
    }
    
    .btn-login {
        font-size: 1rem;
        padding: 0.9rem 1.25rem;
    }
    
    .lobby-content {
        padding: 1.25rem 0.75rem;
        border-radius: 15px;
    }
    
    .lobby-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .lobby-description {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }
    
    .game-arena {
        max-width: 100%;
        aspect-ratio: 4 / 3;
        border-radius: 15px;
    }
    
    .timer, .score, .combo {
        font-size: clamp(1.8rem, 5vw, 2em);
    }
    
    .stat-box {
        min-width: 80px;
    }
    
    .stat-label {
        font-size: 0.8em;
    }
    
    .card {
        border-radius: 15px;
    }
    
    .game-status {
        font-size: clamp(1.8rem, 6vw, 2em);
    }
    
    .game-container {
        padding: 15px 10px;
        gap: 15px;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .stat-item {
        justify-content: space-between;
        padding: 5px 0;
    }
    
    .opponents {
        gap: 10px;
    }
    
    .opponent-card {
        min-width: 120px;
        padding: 10px 15px;
    }
    
    .floating-text {
        font-size: 1.5em;
    }
    
    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .result-rank {
        font-size: 1.5em;
    }
    
    .tournament-item {
        padding: 15px;
    }
    
    .tournament-title {
        font-size: 1.1em;
    }
    
    .tournament-info {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    /* Small Mobile */
    .game-logo {
        width: 40px;
        height: 40px;
    }
    
    .game-header {
        padding: 10px;
    }
    
    .stat-box {
        min-width: 70px;
    }
    
    .timer, .score, .combo {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.7em;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    /* Results Table Small Mobile */
    .results-table-header,
    .result-item {
        grid-template-columns: 0.7fr 1.2fr 0.9fr 0.7fr 0.7fr 0.9fr !important;
        padding: 12px 8px;
        font-size: 0.85rem;
        overflow-x: auto;
    }
    
    .header-cell {
        font-size: 0.7rem;
        padding: 0 3px;
    }
    
    .header-cell.stat-col {
        font-size: 0.65rem;
    }
    
    .result-cell {
        padding: 0 3px;
    }
    
    .rank-badge {
        font-size: 1rem;
        min-width: 35px;
    }
    
    .username-text {
        font-size: 0.85rem;
    }
    
    .stat-value {
        font-size: 0.95rem;
    }
    
    .you-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }
    
    .rank-col svg {
        width: 24px;
        height: 24px;
    }
    
    .game-arena {
        height: calc(100vh - 320px);
        min-height: 280px;
        max-height: 400px;
        border-radius: 10px;
        margin: 10px 0;
    }
    
    .game-container {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .target {
        border-width: 2px;
    }
    
    .card {
        padding: 15px;
    }
}

@media (max-width: 360px) {
    /* Extra Small Mobile */
    .game-logo {
        width: 35px;
        height: 35px;
    }
    
    .stat-box {
        min-width: 60px;
    }
    
    .timer, .score, .combo {
        font-size: 1.3rem;
    }
    
    .game-arena {
        height: calc(100vh - 340px);
        min-height: 250px;
        max-height: 350px;
    }
    
    /* تحسين الأزرار للشاشات الصغيرة جداً */
    .btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .btn-large {
        padding: 12px 22px;
        font-size: 0.95rem;
    }
    
    /* تحسين بطاقات الأوضاع */
    .mode-icon {
        font-size: 2.5rem;
    }
    
    .mode-card {
        padding: 1.5rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .game-arena {
        height: 70vh;
    }
    
    .game-header {
        flex-direction: row;
        justify-content: space-around;
    }
    
    /* تحسين عرض الهيدر في الوضع الأفقي */
    .header {
        margin-bottom: 15px;
    }
    
    .logo-container {
        gap: 10px;
    }
    
    .game-logo {
        width: 40px;
        height: 40px;
    }
    
    /* تحسين البطاقات في الوضع الأفقي */
    .game-modes {
        flex-direction: row;
        gap: 1rem;
    }
    
    .mode-card {
        padding: 1.5rem 1rem;
    }
    
    .mode-icon {
        font-size: 3rem;
        margin-bottom: 0.5rem;
    }
}

/* Reduced Motion Support for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .game-logo,
    .mode-icon,
    .spinner {
        animation: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card,
    .mode-card,
    .header {
        border-width: 3px;
    }
    
    .btn {
        border-width: 3px;
    }
}

/* Dark Mode Override (if system prefers dark) */
@media (prefers-color-scheme: dark) {
    body {
        /* Already dark, just ensure it stays */
        background: var(--bg-dark);
    }
}

/* Print Styles */
@media print {
    .header-nav, 
    .burger-menu, 
    .btn,
    .menu-overlay,
    .session-alert-overlay {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Notification Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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