/* Mobile-specific styles for battle view */

/* Media query for mobile devices */
@media (max-width: 767px) {
    /* General layout adjustments */
    .battle-view {
        padding: 0.5rem;
    }

    /* Adjust the battle grid for mobile */
    .battle-grid {
        grid-template-columns: 1fr !important; /* Force single column layout */
        gap: 1rem;
    }

    /* Adjust the hexagon counter */
    .hexagon-counter {
        width: 12px;
        height: 12px;
    }

    .round-display {
        font-size: 0.7rem;
    }

    /* Adjust selected cases preview */
    #selected-cases-preview {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
        overflow-x: auto;
    }

    .selected-case-preview img {
        width: 40px;
        height: 40px;
    }

    /* Adjust battle header layout */
    .flex.justify-between.items-center.my-6 {
        flex-direction: column;
        gap: 1rem;
    }

    /* Adjust the battle cases container */
    .battle-cases-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Adjust player header */
    .player-header {
        padding: 0.75rem;
    }

    .player-avatar {
        width: 36px;
        height: 36px;
    }

    .player-name {
        font-size: 0.9rem;
    }

    /* Adjust player cases grid */
    .player-cases {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem;
    }

    /* Adjust case result items */
    .case-result {
        max-width: 100% !important;
        height: auto !important;
        padding: 0.75rem !important;
    }

    .case-result img {
        height: 24px !important;
        margin-top: 1.5rem !important;
    }

    /* Adjust emoji container */
    .emoji-container {
        top: -80px;
        min-width: 320px !important;
        padding: 10px 15px !important;
        z-index: 1000;
        left: 50%;
        transform: translateX(-50%);
        display: none !important; /* Hide by default */
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
        background-color: rgba(15, 15, 27, 0.95) !important;
        border: 2px solid #374151 !important;
        border-radius: 10px !important;
        position: absolute !important;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Show emoji container when active */
    .emoji-container.active {
        display: flex !important;
    }
    
    /* Position the emoji container properly */
    .player-header {
        position: relative !important;
    }

    .emoji-button {
        width: 48px !important;
        height: 48px !important;
        margin: 5px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
        transition: all 0.2s ease !important;
    }

    .emoji-button:active {
        transform: scale(0.95) !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
    }

    .emoji-button img {
        width: 36px !important;
        height: 36px !important;
        object-fit: contain !important;
    }
    
    /* Emoji trigger button */
    .emoji-trigger {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
    }
    
    /* Emoji animation styles */
    .emoji-animation {
        position: absolute;
        font-size: 24px;
        z-index: 1000;
        pointer-events: none;
    }
    
    .emoji-animation img {
        width: 48px !important;
        height: 48px !important;
        object-fit: contain;
    }
    
    @keyframes emoji-fly {
        0% {
            transform: scale(0.5);
            opacity: 0;
        }
        10% {
            transform: scale(1.2);
            opacity: 1;
        }
        70% {
            opacity: 1;
        }
        100% {
            transform: translateY(-100px) scale(0.8);
            opacity: 0;
        }
    }

    /* Adjust case spinner */
    .case-spinner {
        height: 300px !important;
    }

    /* Adjust battle navigation */
    .battles-nav-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }
    
    .battles-nav {
        flex-direction: column !important;
        height: auto !important;
        padding: 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .battles-nav-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        height: auto;
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }

    .battles-nav-tab {
        padding: 0.5rem 0.25rem;
        height: auto;
        font-size: 0.65rem;
        flex: 1;
        justify-content: center;
        text-align: center;
        border-right: none;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .battles-nav-tab .nav-icon {
        margin-right: 2px;
        width: 14px;
        height: 14px;
    }

    .battles-nav-actions {
        width: 100% !important;
        justify-content: space-between !important;
        padding: 0.5rem 0 !important;
        display: flex !important;
        gap: 0.25rem !important;
    }

    /* Override all button styles with !important */
    .battles-nav-actions a, 
    .battles-nav-actions button {
        flex: 1 !important;
        justify-content: center !important;
        white-space: nowrap !important;
        padding: 0.2rem !important;
        font-size: 0.5rem !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: flex !important;
        align-items: center !important;
        line-height: 1 !important;
        margin-right: 0.1rem !important;
        width: auto !important;
        max-width: none !important;
        border-width: 1px !important;
    }
    
    /* Remove margin from the last button */
    .battles-nav-actions a:last-child, 
    .battles-nav-actions button:last-child {
        margin-right: 0 !important;
    }

    /* Fix for leave battle button */
    #leave-battle-btn {
        padding: 0.2rem !important;
        font-size: 0.55rem !important;
        min-width: 0 !important;
        margin-right: 0.2rem !important;
        width: auto !important;
        max-width: none !important;
    }

    /* Fix for button icons */
    .battles-nav-actions a i,
    .battles-nav-actions button i {
        margin-right: 2px !important;
        font-size: 0.55rem !important;
    }
    
    /* Override any inline styles */
    .battles-nav-actions a[class*="px-"], 
    .battles-nav-actions button[class*="px-"],
    .battles-nav-actions a[class*="py-"], 
    .battles-nav-actions button[class*="py-"],
    .battles-nav-actions a[class*="mr-"], 
    .battles-nav-actions button[class*="mr-"] {
        padding-left: 0.2rem !important;
        padding-right: 0.2rem !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        margin-right: 0.2rem !important;
    }

    /* Adjust buttons */
    .action-button {
        padding: 0.5rem 1rem;
        font-size: 1.75rem !important;
    }

    .action-button.join {
        width: 100%;
    }

    /* Fix for the botPlaceholder */
    .botPlaceholder {
        height: auto !important;
        padding: 1rem !important;
    }

    .botPlaceholder .relative {
        width: 100px !important;
        height: 100px !important;
    }

    /* Adjust winner/loser overlays */
    .w-full.h-\[400px\].border.border-green-500,
    .w-full.h-\[400px\].border.border-red-500 {
        height: 250px !important;
    }

    /* Adjust countdown timer */
    .countdownTimer {
        transform: translate(-50%, -50%) scale(0.8);
    }

    /* Adjust tooltip positioning */
    .case-tooltip {
        width: 220px;
        left: 50%;
        transform: translateX(-50%) !important;
    }

    .selected-case-preview:hover .case-tooltip {
        transform: translateX(-50%) translateY(5px) !important;
    }
}

