/* Inherit basic styles from home.css and just add specifics */
.hero-builder-container {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 2px solid #b8860b; 
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 120px; /* space for sticky footer */
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
    display: flex;
    gap: 20px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 150px;
}

.tab-btn {
    background: #8b5a2b; /* Brownish background */
    color: #fff;
    border: 2px solid #6b4226;
    padding: 15px 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    position: relative;
}

.tab-btn:hover {
    background: #a06b35;
}

.tab-btn.active {
    background: linear-gradient(90deg, #16a34a, #22c55e); /* Green active */
    border-color: #14532d;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.3);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 10px solid #22c55e;
}

.hero-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    padding-top: 15px; /* Added to prevent top badge cropping */
    padding-right: 10px;
}

/* Custom scrollbar for grid */
.hero-grid::-webkit-scrollbar {
    width: 8px;
}
.hero-grid::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
}
.hero-grid::-webkit-scrollbar-thumb {
    background: #b8860b;
    border-radius: 4px;
}

.hero-card {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Forces exact 1:1 square ratio safely */
    cursor: pointer;
    border: 3px solid #475569;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.1s, border-color 0.2s;
    background: #000;
}

.hero-card:hover {
    transform: scale(1.05);
}

.hero-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-card.selected {
    border-color: #34d399;
}

.hero-card.selected-pet {
    border-color: #a855f7; /* Purple border for pets */
}

.check-overlay {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    box-shadow: 0 0 5px rgba(0,0,0,0.8);
}

.hero-card.selected .check-overlay,
.hero-card.selected-pet .check-overlay {
    display: flex;
}

/* Bottom Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-top: 2px solid #b8860b;
    padding: 15px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 1000;
}

/* Keep the footer clear of the fixed bottom bar */
body:has(.bottom-bar) .site-footer {
    margin-bottom: 145px;
}

.selected-slots {
    display: flex;
    gap: 15px;
    align-items: center;
}

.slot {
    width: 110px;
    height: 110px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    position: relative; /* required for badge */
}

.pet-slot {
    border: 2px solid #a855f7; /* Purple border to match the game image */
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.slot > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.bottom-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ok-btn {
    background: linear-gradient(180deg, #4ade80, #16a34a);
    color: white;
    border: 2px solid #065f46;
    padding: 12px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

.ok-btn:active {
    transform: translateY(2px);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #1e1e1e;
    border: 3px solid #b8860b;
    border-radius: 12px;
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.modal-header {
    background: #2a2a2a;
    padding: 15px 20px;
    border-bottom: 2px solid #b8860b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 9px 9px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #ffd700;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.close-btn {
    background: #ff4444;
    color: white;
    border: 2px solid #cc0000;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Modal Pet Card */
.pet-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.pet-list-item:hover {
    background: #333;
    border-color: #b8860b;
}

.pet-list-img {
    width: 60px;
    height: 60px;
    border: 2px solid #a855f7;
    border-radius: 8px;
    object-fit: cover;
}

.pet-list-info {
    flex: 1;
}

.pet-list-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #fff;
}

.pet-list-status {
    font-size: 0.85rem;
}
.pet-list-status.unassigned {
    color: #94a3b8;
}
.pet-list-status.assigned {
    color: #ffd700;
    font-weight: bold;
}



.patron-badge {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 48px;
    height: 48px;
    background-image: url('frame/add-patron.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    transition: transform 0.1s;
}

.patron-badge:hover {
    transform: scale(1.1);
}

.patron-badge span {
    display: none;
}

.patron-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.patron-badge.has-patron {
    background: transparent;
    background-image: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    filter: none;
    width: 54px;
    height: 54px;
    top: -16px;
    right: -16px;
}

.patron-badge.has-patron img {
    object-fit: contain;
}
