/* ========================
   NOTIFICATION FEED WINDOW
   ======================== */

.notification-feed {
    width: calc(100% - 16px) !important;
    max-width: 480px !important;
    margin: 4px 8px !important;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.95), rgba(52, 73, 94, 0.95)) !important;
    border: 2px solid rgba(240, 195, 60, 0.6) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    font-family: 'Pirata One', cursive !important;
    overflow: hidden !important;
    z-index: 10 !important;
}

.notification-feed-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 4px 8px !important;
    background: rgba(240, 195, 60, 0.1) !important;
    border-bottom: 1px solid rgba(240, 195, 60, 0.3) !important;
    cursor: pointer !important;
    user-select: none !important;
    min-height: 28px !important;
    height: 28px !important;
}

.feed-header-controls {
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
}

.toggle-feed-button {
    background: rgba(52, 152, 219, 0.8) !important;
    border: 1px solid rgba(41, 128, 185, 1) !important;
    border-radius: 4px !important;
    color: white !important;
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    min-width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.toggle-feed-button:hover {
    background: rgba(52, 152, 219, 1) !important;
    transform: scale(1.05) !important;
}

.feed-title {
    color: rgba(240, 195, 60, 1) !important;
    font-size: 0.8rem !important;
    font-weight: bold !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
    line-height: 1 !important;
}

.clear-feed-button {
    background: rgba(231, 76, 60, 0.8) !important;
    border: 1px solid rgba(192, 57, 43, 1) !important;
    border-radius: 4px !important;
    color: white !important;
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    min-width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.clear-feed-button:hover {
    background: rgba(231, 76, 60, 1) !important;
    transform: scale(1.05) !important;
}

.notification-feed-content {
    max-height: 40px !important;
    overflow-y: auto !important;
    padding: 0 !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(240, 195, 60, 0.6) rgba(44, 62, 80, 0.3) !important;
    transition: max-height 0.3s ease, opacity 0.3s ease !important;
    opacity: 1 !important;
}

/* Collapsed state */
.notification-feed.collapsed .notification-feed-content {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
}

.notification-feed.collapsed {
    border-bottom: none !important;
}

.notification-feed.collapsed .notification-feed-header {
    border-bottom: none !important;
    border-radius: 12px !important;
}

/* Toggle button states */
.notification-feed.collapsed .toggle-feed-button {
    background: rgba(46, 204, 113, 0.8) !important;
    border-color: rgba(39, 174, 96, 1) !important;
}

.notification-feed.collapsed .toggle-feed-button:hover {
    background: rgba(46, 204, 113, 1) !important;
}

.notification-feed.collapsed .toggle-feed-button::after {
    content: "▼" !important;
    font-size: 0.6rem !important;
    margin-left: 2px !important;
}

.notification-feed:not(.collapsed) .toggle-feed-button::after {
    content: "▲" !important;
    font-size: 0.6rem !important;
    margin-left: 2px !important;
}

/* Collapsed state indicator */
.notification-feed.collapsed .feed-title::after {
    content: " (collapsed)" !important;
    font-size: 0.7rem !important;
    opacity: 0.7 !important;
    font-weight: normal !important;
}

.notification-feed-content::-webkit-scrollbar {
    width: 8px !important;
}

.notification-feed-content::-webkit-scrollbar-track {
    background: rgba(44, 62, 80, 0.3) !important;
    border-radius: 4px !important;
    margin: 2px !important;
}

.notification-feed-content::-webkit-scrollbar-thumb {
    background: rgba(240, 195, 60, 0.6) !important;
    border-radius: 4px !important;
    border: 1px solid rgba(44, 62, 80, 0.2) !important;
}

.notification-feed-content::-webkit-scrollbar-thumb:hover {
    background: rgba(240, 195, 60, 0.8) !important;
}

.notification-feed-content::-webkit-scrollbar-thumb:active {
    background: rgba(240, 195, 60, 1) !important;
}

/* Enhanced scrolling for touch devices */
.notification-feed-content {
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
}

.feed-notification {
    display: flex !important;
    align-items: center !important;
    padding: 4px 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    animation: feedSlideIn 0.3s ease-out !important;
    transition: opacity 0.3s ease !important;
}

.feed-notification:last-child {
    border-bottom: none !important;
}

.feed-notification.fade-out {
    opacity: 0.3 !important;
}

.feed-notification-icon {
    flex-shrink: 0 !important;
    margin-right: 8px !important;
    font-size: 1rem !important;
}

.feed-notification-text {
    flex: 1 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

.feed-notification-timestamp {
    flex-shrink: 0 !important;
    margin-left: 8px !important;
    font-size: 0.7rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-family: 'Roboto', sans-serif !important;
}

/* Notification type colors */
.feed-notification.treasure {
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.1), transparent) !important;
}

.feed-notification.trap {
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.1), transparent) !important;
}

.feed-notification.special {
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.1), transparent) !important;
}

.feed-notification.negative {
    background: linear-gradient(90deg, rgba(155, 89, 182, 0.1), transparent) !important;
}

.feed-notification.system {
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.1), transparent) !important;
}

@keyframes feedSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty feed state */
.notification-feed-empty {
    padding: 20px !important;
    text-align: center !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.85rem !important;
    font-style: italic !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .notification-feed {
        margin: -15px 8px !important;
        max-width: none !important;
    }
    
    .notification-feed-content {
        max-height: 35px !important;
    }
    
    .feed-notification {
        padding: 5px 10px !important;
        font-size: 0.8rem !important;
    }
    
    .feed-title {
        font-size: 0.9rem !important;
    }
}

/* ========================
   GLOBAL INVENTORY VISIBILITY RULES
   ======================== */

/* Always respect the hidden class on inventory */
.inventory-container.hidden {
    display: none !important;
}

/* Hide inventory when on home screen (mode selection active) */
#mode-selection.active ~ .gameplay-container .inventory-container,
#mode-selection:not(.hidden) ~ .gameplay-container .inventory-container {
    display: none !important;
}

