/* ========================================
   HOMEPAGE OVERHAUL
   Button Positioning & Premium Redesign
   ======================================== */

.npc-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    /* Increased for breathing room */
    padding: 1rem;
    margin: 1rem auto;
    flex-wrap: wrap;
    max-width: 1000px;
}

@media (min-width: 1024px) {
    .game-layout {
        justify-content: flex-start;
        gap: 0.25rem;
        /* Tiny gap */
    }

    .npc-buttons {
        flex-direction: row;
        flex-wrap: nowrap;
        max-width: 1000px;
        padding-bottom: 0.25rem;
        margin: 0 auto;
    }

    .btn-npc {
        width: 140px;
        /* More compact */
        height: 140px;
        padding: 0.75rem;
    }

    .npc-portrait {
        width: 50px;
        height: 50px;
    }

    .npc-name {
        font-size: 1rem;
    }
}

/* 2. PREMIUM RPG BUTTONS (Dark Fantasy Style) */
.btn-npc {
    background: linear-gradient(135deg, #1a1a24 0%, #2a2a35 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 140px;
    height: 140px;
}

/* Textured Background Effect */
.btn-npc::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5 2.24 5 5zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 1;
}

/* Hover State - Glow */
.btn-npc:hover {
    transform: translateY(-5px);
    box-shadow:
        0 8px 15px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 0 0 1px rgba(255, 215, 0, 0.6);
    border-color: rgba(255, 215, 0, 0.8);
    background: linear-gradient(135deg, #2a2a35 0%, #3a3a45 100%);
}

.btn-npc:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Content Z-Index Fix */
.btn-npc>* {
    position: relative;
    z-index: 2;
}

/* Icon Glow */
.npc-portrait {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
    transition: filter 0.3s ease;
    margin-bottom: 0.5rem;
}

.btn-npc:hover .npc-portrait {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1));
    }
}

/* Typography */
.npc-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #e0e0e0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-npc:hover .npc-name {
    color: var(--clr-gold-neon);
}

.npc-subtitle {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    line-height: 1.2;
}

/* Specific Button Themes */
.blacksmith-btn {
    border-bottom: 3px solid #ff4d4d;
}

.blacksmith-btn:hover {
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.3);
    border-color: #ff4d4d;
}

.enchanter-btn {
    border-bottom: 3px solid #b224ef;
}

.enchanter-btn:hover {
    box-shadow: 0 0 20px rgba(178, 36, 239, 0.3);
    border-color: #b224ef;
}

.gemcutter-btn {
    border-bottom: 3px solid #00f5ff;
}

.gemcutter-btn:hover {
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
    border-color: #00f5ff;
}

.treasure-btn {
    border-bottom: 3px solid #ffd700;
}

.treasure-btn:hover {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
}

/* Mobile Optimization for Buttons */
@media (max-width: 768px) {
    .npc-buttons {
        max-width: 100%;
        margin-top: 0.25rem;
        margin-bottom: 0.25rem;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .btn-npc {
        width: 48%;
        /* 2 per row */
        height: auto;
        min-height: 90px;
        padding: 0.5rem;
    }

    .npc-portrait {
        width: 36px;
        height: 36px;
        margin-bottom: 0.25rem;
    }

    .npc-name {
        font-size: 0.85rem;
    }

    .npc-subtitle {
        display: none;
        /* Hide subtitle */
    }

    .character-hero-section {
        flex: 1;
        padding: 0.5rem;
        justify-content: center;
        min-height: 0;
    }

    .game-layout {
        justify-content: space-between;
        height: 100%;
        overflow: hidden;
        padding-bottom: calc(60px + var(--safe-area-inset-bottom));
    }
}