.game-header {
    background-color: var(--bg-panel);
    /* border-bottom: 1px solid var(--border);  <-- KALDIRILDI, Loading Bar alacak yerini */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    /* Loading bar için */
}

/* YÜKLEME ÇUBUĞU STYLE */
.loading-line-container {
    height: 2px;
    /* İnce çizgi */
    width: 100%;
    background-color: var(--border);
    /* Pasif durum rengi (Separator) */
    position: relative;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ef4444 0%, #8b5cf6 50%, #34d399 100%);
    /* Kırmızı -> Mor -> Elmas Yeşili */
    background-size: 200% 100%;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.6);
    /* Elmas Yeşili Glow */
    position: relative;
    will-change: width, opacity;
}

/* Parlama Efekti (Soldan sağa kayan ışık) */
.loading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.header-top {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Profil & Enerji Status - Özgür ve Sınırsız Tasarım */
.user-profile-status {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 2px 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    height: 50px;
}

.user-profile-status:hover {
    transform: translateX(2px);
}

.avatar-container {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.avatar-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 10px;
    opacity: 0.3;
    filter: blur(4px);
}

#user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

.level-indicator {
    position: absolute;
    top: -6px;
    left: -6px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info-area {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 80px;
}

.user-meta {
    display: flex;
    align-items: center;
    height: 100%;
}

.username {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-light);
    white-space: nowrap;
}

.energy-container-mini {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 2px;
    display: flex;
}

.energy-bar-bg {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1px;
    overflow: hidden;
}

.energy-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #eab308, #fbbf24, #eab308);
    background-size: 200% 100%;
    animation: flowPulse 3s linear infinite;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
    border-radius: 1px;
    transition: width 0.5s ease;
}

@keyframes flowPulse {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* Kompakt Sağ Arama */
.header-search-compact {
    margin-right: 8px;
}

.search-wrapper-mini {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 10px;
    height: 32px;
    width: 200px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    /* Sarsılmayı önlemek için */
}

.search-wrapper-mini:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.search-wrapper-mini:focus-within {
    width: 260px;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}

.search-wrapper-mini i {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-right: 8px;
}

.search-wrapper-mini input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.78rem;
    width: 100%;
    outline: none;
}

.search-wrapper-mini input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.search-shortcut {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.55rem;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 5px;
    pointer-events: none;
}

/* Sağ Taraf: Enerji ve Ayarlar */
.status-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.resource-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.25);
    padding: 0 12px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* Gold Display - enhanced with relative positioning for notifications */
.gold-display {
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Altın arttığında yeşil shimmer efekti */
.gold-display.gold-increase {
    border-color: rgba(74, 222, 128, 0.4) !important;
    box-shadow: 
        0 0 12px rgba(74, 222, 128, 0.15),
        inset 0 0 20px rgba(74, 222, 128, 0.06);
    animation: goldGlowPulse 0.8s ease-out;
}

/* Altın azaldığında kırmızı flash */
.gold-display.gold-decrease {
    border-color: rgba(248, 113, 113, 0.4) !important;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.12);
    animation: goldGlowPulse 0.6s ease-out;
}

@keyframes goldGlowPulse {
    0% {
        filter: brightness(1);
    }
    30% {
        filter: brightness(1.3);
    }
    100% {
        filter: brightness(1);
    }
}

/* Altın alanının altında beliren bildirim */
.income-toast {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    background: rgba(15, 23, 42, 0.92) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(74, 222, 128, 0.2) !important;
    border-radius: 8px !important;
    color: #4ade80 !important;
    padding: 6px 14px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 10px rgba(74, 222, 128, 0.06) !important;
    z-index: 10000 !important;
    white-space: nowrap;
    animation: incomeSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    font-family: 'Inter', sans-serif !important;
}

.income-toast small {
    color: #64748b !important;
    font-weight: 500 !important;
}

.income-toast .text-yellow {
    color: #fbbf24 !important;
    font-size: 0.7rem;
}

@keyframes incomeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes incomeSlideOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-6px) scale(0.95); }
}

.text-yellow {
    color: var(--energy);
}

/* =========================================
   GOLD DROPDOWN PANELİ
   ========================================= */
.gold-display { cursor: pointer; }
.gold-display:hover {
    border-color: rgba(234, 179, 8, 0.25) !important;
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.08);
}

