/* ============================================
   PETS SYSTEM — Window, Combat Panel, Cards
   ============================================ */

/* ===========================================
   PETS WINDOW (484x873, draggable, league17 style)
   =========================================== */
.pets-window {
    position: fixed;
    width: 484px;
    height: 873px;
    max-height: 95vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1a1410 0%, #12100c 100%);
    border: 2px solid #5c4a32;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,220,150,0.06);
    font-family: inherit;
    overflow: hidden;
}

/* Header / Drag handle */
.pets-win-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(180deg, #2a2218 0%, #1e1a14 100%);
    border-bottom: 1px solid #5c4a32;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}
.pets-win-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #d4a574;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.pets-win-close {
    width: 24px; height: 24px;
    background: rgba(180,60,60,0.3);
    border: 1px solid rgba(180,60,60,0.5);
    border-radius: 3px;
    color: #ff8080;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.pets-win-close:hover { background: rgba(180,60,60,0.6); color: #fff; }

/* Active pet panel */
.pets-win-active {
    padding: 10px 12px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid #3a3020;
    flex-shrink: 0;
    min-height: 60px;
}

/* Tabs */
.pets-win-tabs {
    display: flex;
    border-bottom: 1px solid #3a3020;
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}
.pets-win-tab {
    flex: 1;
    padding: 7px 0;
    border: none;
    background: transparent;
    color: #888;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 2px solid transparent;
}
.pets-win-tab:hover { color: #ccc; background: rgba(255,255,255,0.02); }
.pets-win-tab.active {
    color: #d4a574;
    border-bottom-color: #d4a574;
    background: rgba(212,165,116,0.06);
}

/* Content area */
.pets-win-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 12px;
    min-height: 0;
}
.pets-win-content::-webkit-scrollbar { width: 5px; }
.pets-win-content::-webkit-scrollbar-track { background: transparent; }
.pets-win-content::-webkit-scrollbar-thumb { background: #3a3020; border-radius: 3px; }

.pet-tab-panel { display: none; }
.pet-tab-panel.active { display: block; }

/* ===== Active pet card (inside window header) ===== */
.pet-active-empty {
    text-align: center;
    color: #666;
    padding: 12px;
    font-size: 0.78rem;
    font-style: italic;
}

.pet-active-info {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.pet-active-avatar {
    width: 56px; height: 56px;
    border-radius: 6px;
    background: rgba(0,0,0,0.4);
    border: 1px solid #5c4a32;
    overflow: hidden;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
}
.pet-active-avatar img { width: 100%; height: 100%; object-fit: cover; }

.pet-active-details { flex: 1; min-width: 0; }

.pet-active-name {
    font-size: 0.85rem;
    font-weight: bold;
    color: #e8d5b5;
    display: flex; align-items: center; gap: 5px;
}

.pet-active-meta {
    font-size: 0.68rem;
    color: #888;
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-top: 2px;
}

.pet-active-genecode {
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    margin-top: 3px;
    letter-spacing: 0.4px;
}
.gene-high { color: #51cf66; font-weight: bold; }
.gene-mid  { color: #ffd43b; }
.gene-low  { color: #ff6b6b; }

.pet-active-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin-top: 5px;
    font-size: 0.6rem;
}
.pet-stat-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 2px 3px;
    border-radius: 2px;
    text-align: center;
}
.pet-stat-label { color: #777; }
.pet-stat-value { color: #e8d5b5; font-weight: bold; }

.pet-active-actions {
    display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap;
}
.pet-action-btn {
    padding: 2px 7px;
    font-size: 0.62rem;
    border-radius: 3px;
    border: 1px solid #3a3020;
    background: rgba(255,255,255,0.04);
    color: #aaa;
    cursor: pointer;
    transition: all 0.15s;
}
.pet-action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: #5c4a32; }
.pet-action-btn.danger { color: #ff6b6b; border-color: rgba(255,80,80,0.2); }
.pet-action-btn.danger:hover { background: rgba(255,50,50,0.12); }

/* ===== Pet collection grid ===== */
.pets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* Pet card */
.pet-card {
    background: rgba(0,0,0,0.25);
    border: 1px solid #3a3020;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.pet-card:hover { border-color: #5c4a32; background: rgba(0,0,0,0.35); }
.pet-card.active-pet { border-color: #5c8a32; box-shadow: 0 0 6px rgba(92,138,50,0.2); }
.pet-card.gene-legendary { border-color: #b8960a; }
.pet-card.gene-epic { border-color: #9b59b6; }
.pet-card.gene-rare { border-color: #3498db; }

.pet-card-header {
    display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.pet-card-avatar {
    width: 36px; height: 36px;
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
    border: 1px solid #3a3020;
    overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.pet-card-avatar img { width: 100%; height: 100%; object-fit: cover; }

.pet-card-name {
    font-size: 0.75rem;
    font-weight: bold;
    color: #e8d5b5;
}
.pet-card-sub {
    font-size: 0.58rem;
    color: #888;
    display: flex; gap: 4px; align-items: center;
}

.pet-card-gene {
    font-family: 'Courier New', monospace;
    font-size: 0.58rem;
    color: #777;
    margin-top: 3px;
    letter-spacing: 0.2px;
}

.pet-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 0.58rem;
}

.pet-quality-badge {
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.52rem;
    font-weight: bold;
}
.pet-breed-badge { font-size: 0.52rem; }
.pet-breed-badge.can-breed { color: #ff69b4; }
.pet-breed-badge.already-bred { color: #666; }

/* ===== Breeding eggs ===== */
.breeding-eggs { display: flex; flex-direction: column; gap: 6px; }

.breeding-egg-card {
    background: rgba(0,0,0,0.25);
    border: 1px solid #3a3020;
    border-radius: 4px;
    padding: 8px;
    display: flex; align-items: center; gap: 10px;
}
.egg-icon { font-size: 1.6rem; width: 40px; text-align: center; }
.egg-info { flex: 1; }
.egg-species { font-size: 0.78rem; color: #e8d5b5; }
.egg-timer { font-size: 0.68rem; color: #ffd43b; margin-top: 2px; }
.egg-parents { font-size: 0.58rem; color: #666; margin-top: 2px; }

.egg-claim-btn {
    padding: 5px 12px;
    background: rgba(50,200,100,0.2);
    border: 1px solid rgba(50,200,100,0.4);
    border-radius: 4px;
    color: #7fff7f;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}
.egg-claim-btn:hover { background: rgba(50,200,100,0.35); }
.egg-claim-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===========================================
   BREED MODAL — modern, minimal, glassmorphism
   =========================================== */

.breed-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breedOverlayIn 0.2s ease-out;
}

@keyframes breedOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes breedModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.breed-modal {
    width: 440px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(170deg, #1e1a14 0%, #151210 60%, #12100c 100%);
    border: 1px solid #4a3c28;
    border-radius: 12px;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 220, 150, 0.04) inset,
        0 1px 0 rgba(255, 220, 150, 0.06) inset;
    animation: breedModalIn 0.25s ease-out;
    overflow: hidden;
}

/* Header */
.breed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(90, 70, 44, 0.5);
}

.breed-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #e8d5b5;
    letter-spacing: 0.3px;
}

.breed-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.breed-modal-close:hover {
    background: rgba(200, 60, 60, 0.2);
    color: #ff8080;
}

/* Subtitle */
.breed-modal-subtitle {
    padding: 10px 20px 0;
    font-size: 0.78rem;
    color: #999;
    line-height: 1.4;
}
.breed-modal-subtitle strong {
    color: #d4a574;
}

/* Body */
.breed-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    min-height: 0;
}
.breed-modal-body::-webkit-scrollbar { width: 4px; }
.breed-modal-body::-webkit-scrollbar-track { background: transparent; }
.breed-modal-body::-webkit-scrollbar-thumb { background: #3a3020; border-radius: 3px; }

/* Pets grid inside modal */
.breed-pets-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual pet card in breed modal */
.breed-pet-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(90, 70, 44, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}

.breed-pet-card:hover {
    background: rgba(212, 165, 116, 0.06);
    border-color: rgba(212, 165, 116, 0.35);
}

.breed-pet-card.selected {
    background: rgba(212, 165, 116, 0.1);
    border-color: #d4a574;
    box-shadow: 0 0 12px rgba(212, 165, 116, 0.15);
}

.breed-pet-card.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #d4a574;
    border-radius: 8px 0 0 8px;
}

.breed-pet-avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(90, 70, 44, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    overflow: hidden;
}
.breed-pet-avatar img { width: 100%; height: 100%; object-fit: cover; }

.breed-pet-info { flex: 1; min-width: 0; }

.breed-pet-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e8d5b5;
    display: flex;
    align-items: center;
    gap: 4px;
}

.breed-pet-gender {
    font-size: 0.75rem;
    opacity: 0.7;
}

.breed-pet-meta {
    font-size: 0.68rem;
    color: #888;
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.breed-pet-stats {
    font-size: 0.62rem;
    color: #777;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.breed-pet-gene {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    color: #666;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.breed-pet-quality {
    font-size: 0.62rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* No pets message */
.breed-no-pets {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.78rem;
    font-style: italic;
    line-height: 1.5;
}

/* Incoming breed request info block */
.breed-incoming-info {
    padding: 14px 20px;
    background: rgba(212, 165, 116, 0.04);
    border-bottom: 1px solid rgba(90, 70, 44, 0.3);
}

.breed-incoming-from {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.breed-incoming-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breed-incoming-login {
    font-size: 0.88rem;
    font-weight: 700;
    color: #d4a574;
}

.breed-incoming-pet {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(90, 70, 44, 0.25);
    border-radius: 8px;
}

.breed-incoming-pet-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 105, 180, 0.1);
    border: 1px solid rgba(255, 105, 180, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #ff69b4;
}

.breed-incoming-pet-details { flex: 1; }

.breed-incoming-pet-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e8d5b5;
}

.breed-incoming-pet-meta {
    font-size: 0.68rem;
    color: #999;
    margin-top: 2px;
}

/* Footer */
.breed-modal-footer {
    display: flex;
    gap: 10px;
    padding: 14px 20px 16px;
    border-top: 1px solid rgba(90, 70, 44, 0.3);
    justify-content: flex-end;
}

.breed-modal-btn {
    padding: 8px 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
    letter-spacing: 0.2px;
}

.breed-btn-cancel,
.breed-btn-decline {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #aaa;
}
.breed-btn-cancel:hover,
.breed-btn-decline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
}

.breed-btn-decline {
    background: rgba(200, 60, 60, 0.12);
    border-color: rgba(200, 60, 60, 0.25);
    color: #ff8080;
}
.breed-btn-decline:hover {
    background: rgba(200, 60, 60, 0.25);
    color: #ffaaaa;
}

.breed-btn-confirm {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.2), rgba(180, 130, 80, 0.15));
    border-color: rgba(212, 165, 116, 0.4);
    color: #e8d5b5;
}
.breed-btn-confirm:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.35), rgba(180, 130, 80, 0.25));
    border-color: rgba(212, 165, 116, 0.6);
    color: #fff;
}
.breed-btn-confirm:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Incompatible pet card (wrong gender) */
.breed-pet-card.breed-incompatible {
    opacity: 0.4;
    border-color: rgba(200, 60, 60, 0.2);
    cursor: not-allowed;
    position: relative;
}
.breed-pet-card.breed-incompatible:hover {
    background: rgba(200, 60, 60, 0.06);
    border-color: rgba(200, 60, 60, 0.3);
}

.breed-incompatible-label {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.58rem;
    color: #ff8080;
    background: rgba(200, 50, 50, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.breed-gender-hint {
    color: #ff69b4;
    font-weight: 600;
}

/* ===========================================
   COMBAT PET PANEL — same style as player side
   =========================================== */
.combat-pet-side {
    /* Наследуем .combat-side: width 200px, background, border, padding */
    /* Только переопределяем radius и border-right (как в game-combat.css) */
    align-items: center;
}
.combat-pet-side.hidden { display: none; }

.combat-pet-image {
    /* Такой же как .combat-image (100x100, скруглённый квадрат) */
    width: 100px; height: 100px;
    border: 2px solid var(--color-accent);
    background: var(--color-panel-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    margin: 0 auto;
}
.combat-pet-image img { width: 100%; height: 100%; object-fit: cover; }

.combat-pet-title {
    font-size: 0.8rem;
    display: flex; align-items: center; gap: 4px; justify-content: center;
}
.pet-gender-badge { font-size: 0.75rem; opacity: 0.7; }
.pet-level-badge {
    font-size: 0.65rem;
    color: var(--color-text-muted, #888);
    text-align: center;
    margin-bottom: 2px;
}
.pet-exp-bar { height: 4px !important; }
.pet-exp-text { font-size: 0.55rem !important; }

/* Pet ability button */
.pet-ability-panel { width: 100%; margin-top: 4px; }
.pet-ability-btn {
    width: 100%;
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px;
    background: rgba(100,50,200,0.25);
    border: 1px solid rgba(150,100,255,0.3);
    border-radius: 6px;
    color: #ddd;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.pet-ability-btn:hover:not(:disabled) {
    background: rgba(100,50,200,0.45);
    border-color: rgba(150,100,255,0.6);
}
.pet-ability-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pet-ability-icon { font-size: 1rem; }
.pet-ability-name { flex: 1; text-align: left; }
.pet-ability-cd {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: rgba(255,50,50,0.7);
    border-radius: 50%; width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: bold;
}
.pet-ability-cd.hidden { display: none; }

.pet-element-badge {
    font-size: 0.6rem; text-align: center;
    color: var(--color-text-muted, #888);
    margin-top: auto;
}

/* Tame button */
.combat-tame-btn {
    padding: 6px 14px;
    background: rgba(50,180,80,0.3);
    border: 1px solid rgba(50,180,80,0.5);
    border-radius: 6px;
    color: #7fff7f;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.combat-tame-btn:hover { background: rgba(50,180,80,0.5); }
.combat-tame-btn.hidden { display: none; }

/* Fainted pet */
.combat-pet-side.fainted { opacity: 0.4; filter: grayscale(0.7); }
.combat-pet-side.fainted .pet-ability-btn { pointer-events: none; }

/* Fainted banner in pet window */
.pet-fainted-banner {
    background: rgba(200,50,50,0.15);
    border: 1px solid rgba(200,50,50,0.3);
    border-radius: 6px;
    padding: 8px 10px;
    margin: 6px 0;
    color: #f88;
    font-size: 0.8rem;
    text-align: center;
}
.pet-revive-btns {
    display: flex; gap: 8px; justify-content: center; margin-top: 6px;
}
.pet-fainted-badge {
    color: #f66; font-size: 0.75rem; text-align: center; padding: 4px;
    background: rgba(200,50,50,0.12); border-radius: 4px; margin-top: 4px;
}
.pet-active-avatar.fainted { opacity: 0.3; filter: grayscale(1); }
.pet-card.fainted-card { opacity: 0.6; border-color: rgba(200,50,50,0.3); }

/* === Miracle-питомцы — розовый тон фото через CSS filter === */

/* Карточки питомцев в коллекции */
.miracle-pet .pet-card-avatar img,
.miracle-pet .pet-active-avatar img {
    filter: sepia(0.35) hue-rotate(290deg) saturate(1.6) brightness(1.05);
}
.miracle-pet .pet-card-name {
    color: #ff85c0;
}
.pet-card.miracle-pet {
    border-color: rgba(255, 105, 180, 0.4);
    box-shadow: 0 0 8px rgba(255, 105, 180, 0.15);
}
.miracle-badge {
    display: inline-block;
    font-size: 0.6rem;
    padding: 1px 4px;
    background: linear-gradient(135deg, rgba(255,105,180,0.2), rgba(218,119,242,0.2));
    color: #ff85c0;
    border-radius: 3px;
    font-weight: 700;
    margin-left: 4px;
}

/* Miracle в бою — розовый тон + пульсирующее свечение */
.combat-enemy-side.miracle-enemy .combat-image img {
    filter: sepia(0.35) hue-rotate(290deg) saturate(1.6) brightness(1.05);
    animation: miraclePulse 2s ease-in-out infinite;
}
.combat-enemy-side.miracle-enemy .combat-image {
    box-shadow: 0 0 12px rgba(255, 105, 180, 0.4);
}
@keyframes miraclePulse {
    0%, 100% { filter: sepia(0.35) hue-rotate(290deg) saturate(1.6) brightness(1.05); }
    50% { filter: sepia(0.35) hue-rotate(290deg) saturate(2.0) brightness(1.15); }
}
