/* ============================================================
   STYLE.CSS — Хроники Эйдона RPG
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #07070f;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: #e0e0e0;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 900px;
    height: 600px;
    border: 2px solid #2a2a4a;
    border-radius: 6px;
    box-shadow: 0 0 50px rgba(80,80,200,0.2);
    overflow: hidden;
}

canvas { display: block; }

/* ───── HUD ───── */
#hud {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    background: linear-gradient(to bottom, rgba(5,5,15,0.92), transparent);
    pointer-events: none;
    z-index: 10;
}
.hpill {
    background: rgba(15,15,30,0.85);
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 11px;
    white-space: nowrap;
}
.hpill b { color: #ffd700; }
.hbar { width: 90px; height: 10px; background: #0d0d1a; border-radius: 5px; border: 1px solid #2a2a4a; overflow: hidden; }
.hbar-hp  { height: 100%; background: linear-gradient(to right, #c0392b, #e74c3c); border-radius: 5px; transition: width .3s; }
.hbar-mp  { height: 100%; background: linear-gradient(to right, #1a6aa0, #3498db); border-radius: 5px; transition: width .3s; }
.hbar-exp { height: 100%; background: linear-gradient(to right, #6c3483, #9b59b6); border-radius: 5px; transition: width .3s; }
#hud-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ───── Панели (общее) ───── */
.panel {
    position: absolute;
    background: rgba(8,8,18,0.97);
    border: 2px solid #28284a;
    border-radius: 8px;
    color: #e0e0e0;
    z-index: 50;
    box-shadow: 0 4px 40px rgba(0,0,0,0.9);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
.panel.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.18s ease;
    animation: panelIn 0.18s ease forwards;
}
@keyframes panelIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.ph {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid #1e1e38;
    background: rgba(20,20,45,0.6);
    border-radius: 8px 8px 0 0;
}
.ph-title { font-size: 16px; font-weight: bold; color: #ffd700; }
.ph-close {
    background: none; border: 1px solid #444; color: #888;
    width: 22px; height: 22px; border-radius: 4px; cursor: pointer;
    font-size: 15px; line-height: 20px; text-align: center;
}
.ph-close:hover { background: #3a1a1a; color: #ff6666; border-color: #f66; }

/* ───── ИНВЕНТАРЬ ───── */
#inventory-panel { top: 25px; left: 50%; transform: translateX(-50%); width: 800px; max-height: 565px; overflow-y: auto; }
.inv-body { padding: 10px 12px; }
.inv-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.inv-stat { background: rgba(20,20,40,0.7); border: 1px solid #1e1e38; border-radius: 5px; padding: 3px 8px; font-size: 11px; }
.sec-title { font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 1px; margin: 7px 0 5px; }

.eq-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 10px; }
.eq-slot {
    background: rgba(15,15,35,0.9); border: 2px solid #1e1e38; border-radius: 5px;
    padding: 6px; cursor: pointer; min-height: 52px; transition: border-color .15s;
}
.eq-slot:hover { border-color: #ffd700; }
.eq-slot.filled { border-color: #3a3a7a; }
.eq-label { font-size: 9px; color: #555; text-transform: uppercase; }
.eq-name  { font-size: 11px; color: #ddd; margin-top: 3px; }
.eq-val   { font-size: 10px; color: #888; }

.inv-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.inv-slot {
    background: rgba(15,15,35,0.9); border: 2px solid #1e1e38; border-radius: 5px;
    padding: 4px; cursor: pointer; min-height: 52px; position: relative;
    transition: all .15s; text-align: center;
}
.inv-slot:hover { border-color: #ffd700; background: rgba(35,35,65,0.95); transform: scale(1.04); }
.is-icon { font-size: 17px; margin-bottom: 1px; }
.is-name  { font-size: 8px; color: #ccc; line-height: 1.2; }
.is-val   { font-size: 8px; color: #888; }
.is-qty   { position: absolute; top: 2px; right: 3px; font-size: 8px; color: #ffd700; font-weight: bold; }
/* Редкость */
.r-common    { border-color: #3a3a3a !important; }
.r-uncommon  { border-color: #2a7a2a !important; }
.r-rare      { border-color: #2a2a9a !important; }
.r-epic      { border-color: #7a2a9a !important; }
.r-legendary { border-color: #9a6a00 !important; }

/* ───── МАГАЗИН ───── */
#shop-panel { top: 35px; left: 50%; transform: translateX(-50%); width: 660px; }
.shop-gold  { padding: 6px 14px; text-align: center; color: #ffd700; font-size: 13px; border-bottom: 1px solid #1e1e38; }
.shop-grid  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 10px; }
.shop-item  {
    background: rgba(10,20,10,0.85); border: 2px solid #1e381e; border-radius: 6px;
    padding: 7px; cursor: pointer; transition: all .18s;
}
.shop-item:hover { background: rgba(25,50,25,0.9); border-color: #4f4; }
.si-name  { font-size: 12px; font-weight: bold; }
.si-price { color: #ffd700; font-size: 11px; margin-top: 2px; }
.si-stat  { color: #888; font-size: 10px; }

/* ───── КВЕСТЫ ───── */
#quest-panel { top: 35px; left: 50%; transform: translateX(-50%); width: 560px; max-height: 530px; overflow-y: auto; }
.quest-list { padding: 8px 10px; }
.q-sec  { color: #666; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin: 7px 0 4px; }
.q-card {
    background: rgba(15,15,32,0.8); border: 1px solid #1e1e38; border-radius: 5px;
    padding: 7px 9px; margin-bottom: 5px;
}
.q-card.active    { border-left: 3px solid #ffd700; }
.q-card.completed { border-left: 3px solid #2ecc71; opacity: 0.65; }
.q-name  { font-size: 12px; font-weight: bold; }
.q-desc  { font-size: 10px; color: #888; margin-top: 1px; }
.q-pbar  { height: 4px; background: #0d0d1a; border-radius: 2px; margin-top: 5px; overflow: hidden; }
.q-pfill { height: 100%; background: linear-gradient(to right, #6c3483, #ffd700); border-radius: 2px; transition: width .3s; }
.q-reward { font-size: 9px; color: #ffd700; margin-top: 3px; }

/* ───── ДИАЛОГ ───── */
#dialog-panel { bottom: 18px; left: 50%; transform: translateX(-50%); width: 600px; border-color: #3a3a6a; }
.dlg-name    { padding: 7px 14px; color: #ffd700; font-size: 15px; font-weight: bold; border-bottom: 1px solid #1e1e38; }
.dlg-text    { padding: 9px 14px; font-size: 13px; line-height: 1.55; color: #ddd; }
.dlg-options { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px 14px; border-top: 1px solid #1e1e38; }
.dlg-opt     {
    background: rgba(20,20,50,0.85); border: 1px solid #3a3a6a; border-radius: 4px;
    color: #ddd; padding: 4px 10px; cursor: pointer; font-size: 11px; transition: all .15s;
}
.dlg-opt:hover { background: rgba(50,50,90,0.9); border-color: #ffd700; color: #ffd700; }

/* ───── БОЕВАЯ ПАНЕЛЬ ───── */
#combat-panel {
    bottom: 0; left: 0; right: 0;
    border-radius: 0; border-bottom: none; border-left: none; border-right: none;
    border-top-color: #5a1a1a;
    background: rgba(8,3,8,0.97);
}
.cbt-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 14px; background: rgba(35,5,5,0.7); border-bottom: 1px solid #3a1010;
}
.cbt-title  { color: #e74c3c; font-size: 13px; font-weight: bold; }
#cbt-status { color: #aaa; font-size: 11px; }
.cbt-body   { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 14px; }
.cbt-fighter { background: rgba(15,10,15,0.8); border-radius: 5px; padding: 7px; }
.cf-name  { font-size: 12px; font-weight: bold; }
.cf-hpbar { height: 9px; background: #0a0a0f; border-radius: 4px; margin: 4px 0; overflow: hidden; }
.cf-hpfill { height: 100%; border-radius: 4px; transition: width .3s; }
.cf-enemy  { background: linear-gradient(to right, #6a0000, #c0392b); }
.cf-player { background: linear-gradient(to right, #0a3a1a, #27ae60); }
.cf-hptext { font-size: 9px; color: #888; }
.cf-status { font-size: 9px; color: #e67e22; margin-top: 2px; }
.cbt-actions { display: flex; flex-wrap: wrap; gap: 5px; padding: 5px 14px 8px; }
.cbt-btn {
    background: rgba(20,12,20,0.9); border: 1px solid #3a2a3a; border-radius: 4px;
    color: #ddd; padding: 5px 10px; cursor: pointer; font-size: 11px; transition: all .15s;
}
.cbt-btn:hover:not(.disabled) { transform: scale(1.06); }
.cbt-btn.b-atk { border-color: #8a2020; }
.cbt-btn.b-atk:hover { background: rgba(60,10,10,0.9); }
.cbt-btn.b-spl { border-color: #1a4a8a; }
.cbt-btn.b-spl:hover { background: rgba(10,25,60,0.9); }
.cbt-btn.b-itm { border-color: #1a6a2a; }
.cbt-btn.b-itm:hover { background: rgba(10,45,15,0.9); }
.cbt-btn.b-fle { border-color: #444; }
.cbt-btn.b-fle:hover { background: rgba(30,30,30,0.9); }
.cbt-btn.disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.cbt-btn:active:not(.disabled) { transform: scale(0.93) !important; filter: brightness(1.4); }
.cbt-log { padding: 4px 14px 8px; font-size: 11px; min-height: 80px; border-top: 1px solid #1a0f1a; overflow-y: auto; max-height: 90px; display: flex; flex-direction: column-reverse; }
.cbt-log div { margin-bottom: 1px; line-height: 1.35; }

/* ───── ПОРТРЕТ В БОЮ ───── */
.portrait-canvas { display:block; margin:0 auto 4px; border:1px solid #2a2a4a; border-radius:4px; background:#08080f; }

/* ───── СКИЛЛ-ПАНЕЛЬ (левел-ап) ───── */
#skill-panel { top: 50%; left: 50%; transform: translate(-50%,-50%); width: 480px; z-index: 100; }
.sk-intro { padding: 8px 14px; color: #999; font-size: 11px; border-bottom: 1px solid #1e1e38; }
.sk-grid  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
.sk-card  {
    background: rgba(15,15,35,0.9); border: 2px solid #2a2a5a; border-radius: 7px;
    padding: 9px; cursor: pointer; text-align: center; transition: all .18s;
}
.sk-card:hover { border-color: #ffd700; transform: scale(1.04); box-shadow: 0 0 12px rgba(255,215,0,.2); }
.sk-icon  { font-size: 22px; margin-bottom: 4px; }
.sk-name  { font-size: 12px; font-weight: bold; color: #ffd700; }
.sk-desc  { font-size: 9px; color: #888; margin-top: 3px; line-height: 1.4; }

/* ───── ДЕРЕВО ПЕРКОВ ───── */
#perk-panel { top: 22px; left: 50%; transform: translateX(-50%); width: 840px; max-height: 580px; }
#perk-branches { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; padding: 10px 8px; overflow-y: auto; max-height: 490px; }
.perk-branch { border-right: 1px solid #1a1a30; padding: 0 8px; }
.perk-branch:last-child { border-right: none; }
.perk-branch-title { font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 1px; text-align: center; padding: 4px 0 8px; border-bottom: 1px solid #1a1a30; margin-bottom: 8px; }
.perk-tier-line { width: 2px; height: 12px; background: #1e1e38; margin: 0 auto; }
.perk-card { background: rgba(12,12,30,0.9); border: 2px solid #1e1e38; border-radius: 6px; padding: 7px 6px; margin-bottom: 4px; cursor: pointer; text-align: center; transition: all .15s; position: relative; }
.perk-card:hover:not(.locked) { border-color: #ffd700; transform: scale(1.04); }
.perk-card.learned { border-color: #27ae60; background: rgba(8,35,18,0.9); }
.perk-card.available { border-color: #3a3a7a; }
.perk-card.locked { opacity: 0.38; cursor: not-allowed; }
.perk-icon { font-size: 17px; margin-bottom: 2px; }
.perk-name { font-size: 9px; font-weight: bold; color: #ffd700; line-height: 1.3; }
.perk-desc { font-size: 8px; color: #666; margin-top: 2px; line-height: 1.3; }
.perk-tier-badge { position: absolute; top: 2px; right: 3px; font-size: 7px; color: #444; }

/* ───── КРАФТИНГ ───── */
#craft-panel { top: 30px; left: 50%; transform: translateX(-50%); width: 660px; }
.craft-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px 10px; border-bottom: 1px solid #1e1e38; }
.craft-tab { background: rgba(12,12,28,0.8); border: 1px solid #2a2a4a; border-radius: 4px; color: #777; padding: 4px 10px; font-size: 10px; cursor: pointer; transition: all .15s; }
.craft-tab.active { background: rgba(38,38,78,0.9); border-color: #ffd700; color: #ffd700; }
.craft-tab:hover:not(.active) { border-color: #4a4a7a; color: #aaa; }
.craft-recipe-btn { display: block; width: 100%; text-align: left; background: rgba(10,10,25,0.8); border: 1px solid #1a1a35; border-radius: 4px; color: #bbb; padding: 5px 9px; font-size: 11px; cursor: pointer; margin-bottom: 3px; transition: all .15s; }
.craft-recipe-btn:hover { border-color: #3a3a7a; color: #eee; }
.craft-recipe-btn.can-craft { border-color: #27ae60; color: #6f6; }
.craft-recipe-btn.selected { border-color: #ffd700; background: rgba(28,28,58,0.9); }
.craft-ing { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; border-bottom: 1px solid #0a0a18; font-size: 10px; }
.craft-ing.have { color: #4f4; }
.craft-ing.missing { color: #f44; }

/* ───── БЕСТИАРИЙ ───── */
#bestiary-panel { top: 22px; left: 50%; transform: translateX(-50%); width: 820px; max-height: 575px; }
#bestiary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; overflow-y: auto; max-height: 495px; }
.beast-card { background: rgba(12,12,28,0.9); border: 2px solid #1e1e38; border-radius: 7px; padding: 8px; text-align: center; transition: border-color .15s; }
.beast-card.seen { border-color: #2a3a6a; cursor: default; }
.beast-card.seen:hover { border-color: #ffd700; }
.beast-card.unseen { opacity: 0.35; filter: grayscale(1); }
.beast-canvas { display:block; margin:0 auto 4px; border:1px solid #1a1a35; border-radius:3px; background:#06060e; }
.beast-name  { font-size: 11px; font-weight: bold; color: #ffd700; }
.beast-lore  { font-size: 8px; color: #666; margin: 3px 0; line-height: 1.4; text-align: left; }
.beast-kills { font-size: 9px; color: #4f4; margin-top: 2px; }
.beast-weak  { font-size: 8px; color: #e67e22; margin-top: 1px; }
.beast-resist{ font-size: 8px; color: #3498db; }

/* ───── КНОПКА MUTE ───── */
#btn-mute {
    background: rgba(15,15,30,0.85); border: 1px solid #2a2a4a;
    border-radius: 8px; padding: 2px 6px; font-size: 13px;
    cursor: pointer; pointer-events: all; user-select: none;
}
#btn-mute:hover { border-color: #ffd700; }

/* ───── СООБЩЕНИЯ ───── */
#msg-overlay { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); pointer-events: none; z-index: 30; min-width: 200px; text-align: center; }
.msg-pop {
    background: rgba(8,8,18,0.88); border: 1px solid #2a2a4a;
    border-radius: 16px; padding: 4px 14px; font-size: 12px; color: #fff;
    margin-bottom: 3px; animation: msgFade 2.8s forwards; display: inline-block;
}
@keyframes msgFade {
    0%   { opacity: 0; transform: translateY(8px); }
    12%  { opacity: 1; transform: translateY(0); }
    72%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-12px); }
}

/* ───── ТОСТ ДОСТИЖЕНИЯ ───── */
#ach-toast {
    position: absolute; top: 58px; right: 8px;
    background: rgba(255,215,0,.12); border: 2px solid #ffd700;
    border-radius: 7px; padding: 7px 11px; font-size: 11px; color: #ffd700;
    z-index: 60; display: none; max-width: 190px;
    animation: none;
}
#ach-toast.show {
    display: block;
    animation: achToastIn .3s ease;
}
@keyframes achToastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ───── СПЛЭШ ЭКРАН ───── */
#splash-screen {
    position: absolute; inset: 0; z-index: 300; overflow: hidden;
    background: #02020a;
    transition: opacity 0.75s ease;
}
#splash-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.splash-content {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    pointer-events: none;
}
.splash-eyeline {
    font-size: 11px; color: #6644aa; letter-spacing: 8px;
    text-transform: uppercase; margin-bottom: 16px;
    opacity: 0; animation: splashFadeUp 1.2s 0.6s ease forwards;
}
.splash-title {
    font-size: 68px; font-weight: 900; line-height: 1.05;
    font-family: Georgia, 'Times New Roman', serif;
    color: #ffd700; text-align: center; letter-spacing: 3px;
    text-shadow: 0 0 60px rgba(255,215,0,0.85), 0 0 130px rgba(255,140,0,0.45), 0 3px 6px rgba(0,0,0,0.95);
    opacity: 0; animation: splashTitleIn 1.6s 0.9s ease forwards;
}
.splash-subtitle {
    font-size: 11px; color: #4433aa; letter-spacing: 5px;
    text-transform: uppercase; margin-top: 12px; margin-bottom: 58px;
    opacity: 0; animation: splashFadeUp 1.2s 1.4s ease forwards;
}
.splash-btn {
    pointer-events: auto;
    background: linear-gradient(160deg, #100828 0%, #1c0948 50%, #100828 100%);
    border: 2px solid #6644aa; border-radius: 8px;
    color: #c8aaee; padding: 15px 48px;
    font-size: 14px; letter-spacing: 3px; text-transform: uppercase;
    cursor: pointer;
    opacity: 0; animation: splashFadeUp 1.2s 1.9s ease forwards, splashPulse 2.8s 3.5s ease-in-out infinite;
    transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.splash-btn:hover {
    background: linear-gradient(160deg, #1c0948 0%, #2e1268 50%, #1c0948 100%);
    border-color: #ffd700; color: #ffd700;
    box-shadow: 0 0 50px rgba(255,215,0,0.22), inset 0 0 20px rgba(255,215,0,0.06);
}
.splash-hint {
    font-size: 10px; color: #2a1840; letter-spacing: 3px; margin-top: 22px;
    opacity: 0; animation: splashHintBlink 2.4s 3.2s infinite;
}
@keyframes splashFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes splashTitleIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); filter: blur(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0);     filter: blur(0);   }
}
@keyframes splashPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(100,60,180,0); }
    50%       { box-shadow: 0 0 24px 8px rgba(100,60,180,0.18); }
}
@keyframes splashHintBlink {
    0%, 100% { opacity: 0.55; }
    50%       { opacity: 0.12; }
}

/* ───── СТАРТОВЫЙ ЭКРАН ───── */
#start-screen {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 200; overflow: hidden;
}
#menu-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.menu-view { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; width: 100%; }

.s-title {
    font-size: 36px; font-weight: bold; color: #ffd700;
    text-shadow: 0 0 40px rgba(255,215,0,.6), 0 0 80px rgba(255,215,0,.2);
    margin-bottom: 4px; letter-spacing: 2px;
    animation: titlePulse 3s ease-in-out infinite;
}
@keyframes titlePulse {
    0%,100% { text-shadow: 0 0 30px rgba(255,215,0,.5), 0 0 60px rgba(255,215,0,.15); }
    50%      { text-shadow: 0 0 50px rgba(255,215,0,.9), 0 0 100px rgba(255,215,0,.3); }
}
.s-subtitle { font-size: 12px; color: #556; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 26px; }

/* Слоты */
.s-slots { display: flex; gap: 14px; margin-bottom: 18px; }
.slot-card {
    width: 220px; min-height: 130px;
    background: rgba(8,8,20,0.85); border: 2px solid #1e1e3a; border-radius: 10px;
    padding: 14px 12px; cursor: pointer; transition: all .22s; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.slot-card:hover { border-color: #ffd700; transform: translateY(-4px); box-shadow: 0 8px 28px rgba(255,215,0,.18); }
.slot-card.empty { border-style: dashed; opacity: 0.55; }
.slot-card.empty:hover { opacity: 0.9; }
.sc-num   { font-size: 9px; color: #444; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.sc-icon  { font-size: 30px; margin-bottom: 6px; }
.sc-class { font-size: 14px; font-weight: bold; color: #ffd700; }
.sc-info  { font-size: 10px; color: #778; margin-top: 4px; line-height: 1.7; }
.sc-date  { font-size: 9px; color: #445; margin-top: 6px; }
.sc-del   { font-size: 9px; color: #c44; cursor: pointer; margin-top: 8px; padding: 2px 8px; border: 1px solid #622; border-radius: 3px; transition: all .15s; }
.sc-del:hover { background: rgba(200,50,50,.18); color: #f66; border-color: #f44; }
.sc-play  { font-size: 11px; color: #4f4; border: 1px solid #282; border-radius: 4px; padding: 4px 14px; margin-top: 8px; transition: all .15s; }
.sc-play:hover { background: rgba(50,200,50,.15); }
.s-new-btn {
    background: rgba(18,18,42,0.88); border: 2px solid #3a3a6a; border-radius: 6px;
    color: #aab; padding: 9px 32px; cursor: pointer; font-size: 13px; transition: all .22s; letter-spacing: 1px;
}
.s-new-btn:hover { border-color: #ffd700; color: #ffd700; transform: scale(1.05); }

/* Выбор класса */
.cls-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; max-width: 840px; }
.cls-btn  {
    background: linear-gradient(135deg, #0f0f22, #080813);
    border: 2px solid #2a2a4a; border-radius: 8px;
    color: #e0e0e0; padding: 10px 8px; cursor: pointer; transition: all .22s; text-align: center;
}
.cls-btn:hover { transform: translateY(-3px); box-shadow: 0 4px 18px rgba(255,215,0,.22); border-color: #ffd700; }
.cb-icon  { font-size: 26px; margin-bottom: 5px; }
.cb-name  { font-size: 14px; font-weight: bold; color: #ffd700; }
.cb-desc  { font-size: 9px; color: #666; margin-top: 3px; line-height: 1.35; }
.cb-stats { font-size: 9px; color: #888; margin-top: 4px; }
.s-back-btn { background: rgba(12,12,28,0.85); border: 1px solid #333; border-radius: 5px; color: #778; padding: 5px 14px; cursor: pointer; font-size: 11px; transition: all .15s; }
.s-back-btn:hover { border-color: #888; color: #ddd; }
.s-folder-btn { background: rgba(12,12,28,0.85); border: 1px solid #2a3a5a; border-radius: 5px; color: #6688aa; padding: 5px 14px; cursor: pointer; font-size: 11px; transition: all .15s; }
.s-folder-btn:hover { border-color: #4488cc; color: #88bbee; }
.cls-slot-hint { font-size: 11px; color: #556; margin: 0 0 10px; letter-spacing: 1px; }

/* ───── ИНДИКАТОР СОХРАНЕНИЯ ───── */
#save-ind {
    position: absolute; bottom: 52px; right: 10px;
    background: rgba(10,40,15,0.92); border: 1px solid #27ae60;
    border-radius: 6px; padding: 5px 10px; font-size: 10px; color: #4f4;
    z-index: 25; opacity: 0; transition: opacity .35s; pointer-events: none;
}

/* ───── ХИНТ ВЗАИМОДЕЙСТВИЯ ───── */
#interact-hint {
    position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%);
    background: rgba(8, 8, 20, 0.88); border: 1px solid #3a3a7a;
    border-radius: 8px; padding: 7px 18px;
    font-size: 12px; color: #ccc; pointer-events: none;
    opacity: 0; transition: opacity 0.22s ease, transform 0.22s ease;
    white-space: nowrap; z-index: 50;
    transform: translateX(-50%) translateY(6px);
    box-shadow: 0 2px 12px rgba(60,0,120,0.25);
}
#interact-hint.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.hint-key {
    display: inline-block; background: #1e1e4a; border: 1px solid #6a6aaa;
    border-radius: 4px; padding: 1px 8px; font-size: 11px; font-weight: bold;
    color: #ffd700; margin-right: 7px; font-family: monospace;
    box-shadow: 0 1px 3px rgba(100,0,200,0.3);
}

/* ───── СКРОЛЛБАР ───── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #0a0a14; }
::-webkit-scrollbar-thumb { background: #2a2a4a; border-radius: 2px; }

/* ───── СЕТЫ ЭКИПИРОВКИ ───── */
.set-bonus-bar {
    display: flex; flex-wrap: wrap; gap: 5px;
    margin: 6px 0 2px; padding: 5px 6px;
    background: rgba(255,215,0,0.05); border: 1px solid rgba(255,215,0,0.18);
    border-radius: 5px;
}
.set-bonus-card {
    display: flex; align-items: center; gap: 4px;
    background: rgba(20,20,40,0.8); border: 1px solid rgba(255,215,0,0.3);
    border-radius: 4px; padding: 3px 7px; font-size: 10px;
}
.sb-icon { font-size: 13px; }
.sb-name { color: #ffd700; font-weight: bold; margin-right: 3px; }
.sb-desc { color: #a8c; font-size: 9px; }
.enc-tag { font-size: 10px; margin-left: 3px; }

/* ───── ПАНЕЛЬ ЗАЧАРОВАНИЯ ───── */
#enchant-panel { top: 30px; left: 50%; transform: translateX(-50%); width: 620px; }
.enchant-body {
    display: flex; height: 430px;
}
.enchant-left {
    width: 200px; border-right: 1px solid #1e1e38;
    display: flex; flex-direction: column;
}
.enchant-right {
    flex: 1; overflow-y: auto; padding: 8px 10px;
}
.enchant-col-title {
    font-size: 9px; color: #555; letter-spacing: 1px; text-transform: uppercase;
    padding: 6px 10px 4px; border-bottom: 1px solid #1a1a30;
}
#enchant-item-list {
    overflow-y: auto; flex: 1; padding: 6px;
}
.enchant-item-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 8px; border-radius: 5px; cursor: pointer;
    font-size: 10px; color: #99a; margin-bottom: 3px;
    border: 1px solid transparent; transition: all .15s;
}
.enchant-item-btn:hover { background: rgba(80,80,180,0.15); border-color: #3a3a6a; color: #ccd; }
.enchant-item-btn.active { background: rgba(100,80,200,0.22); border-color: #5a5aaa; color: #ddf; }
.eib-icon { font-size: 14px; }
.eib-name { flex: 1; }
.eib-ench { font-size: 12px; }
.eib-src  { font-size: 9px; color: #445; }

.ench-item-header {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 4px 8px; border-bottom: 1px solid #1e1e38; margin-bottom: 6px;
}
.eih-icon { font-size: 20px; }
.eih-name { font-size: 13px; color: #dde; font-weight: bold; flex: 1; }
.eih-cur  { font-size: 10px; color: #a8c; background: rgba(150,80,200,0.15); padding: 2px 7px; border-radius: 10px; }

.enchant-card {
    background: linear-gradient(135deg, #0f0f22, #080813);
    border: 1px solid #2a2a4a; border-radius: 6px;
    padding: 8px 10px; margin-bottom: 6px; cursor: pointer; transition: all .18s;
}
.enchant-card:hover:not(.disabled) { border-color: #8844cc; background: rgba(80,40,140,0.25); transform: translateX(2px); }
.enchant-card.disabled { opacity: 0.5; cursor: default; }
.enchant-card.current  { border-color: #5580cc; background: rgba(40,60,140,0.25); }
.ec-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.ec-icon { font-size: 16px; }
.ec-name { font-size: 11px; color: #ccaaff; font-weight: bold; flex: 1; }
.ec-desc { font-size: 10px; color: #88aadd; }
.ec-cost { font-size: 9px; color: #667; }

.ench-empty { color: #445; font-size: 11px; padding: 20px; text-align: center; }

/* ───── ЖУРНАЛ ЛОРА ───── */
#lore-panel  { top: 30px; left: 50%; transform: translateX(-50%); width: 560px; }
#lore-list   { max-height: 480px; overflow-y: auto; padding: 10px 12px; }
.lore-group  { margin-bottom: 14px; }
.lore-group-title {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
    color: #ffd700; border-bottom: 1px solid #2a2a4a;
    padding-bottom: 4px; margin-bottom: 7px;
}
.lore-card {
    background: rgba(10,10,22,0.9); border: 1px solid #2a2a4a;
    border-radius: 6px; padding: 8px 10px; margin-bottom: 6px;
    transition: border-color .15s;
}
.lore-card:hover { border-color: #5566aa; }
.lc-head  { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.lc-icon  { font-size: 16px; }
.lc-title { font-size: 12px; color: #ccccff; font-weight: bold; }
.lc-text  { font-size: 11px; color: #889; line-height: 1.5; font-style: italic; }
.lc-hint  { font-size: 11px; color: #ffdd44; margin-top: 5px; padding: 4px 6px;
            background: rgba(255,221,68,0.08); border-left: 2px solid #ffdd44; border-radius: 3px; }
.lore-map-status { font-size: 11px; margin-top: 6px; padding: 3px 0; text-align: right; }
.lore-empty { color: #445; font-size: 12px; padding: 30px; text-align: center; line-height: 1.7; }

/* ── Boss HP Bar ─────────────────────────────────── */
#boss-bar {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 580px;
    z-index: 60;
    text-align: center;
    pointer-events: none;
    animation: bossBarIn .4s ease;
}
@keyframes bossBarIn {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
#boss-bar-name {
    color: #ff6644;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px #ff440088;
    margin-bottom: 4px;
    font-family: monospace;
}
#boss-bar-track {
    height: 14px;
    background: #110505;
    border: 1px solid #660000;
    border-radius: 7px;
    overflow: hidden;
    box-shadow: 0 0 14px #cc110044, inset 0 0 6px #00000088;
}
#boss-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #6b0000 0%, #cc2200 60%, #ff4400 100%);
    border-radius: 7px;
    transition: width .5s ease;
    box-shadow: inset 0 1px 0 #ff660044;
}
#boss-bar-text {
    color: #aa6655;
    font-size: 10px;
    margin-top: 3px;
    letter-spacing: 1px;
}

/* ───── АНИМАЦИЯ ПОРТРЕТОВ (дыхание + моргание + вспышка) ───── */
#portrait-player { animation: portrait-breathe 3.2s ease-in-out infinite; }
#portrait-enemy  { animation: portrait-breathe 2.4s ease-in-out infinite; }
@keyframes portrait-flash {
    0%   { filter: brightness(1) saturate(1); }
    25%  { filter: brightness(3) saturate(0); }
    100% { filter: brightness(1) saturate(1); }
}
.portrait-hit { animation: portrait-flash 0.28s ease forwards !important; }
@keyframes portrait-breathe {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-2px); }
}
.portrait-wrap { position: relative; display: inline-block; }
.portrait-blink {
    position: absolute; bottom: 28px; left: 50%;
    transform: translateX(-50%);
    width: 32px; height: 4px;
    background: transparent; pointer-events: none; transition: background .05s;
}
.portrait-blink.blinking { background: #08080f; }

/* ───── DRAG & DROP ИНВЕНТАРЬ ───── */
.inv-slot[draggable="true"] { cursor: grab; }
.inv-slot.dragging  { opacity: 0.35; cursor: grabbing; }
.eq-slot.drag-over, .inv-slot.drag-over {
    border-color: #4488ff !important;
    box-shadow: 0 0 8px #4488ff55;
}

/* ───── ДОСТИЖЕНИЯ ───── */
#achiev-panel { top: 30px; left: 50%; transform: translateX(-50%); width: 500px; }
#achiev-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px; padding: 10px; max-height: 400px; overflow-y: auto;
}
.ach-card {
    background: #0d0d1a; border: 1px solid #1a1a2a;
    border-radius: 6px; padding: 8px; text-align: center;
}
.ach-card.unlocked {
    border-color: #ffd700; background: #1a1400;
    box-shadow: 0 0 6px #ffd70033;
}
.ach-card.locked { opacity: 0.35; filter: grayscale(0.7); }
.ach-icon { font-size: 20px; display: block; margin-bottom: 3px; }
.ach-name { font-size: 10px; color: #ccccff; font-weight: bold; }
.ach-desc { font-size: 9px; color: #556; margin-top: 2px; line-height: 1.3; }

/* ───── ПРОГРЕСС ДОСТИЖЕНИЙ ───── */
.ach-progress { height: 3px; background: #1a1a2a; border-radius: 2px; margin: 5px 2px 1px; overflow: hidden; }
.ach-prog-fill { height: 100%; background: linear-gradient(to right, #3a3a8a, #6666cc); border-radius: 2px; transition: width .3s; }
.ach-prog-text { font-size: 8px; color: #445; text-align: center; margin-top: 1px; }

/* ───── ЭКИПИРОВАННЫЕ ПРЕДМЕТЫ ───── */
.inv-slot.equipped { border-color: #ffd700 !important; box-shadow: 0 0 8px #ffd70044; }
.inv-slot.equipped::after {
    content: '✓';
    position: absolute; top: 2px; right: 4px;
    color: #ffd700; font-size: 12px; font-weight: bold;
    text-shadow: 0 0 4px #ffd700;
    pointer-events: none;
}

/* ───── МАГАЗИН — недоступные предметы ───── */
.shop-item { position: relative; }
.shop-item.cant-afford { opacity: 0.40; cursor: not-allowed; pointer-events: none; }
.shop-item.cant-afford .si-price { color: #e74c3c; }

/* ───── КАРТА МИРА ───── */
#worldmap-panel { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 520px; }

/* ───── SVG-ЛИНИИ ПЕРКОВ ───── */
.perk-tier-line { display: none; }
.perk-svg-line { display: block; margin: 2px auto; }

/* ════════════════════════════════════════════
   МЕНЮ ПАУЗЫ
   ════════════════════════════════════════════ */
.pause-overlay {
    position: fixed !important; top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important; transform: none !important;
    background: rgba(0,0,0,0.75);
    display: flex !important; align-items: center; justify-content: center; z-index: 9999;
}
.pause-box {
    background: #0d0d1e; border: 1px solid #2a2a6a; border-radius: 10px;
    padding: 32px 44px; display: flex; flex-direction: column; align-items: center; gap: 14px;
    min-width: 270px; box-shadow: 0 0 50px rgba(80,0,180,0.45);
}
.pause-title {
    font-size: 22px; color: #ffd700; letter-spacing: 5px; font-weight: bold;
    margin-bottom: 8px; text-shadow: 0 0 12px #ffd70066;
}
.pause-btn {
    width: 100%; padding: 9px 0; background: #14143a; border: 1px solid #3a3a7a;
    border-radius: 6px; color: #ccc; font-size: 13px; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pause-btn:hover { background: #1e1e5a; color: #fff; border-color: #6644cc; }
.pause-exit { border-color: #6a1a1a !important; color: #e88; margin-top: 4px; }
.pause-exit:hover { background: #2a0a0a !important; color: #faa; border-color: #cc4444 !important; }
.pause-vol { width: 100%; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pause-vol label { font-size: 11px; color: #778; }
.pause-vol input[type=range] { width: 90%; accent-color: #6644cc; cursor: pointer; }

/* ════════════════════════════════════════════
   ВКЛАДКИ ИНВЕНТАРЯ
   ════════════════════════════════════════════ */
.inv-tabs { display:flex; border-bottom:1px solid #1e1e38; flex-shrink:0; }
.inv-tab {
    flex:1; padding:7px 4px; background:none; border:none;
    border-bottom:2px solid transparent; color:#556; font-size:11px; cursor:pointer;
    transition: color 0.15s, border-color 0.15s;
}
.inv-tab:hover { color:#aaa; }
.inv-tab.active { color:#ffd700; border-bottom-color:#ffd700; }
.inv-tab-pane { display:none; }
.inv-tab-pane.active { display:block; }

/* ════════════════════════════════════════════
   БУМАЖНАЯ КУКЛА (PAPER DOLL)
   ════════════════════════════════════════════ */
.paperdoll {
    display:flex; align-items:center; justify-content:center;
    gap:8px; padding:10px 8px 4px;
}
.pd-col { display:flex; flex-direction:column; gap:6px; }
.pd-portrait { border-radius:6px; border:1px solid #2a2a5a; background:#06060e; display:block; }
.pd-slot {
    width:64px; min-height:64px; background:#0e0e22; border:1px solid #2a2a4a;
    border-radius:6px; display:flex; flex-direction:column;
    align-items:center; justify-content:center; font-size:10px; color:#445; cursor:pointer;
    text-align:center; padding:4px; transition: border-color 0.15s, background 0.15s;
    user-select:none;
}
.pd-slot:hover { border-color:#4a4a8a; background:#141430; }
.pd-slot.filled { border-color:#3a5a8a; background:#0e1a2a; color:#ccc; }
.pd-slot.filled:hover { border-color:#6699ff; background:#101e32; }
.pd-slot.drag-over { border-color:#ffd700; background:#1a1808; }
.pd-slot small { font-size:8px; color:#334; display:block; margin-top:1px; }
.pd-item-icon { font-size:18px; line-height:1.1; }
.pd-item-name { font-size:9px; color:#99aacc; margin-top:2px; max-width:60px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pd-item-stat { font-size:8px; color:#667; margin-top:1px; }
.pd-acc-row { display:flex; justify-content:center; padding:0 8px 8px; }
.pd-slot-wide { width:180px; min-height:40px; flex-direction:row; gap:8px; min-width:0; }

/* ════════════════════════════════════════════
   ДЕТАЛЬНЫЕ СТАТЫ
   ════════════════════════════════════════════ */
#inv-stats-detail { padding:10px 12px; font-size:11px; overflow-y:auto; max-height:360px; }
.stat-group { margin-bottom:12px; }
.stat-group-title {
    color:#ffd700; font-size:10px; letter-spacing:1px;
    text-transform:uppercase; border-bottom:1px solid #1e1e38;
    padding-bottom:3px; margin-bottom:6px;
}
.stat-row { display:flex; align-items:baseline; gap:6px; margin-bottom:4px; flex-wrap:wrap; }
.stat-label { color:#778; width:115px; flex-shrink:0; }
.stat-value { color:#ddd; font-weight:bold; min-width:32px; }
.stat-breakdown { color:#445; font-size:9px; flex:1; min-width:0; }
.stat-breakdown b { color:#667; }
.stat-bar { height:3px; background:#1a1a2a; border-radius:2px; margin-top:2px; margin-bottom:5px; }
.stat-bar-fill { height:100%; background:linear-gradient(to right,#3a3a8a,#6644cc); border-radius:2px; transition:width .3s; }
