/* public/css/account.css — Hesap Seviyesi, Görevler, Profil */

/* ─── Profil Butonu ──────────────────────────────────────────────────────── */

@keyframes profilePulse {
    0%, 100% { box-shadow: 0 0 4px rgba(255, 190, 0, 0.3); }
    50%       { box-shadow: 0 0 12px rgba(255, 190, 0, 0.7); }
}

.profile-hud-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: var(--border-radius-sm, 8px);
    padding: 0 12px;
    height: var(--icon-btn-size, 36px);
    cursor: pointer;
    flex-shrink: 0;
    color: #00ff88;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
    white-space: nowrap;
    pointer-events: auto;
}

.profile-hud-btn:hover {
    background: rgba(0, 255, 136, 0.18);
    border-color: rgba(0, 255, 136, 0.6);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

/* Giriş yapılmamış — amber/sarı + pulse */
.profile-hud-btn.guest-mode {
    color: #ffbe00;
    border-color: rgba(255, 190, 0, 0.45);
    background: rgba(255, 190, 0, 0.07);
    animation: profilePulse 2s ease-in-out infinite;
}

.profile-hud-btn.guest-mode:hover {
    background: rgba(255, 190, 0, 0.15);
    border-color: rgba(255, 190, 0, 0.7);
}

.profile-hud-btn.guest-mode i,
.profile-hud-btn.guest-mode .profile-hud-lv {
    text-shadow: 0 0 6px rgba(255, 190, 0, 0.6);
    color: #ffbe00;
}

.profile-hud-btn.guest-mode .profile-hud-sub {
    color: rgba(255, 190, 0, 0.8);
    display: flex !important; /* mobilde de göster */
}

.profile-hud-btn i {
    font-size: 0.85rem;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
    flex-shrink: 0;
}

.profile-hud-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    gap: 1px;
}

.profile-hud-lv {
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
    font-size: 0.72rem;
}

.profile-hud-sub {
    font-size: 0.58rem;
    color: rgba(0, 255, 136, 0.55);
    letter-spacing: 0.3px;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#acct-level-num {
    color: inherit;
}

/* ─── Profil Modal ────────────────────────────────────────────────────────── */

.profile-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.profile-modal-box {
    background: rgba(5, 10, 22, 0.97);
    border: 1px solid rgba(0, 234, 255, 0.25);
    border-radius: 14px;
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 234, 255, 0.08);
    padding-bottom: 16px;
}

.profile-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 234, 255, 0.15);
    font-size: 0.85rem;
    font-weight: bold;
    color: #00eaff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.profile-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    transition: color 0.2s;
}

.profile-close-btn:hover { color: #fff; }

/* XP satırı (modal üstü) */
.profile-xp-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-lv-big {
    font-size: 1.1rem;
    font-weight: 900;
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    white-space: nowrap;
    font-family: 'Orbitron', sans-serif;
    flex-shrink: 0;
}

.profile-xp-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-xp-text {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: right;
}

/* Modal bölüm başlıkları */
.profile-section-title {
    font-size: 0.7rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 12px 16px 6px;
}

/* Avatar grid — modalin içinde */
.profile-modal-box .avatar-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    padding: 0 16px;
}

/* Renk seçici — modalin içinde */
.profile-modal-box #color-picker-row {
    padding: 0 16px;
}

.acct-xp-bar-bg {
    width: 70px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.acct-xp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff88, #00eaff);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
}

/* ─── Level-Up Overlay ────────────────────────────────────────────────────── */

#level-up-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s;
}

#level-up-overlay.lu-visible {
    background: rgba(0, 0, 0, 0.35);
    animation: luBgPulse 0.5s ease;
}

#level-up-overlay.lu-fade-out {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lu-content {
    text-align: center;
    animation: luSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lu-icon {
    font-size: 3rem;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 20px #00ff88);
}

.lu-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0,255,136,0.8), 0 0 40px rgba(0,255,136,0.4);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.lu-level {
    font-size: 1.6rem;
    color: #00eaff;
    font-weight: bold;
    margin-top: 6px;
    text-shadow: 0 0 12px rgba(0,234,255,0.7);
}

.lu-color-unlock {
    font-size: 0.9rem;
    color: #ffd700;
    margin-top: 10px;
    text-shadow: 0 0 8px rgba(255,215,0,0.5);
}

