/* =========================================
   GENEL VE LAYOUT
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: #1a1a1d; color: #333; font-family: 'Lato', sans-serif; height: 100vh; display: flex; justify-content: center; overflow: hidden; }

.main-container { width: 100%; max-width: 1200px; height: 100vh; display: flex; flex-direction: column; padding: 20px; }
.top-section { display: flex; flex: 1; gap: 20px; margin-bottom: 20px; min-height: 0; }

/* =========================================
   SIDEBAR
   ========================================= */
.sidebar-header {
    display: flex;
    align-items: center; /* Dikeyde ortala */
    gap: 15px; /* Logo ile yazı arası boşluk */
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #444; /* Altına ayırıcı çizgi */
}
/* LOGO AYARLARI */
.brand-logo img {
    width: 60px; /* Logo boyutu */
    height: 60px;
    object-fit: contain;
    border-radius: 50%; /* Yuvarlak olsun istersen, kare ise bu satırı sil */
    border: 2px solid #f3e5ab; /* Logoya çerçeve */
    transition: transform 0.2s;
}

.brand-logo:hover img {
    transform: scale(1.1); /* Üzerine gelince hafif büyüsün */
    box-shadow: 0 0 10px rgba(243, 229, 171, 0.5); /* Hafif parlama */
}

/* BAŞLIK METİNLERİ */
.header-titles h1 {
    font-family: 'Cinzel', serif;
    color: #f3e5ab;
    font-size: 1.4rem; /* Logoyla yan yana sığması için biraz küçülttük */
    margin-bottom: 2px;
    line-height: 1.1;
}

.header-titles p {
    color: #aaa;
    font-style: italic;
    font-size: 0.8rem;
    margin: 0;
}