/* Hide notification feed when on home screen (mode selection active) */
#mode-selection.active ~ .notification-feed,
#mode-selection:not(.hidden) ~ .notification-feed {
    display: none !important;
}

/* Hide mobile inventory button when on home screen (mode selection active) */
#mode-selection.active ~ #mobile-inventory-button,
#mode-selection:not(.hidden) ~ #mobile-inventory-button {
    display: none !important;
}

/* ========================
   MOBILE GAMEPLAY LAYOUT REDESIGN
   Space-efficient horizontal layout for mobile
   ======================== */

@media (max-width: 767px) {
    /* ========================
       TOP NAVIGATION DROPDOWN
       ======================== */
    
    /* Simplified header for horizontal menu layout */
    .game-header {
        padding: 10px 15px !important;
        background: rgba(0, 0, 0, 0.6) !important;
        border-radius: 0 0 12px 12px !important;
        margin-bottom: 15px !important;
        position: relative !important;
    }
    
    .game-header .header-left {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .game-header h1 {
        font-size: 1.4rem !important;
        margin: 0 !important;
        text-align: center !important;
    }
    
    /* ========================
       HORIZONTAL CARD LAYOUT
       ======================== */
    
    .card-area {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 15px !important;
        padding: 12px 10px !important; /* Reduced padding slightly */
        background: rgba(0, 0, 0, 0.4) !important;
        border-radius: 12px !important;
        margin: 8px 5px 6px !important; /* Tighter margins */
        min-height: 240px !important;
    }
    
    #deck {
        width: 180px !important;
        height: 252px !important;
        flex-shrink: 0 !important;
        max-width: calc(50vw - 20px) !important; /* Responsive max-width */
    }
    
    #current-card {
        width: 180px !important;
        height: 252px !important;
        flex-shrink: 0 !important;
        max-width: calc(50vw - 20px) !important; /* Responsive max-width */
    }
    
    /* Ensure cards inside containers fit properly */
    #deck .card,
    #current-card .card {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* ========================
       SCORE PANEL COMPACT
       ======================== */
    
    .score-panel {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        gap: 8px !important;
        margin: 8px 5px 6px !important; /* Reduced bottom margin for tighter spacing */
        padding: 0 !important;
    }
    
    /* COMPACT SCORE BOXES - INLINE LABELS & VALUES */
    .score-box {
        flex: 1 !important;
        padding: 6px 8px !important; /* Reduced padding */
        background: rgba(0, 0, 0, 0.6) !important;
        border-radius: 8px !important;
        text-align: center !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        min-height: 36px !important; /* Reduced from default */
    }
    
    .score-box p:first-child {
        font-size: 0.8rem !important; /* Slightly smaller label */
        margin: 0 !important; /* Remove all margins */
        color: rgba(255, 255, 255, 0.8) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex-shrink: 0 !important;
    }
    
    .score-box p:first-child::after {
        content: ":" !important; /* Add colon after label */
    }
    
    .score-box p:last-child {
        font-size: 1.1rem !important; /* Slightly smaller value */
        font-weight: bold !important;
        color: var(--gold-color) !important;
        margin: 0 !important; /* Remove all margins */
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    /* ========================
       ACTION BUTTONS SIDE BY SIDE - FORCE OVERRIDE
       ======================== */
    
    /* CRITICAL: Override all conflicting button CSS with highest specificity */
    .gameplay-container .action-buttons,
    .game-container .action-buttons {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 12px !important;
        margin: 8px 10px 6px !important;
        padding: 0 5px !important;
        width: calc(100% - 20px) !important;
        box-sizing: border-box !important;
        flex-wrap: nowrap !important; /* CRITICAL: Prevent wrapping */
    }
    
    /* CRITICAL: Override main-buttons.css with higher specificity */
    .gameplay-container .action-buttons button,
    .game-container .action-buttons button,
    .action-buttons .btn,
    .action-buttons button {
        flex: 1 !important;
        max-width: calc(50% - 6px) !important; /* Ensure true 50/50 split */
        min-width: calc(50% - 12px) !important; /* OVERRIDE: Force buttons side by side */
        width: calc(50% - 6px) !important; /* FORCE EXACT WIDTH */
        min-height: 50px !important;
        font-size: 1.1rem !important;
        font-weight: bold !important;
        padding: 12px 8px !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
        transition: all 0.2s ease !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important; /* OVERRIDE: Remove conflicting margins */
    }
    
    #draw-button {
        background: var(--treasure-gradient) !important;
        color: var(--dark-color) !important;
        border: none !important;
    }
    
    #cash-out-button {
        background: rgba(46, 125, 50, 0.9) !important;
        color: white !important;
        border: 2px solid #4caf50 !important;
    }
    
    .action-buttons button:active {
        transform: scale(0.95) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* ========================
       INVENTORY BUTTON - SIMPLE & RELIABLE
       ======================== */
    
    /* Hide default inventory on mobile - it takes up too much space */
    .inventory-container {
        display: none !important;
    }
    
    /* GLOBAL RULE: Hide inventory when on home screen */
    .inventory-container.hidden {
        display: none !important;
    }
    
    /* Hide inventory when mode selection is active (home screen) */
    #mode-selection.active ~ .gameplay-container .inventory-container {
        display: none !important;
    }
    
    /* Inventory button positioned between stats and cards */
    .mobile-inventory-button {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(240, 195, 60, 0.9) !important;
        color: rgba(0, 0, 0, 0.8) !important;
        border: 0px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 20px !important;
        padding: 5px 20px !important;
        margin: -7px 4px -27px !important;
        width: calc(100% - 10px) !important;
        box-sizing: border-box !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        font-size: 1.1rem !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3) !important;
        position: relative !important;
    }
    
    .mobile-inventory-button:hover {
        background: rgba(240, 195, 60, 1) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4) !important;
        border-color: rgba(255, 255, 255, 0.5) !important;
    }
    
    .mobile-inventory-button:active {
        transform: translateY(0px) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Badge showing number of items */
    .mobile-inventory-button .item-count-badge {
        position: absolute !important;
        top: -8px !important;
        right: 10px !important;
        background: #e74c3c !important;
        color: white !important;
        border-radius: 50% !important;
        width: 20px !important;
        height: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.75rem !important;
        font-weight: bold !important;
        border: 2px solid white !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Hide badge when empty */
    .mobile-inventory-button .item-count-badge.empty {
        display: none !important;
    }
    
    /* Modal overlay for inventory */
    .inventory-modal-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.8) !important;
        z-index: 2000 !important;
        display: none !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 20px !important;
        box-sizing: border-box !important;
    }
    
    .inventory-modal-overlay.active {
        display: flex !important;
    }
    
    /* ========================
       CLEAN INVENTORY CAROUSEL
       ======================== */
    
    .inventory-modal {
        background: linear-gradient(145deg, rgba(139, 69, 19, 0.95), rgba(101, 67, 33, 0.95)) !important;
        border: 3px solid rgba(240, 195, 60, 1) !important;
        border-radius: 16px !important;
        padding: 20px !important;
        width: 85% !important;
        max-width: 380px !important;
        height: auto !important;
        min-height: 420px !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(10px) !important;
    }
    
    .inventory-modal-header {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-bottom: 16px !important;
        padding: 0 !important;
        position: relative !important;
    }
    
    .inventory-modal h3 {
        font-size: 1.5rem !important;
        margin: 0 !important;
        color: rgba(240, 195, 60, 1) !important;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8) !important;
        font-weight: 700 !important;
        font-family: 'Pirata One', cursive !important;
    }
    
    .inventory-counter {
        position: absolute !important;
        bottom: 12px !important;
        right: 12px !important;
        font-size: 0.9rem !important;
        color: rgba(240, 195, 60, 1) !important;
        background: rgba(101, 67, 33, 0.9) !important;
        padding: 6px 12px !important;
        border-radius: 12px !important;
        border: 2px solid rgba(240, 195, 60, 0.6) !important;
        font-weight: 600 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Carousel container */
    .inventory-carousel {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        overflow: hidden !important;
        margin: 8px 0 !important;
    }
    
    /* Main card display area - LARGER AND CENTERED */
    .inventory-card-display {
        width: 100% !important;
        height: 340px !important;
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        border-radius: 12px !important;
        background: rgba(101, 67, 33, 0.3) !important;
        border: 2px solid rgba(160, 82, 45, 0.4) !important;
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3) !important;
        margin: 16px 0 8px !important;
    }
    
    /* Action buttons container - CENTERED */
    .inventory-action-buttons {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        margin: 12px 0 16px !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Use button styling */
    .inventory-use-button {
        background: linear-gradient(145deg, rgba(46, 125, 50, 0.9), rgba(27, 94, 32, 0.9)) !important;
        color: white !important;
        border: 2px solid rgba(76, 175, 80, 0.6) !important;
        border-radius: 8px !important;
        padding: 10px 20px !important;
        font-size: 1rem !important;
        font-weight: bold !important;
        font-family: 'Pirata One', cursive !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3) !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        flex: 1 !important;
        max-width: 120px !important;
    }
    
    .inventory-use-button:hover {
        background: linear-gradient(145deg, rgba(56, 142, 60, 1), rgba(27, 94, 32, 1)) !important;
        border-color: rgba(76, 175, 80, 0.8) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4) !important;
    }
    
    .inventory-use-button:active {
        transform: translateY(0px) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Discard button styling */
    .inventory-discard-button {
        background: linear-gradient(145deg, rgba(183, 28, 28, 0.9), rgba(136, 14, 79, 0.9)) !important;
        color: white !important;
        border: 2px solid rgba(244, 67, 54, 0.6) !important;
        border-radius: 8px !important;
        padding: 10px 20px !important;
        font-size: 1rem !important;
        font-weight: bold !important;
        font-family: 'Pirata One', cursive !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3) !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        flex: 1 !important;
        max-width: 120px !important;
    }
    
    .inventory-discard-button:hover {
        background: linear-gradient(145deg, rgba(211, 47, 47, 1), rgba(136, 14, 79, 1)) !important;
        border-color: rgba(244, 67, 54, 0.8) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4) !important;
    }
    
    .inventory-discard-button:active {
        transform: translateY(0px) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Discard confirmation modal */
    .inventory-discard-confirmation {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.8) !important;
        z-index: 3000 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .discard-confirmation-dialog {
        background: linear-gradient(135deg, rgba(44, 62, 80, 0.95), rgba(52, 73, 94, 0.95)) !important;
        border: 3px solid rgba(244, 67, 54, 0.8) !important;
        border-radius: 16px !important;
        padding: 24px !important;
        max-width: 320px !important;
        width: 90% !important;
        text-align: center !important;
        font-family: 'Pirata One', cursive !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    }
    
    .discard-confirmation-dialog h3 {
        color: rgba(244, 67, 54, 1) !important;
        font-size: 1.4rem !important;
        margin: 0 0 16px !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
    }
    
    .discard-confirmation-dialog p {
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: 1rem !important;
        line-height: 1.4 !important;
        margin: 0 0 12px !important;
        font-family: 'Roboto', sans-serif !important;
    }
    
    .discard-confirmation-dialog p:last-of-type {
        color: rgba(255, 255, 255, 0.6) !important;
        font-size: 0.9rem !important;
        font-style: italic !important;
        margin-bottom: 20px !important;
    }
    
    .discard-confirmation-buttons {
        display: flex !important;
        gap: 12px !important;
        justify-content: center !important;
    }
    
    .discard-confirm-button,
    .discard-cancel-button {
        padding: 10px 20px !important;
        border-radius: 8px !important;
        font-size: 1rem !important;
        font-weight: bold !important;
        font-family: 'Pirata One', cursive !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        min-width: 80px !important;
    }
    
    .discard-confirm-button {
        background: linear-gradient(145deg, rgba(183, 28, 28, 0.9), rgba(136, 14, 79, 0.9)) !important;
        color: white !important;
        border: 2px solid rgba(244, 67, 54, 0.6) !important;
    }
    
    .discard-confirm-button:hover {
        background: linear-gradient(145deg, rgba(211, 47, 47, 1), rgba(136, 14, 79, 1)) !important;
        border-color: rgba(244, 67, 54, 0.8) !important;
        transform: translateY(-2px) !important;
    }
    
    .discard-cancel-button {
        background: linear-gradient(145deg, rgba(69, 90, 120, 0.9), rgba(44, 62, 80, 0.9)) !important;
        color: white !important;
        border: 2px solid rgba(96, 125, 139, 0.6) !important;
    }
    
    .discard-cancel-button:hover {
        background: linear-gradient(145deg, rgba(96, 125, 139, 1), rgba(69, 90, 120, 1)) !important;
        border-color: rgba(96, 125, 139, 0.8) !important;
        transform: translateY(-2px) !important;
    }
    
    /* Hide action buttons when inventory is empty */
    .inventory-empty-state.active ~ .inventory-action-buttons {
        display: none !important;
    }
    
    /* Hide empty state when carousel is active */
    .inventory-carousel:not(:empty) ~ .inventory-empty-state {
        display: none !important;
    }
    
    /* Show empty state only when no cards */
    .inventory-empty-state:not(.active) {
        display: none !important;
    }
    
    /* Individual carousel card - FILLS ENTIRE PLACEHOLDER */
    .carousel-card {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transition: all 0.3s ease !important;
        transform: translateX(100%) !important;
        opacity: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        cursor: pointer !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* NUCLEAR CARD SCALING: Cards fill 100% with NO SPACING - OVERRIDE ALL MOBILE CONSTRAINTS */
    .carousel-card .card {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        min-width: 100% !important;
        min-height: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
        transform: none !important;
        perspective: none !important;
        overflow: hidden !important;
        border-radius: 12px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* FORCE OVERRIDE: Kill all mobile card width/height constraints from cards.css */
    @media (max-width: 768px) {
        .carousel-card .card {
            width: 100% !important;
            height: 100% !important;
            max-width: none !important;
            max-height: none !important;
            min-width: 100% !important;
            min-height: 100% !important;
        }
    }
    
    @media (max-width: 480px) {
        .carousel-card .card {
            width: 100% !important;
            height: 100% !important;
            max-width: none !important;
            max-height: none !important;
            min-width: 100% !important;
            min-height: 100% !important;
        }
    }
    
    /* NUCLEAR INNER ELEMENTS: Fill 100% with NO GAPS */
    .carousel-card .card .card-inner,
    .carousel-card .card .card-front,
    .carousel-card .card .card-back {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-width: 100% !important;
        min-height: 100% !important;
        box-sizing: border-box !important;
        border-radius: 12px !important;
        transform: none !important;
        backface-visibility: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* NUCLEAR CARD CONTENT: Perfect fit with proper padding */
    .carousel-card .card .card-content {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 20px !important;
        box-sizing: border-box !important;
        font-size: 1rem !important;
        text-align: center !important;
        margin: 0 !important;
        border: none !important;
        background: transparent !important;
    }
    
    /* LARGER CARD CONTENT - More readable */
    .carousel-card .card .card-icon,
    .carousel-card .card .deck-icon {
        font-size: 7rem !important;
        margin-bottom: 20px !important;
        display: block !important;
    }
    
    /* Hide deck icon (trophy) in inventory carousel - show only card icon */
    .carousel-card .card .deck-icon {
        display: none !important;
    }
    
    .carousel-card .card .card-title {
        font-size: 2.2rem !important;
        margin: 12px 0 !important;
        line-height: 1.3 !important;
        font-weight: bold !important;
        color: white !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }
    
    .carousel-card .card .card-description {
        font-size: 1.7rem !important;
        margin: 10px 0 !important;
        line-height: 1.4 !important;
        opacity: 0.95 !important;
        color: rgba(255, 255, 255, 0.9) !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 4 !important;
        -webkit-box-orient: vertical !important;
    }
    
    .carousel-card .card .card-value {
        font-size: 2rem !important;
        font-weight: bold !important;
        margin: 6px 0 !important;
        color: rgba(240, 195, 60, 1) !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    }
    
    /* DELETE BUTTON - LARGER CORNER CIRCLE */
    .carousel-card .card .discard-card-icon {
        position: absolute !important;
        top: 6px !important;
        right: 6px !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        max-width: 22px !important;
        max-height: 22px !important;
        border-radius: 50% !important;
        background: rgba(231, 76, 60, 0.95) !important;
        color: white !important;
        border: 2px solid rgba(255, 255, 255, 1) !important;
        font-size: 0.7rem !important;
        font-weight: bold !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        z-index: 30 !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
        line-height: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    .carousel-card .card .discard-card-icon:hover {
        background: rgba(231, 76, 60, 1) !important;
        transform: scale(1.2) !important;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7) !important;
    }
    
    .carousel-card .card .discard-card-icon:active {
        transform: scale(0.9) !important;
    }
    
    /* CONFIRMATION MODAL FOR DELETE */
    .inventory-delete-confirmation {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.8) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10000 !important;
        backdrop-filter: blur(5px) !important;
    }
    
    .delete-confirmation-dialog {
        background: linear-gradient(145deg, rgba(139, 69, 19, 0.95), rgba(101, 67, 33, 0.95)) !important;
        border: 3px solid rgba(240, 195, 60, 1) !important;
        border-radius: 16px !important;
        padding: 24px !important;
        max-width: 320px !important;
        width: 90% !important;
        text-align: center !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    }
    
    .delete-confirmation-dialog h3 {
        color: rgba(240, 195, 60, 1) !important;
        font-size: 1.4rem !important;
        margin: 0 0 12px 0 !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    }
    
    .delete-confirmation-dialog p {
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: 1rem !important;
        margin: 0 0 20px 0 !important;
        line-height: 1.4 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
    }
    
    .delete-confirmation-buttons {
        display: flex !important;
        gap: 12px !important;
        justify-content: center !important;
    }
    
    .delete-confirm-btn {
        background: rgba(231, 76, 60, 0.9) !important;
        color: white !important;
        border: 2px solid rgba(231, 76, 60, 1) !important;
        padding: 8px 16px !important;
        border-radius: 8px !important;
        font-weight: bold !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    .delete-confirm-btn:hover {
        background: rgba(231, 76, 60, 1) !important;
        transform: scale(1.05) !important;
    }
    
    .delete-cancel-btn {
        background: rgba(139, 69, 19, 0.9) !important;
        color: rgba(240, 195, 60, 1) !important;
        border: 2px solid rgba(240, 195, 60, 0.8) !important;
        padding: 8px 16px !important;
        border-radius: 8px !important;
        font-weight: bold !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    .delete-cancel-btn:hover {
        background: rgba(240, 195, 60, 0.2) !important;
        border-color: rgba(240, 195, 60, 1) !important;
        transform: scale(1.05) !important;
    }
    
    /* RESPONSIVE CAROUSEL CARD SCALING */
    
    /* Small screens (400px and below) */
    @media (max-width: 400px) {
        .inventory-card-display {
            height: 320px !important;
        }
        
        .carousel-card .card .card-icon,
        .carousel-card .card .deck-icon {
            font-size: 2.8rem !important;
        }
        
        .carousel-card .card .card-title {
            font-size: 1.1rem !important;
        }
        
        .carousel-card .card .card-description {
            font-size: 0.9rem !important;
        }
        
        .carousel-card .card .card-value {
            font-size: 1.2rem !important;
        }
    }
    
    /* Very small screens (360px and below) */
    @media (max-width: 360px) {
        .inventory-card-display {
            height: 300px !important;
        }
        
        .carousel-card .card .card-icon,
        .carousel-card .card .deck-icon {
            font-size: 2.5rem !important;
            margin-bottom: 6px !important;
        }
        
        .carousel-card .card .card-title {
            font-size: 1rem !important;
        }
        
        .carousel-card .card .card-description {
            font-size: 0.85rem !important;
        }
        
        .carousel-card .card .card-value {
            font-size: 1.1rem !important;
        }
        
        .carousel-card .card .card-content {
            padding: 6px !important;
        }
    }
    
    /* Large screens (768px and above) */
    @media (min-width: 768px) {
        .inventory-card-display {
            height: 420px !important;
        }
        
        .carousel-card .card .card-icon,
        .carousel-card .card .deck-icon {
            font-size: 4rem !important;
            margin-bottom: 12px !important;
        }
        
        .carousel-card .card .card-title {
            font-size: 1.5rem !important;
        }
        
        .carousel-card .card .card-description {
            font-size: 1.1rem !important;
        }
        
        .carousel-card .card .card-value {
            font-size: 1.6rem !important;
        }
        
        .carousel-card .card .card-content {
            padding: 12px !important;
        }
    }
    
    .carousel-card.active {
        transform: translateX(0) !important;
        opacity: 1 !important;
        z-index: 2 !important;
    }
    
    .carousel-card.prev {
        transform: translateX(-100%) !important;
        opacity: 0 !important;
    }
    
    .carousel-card.next {
        transform: translateX(100%) !important;
        opacity: 0 !important;
    }
    
    /* Navigation arrows - BIG VISIBLE CARETS */
    .carousel-nav {
        position: static !important;
        background: rgba(139, 69, 19, 0.9) !important;
        color: rgba(240, 195, 60, 1) !important;
        border: 1px solid rgba(240, 195, 60, 0.8) !important;
        border-radius: 10px !important;
        width: 32px !important;
        height: 18px !important;
        font-size: 1.4rem !important;
        font-weight: bold !important;
        cursor: pointer !important;
        z-index: 3 !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9) !important;
        flex-shrink: 0 !important;
        line-height: 1 !important;
    }
    
    .carousel-nav:hover {
        background: rgba(240, 195, 60, 0.9) !important;
        color: rgba(101, 67, 33, 1) !important;
        border-color: rgba(240, 195, 60, 1) !important;
        transform: scale(1.1) !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Navigation container - PREVENT CUTOFF */
    .carousel-navigation {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
        margin: 12px 0 8px !important;
        padding: 0 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }
    
    /* Carousel indicators - PIRATE THEMED DOTS */
    .carousel-indicators {
        display: flex !important;
        justify-content: center !important;
        gap: 8px !important;
        margin: 12px 0 8px !important;
    }
    
    .carousel-indicator {
        width: 8px !important;
        height: 8px !important;
        border-radius: 50% !important;
        background: rgba(160, 82, 45, 0.6) !important;
        border: 1px solid rgba(240, 195, 60, 0.4) !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    }
    
    .carousel-indicator.active {
        background: rgba(240, 195, 60, 1) !important;
        border-color: rgba(240, 195, 60, 1) !important;
        transform: scale(1.2) !important;
        box-shadow: 0 0 6px rgba(240, 195, 60, 0.6) !important;
    }
    
    /* Empty state - MOVED ABOVE CARD AREA */
    .inventory-empty-state {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        color: rgba(240, 195, 60, 0.8) !important;
        text-align: center !important;
        padding: 16px 20px !important;
        margin-bottom: 8px !important;
    }
    
    .inventory-empty-state .empty-icon {
        font-size: 3rem !important;
        margin-bottom: 15px !important;
        opacity: 0.7 !important;
        filter: sepia(100%) saturate(200%) hue-rotate(25deg) !important;
    }
    
    .inventory-empty-state .empty-text {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
        font-weight: 600 !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
    }
    
    .inventory-empty-state .empty-hint {
        font-size: 0.9rem !important;
        opacity: 0.9 !important;
        line-height: 1.4 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
    }
    
    .inventory-modal .inventory-slot .empty-slot-indicator {
        font-size: 0.9rem !important;
        color: rgba(255, 255, 255, 0.6) !important;
        text-align: center !important;
    }
    
    /* NUCLEAR CARD SCALING: Force cards to completely fill inventory slots */
    .inventory-modal .inventory-slot .card {
        position: absolute !important;
        top: 2px !important;
        left: 2px !important;
        right: 2px !important;
        bottom: 2px !important;
        width: calc(100% - 4px) !important;
        height: calc(100% - 4px) !important;
        max-width: calc(100% - 4px) !important;
        max-height: calc(100% - 4px) !important;
        min-width: calc(100% - 4px) !important;
        min-height: calc(100% - 4px) !important;
        box-sizing: border-box !important;
        display: block !important;
        transform: none !important;
        perspective: none !important;
        overflow: hidden !important;
        border-radius: 6px !important;
    }
    
    /* Force all card inner elements to scale properly */
    .inventory-modal .inventory-slot .card .card-inner,
    .inventory-modal .inventory-slot .card .card-front,
    .inventory-modal .inventory-slot .card .card-back {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-width: 100% !important;
        min-height: 100% !important;
        box-sizing: border-box !important;
        border-radius: 6px !important;
        transform: none !important;
        backface-visibility: visible !important;
    }
    
    /* Ensure card content scales with container */
    .inventory-modal .inventory-slot .card .card-content {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 4px !important;
        box-sizing: border-box !important;
        font-size: 0.8rem !important;
        text-align: center !important;
    }
    
    /* Scale card icons and text properly */
    .inventory-modal .inventory-slot .card .card-icon,
    .inventory-modal .inventory-slot .card .deck-icon {
        font-size: 1.8rem !important;
        margin-bottom: 4px !important;
    }
    
    .inventory-modal .inventory-slot .card .card-title {
        font-size: 0.7rem !important;
        margin: 2px 0 !important;
        line-height: 1.1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }
    
    .inventory-modal .inventory-slot .card .card-description {
        font-size: 0.6rem !important;
        margin: 1px 0 !important;
        line-height: 1 !important;
        opacity: 0.8 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 1 !important;
        -webkit-box-orient: vertical !important;
    }
    
    /* NUCLEAR OVERRIDE: Force card sizing in modal to ignore ALL other CSS rules */
    .inventory-modal .inventory-slot .card,
    .inventory-modal .inventory-slot .card *,
    .inventory-modal-overlay .inventory-slot .card,
    .inventory-modal-overlay .inventory-slot .card * {
        box-sizing: border-box !important;
    }
    
    /* Prevent any external card dimensions from interfering */
    .inventory-modal .inventory-slot {
        overflow: hidden !important;
    }
    
    .inventory-modal .inventory-slot .card {
        /* Nuclear override for any external card CSS */
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        outline: none !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    /* Close button - PIRATE THEMED */
    .inventory-modal-close {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        background: rgba(139, 69, 19, 0.9) !important;
        color: rgba(240, 195, 60, 1) !important;
        border: 2px solid rgba(240, 195, 60, 0.8) !important;
        border-radius: 50% !important;
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
        max-width: 24px !important;
        max-height: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        font-size: 0.8rem !important;
        font-weight: bold !important;
        z-index: 100 !important;
        line-height: 1 !important;
        box-sizing: border-box !important;
        transition: all 0.2s ease !important;
        opacity: 0.9 !important;
        padding: 0 !important;
        margin: 0 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    }
    
    .inventory-modal-close:hover {
        background: rgba(240, 195, 60, 0.9) !important;
        color: rgba(139, 69, 19, 1) !important;
        opacity: 1 !important;
        transform: scale(1.1) !important;
        border-color: rgba(240, 195, 60, 1) !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    }
    
    .inventory-modal-close:active {
        transform: scale(0.9) !important;
    }
    
    /* ========================
       STATUS BAR COMPACT
       ======================== */
    
    .status-bar {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 9px !important;
        margin: -40px 5px 10px !important;
        background: rgba(0, 0, 0, 0.5) !important;
        border-radius: 8px !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        flex-wrap: wrap !important;
    }
    
    .status-item {
        flex: 1 !important;
        text-align: center !important;
        font-size: 0.9rem !important;
        min-width: 80px !important;
    }
    
    .status-label {
        display: block !important;
        font-size: 0.75rem !important;
        color: rgba(255, 255, 255, 0.7) !important;
        margin-bottom: 2px !important;
    }
    
    .active-effects-container {
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        margin: 8px 0 !important;
    }
    
    /* ========================
       LANDSCAPE OPTIMIZATIONS
       ======================== */
    
    @media (orientation: landscape) {
        .game-header {
            padding: 8px 12px !important;
            margin-bottom: 10px !important;
        }
        
        .game-header h1 {
            font-size: 1.2rem !important;
        }
        
        .card-area {
            min-height: 180px !important;
            margin: 8px 5px !important;
            padding: 10px !important;
        }
        
        #deck, #current-card {
            width: 150px !important;
            height: 210px !important;
        }
        
        .score-panel {
            margin: 8px 5px !important;
        }
        
        .action-buttons {
            margin: 10px !important;
        }
        
        .inventory-container {
            margin: 10px 5px !important;
            padding: 8px !important;
        }
        
        .inventory-slot {
            width: 70px !important;
            height: 98px !important;
        }
    }
}

/* ========================
   EXTRA NARROW SCREENS (400px and below)
   ======================== */

@media (max-width: 400px) {
    /* Even more compact card sizing */
    .card-area {
        gap: 10px !important;
        padding: 12px 8px !important;
        margin: 8px 3px !important;
        min-height: 200px !important;
    }
    
    #deck {
        width: calc(50vw - 15px) !important;
        height: calc((50vw - 15px) * 1.4) !important; /* Maintain aspect ratio */
        max-width: 160px !important;
        max-height: 224px !important;
    }
    
    #current-card {
        width: calc(50vw - 15px) !important;
        height: calc((50vw - 15px) * 1.4) !important; /* Maintain aspect ratio */
        max-width: 160px !important;
        max-height: 224px !important;
    }
    
    /* Ensure cards fit their containers on narrow screens */
    #deck .card,
    #current-card .card {
        font-size: 0.85rem !important;
    }
    
    #deck .card .card-title,
    #current-card .card .card-title {
        font-size: 0.9rem !important;
        margin-bottom: 4px !important;
    }
    
    #deck .card .card-value,
    #current-card .card .card-value {
        font-size: 1.2rem !important;
        margin: 4px 0 !important;
    }
    
    #deck .card .card-icon,
    #current-card .card .card-icon {
        font-size: 1.5rem !important;
        margin-bottom: 4px !important;
    }
    
    #deck .card .card-description,
    #current-card .card .card-description {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        padding: 0 4px !important;
    }
    
    /* Action buttons truly side by side for narrow screens - FORCE OVERRIDE */
    .gameplay-container .action-buttons,
    .game-container .action-buttons {
        gap: 8px !important;
        margin: 12px 5px !important;
        padding: 0 3px !important;
        width: calc(100% - 10px) !important;
        flex-wrap: nowrap !important; /* CRITICAL: Never wrap */
    }
    
    /* CRITICAL: Override all button sizing for narrow screens */
    .gameplay-container .action-buttons button,
    .game-container .action-buttons button,
    .action-buttons .btn,
    .action-buttons button {
        flex: 1 !important;
        max-width: calc(50% - 4px) !important;
        min-width: calc(50% - 8px) !important; /* OVERRIDE: Force side by side */
        width: calc(50% - 4px) !important; /* FORCE EXACT WIDTH */
        min-height: 48px !important;
        font-size: 1rem !important;
        padding: 10px 6px !important;
        margin: 0 !important; /* OVERRIDE: Remove all margins */
    }
    
    /* Compact score panel for narrow screens - INLINE VERSION */
    .score-panel {
        gap: 6px !important;
        margin: 8px 3px !important;
        height: auto !important; /* Auto height for compact boxes */
    }
    
    .score-box {
        padding: 5px 6px !important; /* Even more compact */
        min-height: 32px !important; /* Smaller height */
        gap: 4px !important; /* Tighter gap between label and value */
    }
    
    .score-box p:first-child {
        font-size: 0.75rem !important; /* Smaller label */
    }
    
    .score-box p:last-child {
        font-size: 1rem !important; /* Smaller value but still prominent */
    }
}