@keyframes luSlideIn {
    from { transform: scale(0.5) translateY(-30px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);     opacity: 1; }
}

@keyframes luBgPulse {
    0%   { background: rgba(0,255,136,0.1); }
    50%  { background: rgba(0,255,136,0.15); }
    100% { background: rgba(0,0,0,0.35); }
}

/* ─── Quest Panel ─────────────────────────────────────────────────────────── */

.quest-panel {
    position: fixed;
    top: 60px;
    right: 16px;
    width: 280px;
    background: rgba(5, 10, 20, 0.92);
    border: 1px solid rgba(0, 234, 255, 0.25);
    border-radius: 12px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(0,234,255,0.1);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.quest-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(0, 234, 255, 0.08);
    border-bottom: 1px solid rgba(0, 234, 255, 0.15);
    font-size: 0.8rem;
    font-weight: bold;
    color: #00eaff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.quest-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s;
}

.quest-close-btn:hover { color: #fff; }

.quest-card {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}

.quest-card:last-child { border-bottom: none; }

.quest-card:hover { background: rgba(255,255,255,0.03); }

.quest-card.quest-done {
    opacity: 0.65;
}

.quest-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 6px;
}

.quest-label {
    font-size: 0.78rem;
    color: #ddd;
    line-height: 1.3;
    flex: 1;
}

.quest-card.quest-done .quest-label {
    color: #888;
    text-decoration: line-through;
}

.quest-reward {
    font-size: 0.72rem;
    color: #00ff88;
    font-weight: bold;
    white-space: nowrap;
}

.quest-progress-bg {
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00eaff, #00ff88);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.quest-card.quest-done .quest-progress-fill {
    background: #4a7a4a;
}

.quest-card-bot {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quest-count {
    font-size: 0.68rem;
    color: #888;
}

.quest-check {
    color: #00ff88;
    font-size: 0.9rem;
    font-weight: bold;
}

.quest-empty {
    padding: 20px;
    text-align: center;
    color: #555;
    font-size: 0.85rem;
}

.quest-login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #778;
    padding: 24px 16px;
}

.quest-login-btn {
    margin-top: 8px;
    padding: 6px 20px;
    background: linear-gradient(135deg, #00eaff22, #00eaff44);
    border: 1px solid #00eaff66;
    color: #00eaff;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.quest-login-btn:hover {
    background: linear-gradient(135deg, #00eaff33, #00eaff55);
    border-color: #00eaff;
}

/* Quest butonu */
.quest-icon-btn {
    position: relative;
}

.quest-btn-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: #ff3355;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 0 4px rgba(255,51,85,0.7);
}

.quest-badge-done {
    background: #00cc66;
    box-shadow: 0 0 4px rgba(0,204,102,0.7);
}

#quest-btn.active {
    background: rgba(0, 234, 255, 0.15) !important;
    color: #00eaff;
}

/* Quest tamamlandı bildirimi (toast şeklinde) */
.quest-complete-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid rgba(0,255,136,0.4);
    color: #00ff88;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 2000;
    animation: questToastIn 0.3s ease, questToastOut 0.4s ease 2.2s forwards;
    pointer-events: none;
}

