/**
 * Likya Mini Games - Ana Stil Dosyası
 * Modern Arcade, Koyu Tema, Neon Efektler, Tam Duyarlı (Responsive)
 */

:root {
    /* Renk Paleti */
    --bg-dark: #0a0c16;
    --bg-card: rgba(18, 22, 42, 0.75);
    --bg-card-hover: rgba(26, 32, 60, 0.85);
    --bg-modal: rgba(12, 15, 29, 0.95);
    
    --neon-blue: #00d2ff;
    --neon-cyan: #00f5c4;
    --neon-purple: #9d4edd;
    --neon-magenta: #ff007f;
    --neon-yellow: #ffb703;
    --neon-green: #00e676;
    --neon-red: #ff3366;

    --text-primary: #f0f4ff;
    --text-secondary: #9aa5ce;
    --text-muted: #565f89;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-neon: rgba(0, 210, 255, 0.4);
    
    --glow-cyan: 0 0 20px rgba(0, 245, 196, 0.35);
    --glow-blue: 0 0 25px rgba(0, 210, 255, 0.4);
    --glow-purple: 0 0 25px rgba(157, 78, 221, 0.4);
    --glow-red: 0 0 25px rgba(255, 51, 102, 0.5);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

/* Sıfırlama ve Temel Kurallar */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(157, 78, 221, 0.14), transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(0, 210, 255, 0.09), transparent 50%),
        radial-gradient(circle at 10% 60%, rgba(0, 245, 196, 0.07), transparent 50%);
}

/* Ana Konteyner (Android Safe Area / Çentik & Gezinme Çubuğu Uyumlu) */
#app {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
}

/* Ekran Yönetimi (Hafif ve Akıcı GPU Geçişi) */
.screen {
    display: none;
    flex-direction: column;
    width: 100%;
    flex: 1;
    will-change: opacity, transform;
    animation: fadeIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Üst Navigasyon Çubuğu (Ortak Header) */
.game-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 0 16px;
    z-index: 20;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.btn-icon:hover, .btn-icon:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--neon-blue);
    transform: scale(1.05);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.game-title-badge {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

/* Ortak Butonlar */
.btn-primary {
    background: linear-gradient(135deg, #00d2ff, #0099ff);
    color: #060913;
    font-size: 1.15rem;
    font-weight: 800;
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 210, 255, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    min-height: 56px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 210, 255, 0.5);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
    transform: scale(0.97);
}

.btn-accent-purple {
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
    color: #fff;
    box-shadow: 0 4px 20px rgba(157, 78, 221, 0.4);
}
.btn-accent-purple:hover {
    box-shadow: 0 8px 30px rgba(157, 78, 221, 0.6);
}

.btn-accent-cyan {
    background: linear-gradient(135deg, #00f5c4, #00b4d8);
    color: #05161e;
    box-shadow: 0 4px 20px rgba(0, 245, 196, 0.4);
}

/* Sonuç / Modal Kartları */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 15, 0.82);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}