/* ========================
   ULTRA NARROW SCREENS (360px and below)
   ======================== */

@media (max-width: 360px) {
    #deck {
        width: calc(50vw - 12px) !important;
        height: calc((50vw - 12px) * 1.4) !important;
        max-width: 140px !important;
        max-height: 196px !important;
    }
    
    #current-card {
        width: calc(50vw - 12px) !important;
        height: calc((50vw - 12px) * 1.4) !important;
        max-width: 140px !important;
        max-height: 196px !important;
    }
    
    /* CRITICAL: Ultra narrow button override */
    .gameplay-container .action-buttons button,
    .game-container .action-buttons button,
    .action-buttons .btn,
    .action-buttons button {
        min-width: calc(50% - 10px) !important; /* Force side by side on ultra narrow */
        width: calc(50% - 5px) !important; /* FORCE EXACT WIDTH */
        max-width: calc(50% - 5px) !important;
        font-size: 0.95rem !important;
        padding: 10px 4px !important;
        margin: 0 !important; /* OVERRIDE: Remove all margins */
    }
    
    .card-area {
        gap: 8px !important;
        padding: 10px 6px !important;
        margin: 6px 2px !important;
    }
}

/* ========================
   NUCLEAR BUTTON OVERRIDE - MAXIMUM SPECIFICITY
   ======================== */

