/* El Zulo Casino - Main Styles */
/* Professional Design inspired by Stake, Rainbet, Gamdom */

:root {
    /* Colors - Dark Theme */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1e1e2f;
    --bg-card-hover: #252540;
    --bg-input: #0d0d15;

    /* Accent Colors */
    --accent-primary: #00d4ff;
    --accent-secondary: #7b2cbf;
    --accent-tertiary: #ff006e;
    --accent-success: #00ff88;
    --accent-warning: #ffd000;
    --accent-danger: #ff4757;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #7b2cbf 100%);
    --gradient-secondary: linear-gradient(135deg, #7b2cbf 0%, #ff006e 100%);
    --gradient-gold: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    --gradient-success: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
    --gradient-danger: linear-gradient(135deg, #ff4757 0%, #ff006e 100%);
    --gradient-card: linear-gradient(145deg, #1e1e2f 0%, #16213e 100%);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6c6c7c;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.3);
    --shadow-glow-purple: 0 0 30px rgba(123, 44, 191, 0.3);

    /* Dimensions */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Z-indexes */
    --z-sidebar: 100;
    --z-topbar: 90;
    --z-modal: 1000;
    --z-toast: 1100;
    --z-preloader: 9999;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    border: none;
    outline: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-preloader);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: loaderSpin 1.5s linear infinite;
}

.loader-ring:nth-child(1) {
    border-top-color: var(--accent-primary);
    animation-delay: 0s;
}

.loader-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-right-color: var(--accent-secondary);
    animation-delay: 0.15s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-bottom-color: var(--accent-tertiary);
    animation-delay: 0.3s;
}

.loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader-text {
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    transition: width var(--transition-normal), transform var(--transition-normal);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-footer {
    opacity: 0;
    visibility: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    animation: logoFloat 3s ease-in-out infinite;
}

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

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity var(--transition-normal);
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 12px;
    transition: opacity var(--transition-normal);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.nav-badge.hot {
    background: var(--gradient-danger);
}

.nav-badge.new {
    background: var(--gradient-success);
    color: var(--bg-primary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.online-users {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.online-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* Top Bar */
.top-bar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: var(--z-topbar);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 16px;
    min-width: 280px;
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Balance Container */
.balance-container {
    display: flex;
    align-items: center;
}

.balance-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 12px 8px 16px;
    transition: all var(--transition-fast);
}

.balance-box:hover {
    border-color: var(--accent-primary);
}

.balance-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--bg-primary);
}

.balance-info {
    display: flex;
    flex-direction: column;
}

.balance-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-amount::before {
    content: '$';
    color: var(--accent-success);
}

.balance-deposit-btn {
    width: 36px;
    height: 36px;
    background: var(--accent-success);
    border-radius: var(--border-radius-sm);
    color: var(--bg-primary);
    font-size: 16px;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.balance-deposit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-avatar:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.user-level {
    font-size: 12px;
    color: var(--accent-primary);
}

.dropdown-items {
    padding: 8px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

/* Content Area */
.content-area {
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.modal {
    width: 90%;
    max-width: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 24px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-content {
    padding: 24px;
}

/* Win Notification */
.win-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.win-notification.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.win-content {
    text-align: center;
    animation: winPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.win-celebration {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 212, 255, 0.3) 0%, transparent 70%);
    animation: winGlow 1s ease-out;
}

.win-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-warning);
    text-shadow: 0 0 30px rgba(255, 208, 0, 0.5);
    margin-bottom: 16px;
}

.win-amount {
    font-size: 56px;
    font-weight: 800;
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.win-multiplier {
    font-size: 24px;
    color: var(--accent-primary);
    margin-top: 8px;
}

@keyframes winPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes winGlow {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: var(--z-toast);
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: toastSlide 0.3s ease;
    min-width: 300px;
}

.toast.success {
    border-left: 4px solid var(--accent-success);
}

.toast.error {
    border-left: 4px solid var(--accent-danger);
}

.toast.warning {
    border-left: 4px solid var(--accent-warning);
}

.toast.info {
    border-left: 4px solid var(--accent-primary);
}

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon { color: var(--accent-success); }
.toast.error .toast-icon { color: var(--accent-danger); }
.toast.warning .toast-icon { color: var(--accent-warning); }
.toast.info .toast-icon { color: var(--accent-primary); }

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-close {
    color: var(--text-muted);
    font-size: 18px;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

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

/* Utility Classes */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }
.text-muted { color: var(--text-muted); }

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

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-container {
    width: 90%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 12px;
    animation: logoFloat 3s ease-in-out infinite;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--border-radius);
}

.login-tab {
    flex: 1;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.login-tab:hover {
    color: var(--text-primary);
}

.login-tab.active {
    background: var(--gradient-primary);
    color: var(--text-primary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input {
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.login-btn {
    padding: 16px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-fast);
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.login-error {
    color: var(--accent-danger);
    font-size: 13px;
    text-align: center;
    min-height: 20px;
}

/* ============================================
   RANKING PAGE
   ============================================ */

.ranking-container {
    max-width: 900px;
    margin: 0 auto;
}

.ranking-header {
    text-align: center;
    margin-bottom: 32px;
}

.ranking-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.ranking-title i {
    color: var(--accent-warning);
    margin-right: 12px;
}

.ranking-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.ranking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
}

.ranking-tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.ranking-tab:hover {
    border-color: var(--accent-primary);
}

.ranking-tab.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--text-primary);
}

.ranking-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: var(--bg-card-hover);
}

.ranking-item.top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent);
}

.ranking-item.top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
}

