:root {
    --primary-color: #4f46e5;
    --secondary-color: #6366f1;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --text-color: #111827;
    --muted-text: #6b7280;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --header-bg: #111827cc;
    --shadow: 0 10px 25px rgba(0,0,0,.08);
    --transition: all .25s ease;
    --radius: 16px;
}

.dark-mode {
    --primary-color: #818cf8;
    --secondary-color: #a5b4fc;
    --accent-color: #34d399;
    --text-color: #e5e7eb;
    --muted-text: #9ca3af;
    --bg-color: #0b1020;
    --card-bg: #0f172a;
    --header-bg: #0b1020cc;
    --shadow: 0 10px 25px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    background: linear-gradient(180deg, var(--bg-color), color-mix(in oklab, var(--bg-color) 85%, #ffffff 15%));
    color: var(--text-color);
    font: 500 16px/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    display: flex; flex-direction: column;
}

header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: saturate(1.2) blur(10px);
    background: var(--header-bg);
    color: #fff; box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px; margin: 0 auto; padding: 12px 20px;
    display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
}

.logo { display:flex; gap:10px; align-items:center; font-weight:800; letter-spacing:.5px; }
.logo i { color: #fbbf24; }
.logo span { font-size: 20px; }

nav ul { display:flex; list-style:none; gap: 10px; }
nav a {
    color:#fff; text-decoration:none; padding:8px 12px; border-radius:12px;
    opacity:.9;
}
nav a:hover { background: #ffffff22; opacity: 1; }

.header-controls { display:flex; gap:12px; align-items:center; }
.search-container { display:flex; }
.search-container input {
    border: none; outline: none; padding: 10px 14px; border-radius: 12px 0 0 12px; width: 220px;
}
.search-container button {
    border: none; background: var(--accent-color); color:#fff; padding: 10px 14px; border-radius:0 12px 12px 0; cursor:pointer;
}
.theme-toggle {
    width:40px; height:40px; border-radius:12px; background:#ffffff22; border:1px solid #ffffff33; color:#fff; cursor:pointer;
    display:grid; place-items:center;
}

.container { max-width: 1200px; margin: 18px auto; padding: 0 16px; flex:1; width:100%; }

.hero {
    position: relative; border-radius: 24px; overflow:hidden; box-shadow: var(--shadow);
    background: radial-gradient(1200px 500px at 10% -20%, #6366f1 20%, transparent 60%), 
                radial-gradient(1200px 500px at 110% 120%, #06b6d4 20%, transparent 60%), 
                linear-gradient(135deg, #0ea5e9, #6366f1);
    padding: 48px 20px; color:#fff; text-align:center;
}
.hero h1 { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 10px; }
.hero p { opacity:.95; max-width: 760px; margin: 8px auto 20px; }
.btn {
    display:inline-flex; gap:8px; align-items:center; padding:12px 18px; border-radius:14px; background:#fff; color:#111827; font-weight:700; text-decoration:none; border: none; cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }

.platform-indicators { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin:14px 0 6px; }
.platform { background: var(--card-bg); padding:8px 12px; border-radius: 999px; box-shadow: var(--shadow); display:flex; align-items:center; gap:8px; }

.warning {
    margin: 14px auto 6px; max-width: 900px; display:flex; gap:10px; align-items:center;
    background: color-mix(in oklab, var(--card-bg) 70%, #f59e0b 30%); color:#111827;
    padding: 12px 14px; border-radius: 14px;
}

.section-title { display:flex; align-items:center; gap:10px; margin: 20px 0 10px; font-size: 20px; font-weight:800; }

.categories { display:flex; flex-wrap:wrap; gap:8px; }
.category {
    background: var(--card-bg); border:1px solid #e5e7eb22; color: var(--text-color);
    padding: 10px 14px; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow);
}
.category.active, .category:hover { background: var(--primary-color); color:#fff; }

.games-grid { 
    display:grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 14px;
}
.game-card {
    background: var(--card-bg); border-radius: var(--radius); overflow:hidden;
    position:relative; box-shadow: var(--shadow); transition: var(--transition); display:flex; flex-direction:column;
}
.game-card:hover { transform: translateY(-4px); }
.thumb {
    position:relative; aspect-ratio: 16/9; background:#0b1020; overflow:hidden;
    display:grid; place-items:center;
}
.thumb img { width:100%; height:100%; object-fit:cover; }
.badge { position:absolute; top:10px; left:10px; background: var(--accent-color); color:#fff; font-weight:800; font-size: 12px; padding:6px 10px; border-radius:999px; }
.fav-btn {
    position:absolute; top:10px; right:10px; width:36px; height:36px; border-radius:50%; border:none; cursor:pointer; display:grid; place-items:center;
    background: #00000055; color:#fff;
}
.fav-btn.active { background: #ef4444; }

.card-body { padding: 12px; display:flex; flex-direction:column; gap:8px; }
.title { font-weight:800; }
.desc { color: var(--muted-text); font-size: 14px; min-height: 42px; }
.meta { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:auto; }
.rating i { color: #f59e0b; }
.play-btn {
    background: var(--primary-color); color:#fff; border:none; padding:8px 12px; border-radius:10px; cursor:pointer; display:flex; gap:8px; align-items:center;
}
.play-btn:hover { background: var(--secondary-color); }

/* Modal */
.modal { 
    display:none; 
    position: fixed; 
    inset:0; 
    background: #000000bb; 
    z-index: 100; 
    align-items:center; 
    justify-content:center; 
    overflow: hidden; /* Sayfa kaymasını engeller */
}
.modal-content { 
    width:min(96vw, 1000px); 
    height:min(90vh, 720px); 
    max-height: 90vh; /* Maksimum yükseklik */
    background: var(--card-bg); 
    border-radius: 16px; 
    overflow: hidden; 
    display:flex; 
    flex-direction:column; 
}
.modal-header { 
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); 
    color:#fff; 
    padding: 12px 16px; 
    display:flex; 
    justify-content:space-between; 
    align-items:center; 
}
.modal-header h2 { font-size: 18px; }
.close-modal { 
    width:36px; 
    height:36px; 
    border-radius:10px; 
    border:none; 
    background:#ffffff33; 
    color:#fff; 
    cursor:pointer; 
}
.game-container { 
    flex: 1; 
    overflow: hidden; /* İframe kaymasını engeller */
}
.game-iframe { 
    width:100%; 
    height:100%; 
    border:none; 
    background: var(--card-bg);
}

footer { margin-top: 24px; background: #111827; color:#cbd5e1; }
footer .footer-content { max-width: 1200px; margin: 0 auto; padding: 24px 16px; text-align:center; }

/* Appear animation */
.game-card { opacity:0; transform: translateY(12px); animation: up .35s forwards; }
@keyframes up { to { opacity:1; transform: translateY(0); } }

/* Oyun kartları için animasyon gecikmeleri */
.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }

/* Modal için responsive düzenlemeler */
@media (max-width: 768px) {
    .modal-content {
        width: 98vw;
        height: 90vh;
        border-radius: 12px;
    }
    
    .header-content {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 12px;
    }
    
    nav ul {
        justify-content: center;
    }
    
    .search-container input {
        width: 180px;
    }
    
    /* Mobil cihazlar için ek stiller */
    .modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .game-iframe {
        height: calc(100vh - 100px);
    }
}

/* Yıldız puanlama stilleri */
.rate a {
    color: #f59e0b;
    text-decoration: none;
    font-size: 18px;
}

.rate a:hover {
    color: #fbbf24;
}

/* Dokunmatik kontroller */
.touch-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    pointer-events: none;
}

.touch-controls.visible {
    display: flex;
}

.control-group {
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

.control-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    touch-action: manipulation;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.control-btn:active {
    background: rgba(200, 200, 200, 0.9);
    transform: scale(0.95);
}

.control-direction {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
}

.control-direction .control-btn {
    width: 60px;
    height: 60px;
    margin: 0;
}

/* Mobil için responsive düzenlemeler */
@media (max-width: 768px) {
    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }
    
    .control-direction .control-btn {
        width: 50px;
        height: 50px;
    }
}

/* Oyun içi kontrol bilgisi */
.control-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 100;
}

/* Klavye kısayol gösterimi */
.keyboard-key {
    display: inline-block;
    padding: 2px 6px;
    background: #333;
    color: white;
    border-radius: 4px;
    font-size: 11px;
    margin: 0 2px;
    border: 1px solid #555;
}