* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #4285f4;
    --secondary-color: #ffd166;
    --accent-color: #34a853;
    --accent-dark: #2a7b3f;
    --background-color: #fff;
    --text-color: #333;
    --white: #fff;
}

html, body {
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
}

body {
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    padding: 20px;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    margin: 0;
    overflow: hidden;
    position: relative;
}

/* Confetti animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='90'%3E%3Crect x='38' y='42' width='3' height='7' fill='%23ea4335' transform='rotate(25 40 45)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='110'%3E%3Crect x='48' y='52' width='3' height='7' fill='%234285f4' transform='rotate(-20 50 55)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='100'%3E%3Crect x='58' y='47' width='3' height='7' fill='%23fbbc04' transform='rotate(50 60 50)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='120'%3E%3Crect x='43' y='57' width='3' height='7' fill='%2334a853' transform='rotate(-40 45 60)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='80'%3E%3Crect x='53' y='37' width='3' height='7' fill='%23ea4335' transform='rotate(70 55 40)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='95' height='105'%3E%3Crect x='45' y='50' width='3' height='7' fill='%234285f4' transform='rotate(-55 47 52)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='85' height='95'%3E%3Crect x='40' y='44' width='3' height='7' fill='%23fbbc04' transform='rotate(15 42 47)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='105' height='85'%3E%3Crect x='50' y='40' width='3' height='7' fill='%2334a853' transform='rotate(-65 52 43)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='115' height='115'%3E%3Crect x='55' y='55' width='3' height='7' fill='%23ff6d00' transform='rotate(35 57 58)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='75' height='100'%3E%3Crect x='35' y='47' width='3' height='7' fill='%234285f4' transform='rotate(-30 37 50)'/%3E%3C/svg%3E");
    background-size: 
        80px 90px, 100px 110px, 120px 100px, 90px 120px,
        110px 80px, 95px 105px, 85px 95px, 105px 85px,
        115px 115px, 75px 100px;
    background-position: 
        0 0, 31px 47px, 67px 23px, 13px 71px,
        53px 89px, 97px 11px, 41px 103px, 79px 59px,
        17px 37px, 61px 67px;
    animation: confettiFall 20s linear infinite;
    opacity: 1;
}

@keyframes confettiFall {
    0% {
        background-position: 
            0 0, 31px 47px, 67px 23px, 13px 71px,
            53px 89px, 97px 11px, 41px 103px, 79px 59px,
            17px 37px, 61px 67px;
    }
    100% {
        background-position: 
            0 100vh, 31px calc(47px + 100vh), 67px calc(23px + 100vh), 13px calc(71px + 100vh),
            53px calc(89px + 100vh), 97px calc(11px + 100vh), 41px calc(103px + 100vh), 79px calc(59px + 100vh),
            17px calc(37px + 100vh), 61px calc(67px + 100vh);
    }
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    padding: clamp(12px, 3vw, 30px);
    max-width: 500px;
    width: 95%;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    max-height: calc(100dvh - 40px);
}

h1 {
    color: var(--primary-color);
    font-size: clamp(28px, 6.5vw, 44px);
    margin-bottom: clamp(12px, 2vw, 18px);
    text-shadow: 2px 2px 0 var(--secondary-color);
    line-height: 1.2;
}

.hero-image {
    width: 100%;
    max-width: clamp(150px, 40vw, 400px);
    height: auto;
    border-radius: 15px;
    margin-bottom: clamp(8px, 2vw, 18px);
}

.version-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: clamp(8px, 2vw, 12px);
    margin-top: clamp(10px, 2vw, 20px);
    width: 100%;
}

.version-option {
    flex: 1;
    max-width: 180px;
    aspect-ratio: 1/1.1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-height: 100px;
    touch-action: manipulation;
}

.version-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.version-option a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: var(--white);
    background-size: cover;
    background-position: center;
}

.version-option .version-content {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding: clamp(8px, 2vw, 12px);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.2));
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.version-option h2 {
    margin: 0;
    font-size: clamp(16px, 4vw, 20px);
    line-height: 1.2;
}

.version-option p {
    font-size: clamp(11px, 2.5vw, 13px);
    margin-top: 2px;
    opacity: 0.9;
    line-height: 1.2;
}

/* Specifieke stijlen voor elke versie */
.version-2d {
    background-color: #ff6b6b;
}

