* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    touch-action: none;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

canvas {
    background: #0a0a0a;
    border: 2px solid #333;
    border-radius: 8px;
    touch-action: none;
    outline: none;
    width: 100%;
    max-width: 800px;
    height: auto;
    max-height: calc(100vh - 200px);
}

canvas:focus {
    outline: 2px solid #00fff5;
    outline-offset: 2px;
}

.hud {
    display: flex;
    flex-direction: row;
    gap: 20px;
    font-size: 1.1em;
    text-shadow: 0 0 10px #00fff5;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    width: 100%;
    max-width: 800px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.hud div {
    display: flex;
    gap: 5px;
    white-space: nowrap;
}

.menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 2em;
    border-radius: 15px;
    border: 2px solid #00fff5;
    z-index: 100;
}

.menu h1 {
    color: #00fff5;
    margin-bottom: 0.5em;
    font-size: 2.5em;
    text-shadow: 0 0 10px #00fff5;
}

.menu-description {
    color: #ccc;
    margin-bottom: 1em;
    font-size: 1.1em;
}

#startBtn {
    background: #00fff5;
    color: #000;
    border: none;
    padding: 1em 2em;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1em 0;
    font-weight: bold;
}

#startBtn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 20px #00fff5;
}

.high-score {
    color: #00fff5;
    font-size: 1.1em;
    margin-top: 1em;
}

.difficulty-selector {
    margin-top: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.difficulty-selector label {
    color: #ccc;
}

.difficulty-selector select {
    background: #333;
    color: #fff;
    border: 2px solid #00fff5;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
}

.level-complete {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 2em;
    border-radius: 15px;
    border: 2px solid #4CAF50;
    z-index: 100;
    display: none;
}

.level-complete h2 {
    color: #4CAF50;
    margin-bottom: 1em;
    font-size: 2em;
    text-shadow: 0 0 10px #4CAF50;
}

.level-complete p {
    color: #ccc;
    font-size: 1.2em;
    margin-bottom: 1em;
}

#nextLevelBtn {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 1em 2em;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

#nextLevelBtn:hover {
    background: #45a049;
    transform: scale(1.1);
    box-shadow: 0 0 20px #4CAF50;
}

.controls {
    position: relative;
    width: 100%;
    pointer-events: none;
}

.mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
    visibility: visible;
    opacity: 1;
}

.horizontal-controls {
    display: flex;
    gap: 10px;
}

.mobile-controls button {
    background: rgba(0, 255, 255, 0.4);
    border: 3px solid #00fff5;
    color: #00fff5;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    font-size: 2em;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.1s ease;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.4);
    font-weight: bold;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-controls button:active,
.mobile-controls button:focus {
    background: rgba(0, 255, 255, 0.6);
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 255, 255, 0.6);
    outline: none;
}

.mobile-controls button:hover {
    background: rgba(0, 255, 255, 0.5);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.5);
}

/* Tablet ve mobil için kontroller her zaman görünür */
@media (max-width: 1024px) {
    .mobile-controls {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Tablet için özel ayarlar */
@media (min-width: 601px) and (max-width: 1024px) {
    .mobile-controls button {
        width: 75px;
        height: 75px;
        font-size: 2.2em;
    }
    
    .mobile-controls {
        bottom: 30px;
        gap: 15px;
    }
}

@media (max-width: 800px) {
    .game-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        padding: 10px;
        gap: 10px;
    }
    
    canvas {
        width: 100%;
        height: calc(100vh - 200px);
        max-height: calc(100vh - 200px);
    }
    
    .mobile-controls button {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }
    
    .mobile-controls {
        bottom: 20px;
        gap: 10px;
    }
    
    .hud {
        font-size: 0.85em;
        padding: 8px 12px;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .hud div {
        font-size: 0.9em;
    }
}

/* Masaüstü için kontrolleri gizle */
@media (min-width: 1025px) {
    .mobile-controls {
        display: none !important;
    }
}
