/* ===== bot.css – страница информации о существе (портальный дизайн) ===== */

:root {
    --color-primary: #8b4513;
    --color-secondary: #a0522d;
    --color-accent: #d4af37;
    --color-gold-light: #ffd966;
    --color-bg-dark: #2b1e0e;
    --color-text-light: #f5e6d3;
    --color-text-muted: #b8a58e;
    --shadow-portal: 0 10px 25px rgba(0,0,0,0.7), 0 0 0 0.5px rgba(212,175,55,0.2);
    --border-portal: 1.5px solid #8b5a2b;
    --transition-default: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --chat-bg: rgba(26, 17, 12, 0.35);
    --chat-inner-glow: inset 0 0 20px rgba(212,175,55,0.08);
}

/* === ФОН СТРАНИЦЫ (портальный, с сеткой) === */
.bgnew {
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    background: radial-gradient(ellipse at 20% 20%, rgba(210, 180, 140, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
    linear-gradient(145deg, #3f2f1c 0%, #332612 20%, #2b1900 40%, #453407 70%, #a13e0f 100%);
    background-attachment: fixed;
    background-size: cover;
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
}

/* Декоративный слой с сеткой */
.bgnew::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(45deg, transparent 0px, transparent 2px, rgba(212, 175, 55, 0.02) 2px, rgba(212, 175, 55, 0.02) 4px),
    radial-gradient(circle at 20% 30%, rgba(210, 180, 140, 0.05) 0%, transparent 20%),
    radial-gradient(circle at 80% 70%, rgba(139, 69, 19, 0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

/* === ОСНОВНОЙ КОНТЕЙНЕР (портальная карточка) === */
.creature-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    background: var(--chat-bg);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    border: var(--border-portal);
    box-shadow: var(--shadow-portal), var(--chat-inner-glow);
    color: var(--color-text-light);
    transition: var(--transition-default);
    animation: floatUp 0.5s ease-out;
}

.creature-container:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(212, 175, 55, 0.4), inset 0 0 30px rgba(212, 175, 55, 0.12);
}

/* === ЗАГОЛОВОК === */
.creature-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(145deg, rgba(44, 30, 21, 0.95), rgba(26, 17, 12, 0.95));
    border-radius: 20px;
    border: 2px solid #a0522d;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 0 0.5px rgba(212,175,55,0.2), inset 0 0 20px rgba(212,175,55,0.08);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.creature-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, #8b4513, #d4af37, transparent);
}

/* === НОВОЕ ОФОРМЛЕНИЕ КОНТЕЙНЕРА С ИЗОБРАЖЕНИЕМ === */
.image-container {
    position: relative;
    width: 100%;
    max-width: 1280px;          /* растягиваем, но не более 1280px */
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7), inset 0 0 30px rgba(212,175,55,0.1);
    border: 2px solid #8b5a2b;
    transition: var(--transition-default);
    max-height: min(60vh, 1176px);   /* ограничение высоты: 60% экрана или 1176px */
}

.image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.8), 0 0 0 1px rgba(212,175,55,0.4);
    border-color: #d4af37;
}

.image-container img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;          /* заполняет контейнер, сохраняя пропорции */
    transition: transform 0.4s ease;
}

.image-container:hover img {
    transform: scale(1.03);
}

/* === НАЗВАНИЕ И УРОВЕНЬ ПОВЕРХ ИЗОБРАЖЕНИЯ (центрирование) === */
.bot-img-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    text-align: center;
    z-index: 3;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    padding: 16px 24px;
    border-radius: 60px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 220px;
    pointer-events: none;
}

/* Заголовок внутри оверлея */
.bot-img-title .creature-title {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #ffd966;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.7);
    margin: 0 0 8px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    pointer-events: auto;       /* если внутри будут интерактивные элементы, они будут работать */
}

.bot-img-title .level-badge {
    background: linear-gradient(145deg, #ffd966, #d4af37);
    color: #1f140c;
    padding: 6px 18px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
    border: 1px solid #ffefb0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bot-img-title .creature-subtitle {
    font-size: 0.9rem;
    color: #f0e6d2;
    text-shadow: 1px 1px 3px black;
    margin: 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.3);
    padding: 6px 12px;
    border-radius: 30px;
    backdrop-filter: blur(2px);
}

/* === ОСТАЛЬНЫЕ СТИЛИ (ВКЛАДКИ, СТАТИСТИКА, УМЕНИЯ, ДРОП) – без изменений === */
.creature-tabs {
    display: flex;
    background: linear-gradient(145deg, rgba(44, 30, 21, 0.95), rgba(26, 17, 12, 0.95));
    border-radius: 16px 16px 0 0;
    border-bottom: 2px solid #a0522d;
    flex-wrap: wrap;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 0 15px rgba(255,215,0,0.1);
    overflow: hidden;
}

.tab-btn {
    padding: 14px 24px;
    background: transparent;
    border: none;
    color: #f0e6d2;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-default);
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.08);
    flex: 1;
    min-width: 120px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: rgba(184, 134, 11, 0.2);
    color: #ffd966;
}

.tab-btn.active {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    color: #1f140c;
    border-bottom: 2px solid #ffd700;
    text-shadow: none;
}

.tab-btn.active i {
    color: #1f140c;
}

.tab-content-container {
    margin-top: 0;
}