.gold-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 30px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    overflow: hidden;
    animation: gdSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gdSlideIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- ALTIN PANELİ (SİMETRİK) --- */
.gold-info-panel {
    position: fixed;
    top: 70px; /* Header simetrisi */
    right: 30px; /* Kenar simetrisi */
    width: 260px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow: hidden;
    animation: slideInDown 0.2s ease-out;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95) translateY(-5px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.gold-panel-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 5px;
}

.gold-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    padding: 10px 5px;
    font-size: 0.72rem; /* Daha küçük font */
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.gold-tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.gold-panel-content {
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
}

/* Log Item Küçültme */
.gold-log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.gli-info .gli-reason { font-size: 0.75rem; color: #e2e8f0; }
.gli-info .gli-time { font-size: 0.6rem; color: #526174; }
.gli-amount { font-size: 0.78rem; font-weight: 700; }

/* --- GELİR-GİDER DENGESİ GÖRÜNÜMÜ (KÜÇÜK) --- */
.gold-balance-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gbv-stat-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px; /* Daha dar padding */
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.gbv-label {
    font-size: 0.6rem;
    color: #64748b;
    margin-bottom: 2px;
}

.gbv-value {
    font-size: 1.1rem; /* Daha dengeli font */
    font-weight: 700;
}

.gold-panel-footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #64748b;
}

.gold-total-balance {
    color: #fbbf24;
    font-weight: 800;
    font-size: 0.85rem;
}

.gd-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gd-header h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gd-header h4 i { color: #eab308; font-size: 0.75rem; }

.gd-summary {
    display: flex;
    gap: 14px;
}

.gd-income, .gd-expense {
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gd-income { color: #4ade80; }
.gd-expense { color: #f87171; }

.gd-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 0;
}

.gd-list::-webkit-scrollbar { width: 3px; }
.gd-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 10px; }

.gd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    transition: background 0.15s;
}

.gd-item:hover { background: rgba(255, 255, 255, 0.03); }

.gd-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.gd-item-icon.income {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.gd-item-icon.expense {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.15);
}

.gd-item-info {
    flex: 1;
    min-width: 0;
}

.gd-item-desc {
    display: block;
    font-size: 0.78rem;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gd-item-time {
    font-size: 0.62rem;
    color: #475569;
}

.gd-item-amount {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    font-family: 'Inter', 'Segoe UI', monospace;
}

.gd-item-amount.income { color: #4ade80; }
.gd-item-amount.expense { color: #f87171; }

.gd-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(234, 179, 8, 0.04);
}

.gd-balance span:first-child {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
}

.gd-balance-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fbbf24;
    font-family: 'Inter', monospace;
}

.bar-container {
    width: 100px;
    height: 12px;
    background-color: #333;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ca8a04, #eab308);
    border-radius: 6px;
}

.bar-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px black;
}

.resource-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    /* Sayılar değişirken titremeyi önler */
}

.label {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-btn:hover {
    background-color: var(--bg-card);
    color: var(--text-light);
}

/* Navigasyon Linkleri - Premium Enhanced */
.header-bottom {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    gap: 6px;
    overflow-x: auto;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.header-bottom a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* Subtle shine effect */
.header-bottom a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0.05),
            rgba(255, 255, 255, 0.03),
            transparent);
    transition: left 0.8s ease;
    pointer-events: none;
}

.header-bottom a:hover::before {
    left: 150%;
}

.header-bottom a:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.05));
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-bottom a.active {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow:
        0 0 20px rgba(6, 182, 212, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.header-bottom a.active::before {
    display: none;
}

.header-bottom a.active:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    box-shadow:
        0 0 25px rgba(6, 182, 212, 0.5),
        0 6px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Icon animation */
.header-bottom a i {
    transition: transform 0.3s ease;
}

.header-bottom a:hover i {
    transform: scale(1.1);
}

.header-bottom a.active i {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* GOLD ANIMATION EFFECTS */
.gold-increase {
    animation: goldFadeGreen 1s ease;
}

.gold-decrease {
    animation: goldFadeRed 1s ease;
}

@keyframes goldFadeGreen {

    0%,
    100% {
        color: inherit;
    }

    30%,
    60% {
        color: #4ade80;
    }
}

@keyframes goldFadeRed {

    0%,
    100% {
        color: inherit;
    }

    30%,
    60% {
        color: #f87171;
    }
}