/* Gachapon Page Specific Styles */
body {
    font-family: 'Varela Round', sans-serif;
}

#gachapon-header {
    text-align: center;
    padding: 120px 20px 40px;
    /* Account for fixed nav */
    background: linear-gradient(180deg, rgba(241, 242, 246, 0) 0%, rgba(241, 242, 246, 0.8) 100%);
}

/* Override global main style which is flex centered */
body>main {
    display: block !important;
    width: 100%;
    text-align: left;
    /* Reset text align */
    min-height: auto;
    /* Allow content to dictate height */
}

main {
    display: block !important;
    width: 100%;
    /* Reset padding-top if needed, though style.css has 100px */
}

#gachapon-header h1 {
    font-size: 3rem;
    color: #2d3436;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    color: #636e72;
}

.section-container {
    max-width: 95%;
    /* Expanded width as requested */
    margin: 0 auto;
    padding: 20px;
    margin-bottom: 60px;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    color: #2d3436;
}

/* Location Selection Grid */
.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.location-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.location-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: #fab1a0;
}

.location-card h3 {
    font-size: 1.5rem;
    color: #2d3436;
    margin: 0;
}

.location-card i {
    font-size: 3rem;
    color: #fab1a0;
    margin-bottom: 15px;
}

/* Item Grid View */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 20px;
}

.back-btn {
    background: white;
    border: 2px solid #dfe6e9;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    color: #636e72;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #f1f2f6;
    color: #2d3436;
    border-color: #b2bec3;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 20px;
}

.item-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s;
    border: 1px solid #f1f2f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.item-icon-wrapper {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 50%;
}

.item-icon {
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
}

.item-name {
    font-size: 0.9rem;
    color: #2d3436;
    margin-bottom: 8px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-chance {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e17055;
    /* Darker orange/red for emphasis */
    background: #ffeaa7;
    /* Highlight background */
    padding: 4px 10px;
    border-radius: 15px;
    width: 100%;
    box-sizing: border-box;
}

.controls {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#search-input {
    padding: 12px 20px;
    border: 2px solid #dfe6e9;
    border-radius: 30px;
    font-size: 1rem;
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
    font-family: inherit;
    text-align: center;
}

#search-input:focus {
    border-color: #fab1a0;
    outline: none;
    box-shadow: 0 0 0 4px rgba(250, 177, 160, 0.2);
}

#loading-indicator {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #b2bec3;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-card,
.item-card {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Response Design */
@media (max-width: 768px) {
    #gachapon-header h1 {
        font-size: 2rem;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .item-card {
        padding: 10px;
    }

    .item-name {
        font-size: 0.8rem;
    }

    .item-chance {
        font-size: 0.9rem;
        padding: 3px 6px;
    }

    .view-header {
        flex-direction: column;
        gap: 15px;
    }
}

.location-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.location-card:hover .location-icon {
    transform: scale(1.1);
}