/* ========================================
   MODERN HOME PAGE - CHARACTER SHOWCASE
   Premium Stats & Hero Section
   ======================================== */

/* === CHARACTER HERO SECTION === */
.character-hero-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    /* Compact for mobile */
    flex: 0 1 auto;
    min-height: 0;
}

/* Character Showcase */
.character-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.character-image-wrapper {
    position: relative;
    position: relative;
    width: 180px;
    /* Reduced from 280px */
    height: 180px;
    /* Reduced from 280px */
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 40px rgba(255, 215, 0, 0.4));
    animation: characterFloat 3s ease-in-out infinite;
    z-index: 2;
    position: relative;
}

@keyframes characterFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

.character-glow {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 40px;
    background: radial-gradient(ellipse, rgba(255, 215, 0, 0.6) 0%, rgba(255, 215, 0, 0.2) 40%, transparent 70%);
    filter: blur(20px);
    animation: glowPulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
}

.character-name-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(18, 18, 26, 0.8);
    backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.character-class-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--clr-gold-neon);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
    margin: 0;
    letter-spacing: 0.05em;
}

.btn-reset-mini {
    background: rgba(255, 215, 0, 0.15);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-reset-mini:hover {
    background: rgba(255, 215, 0, 0.25);
    border-color: var(--clr-gold-neon);
    transform: rotate(180deg);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* === PREMIUM STATS GRID === */
.premium-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2x2 Grid on Mobile */
    gap: 0.5rem;
    /* Tight gap */
    width: 100%;
}

.premium-stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Reduced gap */
    padding: 0.5rem 0.75rem;
    /* Compact padding */
    background: rgba(18, 18, 26, 0.7);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: default;
}

.premium-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.premium-stat-card:hover::before {
    left: 100%;
}

.premium-stat-card.clickable {
    cursor: pointer;
}

