/*
 * Sürat ve Hız Yarışı Eklentisi Stil Dosyası
 * Copyright Aydınoloji (https://www.aydinoloji.com)
 * Bu dosya, Aydınoloji projesinin bir parçasıdır.
 * İzinsiz kopyalanamaz veya dağıtılamaz.
 *
 * v1.1.0 - iFrame Mimarisi (z-index'ler sıfırlandı)
 */

/* Ana Kapsayıcı (Artık tüm sayfa) */
#hsy-game-wrapper {
    width: 100%;
    height: 100%; /* Tam sayfa */
    margin: 0 auto;
    background-color: #0d1a1a;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    /* Sağ tık engelleme (Kural 8) */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    touch-action: manipulation;
    display: flex; /* İçeriği ortalamak için */
    align-items: center;
    justify-content: center;
}

/* Oyunun ana çerçevesi */
#hsy-game-container {
    position: relative;
    width: 100%;
    max-width: 900px; /* Maksimum genişlik */
    overflow: hidden;
    
    /* Aspect ratio (en-boy oranı) koruması */
    aspect-ratio: 4 / 3; /* 800 / 600 (veya 75% padding-bottom yerine) */
    
    /* Eğer aspect-ratio desteklenmiyorsa (eski tarayıcılar) */
    @supports not (aspect-ratio: 4 / 3) {
        padding-bottom: 75%;
        height: 0;
    }
    
    /* dikey olarak çok dar ekranlar için (örn. 900px geniş ama 400px yüksek) */
    max-height: 100vh; 
}

.hsy-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2%;
    box-sizing: border-box;
    text-align: center;
}

/* --- Kontrol Butonları (Kural 3) --- */
#hsy-controls-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100; /* Sadece oyun içi katmanlama */
    display: flex;
    gap: 10px;
}
#hsy-controls-overlay button {
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid var(--tema-renk, #008c8c);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
#hsy-controls-overlay button:hover {
    background-color: rgba(0, 140, 140, 0.8);
}

/* --- Sol Alt Logo (Kural 5) --- */
#hsy-bottom-logo {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 50px;
    height: 50px;
    opacity: 0.7;
    z-index: 50;
    pointer-events: none;
}

/* --- Kapak Ekranı (Kural 4) --- */
#hsy-cover-screen {
    justify-content: center;
    z-index: 20; /* Ana oyun ekranının üstünde */
}
.hsy-cover-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
    border-radius: 50%;
    border: 4px solid var(--tema-renk, #008c8c);
}
.hsy-cover-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 30px;
}
.hsy-cover-buttons {
    display: flex;
    gap: 20px;
}