@media (max-width: 767px) {
    /* NUCLEAR OVERRIDE: Kill all conflicting button rules from other CSS files */
    body .game-container .gameplay-container .action-buttons,
    body .game-container .action-buttons {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 12px !important;
        width: calc(100% - 20px) !important;
        margin: -5px 10px 8px !important;
        padding: 0 5px !important;
    }
    
    /* NUCLEAR OVERRIDE: Force exact button sizing */
    body .game-container .gameplay-container .action-buttons button,
    body .game-container .action-buttons button,
    body .game-container .action-buttons .btn {
        flex: 1 !important;
        width: calc(50% - 6px) !important;
        max-width: calc(50% - 6px) !important;
        min-width: calc(50% - 6px) !important;
        margin: 0 !important;
        padding: 12px 8px !important;
        font-size: 1.1rem !important;
        box-sizing: border-box !important;
    }
    
    /* NUCLEAR OVERRIDE: Force compact inline score boxes */
    body .game-container .score-panel .score-box,
    body .score-panel .score-box {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        min-height: 36px !important;
        padding: 6px 8px !important;
        margin: 0 !important;
    }
    
    body .game-container .score-panel .score-box p:first-child,
    body .score-panel .score-box p:first-child {
        margin: 0 !important;
        flex-shrink: 0 !important;
        font-size: 0.8rem !important;
    }
    
    body .game-container .score-panel .score-box p:last-child,
    body .score-panel .score-box p:last-child {
        margin: 0 !important;
        flex-shrink: 0 !important;
        font-size: 1.1rem !important;
    }
}

