/* ============================================
   Be a Lucky Block Wiki — Responsive Styles
   ============================================ */

/* --- Mobile (up to 768px) --- */
@media (max-width: 768px) {
    /* Nav */
    .nav-toggle {
        display: flex;
    }

    .nav {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Hide desktop nav on mobile */
    .nav-desktop {
        display: none !important;
    }

    /* Mobile visual menu */
    .mobile-menu {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        height: calc(100vh - var(--nav-height));
        background: #0A0A0F;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 9999;
        padding: var(--space-md);
    }

    .mobile-menu.open {
        display: block;
    }

    .mobile-menu-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
    }

    .mobile-menu-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: var(--space-md) var(--space-sm);
        background: var(--color-bg-card);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: var(--border-radius-sm);
        text-decoration: none;
        transition: border-color var(--transition-fast), background var(--transition-fast);
    }

    .mobile-menu-item:hover,
    .mobile-menu-item.active {
        border-color: rgba(255, 215, 0, 0.3);
        background: var(--color-bg-card-hover);
    }

    .mobile-menu-item img {
        width: 48px;
        height: 48px;
        object-fit: contain;
        border-radius: 6px;
    }

    .mobile-menu-icon {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.8rem;
    }

    .mobile-menu-item span {
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--color-text-primary);
        text-align: center;
    }

    .mobile-menu-item.active span {
        color: var(--color-primary);
    }

    .nav-group {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-group::after {
        width: 100%;
        height: 1px;
        margin: var(--space-sm) 0;
    }

    .nav-link {
        padding: 14px var(--space-md);
        font-size: 1rem;
        width: 100%;
        border-radius: var(--border-radius-sm);
    }

    /* On mobile, show all links directly — no dropdown needed */
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-btn {
        display: none;
    }

    .nav-dropdown-menu {
        display: flex !important;
        position: static;
        margin-top: 0;
        box-shadow: none;
        background: transparent;
        border: none;
        padding: 0;
        min-width: auto;
        flex-direction: column;
    }

    body.nav-open {
        overflow: hidden;
    }

    /* Content */
    .content {
        padding: calc(var(--nav-height) + var(--space-md)) var(--space-md) var(--space-xl);
    }

    /* Item grid */
    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--space-md);
    }

    /* Filter bar */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search {
        min-width: auto;
    }

    .filter-count {
        margin-left: 0;
        text-align: center;
    }

    /* Tables */
    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: var(--space-xs) var(--space-sm);
    }

    /* Calculator */
    .calc-container {
        grid-template-columns: 1fr;
    }

    /* Stats grid */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Nav cards */
    .nav-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Season tiers */
    .season-tier {
        grid-template-columns: 40px 1fr;
    }

    .season-tier-track.paid {
        grid-column: 2;
    }

    /* Boss grid — 1 column on mobile */
    .boss-grid {
        grid-template-columns: 1fr;
    }

    .boss-speed-badge {
        display: none;
    }

    .boss-speed-mobile {
        display: block;
    }

    /* Boss stats */
    .boss-stats {
        gap: var(--space-sm);
    }

    /* Boss drops — 3 per row on mobile */
    .boss-drop-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
    }

    .boss-drop-item {
        width: auto;
        padding: var(--space-sm);
    }

    .boss-drop-item img {
        width: 48px;
        height: 48px;
    }

    .boss-drop-name {
        font-size: 0.65rem;
    }

    .boss-drop-item .drop-row-label {
        font-size: 0.55rem;
    }

    /* Special Collection Events — 2 per row on mobile */
    .event-special-grid {
        gap: var(--space-sm);
    }

    .event-special-card {
        width: calc(50% - var(--space-sm) / 2);
    }

    .event-special-preview {
        height: 80px;
    }

    .event-special-preview img {
        width: 56px;
        height: 56px;
    }

    .event-special-info {
        padding: var(--space-sm);
    }

    .event-special-info h3 {
        font-size: 0.85rem;
    }

    .event-special-info p {
        font-size: 0.7rem;
    }

    /* Hero */
    .hero {
        padding: var(--space-lg) 0;
    }

    /* Mobile hero video */
    .hero-video-section {
        margin-top: calc(-1 * (var(--nav-height) + var(--space-md)));
        margin-left: calc(-1 * var(--space-md));
        margin-right: calc(-1 * var(--space-md));
        margin-bottom: var(--space-lg);
        width: 100vw;
        left: 0;
        transform: none;
    }

    .hero-video-wrap {
        aspect-ratio: auto;
        height: 60vh;
        border-radius: 0;
    }

    .hero-video-content .hero-title {
        font-size: 1.5rem;
    }

    .hero-video-content .hero-subtitle {
        font-size: 0.85rem;
    }

    .hero-video-content .hero-badge {
        font-size: 0.7rem;
        padding: var(--space-xs) var(--space-sm);
    }

    /* Mobile logo + nav layout */
    .nav-logo-img {
        height: 35px;
    }

    .nav-inner {
        justify-content: space-between;
    }

    /* Scroll top */
    .scroll-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

/* --- Small Mobile (up to 380px) --- */
@media (max-width: 380px) {
    .item-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .item-card-body {
        padding: var(--space-xs) var(--space-sm);
    }

    .item-card-name {
        font-size: 0.78rem;
    }
}

/* --- Tablet (769px - 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Large Desktop (1536px+) --- */
@media (min-width: 1536px) {
    :root {
        --max-width: 1600px;
    }

    .item-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}