/* Media query for very small devices */
@media (max-width: 375px) {
    .selected-case-preview img {
        width: 32px;
        height: 32px;
    }

    .player-cases {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .emoji-container {
        min-width: 280px !important;
        max-width: 95vw !important;
    }

    .emoji-button {
        width: 40px !important;
        height: 40px !important;
        margin: 3px !important;
    }

    .emoji-button img {
        width: 30px !important;
        height: 30px !important;
    }
    
    .emoji-trigger {
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
    }

    .case-spinner {
        height: 250px !important;
    }
    
    /* Further reduce navigation tab and button sizes */
    .battles-nav-tab {
        padding: 0.5rem 0.25rem;
        font-size: 0.65rem;
    }
    
    .battles-nav-tab .nav-icon {
        margin-right: 2px;
        width: 14px;
        height: 14px;
    }
    
    .battles-nav-actions a, 
    .battles-nav-actions button,
    #leave-battle-btn {
        padding: 0.5rem 0.15rem;
        font-size: 0.6rem;
    }
    
    /* Make button text smaller */
    .battles-nav-actions a,
    .battles-nav-actions button {
        font-size: 0.55rem;
    }
}

/* Media query for extra small devices */
@media (max-width: 320px) {
    .battles-nav-actions a i,
    .battles-nav-actions button i {
        display: none;
    }
    
    .battles-nav-tab .nav-icon {
        display: none;
    }
    
    .battles-nav-tab {
        padding: 0.5rem 0.15rem;
        font-size: 0.6rem;
    }
    
    .battles-nav-actions a, 
    .battles-nav-actions button,
    #leave-battle-btn {
        padding: 0.5rem 0.1rem;
        font-size: 0.5rem;
    }
    
    /* Adjust emoji container for very small screens */
    .emoji-container {
        min-width: 260px !important;
        max-width: 95vw !important;
        padding: 8px 10px !important;
        gap: 5px !important;
    }

    .emoji-button {
        width: 36px !important;
        height: 36px !important;
        margin: 2px !important;
    }

    .emoji-button img {
        width: 26px !important;
        height: 26px !important;
    }
    
    .emoji-trigger {
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
    }
    
    /* Make emoji animation smaller */
    .emoji-animation img {
        width: 40px !important;
        height: 40px !important;
    }
}
