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

:root {
    --container-padding: clamp(0.5rem, 2vw, 2rem);
    --grid-size: clamp(60px, 15vw, 80px);
    --font-size-small: clamp(0.8rem, 2vw, 1rem);
    --font-size-medium: clamp(1rem, 2.5vw, 1.2rem);
    --font-size-large: clamp(1.2rem, 3vw, 1.5rem);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-image: url('assets/splash.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.container {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    padding: var(--container-padding);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

#start-screen {
    background: url('assets/splash.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20vh;
}

#game-screen {
    background: url('assets/bg.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    flex-direction: column;
    padding: var(--container-padding);
}

#end-screen {
    background: url('assets/finish.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    margin-bottom: 1rem;
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.stat-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-container span {
    font-size: var(--font-size-small);
    font-weight: bold;
    color: #333;
}

.stat-container .value-highlight {
    font-size: var(--font-size-medium);
    font-weight: bold;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(5px, 1.5vw, 10px);
    width: 100%;
    max-width: min(400px, 90vw);
    aspect-ratio: 1;
    margin: auto;
    padding: clamp(10px, 2vw, 20px);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.color-box {
    aspect-ratio: 1;
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-box:hover {
    transform: scale(1.05);
}

button.neon-button {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    font-size: var(--font-size-medium);
    padding: clamp(0.8rem, 2vw, 1.5rem) clamp(2rem, 4vw, 3rem);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
    box-shadow: 
        0 0 10px rgba(255,255,255,0.5),
        0 0 20px rgba(255,255,255,0.3),
        0 0 30px rgba(255,255,255,0.2);
}

button.neon-button:hover {
    background: rgba(255,255,255,0.1);
    box-shadow: 
        0 0 20px rgba(255,255,255,0.6),
        0 0 40px rgba(255,255,255,0.4),
        0 0 60px rgba(255,255,255,0.3);
    text-shadow: 0 0 15px rgba(255,255,255,1);
    transform: scale(1.05);
}

.end-content {
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.6);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.end-content h2 {
    font-size: var(--font-size-large);
    margin-bottom: 1rem;
}

.end-content p {
    font-size: var(--font-size-medium);
    margin-bottom: 2rem;
}

#final-score {
    font-size: var(--font-size-large);
    color: #4CAF50;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

#score { color: #4CAF50; }
#timer { color: #2196F3; }
#next-change { 
    color: #ff6b6b;
    font-family: monospace;
}

.target-color-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.target-color-container span {
    font-size: var(--font-size-small);
    font-weight: bold;
    color: #333;
}

#target-color {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

@media (max-height: 600px) {
    #start-screen {
        padding-bottom: 15vh;
    }

    .end-content {
        padding: 1rem;
    }

    button.neon-button {
        padding: 0.6rem 1.5rem;
    }

    #target-color {
        width: 50px;
        height: 50px;
    }
}

/* Animasyon stilleri */
.score-animation {
    position: fixed;
    font-size: 1.5rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
}

.score-gain {
    color: #4CAF50;
    animation: floatUp 0.8s ease-out forwards;
}

.score-penalty {
    color: #ff0000;
    animation: floatUp 0.8s ease-out forwards;
}

.time-animation {
    position: fixed;
    font-size: 1.2rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
}

.time-bonus {
    color: #4CAF50;
    animation: floatUp 0.8s ease-out forwards;
}

.time-penalty {
    color: #ff0000;
    animation: floatUp 0.8s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.screen:not(.hidden) {
    animation: fadeIn 0.3s ease-out;
}

@media (max-width: 600px) {
    .game-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

h1 {
    font-size: var(--font-size-large);
    text-align: center;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}
