/* ================================================================
   MOBILE-ONLY STYLES FOR TIER LIST PAGE (< 768px)
   ================================================================ */

@media (max-width: 768px) {
    /* ===== HEADER COMPACT ===== */
    header {
        padding: 0 !important;
        min-height: 48px;
    }

    header .container {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }

    header h1 {
        font-size: 0.95rem !important;
    }

    header .w-10.h-10 {
        width: 1.6rem !important;
        height: 1.6rem !important;
    }

    header .w-10.h-10 i {
        font-size: 0.7rem !important;
    }

    /* ===== MAIN CONTENT SPACING ===== */
    main {
        padding: 0.5rem 0 !important;
    }

    section.text-center {
        padding: 0.5rem 0 !important;
        margin-bottom: 0.75rem !important;
    }

    section.text-center h2 {
        font-size: 1.3rem !important;
        margin-bottom: 0.15rem !important;
        line-height: 1.2 !important;
    }

    section.text-center p {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
        color: rgba(248, 250, 252, 0.6) !important;
        line-height: 1.4 !important;
    }

    /* Hide floating decorations */
    section.text-center .absolute {
        display: none !important;
    }

    /* ===== SEARCH BAR MOBILE ===== */
    #searchInput {
        padding: 0.65rem 1rem 0.65rem 2.75rem !important;
        font-size: 16px !important;
        border-radius: 1rem !important;
        min-height: 44px !important;
    }

    #searchInput::placeholder {
        color: rgba(248, 250, 252, 0.4) !important;
    }

    /* ===== VIEW TOGGLE & FILTER BUTTON ROW ===== */
    .flex.flex-col.sm\:flex-row.items-center.justify-between {
        flex-direction: column !important;
        gap: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .view-toggle-container {
        width: 100% !important;
        justify-content: center !important;
        margin-bottom: 0 !important;
    }

    .view-toggle-btn {
        padding: 0.55rem 1rem !important;
        font-size: 0.75rem !important;
        border-radius: 0.6rem !important;
    }

    #filterToggleBtn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.55rem 1rem !important;
        font-size: 0.8rem !important;
        border-radius: 0.6rem !important;
    }

    /* ===== ACTIVE FILTERS DISPLAY ===== */
    .active-filters-display {
        margin-top: 0.5rem !important;
    }

    .active-filter-tag {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* ===== FILTER PANEL ===== */
    .filter-panel .bg-gradient-to-br {
        padding: 0.75rem !important;
        border-radius: 0.75rem !important;
        margin-top: 0.5rem !important;
    }

    .filter-section-label {
        margin-bottom: 0.5rem !important;
    }

    .filter-section-label span {
        font-size: 0.7rem !important;
    }

    .filter-btn {
        font-size: 0.7rem !important;
        padding: 0.35rem 0.75rem !important;
        margin-right: 0.25rem !important;
        margin-bottom: 0.25rem !important;
    }

    /* ===== TIER LABELS ===== */
    .tier-label {
        font-size: 1.1rem !important;
        padding: 0.4rem 1.2rem !important;
        margin-bottom: 0.75rem !important;
        border-radius: 1rem !important;
    }

    /* ===== CHARACTER CARDS - 2 COLUMN GRID ===== */
    .grid.grid-cols-1.sm\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }

    .character-card {
        padding: 0.5rem !important;
        border-radius: 0.75rem !important;
    }

    /* Compact View Card */
    .character-card .flex.items-center.mb-4 {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        margin-bottom: 0.25rem !important;
    }

    .character-card .card-image {
        width: 3rem !important;
        height: 3rem !important;
        margin-right: 0 !important;
        margin-bottom: 0.25rem !important;
        border-radius: 0.5rem !important;
    }

    .character-card .card-image i {
        font-size: 1rem !important;
    }

    .character-card .card-image img {
        width: 100% !important;
        height: 100% !important;
    }

    .character-card h4 {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
    }

    .character-card .element-badge {
        font-size: 0.6rem !important;
        padding: 2px 6px !important;
    }

    .character-card .text-sm {
        font-size: 0.6rem !important;
    }

    .character-card .text-sm p {
        margin-bottom: 0.15rem !important;
    }

    .character-card .flex.items-center.justify-between {
        flex-direction: column !important;
        gap: 0.25rem !important;
    }

    .character-card .text-lg {
        font-size: 0.85rem !important;
    }

    .character-card .click-hint {
        display: none !important;
    }

    /* ===== FULL CARD VIEW ===== */
    .full-card-view .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-3.xl\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .full-card-view .character-card .card-image {
        width: 100% !important;
        height: 8rem !important;
        border-radius: 0.75rem 0.75rem 0 0 !important;
    }

    .full-card-view .character-card .card-content {
        padding: 0.5rem !important;
    }

    .full-card-view .character-card h4 {
        font-size: 0.8rem !important;
    }

    .full-card-view .character-card .card-footer {
        padding: 0.5rem 0.75rem !important;
    }

    /* ===== TIER SECTION SPACING ===== */
    .mb-14 {
        margin-bottom: 1rem !important;
    }

    /* ===== MODAL BOTTOM SHEET ===== */
    #characterModal.modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #characterModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        height: auto !important;
        border-radius: 1.25rem 1.25rem 0 0 !important;
        margin: 0 !important;
        background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%) !important;
        border-top: 1px solid rgba(139, 92, 246, 0.15) !important;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5) !important;
        animation: slideUpMobile 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes slideUpMobile {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    /* Modal header */
    #characterModal .modal-header {
        padding: 1rem !important;
    }

    #characterModal .modal-header .flex.items-start.gap-6 {
        flex-direction: column !important;
        gap: 0.75rem !important;
        align-items: center !important;
        text-align: center !important;
    }

    #characterModal .modal-character-image {
        width: 5rem !important;
        height: 5rem !important;
        border-radius: 1rem !important;
    }

    #characterModal #modalName {
        font-size: 1.1rem !important;
    }

    #characterModal .tier-badge {
        width: 2.5rem !important;
        height: 2.5rem !important;
        font-size: 1rem !important;
    }

    /* Modal close button */
    #characterModal .modal-close {
        width: 2rem !important;
        height: 2rem !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.06) !important;
    }

    #characterModal .modal-close:active {
        background: rgba(239, 68, 68, 0.2) !important;
    }

    /* Modal body */
    #characterModal .modal-body {
        padding: 1rem !important;
    }

    /* Modal tabs */
    #characterModal .modal-tabs {
        flex-direction: row !important;
        gap: 0 !important;
        margin-bottom: 0.75rem !important;
        padding-bottom: 0 !important;
        border-bottom: 1px solid rgba(139, 92, 246, 0.1) !important;
    }

    #characterModal .modal-tab-btn {
        flex: 1 !important;
        padding: 0.6rem 0.5rem !important;
        font-size: 0.7rem !important;
        border-bottom: 2px solid transparent !important;
        margin-bottom: -1px !important;
    }

    #characterModal .modal-tab-btn.active {
        border-bottom-color: #8b5cf6 !important;
    }

    /* Info grid */
    #characterModal .info-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }

    #characterModal .info-box {
        padding: 0.5rem !important;
        border-radius: 0.5rem !important;
    }

    #characterModal .info-box-label {
        font-size: 0.6rem !important;
    }

    #characterModal .info-box-value {
        font-size: 0.85rem !important;
    }

    /* Stats */
    #characterModal .modal-stats .text-xl {
        font-size: 1rem !important;
    }

    #characterModal .stat-bar {
        height: 6px !important;
    }

    /* Rebirth stats */
    #characterModal .rebirth-stats {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 0.5rem !important;
    }

    #characterModal .rebirth-stat {
        padding: 0.5rem !important;
        border-radius: 0.4rem !important;
    }

    #characterModal .rebirth-stat-label {
        font-size: 0.55rem !important;
    }

    #characterModal .rebirth-stat-value {
        font-size: 0.9rem !important;
    }

    /* Skills */
    #characterModal .skill-card {
        padding: 0.5rem !important;
        border-radius: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    #characterModal .skill-name {
        font-size: 0.8rem !important;
    }

    #characterModal .skill-desc {
        font-size: 0.7rem !important;
    }

    /* Pros/Cons */
    #characterModal .grid.grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    #characterModal .text-lg {
        font-size: 0.9rem !important;
    }

    /* Rebirth toggle */
    #characterModal .rebirth-single-toggle {
        width: 100% !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
        border-radius: 0.5rem !important;
        margin-top: 0.5rem !important;
    }

    /* Quest/Pre-quest sections */
    #characterModal .quest-checklist-header {
        padding: 0.75rem 1rem !important;
        border-radius: 0.5rem !important;
    }

    #characterModal .quest-checklist-title {
        font-size: 0.8rem !important;
    }

    #characterModal .quest-checklist-stats {
        font-size: 0.7rem !important;
    }

    #characterModal .quest-check-item {
        padding: 0.5rem 0.75rem !important;
    }

    #characterModal .quest-check-label {
        font-size: 0.75rem !important;
    }

    #characterModal .quest-check-box {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    /* Quest section */
    #characterModal .quest-section {
        border-radius: 0.5rem !important;
    }

    #characterModal .quest-section-header {
        padding: 0.6rem 0.75rem !important;
    }

    #characterModal .quest-section-header-left {
        gap: 0.5rem !important;
    }

    #characterModal .quest-number {
        width: 1.75rem !important;
        height: 1.75rem !important;
        font-size: 0.75rem !important;
    }

    #characterModal .quest-title {
        font-size: 0.85rem !important;
    }

    #characterModal .quest-description {
        font-size: 0.75rem !important;
    }

    #characterModal .quest-image {
        width: 5rem !important;
        height: 3.5rem !important;
        border-radius: 0.4rem !important;
    }

    /* Prequest character section */
    #characterModal .prequest-character-header {
        padding: 0.6rem 0.75rem !important;
    }

    #characterModal .prequest-character-icon {
        width: 2rem !important;
        height: 2rem !important;
    }

    #characterModal .prequest-character-name {
        font-size: 0.9rem !important;
    }

    #characterModal .prequest-character-subtitle {
        font-size: 0.65rem !important;
    }

    /* Quest ending banner */
    #characterModal .quest-ending-banner {
        border-radius: 0.75rem !important;
    }

    #characterModal .quest-ending-label {
        font-size: 0.8rem !important;
        padding: 0.5rem !important;
    }

    /* Recommended stats */
    #characterModal .recommended-stats-section {
        padding: 0.75rem !important;
        border-radius: 0.5rem !important;
    }

    #characterModal .recommended-stats-label {
        font-size: 0.75rem !important;
    }

    #characterModal .recommended-stats-value {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* ===== FOOTER MOBILE ===== */
    footer .grid {
        display: block !important;
        text-align: center !important;
    }

    footer .grid > div {
        display: none !important;
    }

    footer .grid > div:first-child {
        display: block !important;
        text-align: center !important;
    }

    footer .grid > div:first-child .flex {
        justify-content: center !important;
    }

    footer .border-t {
        padding-top: 0.75rem !important;
    }

    footer .border-t .text-sm {
        font-size: 0.6rem !important;
    }

    /* ===== MOBILE MENU BUTTON - HIDDEN (replaced by FAB) ===== */
    #openSidebar {
        display: none !important;
    }

    /* ===== SIDEBAR MOBILE ===== */
    #mobileSidebar {
        width: 80vw !important;
        max-width: 18rem !important;
    }

    #mobileSidebar nav a {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.85rem !important;
    }

    /* ===== LIGHTBOX MOBILE ===== */
    .quest-lightbox {
        padding: 20px !important;
    }

    .quest-lightbox img {
        max-width: 95% !important;
        max-height: 80% !important;
    }

    .quest-lightbox-close {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    .quest-lightbox-nav {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    .quest-lightbox-counter {
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
    }
}

/* ===== EXTRA SMALL SCREENS (<=420px) ===== */
@media (max-width: 420px) {
    .character-card {
        padding: 0.4rem !important;
    }

    .character-card .card-image {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    .character-card h4 {
        font-size: 0.68rem !important;
    }

    .tier-label {
        font-size: 0.95rem !important;
        padding: 0.3rem 1rem !important;
    }

    .full-card-view .character-card .card-image {
        height: 6rem !important;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    #characterModal .modal-content {
        max-height: 95vh !important;
    }
}

/* ===== FAB NAVIGATION ===== */
#fabNavContainer {
    display: flex !important;
    position: fixed !important;
    bottom: calc(env(safe-area-inset-bottom, 0.5rem) + 1.5rem) !important;
    left: calc(env(safe-area-inset-left, 0.5rem) + 1.5rem) !important;
    z-index: 999 !important;
}

#fabNavBtn {
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    min-height: 3rem;
    border-radius: 1.5rem;
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25), 0 1px 3px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    color: #6ee7b7 !important;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