@keyframes questToastIn  { from { opacity:0; transform: translateX(-50%) translateY(10px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
@keyframes questToastOut { from { opacity:1; } to { opacity:0; } }

/* ─── Avatar Seçici (Lobby) ────────────────────────────────────────────── */

.avatar-selector {
    margin-bottom: 12px;
}

.avatar-selector-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.avatar-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
    transition: all 0.2s;
}

.avatar-item:hover {
    background: rgba(0,234,255,0.1);
    border-color: rgba(0,234,255,0.3);
    color: #00eaff;
}

.avatar-item.avatar-selected {
    background: rgba(0,234,255,0.15);
    border-color: #00eaff;
    color: #00eaff;
    box-shadow: 0 0 8px rgba(0,234,255,0.3);
}

/* ─── Renk Seçici (Lobby) ──────────────────────────────────────────────── */

.color-picker-section {
    margin-bottom: 12px;
}

.color-picker-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#color-picker-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.color-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.15);
    position: relative;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.color-circle:hover {
    transform: scale(1.15);
    border-color: rgba(255,255,255,0.5);
}

.color-circle.color-active {
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

.color-circle.color-locked {
    opacity: 0.35;
    cursor: not-allowed;
}

.color-circle.color-locked:hover {
    transform: none;
}

.color-lock-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 0.55rem;
    line-height: 1;
}

.color-locked-msg {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    font-style: italic;
}

/* ─── Profil Modal — Çıkış butonu ─────────────────────────────────────────── */

#profile-auth-row {
    display: none;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#profile-logout-btn {
    width: 100%;
    padding: 8px 0;
    background: rgba(255, 60, 60, 0.08);
    border: 1px solid rgba(255, 60, 60, 0.35);
    border-radius: 8px;
    color: #ff6060;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

#profile-logout-btn:hover {
    background: rgba(255, 60, 60, 0.18);
    border-color: rgba(255, 60, 60, 0.6);
}

/* Sadece giriş yapılmışsa göster — auth-client.js updateAuthUI'da toggle edilir */
body.user-logged-in #profile-auth-row {
    display: block;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

/* Küçük telefon ekranları */
@media (max-width: 480px) {
    .profile-hud-btn {
        padding: 0 7px;
        font-size: 0.68rem;
    }
    /* 480px altında sub-satır çok dar → gizle */
    .profile-hud-sub {
        display: none;
    }
    /* 480px altında para yazısı çok yer kaplıyor, küçük boyuta indir */
    .lobby-money {
        font-size: 0.78rem !important;
        padding: 0 10px !important;
    }
    .quest-panel {
        width: calc(100vw - 32px);
        right: 16px;
        top: 50px;
    }
    .profile-modal-box {
        width: calc(100vw - 24px);
    }
}

/* Dokunmatik cihaz — daha büyük hedef alanlar */
@media (pointer: coarse) {
.avatar-item {
        min-height: 40px;
    }
    .color-circle {
        width: 34px;
        height: 34px;
    }
    .quest-close-btn {
        padding: 4px 8px;
        font-size: 1.1rem;
    }
    .profile-close-btn {
        padding: 4px 10px;
        font-size: 1.2rem;
    }
}

/* iPhone X landscape ve benzeri küçük yükseklikler */
@media (max-height: 420px) {
    .quest-panel {
        top: 44px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    #level-up-overlay .lu-title {
        font-size: 1.6rem;
    }
    .profile-modal-box {
        max-height: calc(100vh - 20px);
    }
}

/* Çok küçük ekranlar */
@media (max-width: 360px) {
    .profile-hud-lv {
        display: none;
    }
    /* 360px altında para yazısı gizle */
    .lobby-money {
        display: none !important;
    }
}

/* ─── Mobil: profile-btn + lobby-money lobide görünür olmalı ──────────────
   mobile.css / mobile-landscape.css top-left-controls'u tamamen gizliyor.
   account.css son yüklendiği için !important ile geçersiz kılabiliriz.      */

/* Yatay dokunmatik (iPhone landscape, vb.) — lobi durumunda göster */
@media (pointer: coarse) and (orientation: landscape) {
    /* top-left-controls lobide görünür olmalı (mobile.css'in display:none'ı geçersiz kıl) */
    body:not(.in-game) .top-left-controls {
        display: flex !important;
        top: 5px !important;
        left: 8px !important;
        gap: 6px !important;
    }
    body:not(.in-game):not(.crazygames-mode) #profile-btn,
    body:not(.in-game) .lobby-money {
        display: flex !important;
    }
    /* Oyun içinde profil butonu gizli (sadece exitBtn kalır) */
    body.in-game #profile-btn {
        display: none !important;
    }
    /* Profil butonu compact boyut */
    body:not(.in-game) #profile-btn {
        height: 30px !important;
        padding: 0 8px !important;
        font-size: 0.65rem !important;
    }
    body:not(.in-game) .lobby-money {
        font-size: 0.8rem !important;
        padding: 0 10px !important;
        height: 30px !important;
    }
    .profile-hud-sub {
        display: none !important;
    }
}

/* Dikey dokunmatik portrait (küçük telefon portrait) — lobi durumunda göster */
@media (pointer: coarse) and (orientation: portrait) {
    body:not(.in-game) .top-left-controls {
        display: flex !important;
        top: 5px !important;
        left: 8px !important;
        gap: 6px !important;
    }
    body:not(.in-game):not(.crazygames-mode) #profile-btn,
    body:not(.in-game) .lobby-money {
        display: flex !important;
    }
    body.in-game #profile-btn {
        display: none !important;
    }
    .profile-hud-sub {
        display: none !important;
    }
}
