/* ============================================================================
   KVK BATTLE PORTAL - NEW INDEX CSS
   Strategic Kingdom vs Kingdom Intelligence Portal
   ============================================================================ */

:root {
    /* Primary Brand Colors */
    --primary-gold: #eab308;
    --primary-gold-light: #fbbf24;
    --primary-gold-dark: #d97706;
    
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.95);
    --bg-glass: rgba(30, 41, 59, 0.7);
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Camp Colors */
    --fire-color: #ef4444;
    --earth-color: #f59e0b;
    --water-color: #3b82f6;
    --wind-color: #8b5cf6;
    
    /* Alliance Colors */
    --fire-water-gradient: linear-gradient(135deg, #ef4444, #3b82f6);
    --earth-wind-gradient: linear-gradient(135deg, #f59e0b, #8b5cf6);
    
    /* Status Colors */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* UI Elements */
    --border: rgba(71, 85, 105, 0.3);
    --border-light: rgba(71, 85, 105, 0.2);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(234, 179, 8, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

/* ============================================================================
   HEADER SECTION
   ============================================================================ */

.header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(145deg, var(--bg-card), var(--bg-glass));
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(234, 179, 8, 0.05), transparent);
    animation: shimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.beta-badge {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); 
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5); 
    }
}

.prokingdoms-credit {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    color: var(--bg-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
}

.prokingdoms-credit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.5);
    color: var(--bg-primary);
}

.header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 20px rgba(234, 179, 8, 0.5);
}

.header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.kvk-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.kvk-id {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    color: var(--bg-primary);
    padding: 8px 16px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 1rem;
}

.last-update {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

.main-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================================
   SECTION 1: OVERVIEW CARDS
   ============================================================================ */

.overview-section {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-glass));
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border);
    backdrop-filter: blur(15px);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.metric-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 16px;
    padding: 25px;
    border: 2px solid var(--card-border);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-border);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--card-border);
}

.players-card { --card-border: var(--success-color); }
.kp-card { --card-border: var(--error-color); }
.camps-card { --card-border: var(--warning-color); }
.kingdoms-card { --card-border: var(--info-color); }

.card-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--card-border), rgba(255,255,255,0.1));
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card-content {
    flex: 1;
}

.card-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--card-border);
    margin-bottom: 5px;
}

.card-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ============================================================================
   SECTION 2: LEADERBOARDS
   ============================================================================ */

.leaderboards-section {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-glass));
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border);
    backdrop-filter: blur(15px);
}

.tables-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 30px;
}

.table-wrapper {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
}

.table-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.table-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.table-header h3 {
    color: var(--primary-gold);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.table-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

.table-content {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-table th {
    background: rgba(234, 179, 8, 0.1);
    color: var(--primary-gold);
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--primary-gold);
}

.leaderboard-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-weight: 500;
}

.leaderboard-table tbody tr:hover {
    background: rgba(234, 179, 8, 0.05);
}

.rank-cell {
    font-weight: bold;
    color: var(--primary-gold);
    text-align: center;
    width: 60px;
}

.governor-cell {
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kingdom-cell {
    color: var(--text-secondary);
    text-align: center;
    width: 80px;
}

.camp-cell {
    text-align: center;
    font-size: 1.2rem;
    width: 60px;
}

.value-cell {
    font-weight: bold;
    text-align: right;
    color: var(--success-color);
}

.loading-cell {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* Top 3 highlighting */
.leaderboard-table tbody tr:nth-child(1) .rank-cell { color: #ffd700; }
.leaderboard-table tbody tr:nth-child(2) .rank-cell { color: #c0c0c0; }
.leaderboard-table tbody tr:nth-child(3) .rank-cell { color: #cd7f32; }

/* ============================================================================
   SECTION 3: ALLIANCE ANALYSIS
   ============================================================================ */

.alliance-section {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-glass));
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border);
    backdrop-filter: blur(15px);
}

.alliance-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
}

.alliance-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 20px;
    padding: 30px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.alliance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--alliance-gradient);
    border-radius: 20px;
    padding: 2px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

.alliance-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.fire-water-alliance {
    --alliance-gradient: var(--fire-water-gradient);
}

.earth-wind-alliance {
    --alliance-gradient: var(--earth-wind-gradient);
}

.alliance-header {
    text-align: center;
    margin-bottom: 25px;
}

.alliance-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.camp-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--camp-bg);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.camp-icon.fire { --camp-bg: var(--fire-color); }
.camp-icon.earth { --camp-bg: var(--earth-color); }
.camp-icon.water { --camp-bg: var(--water-color); }
.camp-icon.wind { --camp-bg: var(--wind-color); }

