/* ============================================================
   SHEET-MODULES.CSS
   Modüller: Statlar, Savaş, Skiller, Büyü, Envanter, Modallar
   ============================================================ */

/* ============================================================
   1. TEMEL YETENEK SKORLARI (ABILITY SCORES)
   ============================================================ */
.ability-scores-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
    margin-bottom: 20px; 
}

.ability-score-card {
    background: #1a1a1a; 
    border: 1px solid #444; 
    border-radius: 8px;
    text-align: center; 
    padding: 10px 5px; 
    overflow: hidden;
}

.score-header { 
    font-size: 0.65em; 
    color: #888; 
    letter-spacing: 1px; 
    font-weight: bold; 
    margin-bottom: 2px; 
    text-transform: uppercase; 
}

.score-modifier { 
    font-size: 1.8em; 
    font-weight: bold; 
    color: #fff; 
    line-height: 1; 
}

.score-value { 
    background: #333; 
    color: #aaa; 
    font-size: 0.9em; 
    display: inline-block; 
    padding: 2px 10px; 
    border-radius: 10px; 
    margin-top: 5px; 
    border: 1px solid #555; 
    font-weight: bold;
}

/* ============================================================
   2. SAVAŞ İSTATİSTİKLERİ (AC, HP, INIT, SAVES)
   ============================================================ */
.combat-stats-row { 
    display: flex; 
    gap: 15px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
}

.c-stat-box {
    background: #1a1a1a; 
    border: 1px solid #444; 
    flex: 1 1 100px;
    text-align: center; 
    padding: 15px 10px; 
    border-radius: 8px;
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    min-height: 80px;
}

.c-stat-box .label { 
    font-size: 0.75em; 
    color: #888; 
    text-transform: uppercase; 
    margin-bottom: auto; /* Altına otomatik boşluk vererek değeri aşağı iter */
    font-weight: bold; 
}

.c-stat-box .value { 
    font-size: 1.8em; 
    font-weight: bold; 
    color: #fff; 
    /* Değer kısmı aşağıda kalsın */
    margin-top: 5px;
}

/* --- ZIRH SINIFI (SVG KALKAN) STİLLERİ --- */
.shield-container {
    position: relative;
    width: 75px;
    height: 65px;
    margin: 5px auto 0 auto; /* Üstten biraz boşluk */
    display: flex;
    align-items: center;
    justify-content: center;
}

.shield-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); /* Hafif gölge */
}

