:root {
    /* Light Mode Colors */
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --accent-secondary: #f59e0b;
    --background-start: #f0f9ff;
    --background-end: #e0e7ff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --card-background: #ffffff;
    --card-hover: #fafafa;
    --shadow-color: rgba(99, 102, 241, 0.1);
    --shadow-hover: rgba(99, 102, 241, 0.2);
    --border-color: rgba(99, 102, 241, 0.1);
    --overlay-bg: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --primary-color: #818cf8;
    --secondary-color: #a78bfa;
    --accent-color: #f472b6;
    --accent-secondary: #fbbf24;
    --background-start: #0f172a;
    --background-end: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #cbd5e1;
    --card-background: #1e293b;
    --card-hover: #334155;
    --shadow-color: rgba(129, 140, 248, 0.2);
    --shadow-hover: rgba(129, 140, 248, 0.3);
    --border-color: rgba(129, 140, 248, 0.2);
    --overlay-bg: rgba(0, 0, 0, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--background-start), var(--background-end));
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-background);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 30px var(--shadow-hover);
}

.sun-icon {
    color: var(--accent-secondary);
}

.moon-icon {
    color: var(--primary-color);
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 100px;
}

/* Header Styling */
.header {
    background: var(--card-background);
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--shadow-color);
    margin-bottom: 3rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
}

.site-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.title-main {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.title-year {
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: 900;
    text-shadow: 0 0 20px var(--accent-color);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 20px var(--accent-color); }
    50% { text-shadow: 0 0 30px var(--accent-color), 0 0 40px var(--accent-color); }
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-logout {
    padding: 1rem 2rem;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 15px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.user-logout::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.user-logout:hover::before {
    width: 300px;
    height: 300px;
}

.user-logout:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px var(--shadow-hover);
}

.user-profile {
    display: none;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.user-profile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px var(--shadow-hover);
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    background-color: #ffffff;
}

.username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
    font-weight: 600;
}

/* Effects Section */
.effects-section {
    margin-bottom: 3rem;
}

.effects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.effect-card {
    background: var(--card-background);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.effect-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 48px var(--shadow-hover);
}

.effect-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.effect-card h3 {
    color: var(--text-color);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.effects-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Games Section */
.games-section {
    margin-top: 3rem;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.game-card {
    background: var(--card-background);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px var(--shadow-color);
    border: 1px solid var(--border-color);
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.game-card:hover::before {
    opacity: 0.1;
}

.game-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px var(--shadow-hover);
}

.game-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .game-image {
    transform: scale(1.1);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 4rem;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.game-info {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.game-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    min-height: 2.4rem;
    display: flex;
    align-items: center;
}

/* Buttons */
.button {
    padding: 1rem 2rem;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button:hover::before {
    width: 300px;
    height: 300px;
}

.button-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px var(--shadow-color);
    width: 100%;
}

.button-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px var(--shadow-hover);
}

.button.enable {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    flex: 1;
}

.button.enable:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.5);
}

.button.disable {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    flex: 1;
}

.button.disable:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
        padding-top: 100px;
    }

    .header-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .site-title {
        font-size: 2.5rem;
        text-align: center;
    }

    .auth-section {
        width: 100%;
        justify-content: center;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
    }

    .container {
        padding: 1rem;
        padding-top: 80px;
    }

    .header-content {
        padding: 1.5rem;
    }

    .site-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .title-year {
        font-size: 1.2rem;
    }

    .auth-section {
        flex-direction: column;
        gap: 0.5rem;
    }

    .user-logout,
    .user-profile {
        width: 100%;
        justify-content: center;
    }

    .effects-container {
        grid-template-columns: 1fr;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.5rem;
    }

    .game-image-wrapper {
        height: 180px;
    }

    .button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .button,
    .user-profile,
    .user-logout,
    .theme-toggle {
        min-height: 44px;
    }
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}