/* --- Genel Buton Stilleri --- */
.hsy-btn {
    background-color: var(--tema-renk, #008c8c);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 140, 140, 0.3);
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
}
.hsy-btn:hover {
    background-color: #00a3a3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 140, 140, 0.5);
}
.hsy-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.hsy-btn-alt {
    background-color: transparent;
    border: 2px solid var(--tema-renk, #008c8c);
    color: var(--tema-renk, #008c8c);
    box-shadow: none;
}
.hsy-btn-alt:hover {
    background-color: rgba(0, 140, 140, 0.1);
    color: #00fafab3;
    transform: translateY(-2px);
}

/* --- Bilgi & Quiz Modalı (Artık Basit) --- */
.hsy-modal-backdrop {
    position: absolute; /* 'fixed' değil, oyun çerçevesine göre */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 26, 26, 0.85); /* Arka plan */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200; /* Oyun içi en üst katman */
    -webkit-backdrop-filter: blur(5px); 
    backdrop-filter: blur(5px);
}

.hsy-modal-content {
    background-color: #0d1a1a;
    color: white;
    border: 2px solid var(--tema-renk, #008c8c);
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 0 40px rgba(0, 140, 140, 0.5);
    text-align: left;
    z-index: 201; /* Arka planın üstünde */
}
.hsy-modal-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--tema-renk, #008c8c);
    margin-top: 0;
    margin-bottom: 20px;
}
.hsy-modal-content p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}
.hsy-modal-content ol {
    padding-left: 25px;
    margin-bottom: 25px;
}
.hsy-modal-content li {
    font-size: 1rem;
    margin-bottom: 10px;
}
.hsy-modal-content button {
    display: block;
    margin: 0 auto;
}

/* --- Ana Oyun Ekranı --- */
#hsy-main-game {
    justify-content: flex-start;
    padding-top: 60px; /* Kontrol butonları için yer */
    z-index: 10; /* Kapak ekranının altında */
}
.hsy-description {
    font-size: 1.1rem;
    color: #b0e0e0;
    margin-bottom: 15px;
}
.hsy-animation-controls {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}
.hsy-canvas-container {
    width: 95%;
    max-width: 800px;
    margin: 0 auto;
    background: #060e0e;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #005f5f;
    position: relative;
    overflow: hidden; 
}
#hsy-raceCanvas {
    width: 100%;
    height: auto;
    border-radius: 5px;
    background-color: #f3f4f6;
    display: block; 
}
.hsy-data-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-top: 10px;
}
.hsy-data-item {
    padding: 5px;
}
.hsy-data-title {
    font-size: 1.1rem;
    font-weight: 700;
}
.hsy-displacement-info {
    font-weight: 700;
    color: #facc15; /* yellow-400 */
    margin-top: 10px;
    font-size: 1.1rem;
}

/* --- Quiz Bölümü (Modal İçinde) --- */
.hsy-quiz-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    text-align: center;
}
.hsy-quiz-question {
    background-color: #0d1a1a;
    border: 1px solid #005f5f;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.hsy-quiz-question label {
    font-size: 1.2rem;
    font-weight: 600;
}
.hsy-quiz-inputs {
    display: flex;
    align-items: center;
}
.hsy-quiz-icon {
    font-size: 2rem;
    margin: 0 10px;
}
.hsy-quiz-select {
    background-color: #333;
    color: white;
    border: 2px solid var(--tema-renk, #008c8c);
    border-radius: 5px;
    padding: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
}
.hsy-btn-check {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    background-color: #2563EB; /* blue-600 */
}
.hsy-btn-check:hover {
    background-color: #1D4ED8; /* blue-700 */
}
#hsy-feedbackMessage {
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 10px;
    border-radius: 5px;
    min-height: 20px; 
    text-align: center;
}
#hsy-feedbackMessage.success {
    background-color: #059669; /* green-600 */
    color: white;
}
#hsy-feedbackMessage.error {
    background-color: #E11D48; /* red-600 */
    color: white;
}
#hsy-feedbackMessage.info {
    background-color: #F59E0B; /* amber-500 */
    color: #333;
}

/* Mobil Cihazlar için Ayarlamalar */
@media (max-width: 768px) {
    #hsy-game-container {
       /* aspect-ratio daha esnek olmalı */
       width: 100%;
       height: 100%;
       max-height: 100vh;
       aspect-ratio: unset;
       padding-bottom: 0;
    }
    .hsy-cover-title {
        font-size: 1.8rem;
    }
    .hsy-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    #hsy-controls-overlay {
        top: 10px;
        right: 10px;
    }
    #hsy-controls-overlay button {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    #hsy-bottom-logo {
        width: 40px;
        height: 40px;
    }
    #hsy-main-game {
        padding-top: 50px;
    }
    .hsy-quiz-question {
        flex-direction: column;
    }
    .hsy-quiz-icon {
        font-size: 1.8rem;
    }
    .hsy-quiz-select {
        font-size: 1.3rem;
    }
    .hsy-data-panel {
        flex-direction: column;
        gap: 5px;
        font-size: 0.9rem;
    }
    .hsy-data-title {
        font-size: 1rem;
    }
    .hsy-displacement-info {
        font-size: 1rem;
    }
    .hsy-description {
        font-size: 1rem;
        padding: 0 10px;
    }
}

