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

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

:root {
    /* Color Palette - Dark Gaming Theme */
    --color-bg-main: #0f172a;      /* Deep Slate */
    --color-bg-secondary: #1e293b; /* Lighter Slate */
    --color-bg-tertiary: #334155;  /* Surface */
    
    --color-text-primary: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-text-accent: #fbbf24;  /* Amber Gold */
    
    --color-primary: #d97706;      /* Button Primary */
    --color-primary-hover: #b45309;
    --color-secondary: #2563eb;    /* Links/Info */
    
    --color-border: #334155;
    --color-success: #10b981;
    
    /* Typography */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.6;
    
    /* Spacing & Layout */
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 15px rgba(217, 119, 6, 0.4);
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-family-base);
    background-color: var(--color-bg-main);
    color: var(--color-text-primary);
    line-height: var(--line-height-base);
    overflow-x: hidden;
}

/* =========================================
   2. Typography
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
    padding: var(--spacing-md) 0;
    text-align: center;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: var(--spacing-xs);
    margin-top: var(--spacing-md);
    display: inline-block;
}

h3 {
    font-size: 1.25rem;
    color: var(--color-text-accent);
    margin-top: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-secondary);
    text-align: justify;
}

strong {
    color: var(--color-text-primary);
}

a {
    color: var(--color-text-accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--color-primary);
}

ul, ol {
    margin-bottom: var(--spacing-sm);
    padding-left: 1.5rem;
}

li {
    margin-bottom: var(--spacing-xs);
    color: var(--color-text-secondary);
}

/* =========================================
   3. Layout Utilities
   ========================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Handling the inline style flex container from HTML */
div[style*="display:flex"] {
    gap: var(--spacing-md);
    align-items: flex-start;
}

.joy-left {
    flex: 3; /* Main content takes more space */
    min-width: 0; /* Fix flex overflow */
}

.main-right {
    flex: 1; /* Sidebar */
    min-width: 280px;
}

/* =========================================
   4. Header & Navigation
   ========================================= */
header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

/* Desktop Header Logo Area */
.men1 a {
    display: block;
    width: 180px;
    height: 50px;
    background-color: var(--color-bg-secondary); /* Placeholder for logo */
    background-image: url('path/to/logo.png'); /* Assumed logic */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: var(--radius-sm);
    position: relative;
}
/* Fallback if no image */
.men1 a::after {
    content: 'JOYCASINO';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-text-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Mobile Header */
header.mob {
    display: none; /* Hidden by default on desktop */
}

/* =========================================
   5. Hero Section (.joyl-slide)
   ========================================= */
.joyl-slide {
    position: relative;
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    margin: var(--spacing-md) 0;
    text-align: center;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

/* Abstract decorations */
.joyl-slide::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.1) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

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

.joyl-slide .container {
    position: relative;
    z-index: 2;
}

/* Hero Buttons from HTML (empty 'a' tags styled as buttons) */
.joyl-slide > a.href {
    display: inline-block;
    padding: 0.8em 2em;
    margin: 0.5em;
    background: linear-gradient(to bottom, #fbbf24, #d97706);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
    position: relative;
    z-index: 5;
    cursor: pointer;
}

.joyl-slide > a.href:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.5);
}

.joyl-slide > a.href:nth-of-type(1)::before { content: "Играть Сейчас"; }
.joyl-slide > a.href:nth-of-type(2)::before { content: "Демо Режим"; background: none; }
.joyl-slide > a.href:nth-of-type(2) {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-primary);
}

/* =========================================
   6. Content Styles
   ========================================= */

/* Sidebar / Main-Right */
.main-right {
    background: var(--color-bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    position: sticky;
    top: 100px; /* Below sticky header */
}

.main-right a.href {
    display: block;
    margin-top: var(--spacing-sm);
    padding: 1rem;
    background: var(--color-primary);
    color: white;
    text-align: center;
    border-radius: var(--radius-sm);
    font-weight: bold;
}
.main-right a.href::before { content: "Перейти на зеркало"; }

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: var(--spacing-md);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

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

th {
    background: var(--color-bg-tertiary);
    color: var(--color-text-accent);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

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

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Form Elements (if any implicit) */
input, select, textarea {
    background: var(--color-bg-main);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    width: 100%;
    margin-bottom: var(--spacing-sm);
}

input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

/* =========================================
   7. Footer
   ========================================= */
footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-lg);
    text-align: center;
}

.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.menu-fo {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* =========================================
   8. UI Elements & Scroll to Top
   ========================================= */
#scroller {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition-fast);
}

#scroller:hover {
    transform: translateY(-5px) scale(1.1);
}

.b-top-but {
    font-size: 0; /* Hide text, use icon */
}

#scroller::after {
    content: "▲";
    color: white;
    font-size: 1.2rem;
}

/* =========================================
   9. Mobile Styles
   ========================================= */
@media screen and (max-width: 768px) {
    /* Hide Main Header, Show Mobile Header */
    header {
        display: none;
    }
    
    header.mob {
        display: block;
        background: var(--color-bg-secondary);
        padding: var(--spacing-sm);
        position: relative;
    }

    /* Mobile Header Layout */
    header.mob .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .menn {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-xs);
    }

    .men3, .men4 {
        padding: 0.75rem;
        background: var(--color-bg-tertiary);
        color: var(--color-text-primary);
        text-align: center;
        border-radius: var(--radius-sm);
        border: 1px solid var(--color-border);
        transition: var(--transition-fast);
    }

    .men4 { /* Registration button style */
        background: var(--color-primary);
        font-weight: bold;
        border: none;
    }

    /* Layout Adjustments */
    div[style*="display:flex"] {
        flex-direction: column !important; /* Force stack */
    }
    
    .joy-left, .main-right {
        width: 100%;
    }
    
    .main-right {
        margin-top: var(--spacing-md);
        position: static;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    /* Table scroll for mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .joyl-slide {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .joyl-slide > a.href {
        width: 100%;
        margin: 0.25rem 0;
        display: block;
        text-align: center;
    }
}

/* =========================================
   10. Image Filters & Effects
   ========================================= */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.image-filters-enabled img:hover {
    filter: brightness(1.1) contrast(1.1);
    transform: scale(1.01);
}

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

.main > div {
    animation: fadeIn 0.6s ease-out forwards;
}