.version-2d a {
    background: radial-gradient(circle at center, rgba(255, 107, 107, 0.7), rgba(255, 107, 107, 1)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' fill='%23ff6b6b'/%3E%3Ccircle cx='50' cy='50' r='30' fill='%23ffffff'/%3E%3Cpath d='M35 50 L65 50 M50 35 L50 65' stroke='%23ff6b6b' stroke-width='5'/%3E%3C/svg%3E");
}

.version-3d {
    background-color: #4285f4;
}

.version-3d a {
    background: radial-gradient(circle at center, rgba(66, 133, 244, 0.7), rgba(66, 133, 244, 1)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' fill='%234285f4'/%3E%3Cpath d='M30 70 L50 30 L70 70 Z' fill='%23ffffff'/%3E%3C/svg%3E");
}

.version-sommen {
    background-color: #9c27b0;
}

.version-sommen a {
    background: radial-gradient(circle at center, rgba(156, 39, 176, 0.7), rgba(156, 39, 176, 1)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' fill='%239c27b0'/%3E%3Ctext x='50' y='45' font-family='Arial' font-size='30' font-weight='bold' text-anchor='middle' fill='%23ffffff'%3E+%3C/text%3E%3Ctext x='50' y='75' font-family='Arial' font-size='30' font-weight='bold' text-anchor='middle' fill='%23ffffff'%3E-%3C/text%3E%3C/svg%3E");
}

/* Responsive aanpassingen */
@media (max-width: 600px) {
    .version-option {
        width: 100%;
    }
}

/* Mobile-first optimizations */
@media screen and (max-width: 430px) {
    body {
        padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
        align-items: center;
    }
    
    .container {
        padding: 12px 10px;
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 16px;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }
    
    h1 {
        font-size: clamp(20px, 5.5vw, 28px);
        margin-bottom: 6px;
        line-height: 1.15;
    }
    
    .hero-image {
        max-width: min(120px, 30vw);
        margin-bottom: 6px;
    }
    
    p {
        font-size: clamp(13px, 3.5vw, 15px);
        margin-bottom: 4px;
        line-height: 1.3;
    }
    
    .container > p {
        margin-bottom: 6px;
    }
    
    .version-container {
        gap: 8px;
        margin-top: 8px;
        flex-direction: row;
    }
    
    .version-option {
        flex: 1;
        min-width: 0;
        max-width: none;
        aspect-ratio: 1/1.2;
        min-height: 90px;
    }
    
    .version-option h2 {
        font-size: clamp(14px, 4vw, 17px);
    }
    
    .version-option p {
        font-size: clamp(10px, 2.5vw, 12px);
        margin-top: 2px;
    }
    
    .archived-games {
        margin-top: 10px;
    }
    
    .archived-games summary {
        font-size: clamp(12px, 3vw, 13px);
        padding: 8px;
        min-height: 36px;
    }
    
    .archived-games .archived-container {
        margin-top: 8px;
    }
    
    .archived-games .archived-container .version-option {
        max-width: 140px;
        aspect-ratio: 1/1;
        min-height: 70px;
    }
    
    footer {
        margin-top: 8px;
        padding-bottom: env(safe-area-inset-bottom);
        font-size: 11px;
    }
}

/* iPhone 15 Pro Max and larger (430px+) */
@media screen and (min-width: 431px) and (max-width: 480px) {
    .container {
        padding: 24px 20px;
    }
}

/* Archived games section */
.archived-games {
    margin-top: clamp(20px, 3vw, 30px);
    width: 100%;
}

.archived-games summary {
    cursor: pointer;
    color: rgba(0, 0, 0, 0.5);
    font-size: 14px;
    padding: 10px;
    text-align: center;
    transition: color 0.2s;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.archived-games summary::-webkit-details-marker {
    display: none;
}

.archived-games summary::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.archived-games[open] summary::before {
    transform: rotate(45deg);
}

.archived-games summary:hover {
    color: rgba(0, 0, 0, 0.8);
}

.archived-games .archived-container {
    margin-top: 12px;
    opacity: 0.7;
    display: flex;
    justify-content: center;
}

.archived-games .archived-container .version-option {
    max-width: 160px;
    aspect-ratio: 1.5/1;
}

/* Footer */
footer {
    margin-top: clamp(20px, 3vw, 30px);
    font-size: clamp(12px, 2.5vw, 14px);
    color: rgba(0, 0, 0, 0.6);
}

/* Preload fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');