   @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;700&display=swap');

        * {
            box-sizing: border-box;
            /* touch-action: none; BURADAN KALDIRILDI - Menülerde kaydırmayı engelliyordu */
            user-select: none;
            -webkit-user-select: none;
        }

        body {
            margin: 0;
            padding: 0;
            background-color: #020204;
            overflow: hidden;
            font-family: 'Rajdhani', sans-serif;
            color: white;
            height: 100vh;
            width: 100vw;
        }

        #gameCanvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            cursor: none;
            touch-action: none; /* Sadece oyun alanında kaydırmayı engelle */
        }

        /* --- UI KATMANI --- */
        #uiLayer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 10;
            pointer-events: none;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 25px;
        }

        .hud-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            width: 100%;
        }

        .score-container { text-align: left; }

        .score-label {
            font-size: 14px;
            color: #00ffff;
            letter-spacing: 2px;
            opacity: 0.8;
        }

        .score-value {
            font-size: 42px;
            font-weight: 700;
            color: #fff;
            text-shadow: 0 0 20px #00ffff;
            line-height: 1;
        }

        .player-info {
            font-size: 18px;
            color: #ff00ff;
            text-shadow: 0 0 10px #ff00ff;
            margin-bottom: 2px;
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        .diff-info {
            font-size: 12px;
            color: #aaa;
            margin-bottom: 8px;
            letter-spacing: 1px;
            text-transform: uppercase;
        }
        
        .highscore-value {
            font-size: 16px;
            color: #ffcc00;
            margin-top: 5px;
            text-shadow: 0 0 10px #ffcc00;
        }

        .combo-box {
            font-size: 20px;
            color: #ff0055;
            font-weight: bold;
            opacity: 0;
            transition: opacity 0.2s;
            text-shadow: 0 0 10px #ff0055;
            margin-top: 5px;
        }

        .hud-right { text-align: right; }

        .health-bar-container {
            width: 250px;
            height: 12px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(0, 255, 255, 0.3);
            border-radius: 2px;
            margin-bottom: 5px;
            position: relative;
            transform: skewX(-20deg);
        }

        .health-fill {
            height: 100%;
            width: 100%;
            background: linear-gradient(90deg, #ff0055, #ff4d4d);
            transition: width 0.1s linear;
            box-shadow: 0 0 15px #ff0055;
        }

        .health-text {
            font-size: 18px;
            font-weight: bold;
            color: #fff;
            text-shadow: 0 0 10px #ff0055;
            letter-spacing: 1px;
            min-width: 45px;
            text-align: right;
        }

        .shield-indicator {
            font-size: 14px;
            color: #00ffaa;
            opacity: 0;
            transition: opacity 0.3s;
            text-shadow: 0 0 10px #00ffaa;
        }

        .icon-btn {
            background: rgba(0, 255, 255, 0.1);
            border: 1px solid rgba(0, 255, 255, 0.3);
            color: #00ffff;
            width: 36px;
            height: 36px;
            font-size: 16px;
            font-family: 'Rajdhani', sans-serif;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.3s;
            pointer-events: auto; 
        }
        
        .icon-btn:hover {
            background: rgba(0, 255, 255, 0.3);
            box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
            text-shadow: 0 0 10px #00ffff;
        }

        /* --- MENÜLER --- */
        .screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle, rgba(10,10,20,0.9) 0%, rgba(0,0,0,0.95) 100%);
            backdrop-filter: blur(8px);
            display: flex;
            flex-direction: column;
            align-items: center;
            /* YENİ: justify-content yerine margin: auto trick'i ve overflow */
            overflow-y: auto;
            overflow-x: hidden;
            padding: 20px 0;
            touch-action: pan-y; /* Menülerde aşağı yukarı kaydırmaya izin ver */
            
            z-index: 20;
            pointer-events: auto;
            opacity: 0;
            visibility: hidden;
            transition: all 0.4s ease;
        }
        
        /* Ekran yüksekliğinden kısa olduğunda menüyü ortalamak için */
        .screen::before, .screen::after {
            content: '';
            margin: auto;
        }

        .screen.active {
            opacity: 1;
            visibility: visible;
        }

        h1 {
            font-size: 80px;
            margin: 0 0 10px 0;
            background: linear-gradient(135deg, #fff 0%, #00ffff 50%, #ff00ff 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 0 50px rgba(0, 255, 255, 0.4);
            text-transform: uppercase;
            letter-spacing: 10px;
            text-align: center;
            position: relative;
        }
        
        h1::after {
            content: "ULTIMATE EDITION";
            position: absolute;
            bottom: -8px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 16px;
            letter-spacing: 15px;
            color: #fff;
            white-space: nowrap;
            opacity: 0.7;
            -webkit-text-fill-color: white;
        }

        .btn {
            background: transparent;
            color: #fff;
            border: 1px solid rgba(255,255,255,0.2);
            padding: 16px 60px 18px; 
            font-size: 18px;
            font-family: 'Rajdhani', sans-serif;
            font-weight: 700;
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 4px;
            transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
            position: relative;
            overflow: hidden;
            clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 0; left: -100%;
            width: 100%; height: 100%;
            background: linear-gradient(90deg, transparent, rgba(0,255,255,0.4), transparent);
            transition: 0.5s;
        }

        .btn:hover {
            background: rgba(0, 255, 255, 0.1);
            border-color: #00ffff;
            box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
            text-shadow: 0 0 10px #00ffff;
            transform: translateY(-2px);
        }

        .btn:hover::before { left: 100%; }
        
        .btn-upgrade { border-color: #ffaa00; color: #ffaa00; }
        .btn-upgrade:hover { background: rgba(255, 170, 0, 0.1); border-color: #ffcc00; box-shadow: 0 0 30px rgba(255, 204, 0, 0.2); text-shadow: 0 0 10px #ffcc00; }

        .btn-settings { border-color: #aaa; color: #aaa; }
        .btn-settings:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; box-shadow: 0 0 30px rgba(255, 255, 255, 0.2); text-shadow: 0 0 10px #fff; }

        .nickname-input {
            margin-top: 20px;
            background: rgba(0, 255, 255, 0.05);
            border: 1px solid rgba(0, 255, 255, 0.3);
            color: #fff;
            padding: 15px 20px;
            font-size: 20px;
            font-family: 'Rajdhani', sans-serif;
            text-align: center;
            width: 100%;
            max-width: 300px;
            outline: none;
            transition: all 0.3s;
            text-transform: uppercase;
        }

        .nickname-input:focus { border-color: #00ffff; box-shadow: 0 0 20px rgba(0, 255, 255, 0.2); }

        .diff-container { display: flex; gap: 15px; margin-top: 20px; flex-wrap: wrap; justify-content: center;}
        .diff-btn {
            background: transparent; color: #888; border: 1px solid #444;
            padding: 10px 30px; font-size: 16px; font-family: 'Rajdhani', sans-serif; font-weight: 700;
            cursor: pointer; text-transform: uppercase; letter-spacing: 2px; transition: all 0.3s;
        }
        .diff-btn:hover { color: #fff; border-color: #888; }
        .diff-btn.active { color: #fff; border-color: #ff0055; background: rgba(255, 0, 85, 0.1); box-shadow: 0 0 15px rgba(255, 0, 85, 0.3); text-shadow: 0 0 5px #ff0055; }

        /* --- TEMA SEÇİMİ --- */
        .theme-selection { margin-top: 15px; text-align: center; }
        .theme-container { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
        .theme-item { width: 90px; height: 60px; border: 1px solid rgba(255, 255, 255, 0.2); background: #000; cursor: pointer; transition: all 0.3s; position: relative; overflow: hidden; border-radius: 4px; }
        .theme-item:hover { border-color: #fff; transform: translateY(-2px); }
        .theme-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
        .theme-label { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.8); font-size: 11px; padding: 3px 0; text-align: center; font-weight: bold; pointer-events: none; text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s; }

        /* --- GEMİ SEÇİM MENÜSÜ --- */
        .ship-selection { margin-top: 20px; text-align: center; width: 100%; }
        .ship-title { color: #00ffff; font-size: 14px; letter-spacing: 2px; margin-bottom: 10px; }
        .ship-list { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 500px; margin: 0 auto; }
        .ship-item { width: 65px; height: 65px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.5); cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; padding: 5px; }
        .ship-item:hover:not(.locked) { border-color: #00ffff; background: rgba(0, 255, 255, 0.1); }
        .ship-item.active { border-color: #ff00ff; box-shadow: 0 0 15px rgba(255, 0, 255, 0.4); color: #ff00ff; text-shadow: 0 0 10px #ff00ff; }
        
        .ship-item.locked { opacity: 0.6; cursor: pointer; background: rgba(0, 0, 0, 0.7); border-color: #444; position: relative; }
        .ship-item.locked.unaffordable { background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,0,0,0.05) 5px, rgba(255,0,0,0.05) 10px); }
        .ship-item.locked.affordable:hover { border-color: #00ffaa; background: rgba(0, 255, 170, 0.1); box-shadow: 0 0 15px rgba(0, 255, 170, 0.3); transform: scale(1.05); }
        .ship-item.locked.unaffordable:hover { border-color: #ff0055; background: rgba(255, 0, 85, 0.1); }

        .buy-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8); color: #00ffaa; font-weight: bold; font-size: 14px; opacity: 0; pointer-events: none; text-shadow: 0 0 8px #00ffaa; transition: all 0.2s; z-index: 2; letter-spacing: 1px; text-align: center; }
        .ship-item.locked.affordable:hover .buy-text { opacity: 1; transform: translate(-50%, -50%) scale(1); }
        .ship-item.locked.affordable:hover .ship-icon-canvas, .ship-item.locked.affordable:hover .ship-req { opacity: 0.1; }

        @keyframes purchaseSuccess {
            0% { transform: scale(1); box-shadow: 0 0 0px #00ffaa; border-color: #00ffaa; background: #fff; }
            50% { transform: scale(1.2); box-shadow: 0 0 30px #00ffaa; border-color: #00ffaa; background: rgba(0,255,170,0.5); }
            100% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 0, 255, 0.4); border-color: #ff00ff; background: transparent; }
        }
        .purchased-anim { animation: purchaseSuccess 0.6s ease-out; }
        .ship-icon-canvas { display: block; pointer-events: none; transition: opacity 0.2s; }
        .ship-req { font-size: 11px; color: #ff0055; margin-top: 2px; font-weight: bold; text-align: center; transition: opacity 0.2s; text-shadow: 0 0 5px #ff0055;}

        /* --- BAŞLANGIÇ EKRANI IZGARA TASARIMI --- */
        .start-menu-grid {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: stretch;
            gap: 30px;
            width: 95%;
            max-width: 1000px;
            margin-bottom: 25px;
        }

        .start-menu-panel {
            display: flex;
            flex-direction: column;
            align-items: center;
            background: rgba(0, 255, 255, 0.02);
            border: 1px solid rgba(0, 255, 255, 0.1);
            padding: 25px;
            border-radius: 8px;
            box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.05);
            flex: 1;
            min-width: 320px;
        }

        /* --- KALICI YÜKSELTMELER VE AYARLAR EKRANI --- */
        .upgrade-list { 
            display: flex; flex-direction: column; gap: 15px; width: 400px; max-width: 95%; 
            margin-top: 20px; padding-right: 5px;
        }
        
        /* Neon Scrollbar Tasarımı */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
        ::-webkit-scrollbar-thumb { background: rgba(0, 255, 255, 0.3); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(0, 255, 255, 0.6); }

        /* --- AYARLAR EKRANI IZGARA (GRID) TASARIMI --- */
        .settings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
            width: 90%;
            max-width: 900px;
            margin-top: 20px;
        }
        
        .settings-column {
            display: flex;
            flex-direction: column;
            gap: 12px;
            background: rgba(0, 255, 255, 0.03);
            border: 1px solid rgba(0, 255, 255, 0.15);
            padding: 25px;
            border-radius: 8px;
            box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.05);
        }
        
        .settings-column-title {
            color: #fff;
            font-size: 20px;
            text-align: center;
            letter-spacing: 3px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            padding-bottom: 10px;
            margin-bottom: 10px;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
        }

        .upgrade-item { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 204, 0, 0.3); padding: 15px; border-radius: 4px; }
        .upg-info { text-align: left; }
        .upg-title { font-size: 20px; color: #ffcc00; text-shadow: 0 0 10px #ffcc00; margin-bottom: 5px;}
        .upg-desc { font-size: 12px; color: #aaa; }
        .upg-level { font-size: 14px; color: #00ffff; font-weight: bold; margin-top: 5px;}
        .upg-btn { background: transparent; color: #fff; border: 1px solid #ff0055; padding: 10px 20px; cursor: pointer; font-family: 'Rajdhani'; font-weight: bold; transition: all 0.3s; }
        .upg-btn:hover:not(:disabled) { background: #ff0055; color:#fff; box-shadow: 0 0 15px #ff0055; }
        .upg-btn:disabled { border-color: #444; color: #444; cursor: not-allowed; }

        .controls-info { margin-top: 30px; display: flex; gap: 30px; color: #888; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
        .key { border: 1px solid #444; padding: 4px 8px; border-radius: 4px; color: #ccc; margin-right: 5px; }

        /* MOBIL KONTROLLER */
        .mobile-controls { position: absolute; bottom: 30px; width: 100%; height: 160px; display: none; justify-content: space-between; padding: 0 50px; z-index: 15; pointer-events: none; touch-action: none; }
        .joystick-zone { width: 140px; height: 140px; background: rgba(255, 255, 255, 0.05); border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.1); position: relative; pointer-events: auto; backdrop-filter: blur(2px); }
        .joystick-knob { width: 60px; height: 60px; background: radial-gradient(circle, #00ffff 0%, rgba(0,255,255,0.5) 60%); border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 20px rgba(0,255,255,0.4); transition: transform 0.05s; }
        #knobRight { background: radial-gradient(circle, #ff0055 0%, rgba(255,0,85,0.5) 60%); box-shadow: 0 0 20px rgba(255,0,85,0.4); }

        .total-points-display {
            position: absolute; top: 25px; right: 30px; font-size: 22px; color: #ffcc00;
            text-shadow: 0 0 15px rgba(255, 204, 0, 0.6); font-weight: bold; letter-spacing: 2px;
            background: rgba(0, 0, 0, 0.6); padding: 8px 15px; border: 1px solid rgba(255, 204, 0, 0.3); border-radius: 4px;
            z-index: 50;
        }

        /* Retro CRT Efekti Overlay */
        .crt-overlay {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
            background-size: 100% 2px, 3px 100%;
            pointer-events: none; z-index: 999; 
            display: none;
        }

        /* --- MOBIL UYUMLULUK --- */
        @media (max-width: 768px) {
            #uiLayer { padding: 15px 10px; }
            h1 { font-size: 36px; margin-top: 10px; }
            h1::after { font-size: 11px; letter-spacing: 6px; bottom: -10px; }
            
            /* Puanın başlıkla üst üste binmesini engellemek için akışa sokulur */
            .total-points-display { 
                position: relative; 
                top: auto; right: auto; 
                margin-bottom: 20px; 
                font-size: 16px; 
                padding: 8px 12px;
                align-self: center; 
            }

            .start-menu-grid { gap: 15px; margin-bottom: 15px; }
            .start-menu-panel { padding: 15px; min-width: 100%; }
            .ship-item { width: 55px; height: 55px; }

            .mobile-controls { display: flex; height: 120px; padding: 0 5%; bottom: 20px; }
            .joystick-zone { width: 110px; height: 110px; }
            .joystick-knob { width: 50px; height: 50px; }
            
            .controls-info { display: none; }
            .btn { padding: 12px 30px; font-size: 16px; margin-top: 5px; } 
            
            .hud-top { justify-content: space-between; align-items: flex-start; }
            .player-info { font-size: 14px; }
            .score-value { font-size: 26px; }
            .diff-info { font-size: 10px; margin-bottom: 4px; }
            .highscore-value { font-size: 12px; }
            
            .health-bar-container { width: 120px; height: 10px; }
            .health-text { font-size: 14px; min-width: 35px; }
            .icon-btn { width: 32px; height: 32px; font-size: 14px; }

            .settings-grid { grid-template-columns: 1fr; width: 95%; gap: 15px; }
            
            /* Mobilde dar ekranlarda giriş yerini düzenle */
            .nickname-input { padding: 10px 15px; font-size: 16px; width: 100%; max-width: 250px; }
            .diff-container { gap: 8px; }
            .diff-btn { padding: 8px 15px; font-size: 14px; }
        }

        /* Daha da dar / yatay ekranlı telefonlar için */
        @media (max-height: 600px) {
            .screen { padding: 15px 0; }
            h1 { font-size: 32px; margin-bottom: 20px; }
            .mobile-controls { height: 90px; bottom: 10px; }
            .joystick-zone { width: 90px; height: 90px; }
            .joystick-knob { width: 40px; height: 40px; }
            .btn { padding: 10px 20px; font-size: 14px; }
            .start-menu-grid { gap: 10px; }
        }