/* Narrow screens nuclear override */
@media (max-width: 400px) {
    body .game-container .gameplay-container .action-buttons button,
    body .game-container .action-buttons button,
    body .game-container .action-buttons .btn {
        width: calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        min-width: calc(50% - 4px) !important;
        font-size: 1rem !important;
        padding: 10px 6px !important;
    }
    
    /* Compact score boxes for narrow screens */
    body .game-container .score-panel .score-box,
    body .score-panel .score-box {
        min-height: 32px !important;
        padding: 5px 6px !important;
        gap: 4px !important;
    }
    
    body .game-container .score-panel .score-box p:first-child,
    body .score-panel .score-box p:first-child {
        font-size: 0.75rem !important;
    }
    
    body .game-container .score-panel .score-box p:last-child,
    body .score-panel .score-box p:last-child {
        font-size: 1rem !important;
    }
    
    /* Inventory modal adjustments for narrow screens */
    .inventory-modal {
        max-width: 320px !important;
        padding: 12px !important;
    }
    
    .inventory-modal h3 {
        font-size: 1.3rem !important;
        margin-bottom: 12px !important;
    }
    
    .inventory-modal .inventory-slots {
        gap: 10px !important;
        padding: 0 5px !important;
    }
    
    .inventory-modal .inventory-slot {
        min-height: 110px !important;
    }
    
    .inventory-modal .inventory-slot .card .card-icon,
    .inventory-modal .inventory-slot .card .deck-icon {
        font-size: 1.5rem !important;
    }
    
    .inventory-modal .inventory-slot .card .card-title {
        font-size: 0.6rem !important;
    }
    
    .inventory-modal .inventory-slot .card .card-description {
        font-size: 0.5rem !important;
    }
}

