:root {
    --primary: #00D4FF;
    --primary-dark: #00A8CC;
    --secondary: #6366F1;
    --accent: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;

    /* Dark theme colors */
    --bg-primary: #0A0A0F;
    --bg-secondary: #1A1A2E;
    --bg-tertiary: #16213E;
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --border-color: #374151;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 5rem; /* Added from ai.css */

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-neon: 0 0 20px var(--primary), 0 0 40px var(--primary), 0 0 60px var(--primary);
}

/* Light theme variables */
body.light-mode {
    --bg-primary: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --bg-tertiary: #E2E8F0;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #CBD5E1;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex; /* Ensure content stretches */
    flex-direction: column; /* Ensure content stretches */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Header styles */
header {
    padding: var(--space-3xl) var(--space-lg);
    text-align: center;
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: var(--space-xl);
}

h1 {
    font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-5xl));
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
    position: relative;
    letter-spacing: -0.025em;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    animation: pulse 2s ease-in-out infinite alternate;
}

/* Theme toggle */
.theme-toggle {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 48px;
    height: 48px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--primary);
    font-size: var(--font-size-lg);
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: var(--shadow-lg);
    background: var(--primary);
    color: var(--bg-primary);
}

/* Container */
.container {
    flex: 1; /* Allows container to grow and take available space */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 var(--space-lg);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Button grid for different games/options */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
    width: 100%;
    padding: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

/* Modern button styles */
.btn {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-lg);
    font-weight: 600;
    text-align: center;
    outline: none; /* Add outline none for focus states if you manage them with specific styles */
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.btn:hover, .btn:focus { /* Added :focus for accessibility */
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary);
}

.btn:hover::before, .btn:focus::before { /* Added :focus for accessibility */
    opacity: 0.1;
}

.btn:active {
    transform: translateY(-4px) scale(0.98);
}

.btn i {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.btn:hover i, .btn:focus i { /* Added :focus for accessibility */
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px var(--primary));
}

/* Clock (from original verschiedene_spiele.css, updated to new design) */
.clock {
    position: fixed;
    bottom: var(--space-lg); /* Use variable */
    right: var(--space-lg);  /* Use variable */
    font-size: var(--font-size-lg); /* Use variable */
    color: var(--primary);
    font-weight: 600; /* Adjusted from 500 */
    background: var(--glass-bg); /* Use variable */
    backdrop-filter: blur(20px); /* Use variable */
    padding: var(--space-md) var(--space-lg); /* Use variables */
    border-radius: var(--radius-full); /* Use variable */
    border: 1px solid var(--glass-border); /* Use variable */
    box-shadow: var(--shadow-lg); /* Use variable */
    font-variant-numeric: tabular-nums; /* Ensures consistent width for numbers */
    z-index: 50;
}


/* Media Queries */
@media (max-width: 768px) {
    h1 {
        font-size: clamp(var(--font-size-2xl), 8vw, var(--font-size-4xl));
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-base);
        top: var(--space-md);
        right: var(--space-md);
    }

    header {
        padding: var(--space-xl) var(--space-md);
    }

    .button-grid {
        grid-template-columns: 1fr;
        padding: var(--space-md);
        gap: var(--space-lg);
    }

    .btn {
        padding: var(--space-xl);
        min-height: 120px;
        font-size: var(--font-size-base); /* Adjusted to make it smaller on mobile */
    }

    .btn i {
        font-size: 2.5rem;
        margin-bottom: var(--space-sm);
    }

    .clock {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
        bottom: var(--space-md);
        right: var(--space-md);
    }
}

/* Animations (combined from all provided files) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse { /* Adjusted from pulse-glow in mk_programme to match styles.css */
    0%, 100% {
        transform: translateX(-50%) scaleX(1);
        /* box-shadow: 0 0 10px rgba(0, 212, 255, 0.5), 0 0 20px rgba(0, 212, 255, 0.3); */ /* Removed for cleaner pulse effect on line */
    }
    50% {
        transform: translateX(-50%) scaleX(1.1);
        /* box-shadow: 0 0 15px rgba(0, 212, 255, 0.7), 0 0 30px rgba(0, 212, 255, 0.5); */
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rotate-in {
    from {
        transform: rotate(-90deg) scale(0.5);
        opacity: 0;
    }
    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px); /* Adjusted for consistency */
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px); /* Adjusted for consistency */
    }
}

@keyframes stretch-width {
    from {
        transform: translateX(-50%) scaleX(0.5);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) scaleX(1.1);
        opacity: 0.8;
    }
}

@keyframes pulse-typing {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Animation delays for buttons (from styles.css) */
.btn:nth-child(1) { animation: fadeIn 0.6s ease 0.1s both; }
.btn:nth-child(2) { animation: fadeIn 0.6s ease 0.2s both; }
.btn:nth-child(3) { animation: fadeIn 0.6s ease 0.3s both; }
.btn:nth-child(4) { animation: fadeIn 0.6s ease 0.4s both; }
.btn:nth-child(5) { animation: fadeIn 0.6s ease 0.5s both; }
.btn:nth-child(6) { animation: fadeIn 0.6s ease 0.6s both; }


/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Focus outline for accessibility (from ai.css) */
*:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}