/* GGaming - Modern High-Contrast White, Red & Blue Esports CSS
   Fast, Lightweight, Responsive & 1,000+ CCU Ready */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&family=Rajdhani:wght@600;700&family=Cairo:wght@600;700&display=swap');

:root {
    --bg-main: #F4F6FB;
    --bg-surface: #FFFFFF;
    --bg-subtle: #EDF2F7;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-focus: #0066FF;
    
    --brand-red: #FF2E4D;
    --brand-red-hover: #E01E3C;
    --brand-blue: #0066FF;
    --brand-blue-hover: #0052CC;
    --brand-dark-blue: #0F172A;
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-white: #FFFFFF;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.10);
    --shadow-red: 0 6px 20px rgba(255, 46, 77, 0.35);
    --shadow-blue: 0 6px 20px rgba(0, 102, 255, 0.35);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

.counter-font {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
}

a {
    color: var(--brand-blue);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--brand-blue-hover);
}

/* Header & Navbar */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.65rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--brand-dark-blue);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-logo span.red {
    color: var(--brand-red);
}

.brand-logo span.blue {
    color: var(--brand-blue);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-menu a {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: all 0.2s;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--brand-blue);
    background: #EFF6FF;
}

.search-box {
    position: relative;
    width: 170px;
    transition: width 0.25s ease;
    flex-shrink: 1;
}

.search-box:focus-within {
    width: 220px;
}

.search-box input {
    width: 100%;
    padding: 0.45rem 0.85rem 0.45rem 2.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    background: var(--bg-surface);
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
}

.search-box i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.wallet-badge {
    background: linear-gradient(135deg, var(--brand-blue), #0044BB);
    color: var(--text-white);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.25);
    text-decoration: none;
    flex-shrink: 0;
}

.wallet-badge:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 102, 255, 0.35);
}

.wallet-badge .plus-btn {
    background: var(--brand-red);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    font-weight: 800;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--brand-red);
    color: var(--text-white);
    box-shadow: var(--shadow-red);
}

.btn-primary:hover {
    background: var(--brand-red-hover);
    color: #fff;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--brand-blue);
    color: var(--text-white);
    box-shadow: var(--shadow-blue);
}

.btn-secondary:hover {
    background: var(--brand-blue-hover);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--text-secondary);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

/* Main Container */
.main-wrapper {
    flex: 1;
    max-width: 1320px;
    width: 100%;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.hero-slider {
    position: relative;
    background: linear-gradient(135deg, #FFFFFF 0%, #F4F8FF 55%, #FFF5F6 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 102, 255, 0.15);
    overflow: hidden;
    color: var(--text-primary);
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hero-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, var(--brand-red), var(--brand-blue));
}

.hero-content {
    max-width: 680px;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 46, 77, 0.08);
    border: 1px solid rgba(255, 46, 77, 0.25);
    color: var(--brand-red);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--brand-dark-blue);
    line-height: 1.2;
    margin-bottom: 0.85rem;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.hero-online-box {
    z-index: 2;
    text-align: center;
    background: #FFFFFF;
    padding: 1.75rem 2.25rem;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(0, 102, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0, 102, 255, 0.08);
    min-width: 230px;
}

.hero-online-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.hero-online-val {
    font-size: 3.5rem;
    color: var(--success);
    line-height: 1;
    font-weight: 800;
}

.hero-online-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 0.5rem;
}

.hero-online-status .status-dot {
    color: var(--success);
    margin-right: 0.25rem;
}

/* Stats Bar */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-surface);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-icon i { display: none; }
.stat-icon svg { display: block; }

.stat-icon.red { background: rgba(255, 46, 77, 0.1); color: var(--brand-red); }
.stat-icon.blue { background: rgba(0, 102, 255, 0.1); color: var(--brand-blue); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.gold { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.stat-val {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-lbl {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Game Cards Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 1.1rem;
    margin-bottom: 2.5rem;
}

.game-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.12);
    border-color: var(--brand-blue);
}

.game-cover {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #0F172A;
}

.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-cover img {
    transform: scale(1.05);
}

.game-badge-pvp {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--brand-red);
    color: #fff;
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 700;
}

.game-badge-online {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #00FFA3;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.game-badge-online span.dot {
    width: 5px;
    height: 5px;
    background: #00FFA3;
    border-radius: 50%;
}

.game-info {
    padding: 0.85rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
}

.game-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.game-summary {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.2em;
}

/* Flash Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

table.data-table th, table.data-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--bg-subtle);
    font-size: 0.9rem;
}

table.data-table th {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 700;
}

table.data-table tr:last-child td {
    border-bottom: none;
}

/* Footer */
.site-footer {
    background: #0F172A;
    color: #94A3B8;
    padding: 3.5rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 3px solid var(--brand-red);
}

.footer-grid {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: #94A3B8;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--brand-red);
}

.footer-bottom {
    max-width: 1320px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    max-width: 540px;
    width: 90%;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 992px) {
    .nav-menu { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero-slider { flex-direction: column; text-align: center; }
    .hero-actions { justify-content: center; }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2rem; }
}