/* Ultra narrow screens nuclear override */
@media (max-width: 360px) {
    body .game-container .gameplay-container .action-buttons button,
    body .game-container .action-buttons button,
    body .game-container .action-buttons .btn {
        width: calc(50% - 3px) !important;
        max-width: calc(50% - 3px) !important;
        min-width: calc(50% - 3px) !important;
        font-size: 0.95rem !important;
        padding: 10px 4px !important;
    }
    
    /* Extra compact score boxes for ultra narrow screens */
    body .game-container .score-panel .score-box,
    body .score-panel .score-box {
        min-height: 30px !important;
        padding: 4px 5px !important;
        gap: 3px !important;
    }
    
    body .game-container .score-panel .score-box p:first-child,
    body .score-panel .score-box p:first-child {
        font-size: 0.7rem !important;
    }
    
    body .game-container .score-panel .score-box p:last-child,
    body .score-panel .score-box p:last-child {
        font-size: 0.9rem !important;
    }
    
    /* Inventory modal adjustments for ultra narrow screens */
    .inventory-modal {
        max-width: 300px !important;
        padding: 10px !important;
    }
    
    .inventory-modal h3 {
        font-size: 1.2rem !important;
        margin-bottom: 10px !important;
    }
    
    .inventory-modal .inventory-slots {
        gap: 8px !important;
        padding: 0 3px !important;
    }
    
    .inventory-modal .inventory-slot {
        min-height: 100px !important;
    }
    
    .inventory-modal .inventory-slot .card .card-icon,
    .inventory-modal .inventory-slot .card .deck-icon {
        font-size: 1.3rem !important;
    }
    
    .inventory-modal .inventory-slot .card .card-title {
        font-size: 0.55rem !important;
    }
    
    .inventory-modal .inventory-slot .card .card-description {
        font-size: 0.45rem !important;
    }
}

