* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #08040f;
    --bg-secondary: rgba(20, 18, 40, 0.3);
    --bg-container: rgba(20, 18, 40, 0.3);
    --text-primary: #dbdbdb;
    --text-secondary: #8a86b5;
    --accent-color: #a29bfe;
    --accent-hover: #8a7df0;
    --border-color: rgba(120, 119, 198, 0.2);
    --border-hover: rgba(140, 130, 220, 0.4);
    --shadow-color: rgba(0, 0, 0, 0.6);
    --card-shadow: 0 20px 40px var(--shadow-color);
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --blur-amount: blur(12px);
    --gradient-primary: radial-gradient(ellipse at center, #08040f 0%, #000000 100%);
    --gradient-text: linear-gradient(45deg, #a29bfe, #6c5ce7, #fd79a8, #e84393, #a29bfe);
}

[data-theme="light"] {
    --bg-primary: #f0f2ff;
    --bg-secondary: rgba(255, 255, 255, 0.85);
    --bg-container: rgba(255, 255, 255, 0.9);
    --text-primary: #333344;
    --text-secondary: #666688;
    --accent-color: #6c5ce7;
    --accent-hover: #5b4bd4;
    --border-color: rgba(108, 92, 231, 0.2);
    --border-hover: rgba(108, 92, 231, 0.4);
    --shadow-color: rgba(108, 92, 231, 0.15);
    --gradient-primary: radial-gradient(ellipse at center, #f0f2ff 0%, #e0e4ff 100%);
    --gradient-text: linear-gradient(45deg, #6c5ce7, #a29bfe, #74b9ff, #00cec9, #6c5ce7);
}

html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
    min-height: 100vh;
    background: var(--gradient-primary);
    cursor: default;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--text-primary);
    transition: background-color 0.5s ease;
}

canvas#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#container {
    position: relative;
    z-index: 1;
    border-radius: 24px;
    width: calc(100% - 40px);
    max-width: 800px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 30px;
    background: var(--bg-container);
    backdrop-filter: var(--blur-amount);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.logo-button {
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    background: var(--gradient-text);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 10px;
    animation: textGradient 8s ease infinite;
    text-shadow: 0 2px 10px rgba(162, 155, 254, 0.3);
    line-height: 1.2;
}

@keyframes textGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.logo-button:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.title-section {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.title-section .subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 3vw, 1rem);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
    line-height: 1.5;
}

.layout-button {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    padding: 22px 25px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    backdrop-filter: blur(5px);
    transform: translateZ(0);
}

.layout-button i {
    font-size: 1.4rem;
    color: var(--accent-color);
    transition: var(--transition);
    width: 24px;
    text-align: center;
}

.layout-button span {
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition);
}

.layout-button:hover {
    background: rgba(50, 48, 85, 0.5);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(140, 130, 220, 0.1);
    border-color: var(--border-hover);
}

.layout-button:hover i {
    color: var(--accent-hover);
    transform: scale(1.1);
}

.layout-button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transition-duration: 0.1s;
}

.layout-button.register {
    background: linear-gradient(135deg, rgba(80, 70, 180, 0.4), rgba(100, 90, 220, 0.4));
    border-color: rgba(120, 110, 240, 0.3);
}

.main-image {
    width: 100%;
    max-width: 590px;
    height: auto;
    aspect-ratio: 590/300;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    margin: 10px auto;
    display: block;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    object-fit: cover;
}

.main-image:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(120, 119, 198, 0.25);
    border-color: var(--border-hover);
}

.button-row {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 600px;
    flex-wrap: wrap;
}

.layout-button.half {
    flex: 1 1 calc(50% - 10px);
    min-width: 200px;
    height: auto;
    min-height: 65px;
}

.info-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    max-width: 600px;
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.info-item i {
    color: var(--accent-color);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.info-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    font-weight: 400;
    max-width: 200px;
    line-height: 1.4;
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(30deg);
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.theme-toggle:active {
    transform: scale(0.95) rotate(0deg);
}

@media (max-width: 768px) {
    #container {
        margin: 20px auto;
        padding: 30px 20px;
        gap: 18px;
        width: calc(100% - 20px);
    }
    
    .layout-button {
        padding: 20px;
    }
    
    .button-row {
        flex-direction: column;
        gap: 18px;
    }
    
    .layout-button.half {
        flex: 1 1 100%;
    }
    
    .info-panel {
        flex-direction: column;
        gap: 25px;
        padding: 20px;
    }
    
    .theme-toggle {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    #container {
        padding: 25px 15px;
        gap: 15px;
    }
    
    .logo-button {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .layout-button {
        padding: 18px;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .layout-button:hover {
        transform: none;
    }
    
    .layout-button:active {
        transform: scale(0.96);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#container > * {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

#container > *:nth-child(1) { animation-delay: 0.1s; }
#container > *:nth-child(2) { animation-delay: 0.2s; }
#container > *:nth-child(3) { animation-delay: 0.3s; }
#container > *:nth-child(4) { animation-delay: 0.4s; }
#container > *:nth-child(5) { animation-delay: 0.5s; }
#container > *:nth-child(6) { animation-delay: 0.6s; }
#container > *:nth-child(7) { animation-delay: 0.7s; }
#container > *:nth-child(8) { animation-delay: 0.8s; }

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    
    #container > * {
        animation: none;
        opacity: 1;
    }
}