.tab-content {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    border-radius: 0 0 20px 20px;
    padding: 25px;
    border: 1.5px solid #8b5a2b;
    border-top: none;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3), 0 8px 20px rgba(0,0,0,0.5);
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

.info-card {
    background: rgba(44, 30, 21, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 20px;
    border: 1.5px solid #8b5a2b;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

.info-card:last-child {
    margin-bottom: 0;
}

.info-card h3, .info-card h4 {
    color: #ffd966;
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #a0522d;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    padding: 20px;
    border: 1.5px solid #8b5a2b;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2);
    transition: var(--transition-default);
}

.stat-card:hover {
    border-color: #d4af37;
    box-shadow: 0 0 15px rgba(212,175,55,0.2), inset 0 0 15px rgba(0,0,0,0.2);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 90, 43, 0.4);
}

.stat-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.stat-label {
    font-weight: 600;
    color: #f0e6d2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #ffd966;
    text-shadow: 0 1px 3px black;
}

.stat-value.hp-value {
    color: #2ecc71;
}

.description-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #f0e6d2;
    padding: 5px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.description-content::first-letter {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd966;
    float: left;
    line-height: 1;
    margin-right: 10px;
    margin-top: 5px;
}

.abilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 20px;
    justify-content: center;
}

.ability-item {
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 100px;
    margin: 0 auto;
    cursor: pointer;
    border: 2px solid #8b5a2b;
    border-radius: 14px;
    overflow: hidden;
    transition: var(--transition-default);
    background: rgba(0,0,0,0.4);
    position: relative;
    box-shadow: 0 5px 12px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ability-item:hover {
    transform: translateY(-5px);
    border-color: #ffd700;
    box-shadow: 0 0 18px gold, 0 8px 20px rgba(0,0,0,0.6);
}

.ability-item img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px black);
    transition: transform 0.2s;
}

.ability-item:hover img {
    transform: scale(1.1);
}

.ability-count {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.8);
    color: #ffd966;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid #8b5a2b;
    box-shadow: 0 2px 4px black;
}

/* === ДРОП (только иконки, сетка) === */
.loot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.loot-category {
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    padding: 18px;
    border: 1.5px solid #8b5a2b;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2);
    transition: var(--transition-default);
}

.loot-category:hover {
    border-color: #d4af37;
    box-shadow: 0 0 12px rgba(212,175,55,0.2), inset 0 0 15px rgba(0,0,0,0.2);
}

.loot-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffd966;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #a0522d;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Сетка иконок внутри категории */
.loot-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Каждая иконка — ссылка без текста, с тултипом */
.loot-item {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 75px;
    height: 75px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #8b5a2b;
    border-radius: 12px;
    transition: var(--transition-default);
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.loot-item:hover {
    transform: translateY(-3px);
    border-color: #d4af37;
    background: rgba(184, 134, 11, 0.2);
    box-shadow: 0 0 10px rgba(212,175,55,0.4);
}

.loot-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px black);
    pointer-events: none; /* клик обрабатывает родительская ссылка */
    border-radius: 9px;
}

/* Тултип для иконки (показывается над ней) */
.loot-item .tooltip-text {
    visibility: hidden;
    width: auto;
    max-width: 200px;
    white-space: nowrap;
    background: rgba(26, 17, 12, 0.95);
    backdrop-filter: blur(4px);
    color: #f5e6d3;
    text-align: center;
    border-radius: 8px;
    padding: 6px 12px;
    position: absolute;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid #8b5a2b;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    pointer-events: none;
    white-space: nowrap;
}

.loot-item .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(26, 17, 12, 0.95) transparent transparent transparent;
}

.loot-item:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Адаптация для маленьких экранов */
@media (max-width: 768px) {
    .loot-item {
        width: 64px;
        height: 64px;
    }
    .loot-item .tooltip-text {
        font-size: 10px;
        white-space: normal;
        width: 120px;
    }
}
.tooltip {
    position: relative;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background: rgba(26, 17, 12, 0.95);
    backdrop-filter: blur(4px);
    color: #f5e6d3;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid #8b5a2b;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    pointer-events: none;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(26, 17, 12, 0.95) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Анимации */
@keyframes floatUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
    .bgnew { padding: 12px; }
    .creature-container { padding: 16px; }
    .creature-title { font-size: 1.8rem; }
    .tab-btn { padding: 12px 16px; font-size: 0.9rem; }
    .abilities-grid { grid-template-columns: repeat(3, 1fr); }
    .loot-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }

    /* Адаптация оверлея на мобильных */
    .bot-img-title {
        padding: 10px 18px;
        min-width: 160px;
    }
    .bot-img-title .creature-title {
        gap: 10px;
        font-size: 1.2rem;
    }
    .bot-img-title .level-badge {
        font-size: 0.8rem;
        padding: 3px 12px;
    }
    .bot-img-title .creature-subtitle {
        font-size: 0.7rem;
    }
    .image-container {
        max-height: 40vh; /* чуть меньше на телефонах */
    }
}

@media (max-width: 480px) {
    .creature-title { font-size: 1.5rem; }
    .level-badge { font-size: 0.9rem; padding: 4px 12px; }
    .abilities-grid { grid-template-columns: repeat(2, 1fr); }
    .tab-content { padding: 16px; }
    .bot-img-title .creature-title {
        flex-direction: column;
        gap: 6px;
    }
}