
/* =========================================
   1. Reset & Normalization
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. CSS Variables (Custom Properties)
   ========================================= */
:root {
    /* Palette */
    --bg-body: #0b1120;
    --bg-card: #1e293b;
    --bg-card-hover: #263345;
    --bg-header: rgba(15, 23, 42, 0.95);
    
    --primary: #f59e0b;
    --primary-hover: #d97706;
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    --success: #10b981;
    --danger: #ef4444;

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --h1-size: clamp(2rem, 5vw, 3.5rem);
    --h2-size: clamp(1.5rem, 4vw, 2.5rem);
    --h3-size: clamp(1.2rem, 3vw, 1.75rem);

    /* Layout */
    --container-width: 1200px;
    --gap: 1.5rem;
    --radius: 1rem;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --glow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* =========================================
   3. Typography & Global Styles
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 { font-size: var(--h1-size) !important; color: var(--primary); text-transform: uppercase; letter-spacing: -0.02em; }
h2 { font-size: var(--h2-size); margin-top: 2.5rem; border-left: 4px solid var(--accent); padding-left: 1rem; }
h3 { font-size: var(--h3-size); margin-top: 2rem; color: var(--accent); }

p { margin-bottom: 1.5rem; color: var(--text-muted); }
strong { color: var(--text-main); }
a { color: var(--accent); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--accent-hover); }

ul, ol { margin-bottom: 1.5rem; padding-left: 1.5rem; color: var(--text-muted); }
li { margin-bottom: 0.5rem; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--bg-card); border-radius: 5px; border: 2px solid var(--bg-body); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* =========================================
   4. Header & Navigation
   ========================================= */
header {
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

/* Logo Area */
.men1 a {
    display: block;
    width: 150px;
    height: 50px;
    background: url('path-to-logo.png') no-repeat center/contain; /* Placeholder logic */
    background-color: rgba(255,255,255,0.05); /* Fallback */
    border-radius: var(--radius);
}

/* Mobile Header Logic */
header:not(.mob) { display: block; }
header.mob { display: none; }

/* Navigation Items */
.menn {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.men3, .men4 {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.men3 {
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.2);
}
.men3:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(6, 182, 212, 0.1);
}

.men4 {
    background: var(--primary);
    color: var(--text-dark);
    box-shadow: var(--glow);
}
.men4:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* =========================================
   5. Hero Section & Main Layout
   ========================================= */
.main {
    padding: 2rem 0;
    animation: fadeIn 0.8s ease-out;
}

/* Hero Slider/Banner Placeholder */
.joyl-slide {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    background: linear-gradient(45deg, var(--bg-card), var(--bg-body));
    min-height: 300px; /* Placeholder height */
}

/* Main Layout Grid Fix */
/* Overriding inline styles for structure */
div[style*="display:flex"] {
    display: grid !important;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    align-items: start;
}

.joy-left {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

/* Sidebar (Right Column) */
.main-right {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(15, 23, 42, 0.5));
    border: 1px solid var(--accent);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    position: sticky;
    top: 100px;
}
.main-right b {
    display: block;
    font-size: 1.2rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* =========================================
   6. Components: Tables, Buttons, Cards
   ========================================= */

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    background: var(--bg-card-hover);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

th {
    background: rgba(0,0,0,0.3);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Buttons */
.btn-box {
    margin: 2rem 0;
    text-align: center;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2.5rem;
    background: linear-gradient(90deg, var(--primary), #eab308);
    color: var(--text-dark);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    box-shadow: var(--glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, #eab308, var(--primary));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 25px rgba(245, 158, 11, 0.4);
    color: #fff;
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: translateY(-1px); }

/* Game Lists / Content Boxes */
.joy-left ul li {
    position: relative;
    padding-left: 1.5rem;
}
.joy-left ul li::before {
    content: '►';
    color: var(--primary);
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.8rem;
}

/* Interactive Elements (Generic Forms) */
input, select, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-body);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--text-main);
    margin-bottom: 1rem;
    transition: border-color 0.3s;
}
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* =========================================
   7. Footer & Back to Top
   ========================================= */
footer {
    background: #020617;
    padding: 3rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.menu-fo {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Back to Top Button */
#scroller {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 99;
}
#scroller:hover {
    background: var(--accent-hover);
    transform: translateY(-5px);
}
.b-top-but { font-size: 0; } /* Hide text, use icon preferably */
#scroller::after {
    content: '↑';
    font-size: 1.5rem;
    font-weight: bold;
}

/* =========================================
   8. Animations
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   9. Media Queries (Responsive Design)
   ========================================= */
@media screen and (max-width: 992px) {
    div[style*="display:flex"] {
        grid-template-columns: 1fr;
    }
    .main-right {
        position: static;
        margin-top: 2rem;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --container-width: 100%;
        --radius: 0.5rem;
    }
    
    header { display: none; }
    header.mob {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.8rem 0;
    }

    /* Mobile Header Layout */
    header.mob .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .menn {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .men3, .men4 {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    /* Override table behavior for mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .joy-left {
        padding: 1.5rem;
    }

    h1 { margin-bottom: 1rem !important; }
    
    .btn {
        width: 100%;
    }
}