.shield-text {
    position: relative;
    z-index: 1;
    font-size: 1.6em; /* Kalkan içine sığması için ideal boy */
    font-weight: bold;
    color: #fff;
    margin-top: -3px; /* Optik olarak tam ortaya hizalamak için */
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* --- Can Puanı (HP) --- */
.hp-box { 
    flex: 2 1 150px; 
    border-color: #2e7d32; 
    position: relative; 
    overflow: hidden; 
}

.hp-box::before { 
    content:''; position: absolute; top:0; left:0; width:100%; height: 5px; background: #2e7d32; 
}

.hp-box .value { color: #4caf50; font-size: 2.2em; }
.hp-box .sub-label { font-size: 0.8em; color: #666; margin-top: -5px; }

/* HP Animasyonları */
.hp-low { color: #ff9800 !important; text-shadow: 0 0 5px rgba(255, 152, 0, 0.4); animation: pulse-orange 2s infinite; }
.hp-critical { color: #ff4444 !important; text-shadow: 0 0 8px rgba(255, 68, 68, 0.6); animation: pulse-red 1s infinite; }
.hp-dead { 
    color: #555 !important; 
    /* text-decoration: line-through;  <-- BU SATIRI SİLDİK, SORUN BUYDU */ 
}

@keyframes pulse-orange { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }
@keyframes pulse-red { 0% { transform: scale(1); } 50% { transform: scale(1.1); color: #ff0000; } 100% { transform: scale(1); } }

/* --- Kurtulma Zarları --- */
.saving-throws-panel { 
    background: #1a1a1a; border: 1px solid #333; border-radius: 8px; 
    padding: 8px 15px; margin-bottom: 20px; 
}

.st-header { 
    text-align: center; color: #888; font-size: 0.75em; margin: 0 0 8px 0; 
    text-transform: uppercase; letter-spacing: 2px; font-weight: bold; 
    border-bottom: 1px solid #333; padding-bottom: 4px; 
}

.st-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }

.st-row {
    display: flex; align-items: center; justify-content: center;
    background: #252525; padding: 5px 8px; border-radius: 6px;
    border: 1px solid #444; gap: 8px; transition: transform 0.2s, border-color 0.2s;
}
.st-row:hover { border-color: #666; transform: translateY(-2px); }
.st-info { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.st-label { font-weight: bold; color: #aaa; font-size: 0.7em; margin-bottom: 2px; }
.st-val { font-weight: bold; color: #fff; font-size: 1.1em; }
.st-indicator { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #555; background: transparent; flex-shrink: 0; }
.st-indicator.active { background: #b52b2b; border-color: #b52b2b; box-shadow: 0 0 6px #b52b2b; }

/* ============================================================
   3. YETENEKLER (SKILLS)
   ============================================================ */
.pb-box {
    background-color: #222; border: 1px solid #444; border-radius: 6px;
    padding: 10px 15px; margin-bottom: 15px; display: flex; 
    justify-content: space-between; align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.pb-label { font-size: 0.85em; color: #aaa; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; }
.pb-val { font-size: 1.4em; font-weight: bold; color: #4caf50; }

.sheet-skills-panel { background: #1a1a1a; padding: 15px; border-radius: 6px; border: 1px solid #333; }
.sheet-skills-panel h3 {
    margin: 0 0 15px 0; color: #b52b2b; font-size: 1.1em; text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid #333; padding-bottom: 5px;
}

.clickable-header {
    font-size: 0.9em; text-align: center; border-bottom: 1px solid #333; padding-bottom: 5px;
    cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: center;
    gap: 8px; transition: color 0.2s;
}
.clickable-header:hover { color: #eee; }
.toggle-arrow { font-size: 0.8em; color: #666; transition: transform 0.3s; display: inline-block; }
.toggle-arrow.rotated { transform: rotate(180deg); color: #b52b2b; }

.sheet-skill-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid #2a2a2a; font-size: 0.95em;
    cursor: pointer; transition: background 0.1s;
}
.sheet-skill-row:hover { background: rgba(255,255,255,0.03); }
.sheet-skill-row:hover .dimmed-text { color: #ccc; }
.dimmed-text { color: #888; }

.skill-left { display: flex; align-items: center; gap: 8px; }
.skill-indicator { width: 25px; text-align: center; color: #b52b2b; font-size: 1em; }

/* ============================================================
   4. SEKMELER (TABS)
   ============================================================ */
.sheet-tabs { 
    display: flex; gap: 5px; border-bottom: 2px solid #333; margin-bottom: 0;
    overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.sheet-tabs::-webkit-scrollbar { height: 4px; background: #111; }
.sheet-tabs::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

.sheet-tabs button {
    background: transparent; border: none; color: #888; padding: 12px 20px; cursor: pointer;
    font-size: 1.05em; display: flex; align-items: center; gap: 8px;
    transition: all 0.2s; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0;
}
.sheet-tabs button.active { color: #b52b2b; border-bottom-color: #b52b2b; background: rgba(181, 43, 43, 0.05); }
.sheet-tabs button:hover { color: #fff; background: rgba(255,255,255,0.05); }

.tab-icon { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.sheet-tab-content { background: #1e1e1e; padding: 25px; border-radius: 0 0 8px 8px; min-height: 400px; border: 1px solid #333; border-top: none; }

@media (max-width: 600px) {
    
    /* İkonları Gizle */
    .sheet-tabs button .tab-icon {
        display: none !important;
    }

    /* Buton Ayarları */
    .sheet-tabs button {
        padding: 10px 15px; /* Mobilde biraz daha kompakt */
        font-size: 0.95em;  /* Yazı boyutu ideal */
        justify-content: center; /* Yazıyı ortala */
        gap: 0; /* İkon gittiği için boşluğa gerek yok */
    }
    
    /* Sekme çubuğunun kaydırma davranışını iyileştir */
    .sheet-tabs {
        justify-content: flex-start; /* Sola yaslı başlasın */
    }
}

/* ============================================================
   5. ÖZELLİKLER & KAYNAKLAR
   ============================================================ */
.resources-dashboard { background-color: #222; border: 1px solid #333; border-radius: 8px; padding: 15px; margin-bottom: 25px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; }

.res-card {
    background: #222; border: 1px solid #444; border-left: 4px solid #b52b2b;
    border-radius: 4px; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center;
    transition: transform 0.2s, border-color 0.2s;
}
.res-card:hover { border-color: #666; transform: translateY(-2px); }
.res-info h5 { margin: 0; font-size: 1em; color: #eee; }
.res-meta { font-size: 0.75em; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.res-controls { display: flex; align-items: center; gap: 5px; background: #111; padding: 4px; border-radius: 20px; border: 1px solid #333; }
.res-btn { width: 28px; height: 28px; border: none; border-radius: 50%; cursor: pointer; font-weight: bold; font-size: 1.1em; display: flex; align-items: center; justify-content: center; transition: all 0.2s; color: #fff; }
.res-btn.minus { background: #333; color: #aaa; }
.res-btn.minus:hover { background: #b52b2b; color: #fff; }
.res-btn.plus { background: #1e1e1e; color: #aaa; }
.res-btn.plus:hover { background: #4caf50; color: #fff; }

.res-value { min-width: 40px; text-align: center; font-weight: bold; font-size: 1.1em; color: #fff; user-select: none; }
.res-card.empty { opacity: 0.6; border-left-color: #444; }
.res-card.empty .res-value { color: #b52b2b; }

.feature-sub-tabs {
    display: flex; justify-content: center; gap: 15px; margin-bottom: 30px;
    padding: 15px; background-color: #222; border: 1px solid #333; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.feature-sub-tabs button {
    /* Kutu Yapısı */
    display: flex;
    flex-direction: column; /* İkon ve yazıyı alt alta veya yan yana dizebiliriz */
    align-items: center;
    justify-content: center;
    
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.03); /* Stat Box Arkaplanı */
    border: 1px solid #444;
    border-radius: 6px;
    
    /* Yazı Stili */
    color: #888;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
}

/* Hover (Üzerine Gelince) */
.feature-sub-tabs button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #666;
    color: #fff;
    transform: translateY(-2px); /* Hafif yukarı kalkma efekti */
}

/* Aktif (Seçili) Durum */
.feature-sub-tabs button.active {
    background: rgba(181, 43, 43, 0.15); /* Crimson Red Vurgu (Hafif) */
    border-color: #b52b2b; /* Crimson Red Çerçeve */
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Derinlik */
}

/* ============================================================
   MOBİL UYUMLULUK: ALT TABLAR (SADECE İKON)
   ============================================================ */

@media (max-width: 600px) {
    
    /* Grid'i mobilde tek satıra sığdır (5 buton yan yana) */
    .feature-sub-tabs {
        grid-template-columns: repeat(5, 1fr) !important; 
        gap: 5px;
        padding: 15px;
    }

    /* Buton içindeki metni gizle */
    .feature-sub-tabs button {
        font-size: 0 !important; /* Metni yok et */
        padding: 15px; /* Dikey boşluğu azalt */
        height: auto;
    }

    /* İkonu (span) görünür ve büyük yap */
    .feature-sub-tabs button span {
        font-size: 2rem !important; /* İkon boyutu (24px civarı) */
        margin-bottom: 0 !important; /* Alt boşluğu kaldır */
        display: block;
        line-height: 1;
    }
    
    /* Aktif durumda biraz daha belirgin olsun */
    .feature-sub-tabs button.active {
        background: rgba(181, 43, 43, 0.25);
    }
}

.sheet-feature-item { border-bottom: 1px solid #333; padding-bottom: 15px; margin-bottom: 15px; }
.sheet-feature-item h4 { margin: 0 0 8px 0; color: #b52b2b; font-size: 1.1em; font-weight: bold; letter-spacing: 0.5px; border-bottom: 1px solid rgba(181, 43, 43, 0.2); padding-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.source-tag { font-size: 0.6em; background: #222; border: 1px solid #444; padding: 2px 6px; border-radius: 4px; color: #888; font-weight: normal; }
.feat-text { color: #aaa; line-height: 1.6; font-size: 0.95em; margin-bottom: 10px; }
/* ============================================================
   6. SALDIRI KARTLARI (ATTACK)
   ============================================================ */
.attack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.attack-card-split {
    background: #252525; border: 1px solid #444; border-radius: 8px; overflow: hidden;
    display: flex; flex-direction: column; box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, border-color 0.2s;
}
.attack-card-split:hover { border-color: #666; transform: translateY(-2px); }

.atk-btn-top {
    background: linear-gradient(to bottom, #2a2a2a, #202020); padding: 10px; border-bottom: 1px solid #444;
    cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s;
}
.atk-btn-top:hover { background: #333; }
.atk-name { font-weight: bold; color: #eee; font-size: 0.9em; }
.atk-hit-badge { background: #151515; color: #4caf50; font-weight: bold; padding: 2px 8px; border-radius: 4px; border: 1px solid #333; font-size: 0.9em; }

.atk-btn-bottom {
    background: #1a1a1a; padding: 8px; cursor: pointer; text-align: center;
    display: flex; flex-direction: column; justify-content: center; transition: background 0.2s; height: 100%;
}
.atk-btn-bottom:hover { background: rgba(181, 43, 43, 0.1); }
.atk-dmg-val { color: #ccc; font-family: 'Courier New', monospace; font-weight: bold; font-size: 1.1em; }
.atk-dmg-type { color: #666; font-size: 0.7em; text-transform: uppercase; margin-top: 2px; }

/* ============================================================
   7. BÜYÜ SİSTEMİ (SPELLCASTING) - RESTORE EDİLDİ
   ============================================================ */
.spell-stats-header {
    display: flex; justify-content: center; gap: 15px; margin-bottom: 30px;
    padding: 15px; background-color: #222; border: 1px solid #333; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.stat-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #2b2b2b; border: 1px solid #444; border-radius: 6px; padding: 10px 20px; min-width: 70px;
}
.stat-box.main-stat { border-color: #b52b2b; background: linear-gradient(180deg, #2b2b2b 0%, #3a2222 100%); min-width: 80px; }
.stat-label { font-size: 0.75em; color: #aaa; text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 1.5em; font-weight: bold; color: #fff; margin: 2px 0; }
.stat-sub { font-size: 0.8em; color: #888; }

.btn-add-spell {
    background-color: #2a2a2a; border: 1px dashed #666; color: #4dabf7;
    padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: all 0.2s; height: 100%;
}
.btn-add-spell:hover { background-color: #333; border-color: #4dabf7; }

/* --- Seviye Grupları (Level Groups) - EKSİK OLAN KISIM --- */
.spell-level-group {
    margin-bottom: 25px;
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

.level-header {
    background-color: #252525;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.level-title { font-weight: bold; color: #b52b2b; font-size: 1.1em; }

/* Büyü Slotları (Slots) */
.spell-slots { display: flex; gap: 5px; align-items: center; }
.slot-label { font-size: 0.8em; color: #888; margin-right: 5px; }

.slot-checkbox {
    appearance: none; width: 16px; height: 16px;
    border: 1px solid #555; border-radius: 50%; /* Yuvarlak slot */
    background-color: #222; cursor: pointer; position: relative;
}
.slot-checkbox:checked {
    background-color: #b52b2b; border-color: #b52b2b;
    box-shadow: 0 0 5px rgba(181, 43, 43, 0.5);
}

/* Büyü Listesi Satırları */
.spell-list-items { padding: 0; width: 100%; max-width: 1500px;}

.spell-row {
    flex-direction: column; align-items: stretch; border-bottom: 1px solid #2a2a2a; transition: background 0.2s;
}
.spell-row-header {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
    padding: 12px 15px; cursor: pointer;
}
.spell-row-header:hover { background-color: #252525; }

.spell-name { display: block; font-weight: bold; color: #eee; }
.spell-meta { font-size: 0.85em; color: #888; }
.ritual-tag { color: #fcc419; margin-left: 5px; font-size: 0.8em; border:1px solid #fcc419; padding:0 3px; border-radius:3px;}
.conc-tag { color: #4dabf7; margin-left: 5px; font-size: 0.8em; border:1px solid #4dabf7; padding:0 3px; border-radius:3px;}

.btn-remove-spell {
    background: none; border: none; color: #666; font-size: 1.2em; cursor: pointer; margin-left: 10px;
}
.btn-remove-spell:hover { color: #e03131; }

.spell-detail-content {
    display: none; padding: 15px; background-color: #1a1a1a;
    border-top: 1px dashed #333; color: #ccc; font-size: 0.95em; line-height: 1.7; cursor: text;
}
.spell-row.expanded .spell-detail-content { display: block; animation: fadeIn 0.3s ease; }
.spell-row.expanded { border-left: 3px solid #b52b2b; }

.spell-text-damage.clickable {
    display: inline-block; position: relative; z-index: 10; cursor: pointer !important;
    color: #a855f7; font-weight: bold; border-bottom: 1px dotted #a855f7; padding: 0 4px; border-radius: 4px;
    transition: all 0.2s;
}
.spell-text-damage.clickable:hover {
    background-color: rgba(168, 85, 247, 0.2); color: #fff; border-bottom-style: solid;
}

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

/* ============================================================
   8. ENVANTER SİSTEMİ (Inventory & Crafting)
   ============================================================ */
.inventory-dashboard { background-color: #222; box-shadow: 0 4px 10px rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #333; }

.currency-display { display: flex; gap: 10px; margin-top: 10px; }
.coin-box { display: flex; align-items: center; background: #222; padding: 5px 10px; border-radius: 20px; border: 1px solid #444; }
.coin-box span { font-weight: bold; margin-right: 5px; font-size: 0.8em; }
.gp span { color: #ffd43b; } .sp span { color: #ced4da; } .cp span { color: #d9480f; }
.coin-box input { background: transparent; border: none; color: #fff; width: 50px; text-align: right; font-weight: bold; }

/* Envanter Sekmeleri ve Buton */
.inv-controls-bar {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #333; margin-bottom: 15px; padding-bottom: 5px;
}
.inv-subtabs { display: flex; gap: 5px; }
.inv-subtabs button {
    background: none; border: none; color: #666; padding: 8px 12px; cursor: pointer; font-size: 0.95em; border-radius: 4px; transition: all 0.2s;
}
.inv-subtabs button:hover { color: #ccc; background: rgba(255,255,255,0.05); }
.inv-subtabs button.active { color: #fff; background: rgba(255,255,255,0.1); border-bottom: 2px solid #e67e22; }

/* Şık Ekleme Butonu */
.btn-compact-add {
    background: #1a1a1a; border: 1px solid #444; color: #4caf50; padding: 5px 12px;
    border-radius: 20px; cursor: pointer; font-size: 0.85em; display: flex; align-items: center; gap: 5px; transition: all 0.2s;
}
.btn-compact-add:hover { background: #4caf50; color: #000; border-color: #4caf50; }
.plus-icon { font-weight: bold; font-size: 1.1em; }

/* Liste Kartları */
.inv-item-card { display: flex; justify-content: space-between; align-items: center; background: #252525; padding: 8px 12px; margin-bottom: 6px; border-radius: 6px; border: 1px solid #333; transition: border-color 0.2s; }
.inv-item-card:hover { border-color: #444; }

.mechanic-badge {
    background: #111; padding: 2px 6px; border-radius: 4px; font-size: 0.75em; color: #4dabf7; margin-left: 5px; border: 1px solid #333;
}

.item-actions { display: flex; align-items: center; gap: 15px; }
.equip-check { cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 0.8em; color: #888; transition: color 0.2s; }
.equip-check:hover { color: #ccc; }
.equip-check input { cursor: pointer; }

/* Kızıl Silme Butonu (SVG Fix Dahil) */
.btn-icon-delete {
    background: none; border: none; cursor: pointer; padding: 4px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px; transition: background 0.2s;
}
.btn-icon-delete svg {
    width: 18px; height: 18px; fill: #8a2a2a; transition: fill 0.2s;
    pointer-events: none; /* Mobilde tıklamayı engellememesi için */
}
.btn-icon-delete:hover { background: rgba(181, 43, 43, 0.1); }
.btn-icon-delete:hover svg { fill: #e03131; }

.empty-list-msg { text-align: center; color: #555; padding: 30px; font-style: italic; border: 1px dashed #333; border-radius: 8px; }

/* Eşya Grid (Gear) */
.gear-grid { display: flex; flex-direction: column; gap: 5px; }
.gear-row { display: flex; align-items: center; background: #252525; padding: 5px; border-radius: 6px; border: 1px solid #333; margin-bottom: 1px}
.qty-input { width: 40px; background: #111; border: 1px solid #444; color: #fff; text-align: center; margin-right: 10px; border-radius: 4px; }
.gear-name { flex: 1; }
.gear-weight { color: #666; font-size: 0.9em; margin-right: 10px; }

/* ============================================================
   9. MODALLAR & FORMLAR (HP, Seçim, Özel Üretim)
   ============================================================ */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
}
.modal-content.large-modal {
    width: 90%; max-width: 800px; height: 80%; max-height: 900px;
    background: #1a1a1a; border: 1px solid #444; border-radius: 8px;
    display: flex; flex-direction: column;
}
.modal-header {
    padding: 15px 20px; background: #222; border-bottom: 1px solid #444;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* Modal Sekmeleri (Listeden Seç vs Özel Yarat) */
.modal-tabs { display: flex; background: #1a1a1a; border-bottom: 1px solid #333; }
.modal-tabs button {
    flex: 1; background: transparent; border: none; padding: 12px; color: #888; cursor: pointer; font-size: 1em;
    transition: all 0.2s; border-bottom: 3px solid transparent;
}
.modal-tabs button:hover { color: #ccc; background: rgba(255,255,255,0.05); }
.modal-tabs button.active { color: #fff; background: #222; border-bottom-color: #e67e22; font-weight: bold; }

/* Filtre Paneli */
.filter-sort-bar {
    display: flex; gap: 15px; margin-bottom: 15px; background: #222; padding: 10px; border-radius: 6px; border: 1px solid #333;
}
.filter-group { display: flex; align-items: center; gap: 8px; flex: 1; }
.filter-group label { font-size: 0.85em; color: #888; white-space: nowrap; }
.filter-select {
    width: 100%; background: #151515; border: 1px solid #444; color: #ddd; padding: 6px 10px; margin-top: 6px; border-radius: 4px; font-size: 0.9em; cursor: pointer; outline: none;
}
.filter-select:focus { border-color: #e67e22; }

/* Liste Öğeleri (Seçim Modalı) */
.item-select-row {
    display: flex; justify-content: space-between; align-items: center;
    background: #252525; padding: 10px; margin-bottom: 8px; border-radius: 6px; border: 1px solid #333; transition: background 0.2s;
}
.item-select-row:hover { background: #2a2a2a; border-color: #555; }
.item-info { display: flex; flex-direction: column; }
.btn-select-spell {
    background: #b52b2b; color: #fff; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer;
}

/* Özel Eşya Yaratma Formu */
.custom-item-form { padding: 10px; background: #222; border-radius: 8px; border: 1px solid #333; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.85em; color: #888; font-weight: bold; }
.form-group input, .form-group select {
    background: #151515; border: 1px solid #444; padding: 8px; border-radius: 4px; color: #fff; font-size: 0.95em;
}
.form-group input:focus, .form-group select:focus { border-color: #e67e22; outline: none; }

.btn-create-custom {
    background: linear-gradient(135deg, #e67e22, #d35400); color: #fff; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; box-shadow: 0 4px 10px rgba(230, 126, 34, 0.3); transition: transform 0.2s, box-shadow 0.2s;
}
.btn-create-custom:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(230, 126, 34, 0.5); }
.btn-create-custom:active { transform: translateY(0); }

/* HP Modalı */
.hp-modal-window { max-width: 380px !important; background: #181818; border: 1px solid #333; border-radius: 16px; overflow: hidden; }
.hp-display-large { font-family: 'Segoe UI', sans-serif; text-align: center; margin-bottom: 20px; line-height: 1; }
.hp-display-large .current { font-size: 4em; font-weight: 800; color: #fff; }
.hp-display-large .divider { font-size: 2em; color: #444; vertical-align: super; margin: 0 5px; }
.hp-display-large .max { font-size: 1.5em; color: #666; font-weight: 600; }

.hp-stepper-container { background: #111; padding: 15px; border-radius: 12px; margin-bottom: 20px; border: 1px solid #2a2a2a; }
.stepper-row { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.step-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: #2b2b2b; color: #fff; font-weight: bold; cursor: pointer; }
.step-value-display { font-size: 2em; font-weight: bold; color: #e67e22; width: 60px; text-align: center; }
.step-value-display.val-pos { color: #4caf50; }
.step-value-display.val-neg { color: #ff4444; }

.hp-action-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px; border: none; border-radius: 12px; cursor: pointer; transition: transform 0.1s; color: white; font-weight: bold; font-size: 1.1em; width:100%; }
.smart-btn.btn-heal { background: linear-gradient(135deg, #4caf50, #2e7d32); box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4); }
.smart-btn.btn-dmg { background: linear-gradient(135deg, #b52b2b, #8a1c1c); box-shadow: 0 4px 15px rgba(181, 43, 43, 0.4); }
.smart-btn:disabled { background: #222; color: #555; box-shadow: none; }

.mini-reset-btn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid #444; background: transparent; color: #666; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mini-reset-btn:hover { border-color: #b52b2b; color: #b52b2b; transform: rotate(180deg); }

/* ============================================================
   GERİLİM EFEKTİ (RESPONSIVE - EKRANA ORANTILI)
   ============================================================ */
.low-hp-vignette {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9500 !important; 
    opacity: 0;
    background: transparent;
    transition: opacity 0.5s ease-in-out;

    /* Başlangıç (Hafif Çerçeve) */
    /* Blur: 15vmin (%15 yumuşaklık), Spread: 5vmin (%5 kalınlık) */
    box-shadow: inset 0 0 15vmin 5vmin rgba(220, 20, 20, 0.8);
}

.low-hp-vignette.active {
    opacity: 1; 
    animation: danger-pulse 4s infinite ease-in-out;
}

/* vmin = Ekranın kısa kenarının %1'i.
   Örn: 25vmin = Ekranın %25'i kadar içeri gir demek.
*/
@keyframes danger-pulse {
    0% { 
        opacity: 0.4;
        /* Sakin: Kenarlarda ince (%5) bir çerçeve */
        box-shadow: inset 0 0 15vmin 5vmin rgba(220, 20, 20, 0.7);
    }
    50% { 
        opacity: 0.6;
        /* Boğulma Anı: Ekranın neredeyse %30'u içeri giriyor (Toplam %60 kapalı) */
        /* Blur arttı (25vmin), Kalınlık çok arttı (25vmin) */
        box-shadow: inset 0 0 25vmin 20vmin rgba(220, 20, 20, 0.9);
    }
    100% { 
        opacity: 0.4;
        /* Tekrar Sakin */
        box-shadow: inset 0 0 15vmin 5vmin rgba(220, 20, 20, 0.7);
    }
}

/* ============================================================
   ÖLÜM ANI (DONMA EFEKTİ - RESPONSIVE)
   ============================================================ */
.low-hp-vignette.dead {
    animation: none !important; 
    
    /* Öldüğünde o en yoğun (%50) ana sabitleniyor */
    opacity: 0.6 !important; /* Biraz karartarak donduruyoruz */
    
    /* %50 anındaki değerlerin aynısı */
    box-shadow: inset 0 0 25vmin 25vmin rgba(220, 20, 20, 0.9) !important;
    
    transition: all 3s ease-out;
    filter: brightness(0.6) grayscale(0.8) contrast(1.2); /* Ölüm soğukluğu */
}

/* 2. ÖLÜM ZARLARI PANELİ */
.death-saves-container {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}

.ds-row {
    display: flex; align-items: center; gap: 5px; margin-bottom: 4px;
}

.ds-label {
    font-size: 0.65em; color: #888; font-weight: bold; width: 40px; text-align: right;
}

.ds-slot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1px solid #555;
    cursor: pointer;
    transition: all 0.2s;
    background: #222;
}

.ds-slot:hover { transform: scale(1.2); border-color: #fff; }

/* Başarı Yuvası (Yeşil) */
.ds-slot.success.filled { background: #4caf50; box-shadow: 0 0 5px #4caf50; border-color: #4caf50; }

/* Başarısızlık Yuvası (Kırmızı) */
.ds-slot.fail.filled { background: #d32f2f; box-shadow: 0 0 5px #d32f2f; border-color: #d32f2f; }

/* İyileşme Butonu (Acil Durum) */
.btn-emergency-heal {
    font-size: 0.7em; margin-top: 5px; background: #333; border: 1px solid #444; color: #ccc; 
    padding: 2px 8px; border-radius: 4px; cursor: pointer;
}
.btn-emergency-heal:hover { background: #2e7d32; color: #fff; border-color: #4caf50; }


/* --- GENEL KUTU YAPISI --- */
.sheet-feature-item {
    background-color: rgba(30, 30, 30, 0.6); /* Hafif koyu transparan zemin */
    border: 1px solid #444;
    border-radius: 8px; /* Köşeleri yuvarla */
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* Hafif gölge */
}

/* --- BAŞLIK (Örn: Mürit) --- */
.sheet-feature-item h4 { margin: 0 0 8px 0; color: #b52b2b; font-size: 1.1em; font-weight: bold; 
    letter-spacing: 0.5px; border-bottom: 1px solid rgba(181, 43, 43, 0.2); padding-bottom: 4px; 
    display: flex; justify-content: space-between; align-items: center; }   

/* --- GENEL METİN / AÇIKLAMALAR --- */


.feature-box { color: #aaa; line-height: 1.6; font-size: 0.95em; margin-bottom: 10px; }


/* --- BECERİLER VURGUSU --- */
.skill-list {
    font-size: 0.9em;
    color: #aaa;
    margin-bottom: 15px;
    margin-top: 15px;
    font-style: italic;
    border-radius: 4px;
    display: inline-block;
}

/* --- ÖZEL YETENEK KUTUSU (Feature Box) --- */
/* Burası özelliğin mekaniğinin yazdığı yer */
.feature-box-highlight {
    border-top: solid 1px #333;
    padding-top: 15px;

}

.feature-box-highlight strong {
    color: #b52b2b;
    display: block;
    margin-bottom: 5px;
    font-size: 1em;
    letter-spacing: 0.5px;
}

.choice-entry {
    border: 1px solid #333; 
    border-radius: 8px;
    padding: 15px 10px 15px 15px; 

    border-left: 2px solid #4dabf7;
}
.choice-header {
    margin: 0 0 8px 0; 
    color: #4dabf7; 
    font-size: 0.9em; 
    font-weight: bold; 
    letter-spacing: 0.5px; 
    
    border-bottom: 2px solid #333; 
    margin-bottom: 15px; 
    padding-bottom: 15px;

}

.choice-body {
    color: #aaa;
    line-height: 1.6;
    font-size: 0.95em;

}

/*
.sheet-feature-item { border-bottom: 1px solid #333; padding-bottom: 15px; margin-bottom: 15px; }

.sheet-feature-item h4 { margin: 0 0 8px 0; color: #b52b2b; font-size: 1.1em; font-weight: bold; 
    letter-spacing: 0.5px; border-bottom: 1px solid rgba(181, 43, 43, 0.2); padding-bottom: 4px; 
    display: flex; justify-content: space-between; align-items: center; }    */

/* ============================================================
   10. RESPONSIVE (MOBİL UYUMLULUK)
   ============================================================ */
@media (max-width: 860px) {
    .ability-scores-container { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .ability-score-card { padding: 15px 5px; background: #202020; }
    .score-modifier { font-size: 2em; }
    
    /* --- KOMBAT STATLARI (DÜZELTME BURADA) --- */
    .combat-stats-row { display: grid;grid-template-columns: repeat(3, 1fr); gap: 10px; }

    .c-stat-box { min-height: 90px; padding: 10px 5px; /* Mobilde biraz daha sıkışık padding */}
    


    .hp-box { /* 1. sütundan başla, sonuncuya kadar git (Yani tüm satırı kapla) */ grid-column: 1 / -1; /* Görsel olarak en başa (üste) al */ order: -1; }
    
    .sheet-tabs { width: 100%; display: flex; padding-bottom: 5px; border-bottom: 1px solid #444; }
    .sheet-tabs button { flex: 1; padding: 15px 10px; font-size: 0.95em; justify-content: center; }
    
    .sheet-tab-content { padding: 15px; border: none; margin-bottom: 100px; }
    
    .st-grid { grid-template-columns: repeat(3, 1fr); }
    .st-row { flex-direction: row; justify-content: space-between; padding: 8px 12px; }
    .st-info { flex-direction: row; gap: 8px; }
    .st-label { font-size: 0.9em; margin-bottom: 0; }

    /* Mobil Envanter Düzeni */
    .filter-sort-bar { flex-direction: column; gap: 10px; }
    .filter-group { width: 100%; }
    
    /* Eşya Seçim Kartları */
    .item-select-row { align-items: flex-start; gap: 10px; position: relative; display: flex; align-items: center;}
    .item-info { width: 100%; margin-bottom: 5px; }
    .item-select-row .btn-select-spell { padding: 6px 10px; font-size: 1em; text-align: center; background: #2b2b2b; border: 1px solid #555; }
    .modal-body { padding: 5px; overflow-y: auto; flex: 1; }

    /* --- YENİ EKLENEN KISIM: ÖZEL EŞYA FORMU MOBİL DÜZENİ --- */
    .form-grid {
        grid-template-columns: 1fr; /* 2 sütun yerine tek sütun yap */
        gap: 10px;
    }
    
    .form-group input, 
    .form-group select {
        font-size: 16px; /* Mobilde otomatik zoom'u engeller ve okumayı kolaylaştırır */
        padding: 10px;
    }

    /* Envanter Kartları */
    /*
    .inv-item-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .inv-item-card { display: flex; justify-content: space-between; align-items: center; background: #1e1e1e; padding: 8px 12px; margin-bottom: 6px; border-radius: 6px; border: 1px solid #2a2a2a; transition: border-color 0.2s; }

    .inv-item-card .item-details { width: 100%; }
    .inv-item-card .item-actions { width: 100%; display: flex; justify-content: space-between; border-top: 1px solid #333; padding-top: 8px; margin-top: 5px; }
    */
    /* Silme butonunu daha belirgin yap */
    .btn-icon-delete { background: rgba(181, 43, 43, 0.1); border: 1px solid rgba(181, 43, 43, 0.3); border-radius: 6px; padding: 10px; margin-left: 5px; }
    
    .gear-row { flex-wrap: wrap; }
    .gear-name { min-width: 120px; }
}

@media (max-width: 500px) {
    .st-grid { grid-template-columns: repeat(2, 1fr); }
}


/* Tıklanabilir Büyü İstatistiği */
.stat-box.clickable-stat {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-box.clickable-stat:hover {
    border-color: #e67e22; /* Turuncu vurgu */
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.stat-box.clickable-stat:active {
    transform: translateY(0);
    background: #222;
}

/* ============================================================
   EKSİK OLAN BÜYÜ ARAMA MODALI STİLLERİ (RESTORED)
   ============================================================ */

/* Sonuç Listesi Grid Yapısı */
.spell-results-grid {
    display: grid;
    /*grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive kolonlar */
    gap: 10px;
    padding-bottom: 20px;
}

/* Tekil Büyü Kartı (Arama Sonucu) */
.spell-result-card {
    background: #252525;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.spell-result-card:hover {
    border-color: #b52b2b;
    background: #2a2a2a;
    transform: translateY(-1px);
}

/* Kart İçindeki Metinler */
.spell-result-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.spell-result-name {
    font-weight: bold;
    color: #eee;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spell-result-meta {
    font-size: 0.8em;
    color: #888;
    margin-top: 2px;
    display: flex;
    align-items: center;
}

/* Seviye Rozeti */
.spell-meta-badge {
    display: inline-block;
    background: #111;
    border: 1px solid #444;
    color: #e67e22;
    font-size: 0.75em;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: bold;
}

/* Ritual Tag (R) */
.meta-rit {
    color: #ffd43b;
    border: 1px solid #ffd43b;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    margin-left: 5px;
    cursor: help;
}

/* Ekle/Çıkar Butonları (Modal İçi) */
.spell-result-card .btn-select-spell {
    padding: 5px 12px;
    font-size: 0.85em;
    min-width: 60px;
    margin-left: 10px;
}

/* ============================================================
   GLOBAL ONAY PENCERESİ (CONFIRM MODAL)
   ============================================================ */

/* Kart Tasarımı (Toast Stilinde) */
.confirm-card {
    background: #1a1a1a;
    border: 1px solid #444;
    border-left: 4px solid #b52b2b; /* Kızıl uyarı çizgisi */
    border-radius: 8px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    text-align: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Buton Grubu */
.confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

/* İptal Butonu */
.btn-confirm-cancel {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-confirm-cancel:hover {
    border-color: #666;
    color: #fff;
    background: rgba(255,255,255,0.05);
}

/* Onay Butonu (Kızıl) */
.btn-confirm-yes {
    background: linear-gradient(135deg, #b52b2b, #8a1c1c);
    color: #fff;
    border: none;
    padding: 8px 25px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(181, 43, 43, 0.3);
    transition: transform 0.2s;
}
.btn-confirm-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(181, 43, 43, 0.5);
}