.alliance-connector {
    font-size: 1.5rem;
    color: var(--primary-gold);
    font-weight: bold;
}

.alliance-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.alliance-header p {
    color: var(--text-secondary);
    font-style: italic;
}

.alliance-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-item {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
}

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

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-gold);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-text {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    color: var(--bg-primary);
    padding: 15px 25px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 8px 25px rgba(234, 179, 8, 0.4);
    animation: vsGlow 2s ease-in-out infinite;
}

@keyframes vsGlow {
    0%, 100% { box-shadow: 0 8px 25px rgba(234, 179, 8, 0.4); }
    50% { box-shadow: 0 12px 35px rgba(234, 179, 8, 0.6); }
}

.advantage-indicator {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1), rgba(245, 158, 11, 0.05));
    border: 2px solid rgba(234, 179, 8, 0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.advantage-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-gold);
}

/* ============================================================================
   PROKINGDOMS FOOTER
   ============================================================================ */

.prokingdoms-footer {
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(234, 179, 8, 0.2);
    margin-top: 20px;
}

.prokingdoms-logo {
    color: var(--primary-gold);
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.prokingdoms-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.prokingdoms-link {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.prokingdoms-link:hover {
    color: var(--primary-gold-light);
    text-shadow: 0 0 5px rgba(234, 179, 8, 0.5);
}

/* ============================================================================
   GUAN YU AI CHAT POPUP
   ============================================================================ */

.chat-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(234, 179, 8, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: var(--bg-primary);
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(234, 179, 8, 0.6);
}

.chat-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.chat-toggle-btn:hover::before {
    transform: translateX(100%);
}

.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--error-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    animation: notificationPulse 2s infinite;
}

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

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: linear-gradient(145deg, var(--bg-primary), var(--bg-secondary));
    border-radius: 15px;
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--primary-gold);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s ease-out;
}

.chat-window.open {
    display: flex;
}

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

.chat-header {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    color: var(--bg-primary);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: headerShimmer 3s ease-in-out infinite;
}

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

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-gold);
    font-size: 20px;
    border: 2px solid var(--bg-primary);
}

.ai-name {
    font-size: 16px;
    font-weight: bold;
}

.ai-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

.chat-close {
    background: none;
    border: none;
    color: var(--bg-primary);
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.chat-close:hover {
    background: rgba(15, 23, 42, 0.1);
    transform: rotate(90deg);
}

.chat-status {
    background: rgba(15, 23, 42, 0.9);
    color: var(--success-color);
    padding: 8px 20px;
    font-size: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(234, 179, 8, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(145deg, var(--bg-primary), var(--bg-secondary));
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(234, 179, 8, 0.5);
    border-radius: 3px;
}

.message {
    margin-bottom: 15px;
    animation: messageSlide 0.3s ease-out;
}

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

.message-content {
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    color: var(--bg-primary);
    margin-left: auto;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}

.ai-message .message-content {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    color: var(--text-primary);
    margin-right: auto;
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-input-area {
    padding: 15px 20px;
    background: rgba(30, 41, 59, 0.9);
    border-top: 1px solid rgba(234, 179, 8, 0.2);
}

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(234, 179, 8, 0.3);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    resize: none;
    min-height: 40px;
    max-height: 80px;
    font-family: inherit;
}

.chat-input:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
    background: rgba(15, 23, 42, 0.95);
}

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

.send-button {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    color: var(--bg-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.4);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: none;
    padding: 10px 16px;
    color: var(--primary-gold);
    font-style: italic;
    font-size: 12px;
    animation: typing 1.5s ease-in-out infinite;
}

.typing-indicator.show {
    display: block;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.6; }
    30% { opacity: 1; }
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .alliance-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .vs-divider {
        order: 2;
    }
    
    .fire-water-alliance {
        order: 1;
    }
    
    .earth-wind-alliance {
        order: 3;
    }
    
    .tables-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 25px;
        margin-bottom: 30px;
    }
    
    .header-top {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .kvk-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .metric-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .card-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
    
    .alliance-stats {
        grid-template-columns: 1fr;
    }
    
    .chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        right: -15px;
        bottom: 80px;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .tables-container {
        padding: 0 10px;
    }
    
    .leaderboard-table {
        font-size: 0.8rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 4px;
    }
    
    .chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 90px);
        right: -10px;
    }
    
    .chat-toggle-btn {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.error-state {
    color: var(--error-color) !important;
}

.success-state {
    color: var(--success-color) !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border: rgba(255, 255, 255, 0.6);
        --border-light: rgba(255, 255, 255, 0.4);
        --text-secondary: #e2e8f0;
    }
}

/* Print styles */
@media print {
    .chat-popup,
    .header-top {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .main-content {
        gap: 20px;
    }
}
