/* ===== COMMON STYLES ===== */
/* Общие стили для всех страниц */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

html.modal-open,
body.modal-open {
    height: 100%;
    overflow: hidden;
}

body.dark {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif;
    line-height: 1.2;
    font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

/* ===== UTILITIES ===== */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .container { padding: 0 3rem; }
}

.gradient-text {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: white;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

/* ===== CARDS ===== */
.card {
    background: var(--card-light);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

body.dark .card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(124, 58, 237, 0.3);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-primary {
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: white;
}

/* ===== ANIMATIONS ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(10deg); }
}

.floating-chess {
    position: absolute;
    font-size: 4rem;
    opacity: 0.15;
    animation: float 8s ease-in-out infinite;
    user-select: none;
    pointer-events: none;
    z-index: 1;
}

.floating-chess:nth-child(1) { animation-delay: 0s; top: 10%; left: 5%; }
.floating-chess:nth-child(2) { animation-delay: 2s; top: 60%; right: 10%; }
.floating-chess:nth-child(3) { animation-delay: 4s; top: 80%; left: 15%; }
.floating-chess:nth-child(4) { animation-delay: 6s; top: 30%; right: 20%; }

@keyframes logoGlow {
    0%, 100% { 
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 215, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.1); 
    }
    50% { 
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.2); 
    }
}

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

/* ===== LOGO ===== */
.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s;
    position: relative;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, #1f2937, #000000);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 215, 0, 0.4);
    animation: logoGlow 3s ease-in-out infinite;
}

.chess-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background: 
        linear-gradient(45deg, #ffffff 25%, transparent 25%),
        linear-gradient(-45deg, #ffffff 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ffffff 75%),
        linear-gradient(-45deg, transparent 75%, #ffffff 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

.logo-sparkle {
    position: absolute;
    width: 0.5rem;
    height: 0.5rem;
    background: #ffd700;
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
}

.logo-sparkle:nth-child(1) { top: 0.5rem; left: 0.5rem; animation-delay: 0s; }
.logo-sparkle:nth-child(2) { top: 0.5rem; right: 0.5rem; animation-delay: 0.5s; }
.logo-sparkle:nth-child(3) { bottom: 0.5rem; left: 0.5rem; animation-delay: 1s; }
.logo-sparkle:nth-child(4) { bottom: 0.5rem; right: 0.5rem; animation-delay: 1.5s; }

