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

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

body {
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(138, 43, 226, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 105, 180, 0.2) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-50px, -50px) rotate(180deg);
    }
}

.game-container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 30px;
    box-shadow:
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5em;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.score,
.high-score {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 12px 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.score .label,
.high-score .label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    margin-right: 8px;
}

.score span:last-child,
.high-score span:last-child {
    color: #fff;
    font-size: 1.5em;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#gameCanvas {
    width: 100%;
    height: 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    display: block;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.game-over,
.start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: none;
    animation: fadeIn 0.5s ease;
    z-index: 10;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.game-over.show,
.start-screen.show {
    display: block;
}

.game-over-content h2,
.start-content h2 {
    font-size: 2.5em;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.final-score {
    font-size: 1.3em;
    color: #fff;
    margin-bottom: 30px;
    font-weight: 600;
}

.final-score span {
    font-size: 1.5em;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.instructions {
    color: #2d3748;
    font-size: 1.1em;
    line-height: 1.8;
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.instructions strong {
    color: #d97706;
    font-weight: 700;
}

.restart-btn,
.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    font-family: 'Outfit', sans-serif;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.restart-btn:hover,
.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.restart-btn:active,
.start-btn:active {
    transform: scale(0.95);
}

.controls {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
}

.controls strong {
    color: #ffd700;
    font-weight: 700;
}

/* Tablet ve Mobil */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .game-container {
        padding: 15px;
        width: 98%;
    }

    .header h1 {
        font-size: 1.8em;
        margin-bottom: 10px;
    }

    .score-board {
        gap: 20px;
    }

    .score,
    .high-score {
        padding: 10px 20px;
    }

    #gameCanvas {
        height: 300px;
    }

    .game-over,
    .start-screen {
        padding: 25px;
        width: 92%;
    }

    .game-over-content h2,
    .start-content h2 {
        font-size: 1.8em;
    }

    .instructions {
        font-size: 1em;
        padding: 15px;
    }

    .restart-btn,
    .start-btn {
        padding: 18px 45px;
        font-size: 1.3em;
        min-width: 200px;
        min-height: 60px;
    }
}

/* Küçük Telefonlar */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    #gameCanvas {
        height: 250px;
    }

    .game-over,
    .start-screen {
        padding: 20px;
    }

    .game-over-content h2,
    .start-content h2 {
        font-size: 1.5em;
    }

    .restart-btn,
    .start-btn {
        padding: 16px 40px;
        font-size: 1.2em;
    }
}

/* Yatay Mod */
@media (orientation: landscape) and (max-height: 500px) {
    .game-container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }

    #gameCanvas {
        height: 250px;
    }

    .instructions {
        margin: 15px 0;
        padding: 12px;
        font-size: 0.85em;
        line-height: 1.4;
    }
}

/* Mobil Dokunma Optimizasyonu */
@media (hover: none) and (pointer: coarse) {

    .restart-btn,
    .start-btn {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    }

    #gameCanvas {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* Animasyonlar */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.start-btn,
.restart-btn {
    animation: pulse 2s ease-in-out infinite;
}