.sidebar { width: 300px; background-color: #2c2c30; padding: 20px; border-radius: 10px; border: 1px solid #444; color: #f3e5ab; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar header h1 { font-family: 'Cinzel', serif; color: #f3e5ab; margin-bottom: 5px; font-size: 1.8rem; }
.sidebar header p { color: #aaa; font-style: italic; margin-bottom: 20px; font-size: 0.9rem; }
.filters label { display: block; margin-bottom: 5px; font-size: 0.8rem; color: #ccc; }
.filters select { width: 100%; margin-bottom: 15px; padding: 10px; background: #f3e5ab; border: none; border-radius: 4px; font-family: 'Lato', sans-serif; }
#generate-btn { background-color: #721c24; color: #f3e5ab; padding: 15px; border: none; width: 100%; font-family: 'Cinzel', serif; font-size: 1.1rem; cursor: pointer; border-radius: 5px; margin-top: 10px; transition: 0.3s; }
#generate-btn:hover { background-color: #91232d; }

/* =========================================
   GÖRÜNÜR KART ALANI
   ========================================= */
.content-area { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding-right: 5px; }

.npc-card {
    background-color: #f3e5ab;
    background-image: url('https://www.transparenttextures.com/patterns/aged-paper.png');
    padding: 20px 25px;
    border-radius: 5px;
    border: 3px double #8b5a2b;
    text-align: left;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* HERO ALANI (YATAY) */
.card-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; border-bottom: 2px solid #8b5a2b; padding-bottom: 15px; }
#npc-avatar { width: 90px; height: 90px; border-radius: 50%; border: 3px solid #8b5a2b; background: #fff; object-fit: cover; flex-shrink: 0; }
.card-header-info { flex: 1; }
#npc-name { font-family: 'Cinzel', serif; font-size: 2.2rem; color: #4a0404; margin-bottom: 5px; line-height: 1; }
.subtitle { font-weight: bold; color: #555; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }

/* STAT KUTULARI (GÜNCELLENDİ: MODIFIER İÇİN) */
.stats-grid { display: flex; justify-content: space-between; gap: 5px; margin-bottom: 20px; align-items: stretch; }

.stat-box {
    background: rgba(255,255,255,0.5);
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    flex: 1;
    text-align: center;
    padding: 10px 2px;
    font-family: 'Cinzel', serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* İçerikleri tepeye ve tabana yay */
    align-items: center;
    min-height: 80px; /* Tüm kutulara minimum bir yükseklik verelim */
}

.stat-label { font-size: 0.8rem; font-weight: bold; color: #4a0404; margin-bottom: 2px; }

/* Ana Sayı ve Yanındaki Modifier */
.stat-value {
    font-family: 'Lato', sans-serif;
    font-size: 1.3rem;
    font-weight: bold;
    color: #000;
    /* Değeri dikeyde merkeze itmek için margin kullanabiliriz */
    margin-bottom: 5px;
}
/* Parantez içindeki (+3) kısmı */
.stat-value small {
    font-size: 1rem;
    color: #555;
    font-weight: normal;
    margin-left: 2px;
}

.stat-mod { font-size: 1.4rem; font-weight: 900; color: #000; } /* Büyük Modifier (+3) */
.stat-score { font-size: 0.75rem; color: #555; font-family: 'Lato', sans-serif; margin-top: 2px; } /* Küçük Puan (16) */

.stat-bonus { 
    font-size: 0.65rem;
    color: #2e7d32;
    font-weight: bold;
    min-height: 15px; 
    line-height: 15px;
} /* Irk bonusu (+2 Race) */

/* Bonus yoksa (JS'den gelen hidden-bonus sınıfı) */
.hidden-bonus {
    visibility: hidden; /* Görünmez yap ama yerini koru */
}

/* DETAYLAR */
.details { display: flex; gap: 20px; margin-top: 0; }
.details-left { flex: 1; border-right: 2px solid rgba(139, 90, 43, 0.3); padding-right: 20px; }
.details-right { flex: 1; display: flex; flex-direction: column; gap: 15px; }
.details h3 { font-family: 'Cinzel', serif; font-size: 0.95rem; color: #4a0404; margin-bottom: 5px; border-bottom: 1px solid #ccc; display: inline-block; font-weight: bold; }
.details p { font-size: 0.9rem; line-height: 1.4; color: #333; }
#npc-hook { font-style: italic; color: #721c24; }
#npc-inventory { font-size: 0.85rem; color: #555; }
.card-footer { margin-top: 25px; font-size: 0.6rem; color: rgba(139, 90, 43, 0.4); text-align: right; text-transform: uppercase; font-weight: bold; letter-spacing: 1px; }

/* BUTONLAR */
.button-group { display: flex; gap: 10px; margin-top: 15px; }
.secondary-btn { background-color: #444; color: #fff; padding: 10px; border: none; width: 100%; cursor: pointer; border-radius: 4px; font-size: 0.9rem; }
.secondary-btn:hover { background-color: #555; }

/* =========================================
   GİZLİ EXPORT KARTI (DİKEY TASARIM)
   ========================================= */
.vertical-mode {
    width: 400px; /* Dikey kart için sabit genişlik */
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Her şeyi ortala */
    text-align: center;
    background-color: #fffdf5; /* Biraz daha açık renk */
    border: 5px solid #4a0404; /* Daha kalın çerçeve */
}

.vertical-header img {
    width: 150px;
    height: 150px;
    border-radius: 10px; /* Karemsi */
    border: 3px solid #8b5a2b;
    object-fit: cover;
    margin-bottom: 15px;
}

.vertical-header h2 { font-family: 'Cinzel', serif; font-size: 2rem; color: #4a0404; }
.vertical-header p { font-weight: bold; text-transform: uppercase; color: #555; margin-bottom: 25px; border-bottom: 2px solid #8b5a2b; display: inline-block; padding-bottom: 5px;}

.vertical-details { width: 100%; text-align: left; margin-top: 20px; }
.vertical-details h3 { margin-top: 15px; color: #721c24; border-bottom: 1px solid #ccc; }

/* =========================================
   GEÇMİŞ ŞERİDİ
   ========================================= */
.bottom-history { height: 160px; background-color: #222; border-top: 2px solid #8b5a2b; padding: 10px 20px; display: flex; flex-direction: column; }
.bottom-history h3 { color: #f3e5ab; font-family: 'Cinzel', serif; font-size: 1rem; margin-bottom: 10px; }
#history-list { display: flex; gap: 15px; overflow-x: auto; list-style: none; height: 100%; padding-bottom: 5px; }
#history-list::-webkit-scrollbar { height: 8px; }
#history-list::-webkit-scrollbar-track { background: #333; }
#history-list::-webkit-scrollbar-thumb { background: #8b5a2b; border-radius: 4px; }
.history-item { min-width: 250px; background-color: #3a3a3e; border: 1px solid #555; border-radius: 6px; padding: 10px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: 0.2s; }
.history-item:hover { background-color: #4a4a4e; border-color: #f3e5ab; }
.history-item img { width: 50px; height: 50px; border-radius: 50%; border: 2px solid #8b5a2b; object-fit: cover; }
.history-info { display: flex; flex-direction: column; }
.history-name { color: #f3e5ab; font-weight: bold; font-family: 'Cinzel', serif; font-size: 0.9rem; }
.history-race { color: #aaa; font-size: 0.8rem; }

/* MOBİL */
@media (max-width: 768px) { body { height: auto; overflow: auto; } .main-container { height: auto; } .top-section { flex-direction: column; } .sidebar { width: 100%; } .details { flex-direction: column; } .details-left { border-right: none; padding-right: 0; } }