.premium-stat-card:hover {
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.stat-card-icon {
    font-size: 1.5rem;
    /* Smaller icon */
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    animation: iconBreathe 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-img-dynamic {
    width: 1.5em;
    /* Match font-size sizing */
    height: 1.5em;
    object-fit: contain;
}

@keyframes iconBreathe {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.stat-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-card-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: rgba(0, 245, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.stat-card-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    /* Smaller Font */
    color: var(--clr-gold-neon);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    line-height: 1;
}

.stat-card-sublabel {
    font-size: 0.7rem;
    color: rgba(0, 245, 255, 0.6);
    font-weight: 400;
}

.stat-card-glow {
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.premium-stat-card:hover .stat-card-glow {
    opacity: 1;
}

/* Specific Card Colors */
.yang-card:hover {
    border-color: rgba(255, 215, 0, 0.6);
}

.power-card:hover {
    border-color: rgba(255, 77, 77, 0.6);
}

.power-card .stat-card-icon {
    filter: drop-shadow(0 0 10px rgba(255, 77, 77, 0.5));
}

.income-card:hover {
    border-color: rgba(0, 255, 136, 0.6);
}

.income-card .stat-card-icon {
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.5));
}

.stats-card:hover {
    border-color: rgba(178, 36, 239, 0.6);
}

.stats-card .stat-card-icon {
    filter: drop-shadow(0 0 10px rgba(178, 36, 239, 0.5));
}

/* === RESPONSIVE DESIGN === */
@media (min-width: 480px) {
    .premium-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .character-image-wrapper {
        width: 250px;
        height: 250px;
    }

    .stat-card-icon {
        font-size: 2rem;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .game-header {
        padding: 0.5rem 0;
        /* Slightly more space */
        margin-bottom: 0.5rem;
    }

    .header-logo {
        width: 420px;
        /* Re-scaling for more impact */
        max-width: 80%;
    }

    .btn-settings-premium {
        width: 55px;
        height: 55px;
    }
}

@media (min-width: 1024px) {
    .character-hero-section {
        display: grid;
        grid-template-columns: 1fr 1.2fr 1fr;
        grid-template-areas:
            "stat1 char stat3"
            "stat2 char stat4";
        align-items: center;
        gap: 0.5rem;
        /* Minimal gap */
        max-width: 1100px;
        margin: 0 auto;
        padding-top: 0;
        flex: 0 0 auto;
    }

    .character-showcase {
        grid-area: char;
        flex: none;
    }

    .character-image-wrapper {
        width: 280px;
        /* Reduced to pull bottom up */
        height: 280px;
    }

    /* Move inner cards to the grid */
    .premium-stats-grid {
        display: contents;
        /* Allows children to be grid-items of the parent */
    }

    .yang-card {
        grid-area: stat1;
    }

    .power-card {
        grid-area: stat2;
    }

    .income-card {
        grid-area: stat3;
    }

    .stats-card {
        grid-area: stat4;
    }

    .premium-stat-card {
        padding: 1.25rem 1.5rem;
        min-height: 100px;
    }

    .stat-card-icon {
        font-size: 2.8rem;
    }

    .stat-card-value {
        font-size: 1.8rem;
    }
}

/* Duplication Fix: Hide Header stats-bar when Hero section exists */
body:not(.modal-open) .game-header .stats-bar {
    opacity: 0;
    pointer-events: none;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Re-show when in NPC mode or if specifically needed */
.game-screen.npc-mode .game-header .stats-bar {
    opacity: 1;
    pointer-events: auto;
    height: auto;
    padding: 0.5rem;
}

/* ========================================
   HOME PAGE - INVENTORY INTEGRATION
   Bag Section styling for home view
   ======================================== */

/* Bag section on home - NOT a modal */
.bag-section:not(.modal-mode) {
    position: relative !important;
    z-index: auto !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 1.5rem;
    height: auto !important;
    width: 100% !important;
    top: auto !important;
    left: auto !important;
    overflow: visible !important;
}

.bag-section:not(.modal-mode) .btn-close-section {
    display: none !important;
}

.bag-section:not(.modal-mode) .npc-section-header {
    background: rgba(18, 18, 26, 0.9);
    backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px 16px 0 0;
    padding: 1rem;
}

.bag-section:not(.modal-mode) .bag-content {
    background: rgba(18, 18, 26, 0.9);
    backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-top: none;
    border-radius: 0 0 16px 16px;
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.bag-section:not(.modal-mode) .bag-tabs {
    display: none !important;
}

.bag-section:not(.modal-mode) .npc-header-name {
    text-align: center;
}


/* ========================================
   CRITICAL: HIDE INVENTORY ON HOMEPAGE
   ======================================== */

/* Hide inventory container on homepage by default */
.game-screen .bag-section:not(.modal-mode) {
    display: none !important;
}

/* Show only when explicitly opened from nav */
.bag-section.modal-mode {
    display: block !important;
}

/* ========================================
   NPC BUTTONS - CENTERED & ACCESSIBLE
   ======================================== */

.npc-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 1rem;
    max-width: 600px;
    margin: 0 auto;
    justify-content: center !important;
    align-items: stretch;
}

/* ========================================
   CLASS SELECTION PC OPTIMIZATION
   Balanced visual scale for desktop
   ======================================== */
@media (min-width: 1024px) {
    .class-selection {
        padding-top: 0 !important;
        margin-top: -30px !important;
        /* Balanced pull up */
        justify-content: center !important;
        min-height: auto !important;
    }

    .class-selection .section-title {
        font-size: 1.8rem !important;
        margin-bottom: 20px !important;
        margin-top: 0 !important;
    }

    .class-grid {
        gap: 1.5rem !important;
        /* Spacious for readability */
        max-width: 1400px !important;
        padding: 0 2rem !important;
        align-items: start !important;
        flex: 0 1 auto !important;
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .class-card {
        min-height: auto !important;
        padding: 1.25rem !important;
        /* Large cards */
        gap: 0.5rem !important;
        max-width: 320px;
    }

    .class-portrait {
        width: 100% !important;
        height: auto !important;
        max-height: 160px !important;
        /* Strong portrait impact */
        object-fit: cover;
    }

    .class-name {
        font-size: 1.4rem !important;
        margin: 8px 0 !important;
    }

    .class-description {
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
        display: block !important;
        line-height: 1.4 !important;
        height: 6em;
        /* More space for text */
        overflow: hidden;
    }

    .class-stats {
        margin-bottom: 0.75rem !important;
        transform: none;
        /* Full scale stats */
    }

    .class-bonus {
        font-size: 0.8rem !important;
        margin-bottom: 10px !important;
        padding: 4px 10px !important;
    }

    .select-class-btn {
        padding: 12px 0 !important;
        font-size: 1rem !important;
        margin-top: 10px !important;
    }
}