/* ========================
   DESKTOP - KEEP ORIGINAL LAYOUT
   ======================== */

@media (min-width: 768px) {
    .mobile-game-menu,
    .mobile-menu-trigger,
    .mobile-menu-dropdown,
    .mobile-inventory-button {
        display: none !important;
    }
    
    .game-header .game-controls {
        display: flex !important;
    }
    
    /* Hide inventory button and modal on desktop - show normal inventory */
    .inventory-modal-overlay {
        display: none !important;
    }
    
    /* Only show inventory during gameplay, not on home screen */
    .inventory-container {
        display: block !important;
    }
    
    /* Hide inventory on home screen */
    .inventory-container.hidden {
        display: none !important;
    }
    
    /* When mode-selection is active (home screen), hide inventory */
    #mode-selection.active ~ .gameplay-container .inventory-container,
    #mode-selection:not(.hidden) ~ .gameplay-container .inventory-container {
        display: none !important;
    }
}

/* Mobile: Show inventory button, hide normal inventory */
@media (max-width: 767px) {
    .mobile-inventory-button:not(.hidden) {
        display: flex !important;
    }
    
    /* Always hide desktop inventory on mobile */
    .inventory-container {
        display: none !important;
    }
    
    /* Ensure inventory is hidden on home screen for mobile too */
    #mode-selection.active ~ .gameplay-container .inventory-container,
    #mode-selection:not(.hidden) ~ .gameplay-container .inventory-container {
        display: none !important;
    }
    
    /* ========================
       LESS INTRUSIVE NOTIFICATIONS
       ======================== */
    
    /* Make notifications smaller and less annoying on mobile */
    .notification-container {
        top: 10px !important;
        right: 10px !important;
        left: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: 280px !important;
        z-index: 999 !important; /* Lower than modals */
    }
    
    .notification {
        font-size: 0.85rem !important;
        padding: 8px 12px !important;
        margin-bottom: 5px !important;
        border-radius: 8px !important;
        max-width: 280px !important;
        word-break: break-word !important;
        animation: notification-quick-fade 2s ease forwards !important;
        backdrop-filter: blur(5px) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        opacity: 0.9 !important;
    }
    
    /* Faster fade animation */
    @keyframes notification-quick-fade {
        0% {
            opacity: 0;
            transform: translateX(20px);
        }
        10% {
            opacity: 0.9;
            transform: translateX(0);
        }
        80% {
            opacity: 0.9;
            transform: translateX(0);
        }
        100% {
            opacity: 0;
            transform: translateX(20px);
        }
    }
    
    /* Remove mobile notification close buttons - they auto-dismiss faster */
    .notification::after {
        display: none !important;
    }
}
