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

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --highlight-color: #e94560;
    --text-color: #ffffff;
    --bg-color: #1a1a2e;
    --card-bg: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    transition: all 0.5s ease;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--accent-color), var(--highlight-color));
    padding: 2rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Navigation */
nav {
    background: var(--secondary-color);
    padding: 1rem 0;
    backdrop-filter: blur(10px);
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

nav a:hover {
    background: var(--accent-color);
    border-color: var(--highlight-color);
    transform: translateY(-2px);
}

/* Main content */
main {
    padding: 2rem 0;
}

section {
    margin-bottom: 3rem;
}

h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    color: var(--highlight-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.widget {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow);
}

/* Clock */
.clock-widget {
    text-align: center;
}

#digital-clock {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    margin: 1rem 0;
    color: var(--highlight-color);
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

#date-display {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Calendar */
.calendar-widget {
    text-align: center;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-header button {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-header button:hover {
    background: var(--highlight-color);
    transform: scale(1.1);
}

.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-days span {
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-days span:hover {
    background: var(--accent-color);
}

.calendar-days .today {
    background: var(--highlight-color);
    color: white;
}

/* Tools and Games */
.tools-grid, .games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card, .game-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

/* Color Picker */
.color-picker {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.color-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* Effects */
.effects {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.effect-btn {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.effect-btn:hover {
    background: var(--highlight-color);
    transform: translateY(-2px);
}

/* Buttons */
.fun-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--highlight-color));
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 0.5rem;
}

.fun-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.fun-btn.danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

/* Settings */
.settings {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
}

.settings label {
    display: block;
    margin: 1rem 0;
    font-size: 1.1rem;
}

.settings input[type="range"] {
    width: 100%;
    max-width: 300px;
    margin: 0 1rem;
}

.settings input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.5);
}

/* Footer */
footer {
    background: var(--secondary-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

/* Snowfall */
#snowfall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

.snowflake {
    position: absolute;
    color: #ffffff;
    font-size: 1rem;
    opacity: 0.8;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    0% { transform: translateY(-10px) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .dashboard-grid,
    .tools-grid,
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    #digital-clock {
        font-size: 2rem;
    }
}

/* Dark mode */
body.dark-mode {
    --bg-color: #0a0a1a;
    --secondary-color: #0f0f2d;
    --card-bg: rgba(255, 255, 255, 0.05);
}

/* Brightness control */
body.brightness-50 { filter: brightness(0.5); }
body.brightness-75 { filter: brightness(0.75); }
body.brightness-100 { filter: brightness(1); }
body.brightness-125 { filter: brightness(1.25); }
body.brightness-150 { filter: brightness(1.5); }

/* Spinner Styles */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 120px;
    height: 120px;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(var(--accent-color), var(--highlight-color), var(--accent-color));
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    border: 4px solid var(--secondary-color);
    z-index: 2;
}

.spinner-arm {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 4px;
    height: 50px;
    background: white;
    transform: translateX(-50%);
    transform-origin: bottom center;
    z-index: 1;
}

.spinner-controls {
    display: flex;
    gap: 0.5rem;
}

.spinner.spinning {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tic-Tac-Toe Game */
.tic-tac-toe {
    text-align: center;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: bold;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    grid-template-rows: repeat(3, 60px);
    gap: 4px;
    margin: 0 auto 1rem;
    background: var(--secondary-color);
    padding: 4px;
    border-radius: 10px;
}

.cell {
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cell:hover {
    background: var(--accent-color);
    transform: scale(1.05);
}

.cell.x::before {
    content: "❌";
}

.cell.o::before {
    content: "⭕";
}

.cell.winner {
    background: var(--highlight-color);
    animation: pulse 1s infinite;
}

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

/* Target Game */
.target-game {
    text-align: center;
}

.target {
    width: 150px;
    height: 150px;
    position: relative;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--card-bg);
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid white;
}

.ring-1 { width: 140px; height: 140px; }
.ring-2 { width: 100px; height: 100px; }
.ring-3 { width: 60px; height: 60px; }
.ring-4 { width: 30px; height: 30px; }

.bullseye {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: var(--highlight-color);
    border-radius: 50%;
}

.target-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.target:hover {
    animation: targetPulse 0.5s ease-in-out;
}

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

/* Cube Game */
.cube-game {
    text-align: center;
}

.cube {
    width: 100px;
    height: 100px;
    position: relative;
    margin: 0 auto 1rem;
    transform-style: preserve-3d;
    transform: rotateX(25deg) rotateY(25deg);
    transition: transform 1s ease;
}

.face {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backface-visibility: hidden;
}

.front { transform: translateZ(50px); }
.back { transform: translateZ(-50px) rotateY(180deg); }
.right { transform: translateX(50px) rotateY(90deg); }
.left { transform: translateX(-50px) rotateY(-90deg); }
.top { transform: translateY(-50px) rotateX(90deg); }
.bottom { transform: translateY(50px) rotateX(-90deg); }

.cube-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cube-btn {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cube-btn:hover {
    background: var(--highlight-color);
    transform: scale(1.05);
}

/* Bubbles Effect */
.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: floatBubble linear infinite;
    pointer-events: none;
    z-index: 9998;
}

@keyframes floatBubble {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(0.5);
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) scale(1.2);
        opacity: 0;
    }
}







/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle::after {
    content: " ▾";
    font-size: 0.8em;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--secondary-color);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000; /* Увеличиваем z-index */
    backdrop-filter: blur(10px);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.dropdown-menu a:hover {
    background: var(--accent-color);
}






/* News Widget */
.news-widget {
    text-align: center;
}

.news-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.news-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.news-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.news-date {
    font-size: 0.8rem;
    opacity: 0.7;
}

.news-title {
    font-weight: 500;
}

.news-more {
    color: var(--highlight-color);
    text-decoration: none;
    font-size: 0.9rem;
    text-align: right;
    transition: all 0.3s ease;
}

.news-more:hover {
    color: var(--text-color);
    transform: translateX(3px);
}

/* News Section */
.news-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.tab-btn {
    background: var(--card-bg);
    border: none;
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.tab-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-articles {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-article {
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--highlight-color);
    transition: all 0.3s ease;
}

.news-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.article-date {
    opacity: 0.7;
}

.article-category {
    background: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.news-article h3 {
    color: var(--highlight-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.news-article p {
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.7;
}

.article-author {
    font-style: italic;
}

.article-views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Subscribe Form */
.news-subscribe {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 20px;
    text-align: center;
}

.subscribe-form {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

.subscribe-input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    color: var(--text-color);
    font-size: 1rem;
    min-width: 250px;
    transition: all 0.3s ease;
}

.subscribe-input:focus {
    outline: none;
    border-color: var(--highlight-color);
    background: rgba(255,255,255,0.15);
}

/* Responsive Design for News */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        margin-top: 0.5rem;
    }
    
    .dropdown:hover .dropdown-menu {
        display: block;
    }
    
    .news-tabs {
        flex-direction: column;
    }
    
    .subscribe-form {
        flex-direction: column;
    }
    
    .subscribe-input {
        min-width: auto;
        width: 100%;
    }
    
    .article-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Highlight target sections when navigating */
section:target {
    animation: highlightSection 2s ease;
}

@keyframes highlightSection {
    0% { background: transparent; }
    50% { background: rgba(233, 69, 96, 0.1); }
    100% { background: transparent; }
}


/* About Page Styles */
.about-hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--accent-color), var(--highlight-color));
    border-radius: 20px;
    margin-bottom: 3rem;
}

.about-hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.about-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.tech-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.tech-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.tech-icon {
    font-size: 2rem;
}

.tech-info h4 {
    margin-bottom: 0.5rem;
    color: var(--highlight-color);
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.features-list li:hover {
    color: var(--highlight-color);
    transform: translateX(5px);
}

.roadmap {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.roadmap-item {
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border-left: 4px solid var(--highlight-color);
}

.roadmap-date {
    display: inline-block;
    background: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.stats-section {
    text-align: center;
    margin: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--highlight-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    opacity: 0.8;
}

.contact-section {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.form-input, .form-textarea {
    padding: 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--highlight-color);
    background: rgba(255,255,255,0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Back link in footer */
footer a {
    color: var(--highlight-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}