#fabNavBtn i {
    font-size: 0.8rem !important;
}

#fabNavBtn .fab-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.9);
    white-space: nowrap;
}

#fabNavBtn:active {
    transform: scale(0.93) !important;
    background: rgba(16, 185, 129, 0.35) !important;
}

/* FAB Drawer */
#fabNavDrawer {
    display: none !important;
    position: fixed !important;
    bottom: calc(env(safe-area-inset-bottom, 0.5rem) + 5rem) !important;
    left: calc(env(safe-area-inset-left, 0.5rem) + 1.5rem) !important;
    z-index: 998 !important;
    background: linear-gradient(180deg, rgba(20, 20, 35, 0.98) 0%, rgba(13, 13, 20, 0.99) 100%) !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
    border-radius: 1rem !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 0.5rem !important;
    min-width: 180px;
    transform: scale(0.75) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#fabNavDrawer.open {
    display: flex !important;
    flex-direction: column !important;
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

#fabNavDrawer a {
    display: flex !important;
    align-items: center;
    gap: 0.6rem !important;
    padding: 0.65rem 0.85rem !important;
    border-radius: 0.6rem !important;
    font-size: 0.8rem !important;
    color: rgba(248, 250, 252, 0.7) !important;
    transition: background-color 0.1s ease, transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

#fabNavDrawer a:active {
    transform: scale(0.97);
    background-color: rgba(139, 92, 246, 0.1) !important;
}

#fabNavDrawer a i {
    font-size: 0.85rem !important;
    width: 1.2rem;
    text-align: center;
}

/* FAB overlay backdrop */
#fabNavOverlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 997;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease;
}

#fabNavOverlay.open {
    display: block;
    opacity: 1;
}