.modal-overlay.active {
    display: flex;
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-card {
    background: var(--bg-modal);
    border: 1px solid var(--border-neon);
    box-shadow: var(--glow-blue), 0 20px 40px rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.modal-header-badge {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}

.badge-gold {
    background: rgba(255, 183, 3, 0.2);
    color: var(--neon-yellow);
    border: 1px solid rgba(255, 183, 3, 0.4);
}

.badge-purple {
    background: rgba(157, 78, 221, 0.2);
    color: var(--neon-purple);
    border: 1px solid rgba(157, 78, 221, 0.4);
}

.badge-cyan {
    background: rgba(0, 245, 196, 0.2);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 245, 196, 0.4);
}

.badge-green {
    background: rgba(0, 230, 118, 0.2);
    color: var(--neon-green);
    border: 1px solid rgba(0, 230, 118, 0.4);
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #fff;
}

.modal-stats {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 16px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.stat-highlight {
    font-size: 1.25rem;
    color: var(--neon-cyan);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Toast Bildirim */
#toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(18, 24, 45, 0.95);
    border: 1px solid var(--neon-cyan);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--glow-cyan), 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

#toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Ekran Sarsıntısı (Screen Shake) */
.shake {
    animation: shakeAnim 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeAnim {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Görsel Gerilim / Kırmızı Flaş */
.flash-red {
    animation: flashRed 0.3s ease-out;
}

@keyframes flashRed {
    0% { background-color: rgba(255, 51, 102, 0.3); }
    100% { background-color: transparent; }
}

/* Yardımcı Sınıflar */
.text-cyan { color: var(--neon-cyan); }
.text-blue { color: var(--neon-blue); }
.text-purple { color: var(--neon-purple); }
.text-yellow { color: var(--neon-yellow); }
.text-red { color: var(--neon-red); }
.text-green { color: var(--neon-green); }

/* Tablet / Geniş Ekranlarda Ana Menü 2 Sütun Desteği */
@media (min-width: 720px) {
    #app.hub-wide {
        max-width: 820px;
    }
}

/* Oyun Üst Bar Sağ Aksiyon Grubu */
.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Ortak Duraklatma Örtüsü (Pause Overlay) */
.pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 9, 19, 0.92);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    z-index: 35;
    border-radius: var(--radius-lg);
}

.pause-title {
    font-size: 1.65rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.pause-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* 320px Küçük Mobil Ekran Optimizasyonu */
@media (max-width: 350px) {
    #app {
        padding-top: calc(8px + env(safe-area-inset-top, 0px));
        padding-right: calc(10px + env(safe-area-inset-right, 0px));
        padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        padding-left: calc(10px + env(safe-area-inset-left, 0px));
    }
    .hub-title {
        font-size: 1.8rem;
    }
    .game-card {
        padding: 14px;
    }
    .modal-card {
        padding: 18px 14px;
    }
}

/* Yatay (Landscape) veya Kısa Ekran Optimizasyonu */
@media (max-height: 640px) {
    .game-top-bar {
        padding: 4px 0 10px;
    }
    .hub-hero {
        margin-bottom: 14px;
    }
}

/* Erişilebilirlik: Azaltılmış Hareket Tercihi Desteği */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .shake, .flash-red, .combo-pulse {
        animation: none !important;
    }
}


/* ========================================================================== */
/* GİZLİLİK VE VERİ GÜVENLİĞİ MODALI                                          */
/* ========================================================================== */
.modal-card-privacy {
    max-width: 480px;
    max-height: 85vh;
    padding: 24px 20px 20px;
    text-align: left;
    align-items: stretch;
}

.privacy-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 14px;
}

.privacy-modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.btn-privacy-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-privacy-close:hover {
    background: rgba(255, 59, 48, 0.2);
    color: #ff453a;
    border-color: rgba(255, 59, 48, 0.4);
}

.privacy-modal-body {
    overflow-y: auto;
    padding-right: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 52vh;
}

.privacy-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 2px;
}

.privacy-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--neon-cyan);
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.25);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.privacy-intro {
    font-size: 0.88rem;
    color: var(--text-primary);
    margin: 0;
}

.privacy-section h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.privacy-section p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.privacy-section a {
    color: var(--neon-cyan);
    text-decoration: underline;
}

.privacy-modal-actions {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
}


/* ========================================================================== */
/* BİLGİ / NASIL OYNANIR VE VERİ AKTARIMI MODALLARI                           */
/* ========================================================================== */
.modal-card-info {
    max-width: 480px;
    text-align: left;
    align-items: stretch;
    padding: 24px;
}

.info-modal-rule-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 14px 0 18px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-line;
}

.modal-card-transfer {
    max-width: 500px;
    text-align: left;
    align-items: stretch;
    padding: 24px;
}

.transfer-textarea {
    width: 100%;
    height: 85px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 10px;
    margin: 12px 0;
    resize: none;
    outline: none;
}

.transfer-textarea:focus {
    border-color: var(--neon-cyan);
}

.transfer-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}