.ranking-item.top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
}

.ranking-position {
    width: 50px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-muted);
}

.ranking-item.top-1 .ranking-position { color: #ffd700; }
.ranking-item.top-2 .ranking-position { color: #c0c0c0; }
.ranking-item.top-3 .ranking-position { color: #cd7f32; }

.ranking-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 16px;
    border: 2px solid var(--border-color);
}

.ranking-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-info {
    flex: 1;
}

.ranking-username {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.ranking-level {
    font-size: 12px;
    color: var(--accent-primary);
}

.ranking-stats {
    display: flex;
    gap: 32px;
    text-align: right;
}

.ranking-stat {
    display: flex;
    flex-direction: column;
}

.ranking-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.ranking-stat-value {
    font-size: 16px;
    font-weight: 700;
}

.ranking-stat-value.positive {
    color: var(--accent-success);
}

.ranking-stat-value.negative {
    color: var(--accent-danger);
}

/* ============================================
   BOXES PAGE
   ============================================ */

.boxes-container {
    max-width: 1200px;
    margin: 0 auto;
}

.boxes-header {
    text-align: center;
    margin-bottom: 32px;
}

.boxes-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.boxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.box-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.box-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.box-card.common { border-top: 4px solid #a0a0a0; }
.box-card.rare { border-top: 4px solid #00d4ff; }
.box-card.epic { border-top: 4px solid #9b59b6; }
.box-card.legendary { border-top: 4px solid #ffd700; }

.box-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    background: var(--bg-tertiary);
    position: relative;
}

.box-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, var(--bg-tertiary) 70%);
}

.box-card.legendary .box-image {
    animation: boxGlow 2s ease-in-out infinite;
}

@keyframes boxGlow {
    0%, 100% { box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: inset 0 0 50px rgba(255, 215, 0, 0.4); }
}

.box-info {
    padding: 20px;
}

.box-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.box-rarity {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.box-card.common .box-rarity { color: #a0a0a0; }
.box-card.rare .box-rarity { color: #00d4ff; }
.box-card.epic .box-rarity { color: #9b59b6; }
.box-card.legendary .box-rarity { color: #ffd700; }

.box-contents {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.box-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.box-price-amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-warning);
}

.box-open-btn {
    padding: 10px 24px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.box-open-btn:hover {
    transform: scale(1.05);
}

/* Box Opening Animation */
.box-opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.box-opening-content {
    text-align: center;
}

.box-opening-animation {
    font-size: 120px;
    animation: boxShake 0.5s ease infinite;
    margin-bottom: 24px;
}

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

.box-reward {
    animation: rewardPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes rewardPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.box-reward-title {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.box-reward-amount {
    font-size: 64px;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   SHOP PAGE
   ============================================ */

.shop-container {
    max-width: 1200px;
    margin: 0 auto;
}

.shop-header {
    text-align: center;
    margin-bottom: 32px;
}

.shop-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.shop-categories {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.shop-category {
    padding: 10px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.shop-category:hover {
    border-color: var(--accent-primary);
}

.shop-category.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--text-primary);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.shop-item {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-fast);
}

.shop-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}

.shop-item.owned {
    border-color: var(--accent-success);
}

.shop-item-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.shop-item-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.shop-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    min-height: 40px;
}

.shop-item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.shop-item-price i {
    color: var(--accent-warning);
}

.shop-item-price span {
    font-size: 18px;
    font-weight: 700;
}

.shop-buy-btn {
    width: 100%;
    padding: 12px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.shop-buy-btn:hover {
    box-shadow: var(--shadow-glow);
}

.shop-buy-btn.owned {
    background: var(--accent-success);
    color: var(--bg-primary);
    pointer-events: none;
}

/* ============================================
   PROFILE PAGE
   ============================================ */

.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}

.profile-avatar-section {
    position: relative;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-avatar-upload:hover {
    transform: scale(1.1);
}

.profile-avatar-upload input {
    display: none;
}

.profile-info {
    flex: 1;
}

.profile-username {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.profile-joined {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.profile-balance {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    padding: 12px 20px;
    border-radius: var(--border-radius);
}

.profile-balance i {
    color: var(--accent-warning);
    font-size: 20px;
}

.profile-balance span {
    font-size: 24px;
    font-weight: 700;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.profile-stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
}

.profile-stat-icon {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--accent-primary);
}

.profile-stat-value {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.profile-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.profile-section {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.profile-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-section-title i {
    color: var(--accent-primary);
}

.profile-upload-info {
    background: var(--bg-input);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.profile-upload-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.profile-upload-info .cost {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-warning);
}

/* ============================================
   HISTORY PAGE
   ============================================ */

.history-container {
    max-width: 900px;
    margin: 0 auto;
}

.history-header {
    margin-bottom: 24px;
}

.history-title {
    font-size: 28px;
    font-weight: 800;
}

.history-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.history-filter {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.history-filter:hover {
    border-color: var(--accent-primary);
}

.history-filter.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--text-primary);
}

.history-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: var(--bg-card-hover);
}

.history-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 16px;
}

.history-details {
    flex: 1;
}

.history-game {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.history-time {
    font-size: 12px;
    color: var(--text-muted);
}

.history-result {
    text-align: right;
}

.history-amount {
    font-size: 16px;
    font-weight: 700;
}

.history-amount.win {
    color: var(--accent-success);
}

.history-amount.win::before {
    content: '+';
}

.history-amount.loss {
    color: var(--accent-danger);
}

.history-multiplier {
    font-size: 12px;
    color: var(--text-muted);
}

/* Nav Badge Live */
.nav-badge.live {
    background: var(--accent-danger);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-box {
        min-width: auto;
        flex: 1;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ranking-stats {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 24px;
        margin: 16px;
    }

    .login-logo .logo-icon {
        font-size: 40px;
    }

    .login-logo h1 {
        font-size: 22px;
    }

    .ranking-item {
        flex-wrap: wrap;
        gap: 12px;
    }

    .ranking-position {
        width: 40px;
        font-size: 16px;
    }

    .ranking-avatar {
        width: 40px;
        height: 40px;
    }

    .ranking-stats {
        width: 100%;
        flex-direction: row;
        justify-content: space-around;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
    }

    .boxes-grid {
        grid-template-columns: 1fr;
    }

    .box-image {
        height: 140px;
        font-size: 60px;
    }

    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-categories {
        flex-wrap: wrap;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-username {
        font-size: 22px;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .profile-stat-card {
        padding: 16px;
    }

    .profile-stat-value {
        font-size: 20px;
    }

    .history-item {
        flex-wrap: wrap;
    }

    .history-result {
        width: 100%;
        text-align: left;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 640px) {
    .top-bar {
        padding: 0 16px;
    }

    .search-box {
        display: none;
    }

    .balance-info {
        display: none;
    }

    .balance-box {
        padding: 8px;
    }

    .content-area {
        padding: 16px;
    }

    .login-tabs {
        flex-direction: column;
    }

    .login-tab {
        text-align: center;
    }

    .ranking-tabs {
        flex-direction: column;
        width: 100%;
    }

    .ranking-tab {
        text-align: center;
    }

    .ranking-title {
        font-size: 24px;
    }

    .boxes-title,
    .shop-title,
    .profile-username {
        font-size: 20px;
    }

    .box-info {
        padding: 16px;
    }

    .box-price {
        flex-direction: column;
        gap: 12px;
    }

    .box-open-btn {
        width: 100%;
    }

    .shop-grid {
        grid-template-columns: 1fr;
    }

    .shop-item {
        padding: 16px;
    }

    .profile-balance {
        width: 100%;
        justify-content: center;
    }

    .profile-section {
        padding: 16px;
    }

    .history-filters {
        flex-wrap: wrap;
    }

    .history-filter {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }

    .box-opening-animation {
        font-size: 80px;
    }

    .box-reward-amount {
        font-size: 48px;
    }

    .win-amount {
        font-size: 40px;
    }

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

@media (max-width: 480px) {
    .content-area {
        padding: 12px;
    }

    .profile-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .profile-stat-card {
        padding: 12px;
    }

    .profile-stat-value {
        font-size: 18px;
    }

    .profile-stat-label {
        font-size: 10px;
    }

    .ranking-item {
        padding: 12px 16px;
    }

    .box-card {
        border-radius: var(--border-radius);
    }

    .toast {
        min-width: auto;
        width: calc(100% - 32px);
        right: 16px;
    }
}

/* ============================================
   LIVE WINS CHAT
   ============================================ */
.wins-chat {
    width: 280px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    z-index: var(--z-sidebar);
}

.wins-chat-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(123, 44, 191, 0.1) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--accent-primary);
}

.wins-chat-header i {
    color: var(--accent-warning);
}

.wins-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wins-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.wins-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.wins-chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
}

.win-chat-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    animation: winChatSlide 0.3s ease-out;
    transition: all 0.2s ease;
}

.win-chat-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(-3px);
}

.win-chat-item.big-win {
    background: linear-gradient(135deg, rgba(255, 208, 0, 0.15) 0%, rgba(255, 140, 0, 0.1) 100%);
    border-color: var(--accent-warning);
}

.win-chat-item.mega-win {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 212, 255, 0.1) 100%);
    border-color: var(--accent-success);
    animation: winChatSlide 0.3s ease-out, megaWinGlow 1s ease-in-out infinite alternate;
}

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

@keyframes megaWinGlow {
    from { box-shadow: 0 0 5px rgba(0, 255, 136, 0.3); }
    to { box-shadow: 0 0 15px rgba(0, 255, 136, 0.5); }
}

.win-chat-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.win-chat-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.win-chat-username {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.win-chat-game {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

.win-chat-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.win-chat-amount {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-success);
}

.win-chat-mult {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-warning);
    background: rgba(255, 208, 0, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
}

/* Adjust main content for wins chat */
.main-content {
    margin-right: 280px;
}

/* Small win popup */
.small-win-popup {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--accent-success);
    border-radius: 16px;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 40px rgba(0, 255, 136, 0.3);
}

.small-win-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.small-win-icon {
    font-size: 28px;
}

.small-win-info {
    text-align: left;
}

.small-win-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.small-win-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-success);
}

.small-win-mult {
    font-size: 14px;
    color: var(--accent-warning);
    margin-left: 8px;
}

@media (max-width: 1400px) {
    .wins-chat {
        width: 240px;
    }
    .main-content {
        margin-right: 240px;
    }
}

@media (max-width: 1100px) {
    .wins-chat {
        display: none;
    }
    .main-content {
        margin-right: 0;
    }
}

/* ============================================
   SHOP PAGE
   ============================================ */
.shop-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.shop-section {
    padding: 24px;
}

.shop-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.shop-grid {
    display: grid;
    gap: 16px;
}

.color-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.avatar-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.shop-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.shop-item.owned {
    border-color: var(--accent-success);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05) 0%, var(--bg-secondary) 100%);
}

.color-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shop-item-name {
    font-weight: 700;
    font-size: 15px;
}

.shop-item-price {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.shop-item-price i {
    color: var(--accent-warning);
}

.shop-buy-btn {
    padding: 10px 20px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.shop-buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.shop-balance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-warning);
}

.shop-balance i {
    font-size: 36px;
}

/* ============================================
   IMPROVED RANKING
   ============================================ */
.ranking-card {
    max-width: 800px;
    margin: 0 auto;
}

.ranking-header-row {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ranking-col-pos {
    width: 60px;
}

.ranking-col-player {
    flex: 1;
}

.ranking-col-balance {
    width: 150px;
    text-align: right;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: var(--bg-card-hover);
}

.ranking-item.me {
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--accent-primary);
}

.ranking-item.top-three {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08) 0%, transparent 100%);
}

.ranking-position {
    width: 60px;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
}

.ranking-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ranking-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.ranking-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-name {
    font-size: 16px;
    font-weight: 700;
}

.ranking-balance {
    width: 150px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.ranking-balance i {
    color: var(--accent-warning);
    font-size: 14px;
}

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

    .shop-item {
        flex-wrap: wrap;
    }

    .shop-buy-btn {
        width: 100%;
        margin-top: 10px;
    }

    .ranking-header-row {
        display: none;
    }

    .ranking-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .ranking-position {
        width: 50px;
    }

    .ranking-player {
        flex: 1;
        min-width: 150px;
    }

    .ranking-balance {
        width: auto;
    }
}

/* ============================================
   LOBBY - Beautiful Home Screen
   ============================================ */

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

/* Hero Section */
.lobby-hero {
    position: relative;
    background: linear-gradient(135deg, rgba(123, 44, 191, 0.3) 0%, rgba(0, 212, 255, 0.2) 50%, rgba(255, 0, 110, 0.2) 100%);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 32px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lobby-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

.lobby-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(123, 44, 191, 0.2) 0%, transparent 70%);
    animation: heroGlow 6s ease-in-out infinite alternate-reverse;
}

@keyframes heroGlow {
    from { transform: scale(1) rotate(0deg); opacity: 0.5; }
    to { transform: scale(1.2) rotate(10deg); opacity: 1; }
}

.lobby-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.lobby-welcome {
    flex: 1;
    min-width: 280px;
}

.lobby-welcome h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, #a0a0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lobby-welcome p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.lobby-balance-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 220px;
}

.lobby-balance-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.lobby-balance-amount {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lobby-balance-currency {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Section Headers */
.lobby-section {
    margin-bottom: 32px;
}

.lobby-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.lobby-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.lobby-section-title i {
    color: var(--accent-primary);
}

.lobby-section-badge {
    background: var(--gradient-danger);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s ease-in-out infinite;
}

/* Games Grid */
.lobby-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.lobby-games-grid.featured {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Game Card */
.lobby-game-card {
    position: relative;
    background: var(--gradient-card);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.05);
    group: game-card;
}

.lobby-game-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 212, 255, 0.2);
}

.lobby-game-card.featured {
    background: linear-gradient(145deg, #252540 0%, #1a1a2e 100%);
}

.lobby-game-card.featured:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(123, 44, 191, 0.3);
}

.lobby-game-image {
    position: relative;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(123, 44, 191, 0.1) 0%, rgba(0, 212, 255, 0.1) 100%);
    overflow: hidden;
}

.lobby-game-card.featured .lobby-game-image {
    height: 180px;
}

.lobby-game-icon {
    font-size: 64px;
    transition: transform 0.4s ease;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.lobby-game-card.featured .lobby-game-icon {
    font-size: 80px;
}

.lobby-game-card:hover .lobby-game-icon {
    transform: scale(1.15) rotate(-5deg);
}

.lobby-game-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.lobby-game-badge.hot {
    background: var(--gradient-danger);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.lobby-game-badge.new {
    background: var(--gradient-success);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.lobby-game-badge.live {
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.lobby-game-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
}

.lobby-game-card:hover .lobby-game-overlay {
    opacity: 1;
}

.lobby-play-btn {
    background: var(--gradient-primary);
    color: white;
    padding: 10px 28px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.lobby-game-card:hover .lobby-play-btn {
    transform: translateY(0);
}

.lobby-play-btn:hover {
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.lobby-game-info {
    padding: 16px;
    text-align: center;
}

.lobby-game-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.lobby-game-provider {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick Stats */
.lobby-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.lobby-stat-card {
    background: var(--gradient-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.lobby-stat-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.lobby-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.lobby-stat-icon.users {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 212, 255, 0.1) 100%);
    color: var(--accent-primary);
}

.lobby-stat-icon.wins {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 255, 136, 0.1) 100%);
    color: var(--accent-success);
}

.lobby-stat-icon.jackpot {
    background: linear-gradient(135deg, rgba(255, 208, 0, 0.2) 0%, rgba(255, 208, 0, 0.1) 100%);
    color: var(--accent-warning);
}

.lobby-stat-info h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.lobby-stat-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .lobby-hero {
        padding: 24px;
    }

    .lobby-hero-content {
        flex-direction: column;
        text-align: center;
    }

    .lobby-welcome h1 {
        font-size: 1.8rem;
    }

    .lobby-balance-card {
        width: 100%;
    }

    .lobby-games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .lobby-game-image {
        height: 100px;
    }

    .lobby-game-icon {
        font-size: 48px;
    }

    .lobby-game-info {
        padding: 12px;
    }

    .lobby-game-name {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .lobby-games-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lobby-games-grid.featured {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   AD SYSTEM STYLES
   ============================================ */

.watch-ad-section {
    background: var(--gradient-card);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.watch-ad-section h3 {
    color: var(--accent-warning);
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.watch-ad-section h3 i {
    margin-right: 8px;
}

.watch-ad-section p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.watch-ad-section p strong {
    color: var(--accent-success);
}

.watch-ad-btn {
    background: var(--gradient-gold);
    color: #000;
    font-weight: 700;
    padding: 14px 32px;
    font-size: 1.1rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.watch-ad-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.5);
}

.watch-ad-btn i {
    margin-right: 8px;
}

.ad-cooldown {
    color: var(--accent-warning);
    font-size: 0.9rem;
    margin-top: 12px;
}

/* Ad Modal */
.ad-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.ad-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 32px;
    max-width: 800px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

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

.ad-modal-header {
    margin-bottom: 24px;
}

.ad-modal-header h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.ad-timer {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.ad-container {
    background: #000;
    border-radius: var(--border-radius-sm);
    padding: 20px;
    margin-bottom: 24px;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-modal-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.ad-modal-footer p {
    color: var(--text-secondary);
    font-size: 1rem;
}

#adClaimBtn {
    background: var(--gradient-success);
    color: #000;
    font-weight: 700;
    padding: 14px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#adClaimBtn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

#adClaimBtn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 255, 136, 0.5);
}

.close-ad-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-ad-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .ad-modal-content {
        padding: 20px;
    }

    .ad-container iframe {
        transform: scale(0.8);
        transform-origin: center;
    }
}

/* ============================================
   ARCADE GAMES STYLES
   ============================================ */

.arcade-game {
    text-align: center;
}

.arcade-game h2 {
    margin-bottom: 5px;
}

.game-subtitle {
    color: var(--accent-success);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* MINESWEEPER */
.ms-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ms-controls select {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
}

.ms-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.ms-board {
    display: grid;
    gap: 2px;
    background: var(--bg-tertiary);
    padding: 8px;
    border-radius: var(--border-radius-sm);
    margin: 0 auto 16px;
    max-width: fit-content;
}

.ms-cell {
    width: 28px;
    height: 28px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.1s;
    user-select: none;
}

.ms-cell:hover:not(.revealed) {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.ms-cell.revealed {
    background: var(--bg-secondary);
    cursor: default;
}

.ms-cell.mine {
    background: var(--accent-danger);
}

.ms-cell[data-count="1"] { color: #3498db; }
.ms-cell[data-count="2"] { color: #27ae60; }
.ms-cell[data-count="3"] { color: #e74c3c; }
.ms-cell[data-count="4"] { color: #9b59b6; }
.ms-cell[data-count="5"] { color: #f39c12; }
.ms-cell[data-count="6"] { color: #1abc9c; }
.ms-cell[data-count="7"] { color: #e91e63; }
.ms-cell[data-count="8"] { color: #607d8b; }

.ms-status {
    font-size: 1.3rem;
    margin-top: 16px;
}

/* SOLITAIRE */
.sol-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.sol-board {
    background: #0a5f38;
    border-radius: var(--border-radius);
    padding: 20px;
    min-height: 500px;
}

.sol-top-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.sol-stock-waste {
    display: flex;
    gap: 15px;
}

.sol-foundations {
    display: flex;
    gap: 10px;
}

.sol-pile {
    width: 70px;
    height: 100px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    position: relative;
}

.sol-tableau {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.sol-tableau-pile {
    height: 350px;
}

.sol-card {
    width: 66px;
    height: 96px;
    background: #fff;
    border-radius: 6px;
    position: absolute;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.1s;
    box-sizing: border-box;
}

.sol-card:hover {
    transform: translateY(-3px);
}

.sol-card.back {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #1a237e 100%);
    background-size: 10px 10px;
}

.sol-card.back::after {
    content: '🎴';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
}

.sol-card.red {
    color: #c0392b;
}

.sol-card.black {
    color: #2c3e50;
}

.sol-rank {
    font-size: 1.2rem;
    font-weight: bold;
}

.sol-suit {
    font-size: 1.5rem;
    align-self: flex-end;
}

.sol-status {
    font-size: 1.3rem;
    margin-top: 16px;
}

/* PINBALL */
.pb-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 16px;
    font-size: 1.2rem;
}

#pbCanvas {
    display: block;
    margin: 0 auto 16px;
    border-radius: var(--border-radius);
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.pb-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
}

.pb-paddle-btn {
    min-width: 100px;
}

.pb-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Badge FREE styling */
.lobby-game-badge.free {
    background: var(--gradient-success);
    color: #000;
}

/* Responsive arcade games */
@media (max-width: 600px) {
    .ms-cell {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }

    .sol-pile, .sol-card {
        width: 45px;
        height: 65px;
    }

    .sol-card {
        width: 41px;
        height: 61px;
        padding: 3px;
    }

    .sol-rank {
        font-size: 0.9rem;
    }

    .sol-suit {
        font-size: 1rem;
    }

    .sol-tableau-pile {
        height: 250px;
    }

    .sol-card.back::after {
        font-size: 1.2rem;
    }

    #pbCanvas {
        width: 100%;
        max-width: 350px;
        height: auto;
    }

    .pb-controls {
        flex-wrap: wrap;
    }

    .pb-paddle-btn {
        min-width: 80px;
        font-size: 0.85rem;
    }
}

/* ============================================
   ALL IN / MAX BUTTON STYLES
   ============================================ */

.bet-btn.allin,
.bet-mult-btn.allin,
button.allin,
.quick-amounts .allin {
    background: linear-gradient(135deg, #ff006e 0%, #ff4757 100%) !important;
    color: #fff !important;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(255, 0, 110, 0.3);
}

.bet-btn.allin:hover,
.bet-mult-btn.allin:hover,
button.allin:hover,
.quick-amounts .allin:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 0, 110, 0.5);
}

.bet-btn.allin:active,
.bet-mult-btn.allin:active,
button.allin:active,
.quick-amounts .allin:active {
    transform: scale(0.98);
}

/* ============================================
   TEXAS HOLD'EM POKER STYLES
   ============================================ */

.poker-game {
    text-align: center;
}

.poker-lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.poker-tables-list {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
    min-height: 100px;
}

.poker-table-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.poker-table-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(5px);
}

.poker-buy-in {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.poker-table-container {
    background: linear-gradient(135deg, #0a5f38 0%, #0d4a2c 100%);
    border-radius: 150px;
    padding: 40px;
    position: relative;
    min-height: 400px;
    border: 10px solid #2a1810;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.3);
}

.poker-community {
    text-align: center;
    margin-bottom: 30px;
}

.poker-pot {
    font-size: 1.3rem;
    color: #ffd700;
    margin-bottom: 15px;
}

.poker-community-cards {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.poker-card {
    width: 60px;
    height: 85px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    font-weight: bold;
}

.poker-card.empty {
    background: rgba(0,0,0,0.2);
    border: 2px dashed rgba(255,255,255,0.2);
}

.poker-card.back {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

.poker-card.back::after {
    content: '🎴';
    font-size: 2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.poker-card.red {
    color: #c0392b;
}

.poker-card.black {
    color: #2c3e50;
}

.card-rank {
    font-size: 1.1rem;
}

.card-suit {
    font-size: 1.5rem;
    text-align: right;
}

.poker-seats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.poker-seat {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 15px;
    min-width: 120px;
    transition: all 0.3s;
}

.poker-seat.occupied {
    background: rgba(0,0,0,0.5);
}

.poker-seat.me {
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.poker-seat.active {
    border: 2px solid var(--accent-warning);
    box-shadow: 0 0 20px rgba(255, 208, 0, 0.5);
}

.poker-seat.folded {
    opacity: 0.5;
}

.seat-cards {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 10px;
}

.seat-cards .poker-card {
    width: 40px;
    height: 55px;
    font-size: 0.8rem;
    position: relative;
}

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

.seat-name {
    display: block;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.seat-chips {
    display: block;
    color: var(--accent-warning);
    font-size: 0.9rem;
}

.seat-bet {
    color: var(--accent-success);
    font-weight: bold;
    margin-top: 5px;
}

.poker-my-cards {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.poker-my-cards .poker-card {
    width: 80px;
    height: 110px;
    font-size: 1.2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.poker-controls {
    margin-top: 25px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.poker-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.poker-btn {
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.poker-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.poker-btn.fold {
    background: var(--gradient-danger);
    color: #fff;
}

.poker-btn.check {
    background: var(--bg-tertiary);
    color: #fff;
    border: 1px solid var(--border-color);
}

.poker-btn.call {
    background: var(--gradient-primary);
    color: #fff;
}

.poker-btn.raise {
    background: var(--gradient-gold);
    color: #000;
}

.poker-btn.allin {
    background: linear-gradient(135deg, #ff006e 0%, #ff4757 100%);
    color: #fff;
}

.poker-raise-slider {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

.poker-raise-slider input[type="range"] {
    width: 200px;
}

.poker-raise-slider input[type="number"] {
    width: 100px;
    padding: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
}

.poker-status {
    margin-top: 15px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.action-btn.danger {
    background: var(--gradient-danger);
}

.no-tables {
    color: var(--text-muted);
    padding: 20px;
}

@media (max-width: 768px) {
    .poker-table-container {
        border-radius: 30px;
        padding: 20px;
    }

    .poker-card {
        width: 45px;
        height: 65px;
    }

    .poker-my-cards .poker-card {
        width: 60px;
        height: 85px;
    }

    .poker-seat {
        min-width: 80px;
        padding: 10px;
    }

    .poker-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
}

/* ============================================
   KART RACING STYLES
   ============================================ */

.kart-game {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
}

.kart-lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kart-lobby-header h3 {
    color: #fff;
    margin: 0;
}

.kart-rooms-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    min-height: 100px;
}

.kart-room-item {
    display: grid;
    grid-template-columns: 1fr 1fr 80px 100px;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
}

.kart-room-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.room-name {
    font-weight: 600;
    color: #fff;
}

.room-track {
    color: #aaa;
}

.room-players {
    color: #00ff88;
    font-weight: 600;
}

.room-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-align: center;
}

.room-status.waiting {
    background: #00ff8822;
    color: #00ff88;
}

.room-status.racing {
    background: #ff880022;
    color: #ff8800;
}

.no-rooms {
    color: #888;
    text-align: center;
    padding: 30px;
}

.kart-character-select {
    margin-top: 20px;
}

.kart-character-select h4 {
    color: #fff;
    margin-bottom: 15px;
}

.kart-characters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.kart-character {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.kart-character:hover {
    background: rgba(255, 255, 255, 0.1);
}

.kart-character.selected {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.kart-char-emoji {
    font-size: 2rem;
    margin-bottom: 5px;
}

.kart-char-name {
    color: #fff;
    font-size: 0.9rem;
}

/* Waiting Room */
.kart-waiting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kart-room-code {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 8px 15px;
    border-radius: 20px;
    color: #fff;
    font-weight: 600;
    font-family: monospace;
    letter-spacing: 2px;
}

.kart-players-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.kart-player-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed #444;
    border-radius: 10px;
    transition: all 0.3s;
}

.kart-player-slot.filled {
    border-style: solid;
    background: rgba(255, 255, 255, 0.1);
}

.kart-player-slot.empty {
    opacity: 0.5;
}

.slot-emoji {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.slot-name {
    color: #fff;
    font-weight: 600;
    margin-bottom: 5px;
}

.slot-host {
    font-size: 0.8rem;
    color: #ffd700;
}

.kart-track-select {
    margin-bottom: 20px;
}

.kart-track-select h4 {
    color: #fff;
    margin-bottom: 10px;
}

.kart-track-select select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
}

.kart-waiting-actions {
    display: flex;
    gap: 15px;
}

.kart-waiting-actions .action-btn {
    flex: 1;
}

/* Race HUD */
.kart-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-bottom: 10px;
}

.kart-hud-left,
.kart-hud-right {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.kart-hud span {
    color: #fff;
    font-weight: 600;
}

.kart-hud-center {
    text-align: center;
}

.kart-countdown {
    font-size: 3rem;
    font-weight: 800;
    color: #ff4444;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
    animation: pulseCountdown 1s ease-in-out;
}

.kart-countdown.show {
    display: block;
}

@keyframes pulseCountdown {
    0% { transform: scale(1.5); opacity: 0; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.8; }
}

#kartTimer {
    font-size: 1.5rem;
    font-family: monospace;
    color: #00ff88;
}

.kart-item-slot {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas */
#kartCanvas {
    width: 100%;
    max-width: 800px;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
    background: #2d5a27;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

/* Mobile Controls */
.kart-controls-mobile {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.kart-btn-mobile {
    padding: 15px;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #444;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.kart-btn-mobile:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ff88;
}

.kart-btn-item {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
}

/* Results */
#kartResults {
    text-align: center;
}

#kartResults h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.kart-results-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.kart-result-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.kart-result-row.me {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
}

.result-pos {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffd700;
}

.result-name {
    color: #fff;
    font-weight: 600;
}

.result-time {
    color: #00ff88;
    font-family: monospace;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .kart-characters {
        grid-template-columns: repeat(2, 1fr);
    }

    .kart-players-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kart-room-item {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }

    .kart-controls-mobile {
        display: grid;
    }

    #kartCanvas {
        height: 400px;
    }

    .kart-waiting-actions {
        flex-direction: column;
    }
}

/* MKPC iframe styles */
.mkpc-container {
    width: 100%;
    height: 80vh;
    min-height: 600px;
    background: #000;
}

.mkpc-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.mkpc-info {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
}

.mkpc-info p {
    color: #aaa;
    margin: 5px 0;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .mkpc-container {
        height: 60vh;
        min-height: 400px;
    }
}

/* MKPC controls info */
.mkpc-controls-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    flex-wrap: wrap;
}

.mkpc-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 0.9rem;
}

.mkpc-control span {
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 10px;
    border-radius: 5px;
    font-family: monospace;
}

/* MKPC Help Modal */
.mkpc-help {
    text-align: left;
}

.mkpc-help h4 {
    color: #00ff88;
    margin-bottom: 15px;
}

.mkpc-help ol {
    padding-left: 20px;
    line-height: 1.8;
}

.mkpc-help li {
    margin-bottom: 10px;
}

.mkpc-help ul {
    margin-top: 8px;
    padding-left: 20px;
    font-size: 0.9rem;
    color: #aaa;
}

.mkpc-help a {
    color: #00ff88;
}

.mkpc-note {
    margin-top: 15px;
    padding: 10px 15px;
    background: rgba(0, 255, 136, 0.1);
    border-left: 3px solid #00ff88;
    border-radius: 5px;
}

/* MKPC Loading state */
.mkpc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: #fff;
    gap: 20px;
}

.mkpc-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.mkpc-loading p {
    font-size: 1.1rem;
    color: #aaa;
}

/* MKPC Lobby */
.mkpc-lobby {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mkpc-lobby-section {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.mkpc-lobby-section h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.mkpc-lobby-section p {
    color: #888;
    margin-bottom: 15px;
}

.mkpc-lobby-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #444, transparent);
}

.mkpc-btn-large {
    padding: 15px 40px !important;
    font-size: 1.1rem !important;
    width: 100%;
    max-width: 300px;
}

.mkpc-btn-primary {
    background: linear-gradient(135deg, #00ff88, #00cc66) !important;
    color: #000 !important;
}

.mkpc-game-link {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 10px;
    border: 1px solid #00ff88;
}

.mkpc-game-link p {
    color: #00ff88 !important;
    margin-bottom: 10px;
}

.mkpc-link-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.mkpc-link-box input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
}

.mkpc-link-box button {
    padding: 12px 20px;
    background: #00ff88;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.mkpc-join-box {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.mkpc-join-box input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
}

.mkpc-game-header {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .mkpc-lobby {
        padding: 15px;
    }

    .mkpc-btn-large {
        padding: 12px 25px !important;
    }

    .mkpc-link-box,
    .mkpc-join-box {
        flex-direction: column;
    }
}

/* MKPC Mode Selection */
.mkpc-mode-select,
.mkpc-submode {
    padding: 30px;
}

.mkpc-mode-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mkpc-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 40px;
    min-width: 200px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mkpc-mode-btn:hover {
    transform: translateY(-5px);
    border-color: #00ff88;
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.1));
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
}

.mkpc-mode-btn.mkpc-mode-online {
    border-color: rgba(0, 136, 255, 0.3);
}

.mkpc-mode-btn.mkpc-mode-online:hover {
    border-color: #0088ff;
    background: linear-gradient(145deg, rgba(0, 136, 255, 0.2), rgba(0, 136, 255, 0.1));
    box-shadow: 0 10px 30px rgba(0, 136, 255, 0.2);
}

.mkpc-mode-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.mkpc-mode-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
}

.mkpc-mode-desc {
    font-size: 0.9rem;
    color: #888;
}

.mkpc-back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #888;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.mkpc-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.mkpc-online-room {
    margin-top: 30px;
    padding: 25px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    border-radius: 15px;
    text-align: center;
}

.mkpc-online-room h3 {
    color: #00ff88;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.mkpc-online-room p {
    color: #aaa;
    margin-bottom: 15px;
}

.mkpc-join-room {
    text-align: center;
}

.mkpc-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0 20px;
}

.mkpc-divider::before,
.mkpc-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #444, transparent);
}

.mkpc-divider span {
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .mkpc-mode-buttons {
        flex-direction: column;
        align-items: center;
    }

    .mkpc-mode-btn {
        width: 100%;
        max-width: 280px;
        padding: 25px 30px;
    }
}

/* MKPC Online Panel */
.mkpc-online-panel {
    padding: 20px;
}

.mkpc-online-section {
    text-align: center;
    margin-bottom: 20px;
}

.mkpc-create-room-box {
    padding: 20px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 15px;
    border: 1px dashed rgba(0, 255, 136, 0.3);
}

.mkpc-hint {
    color: #888;
    font-size: 0.85rem;
    margin-top: 10px;
}

.mkpc-online-users {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
}

.mkpc-no-users,
.mkpc-loading-users {
    text-align: center;
    color: #666;
    padding: 30px;
}

.mkpc-user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mkpc-user-card.has-room {
    border-color: rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.1);
}

.mkpc-user-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mkpc-user-name {
    color: #fff;
    font-weight: bold;
}

.mkpc-user-status {
    font-size: 0.8rem;
    color: #888;
}

.mkpc-user-card.has-room .mkpc-user-status {
    color: #00ff88;
}

.mkpc-btn-join {
    background: linear-gradient(135deg, #00ff88, #00cc66) !important;
    color: #000 !important;
}

.mkpc-btn-invite {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.mkpc-btn-invite:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.mkpc-btn-cancel {
    background: rgba(255, 100, 100, 0.2) !important;
    color: #ff6666 !important;
    border: 1px solid rgba(255, 100, 100, 0.3) !important;
}

.mkpc-waiting-room {
    margin-top: 20px;
    padding: 25px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    border-radius: 15px;
    text-align: center;
}

.mkpc-waiting-room h3 {
    color: #00ff88;
    margin-bottom: 15px;
}

.mkpc-waiting-info {
    margin-bottom: 20px;
}

.mkpc-waiting-info p {
    color: #aaa;
    margin: 5px 0;
}

.mkpc-room-key {
    font-family: monospace;
    color: #fff !important;
}

.mkpc-room-key span {
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 1.2rem;
}

/* MKPC Invitation Popup */
.mkpc-invitation-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.mkpc-invitation-content {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(0, 255, 136, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mkpc-invitation-content h3 {
    color: #00ff88;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.mkpc-invitation-content p {
    color: #ccc;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.mkpc-invitation-content strong {
    color: #fff;
}

.mkpc-invitation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.mkpc-invitation-buttons button {
    min-width: 120px;
}
