/* single-player-controls.css */

.mobile-difficulty-selector {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.5rem; /* Reduced padding */
    border-radius: 12px;
    user-select: none;
    transition: all 0.3s ease;
    width: auto;
}

.difficulty-toggles {
    display: flex;
    gap: 0.5rem; /* Reduced gap */
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.difficulty-btn {
    padding: 0.5rem 1rem; /* Reduced padding for desktop */
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    min-width: 90px; /* Reduced min-width */
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.difficulty-btn.active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
}

.difficulty-btn:active {
    transform: scale(0.98);
}

/* Light Theme */
.theme-light .mobile-difficulty-selector {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-light .difficulty-btn {
    background: rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

.theme-light .difficulty-btn:hover {
    background: rgba(0, 0, 0, 0.15);
}

.theme-light .difficulty-btn.active {
    background: #2563eb;
    color: #ffffff;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .mobile-difficulty-selector {
        bottom: 1rem;
        padding: 0.75rem;
        width: 90%;
        max-width: 400px;
    }

    .difficulty-toggles {
        gap: 0.375rem;
        width: 100%;
        justify-content: space-between;
    }

    .difficulty-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-width: unset;
        flex: 1;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 380px) {
    .mobile-difficulty-selector {
        padding: 0.5rem;
    }

    .difficulty-toggles {
        gap: 0.25rem;
    }

    .difficulty-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.6875rem;
    }
}

@media (max-width: 320px) {
    .mobile-difficulty-selector {
        padding: 0.375rem;
    }

    .difficulty-toggles {
        gap: 0.2rem;
    }

    .difficulty-btn {
        padding: 0.375rem 0.375rem;
        font-size: 0.625rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .difficulty-btn {
        -webkit-tap-highlight-color: transparent;
    }

    .difficulty-btn:active {
        background: rgba(255, 255, 255, 0.2);
    }

    .theme-light .difficulty-btn:active {
        background: rgba(0, 0, 0, 0.2);
    }
}

/* Animations */
@keyframes button-press {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

/* Accessibility */
.difficulty-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

.difficulty-btn:focus:not(:focus-visible) {
    box-shadow: none;
}

/* High Contrast Mode Support */
@media (forced-colors: active) {
    .difficulty-btn {
        border: 1px solid currentColor;
    }
    
    .difficulty-btn.active {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .difficulty-btn {
        transition: none;
    }
}

/* Game Over Dialog Button Styles */
.single-player-game-over .button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.single-player-game-over .button.primary {
    background: #2563eb;
    color: #ffffff;
}

.single-player-game-over .button.primary:hover {
    background: #1d4ed8;
}

.single-player-game-over .button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.single-player-game-over .button.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Light theme button styles */
.theme-light .single-player-game-over .button.primary {
    background: #2563eb;
    color: #ffffff;
}

.theme-light .single-player-game-over .button.primary:hover {
    background: #1d4ed8;
}

.theme-light .single-player-game-over .button.secondary {
    background: rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

.theme-light .single-player-game-over .button.secondary:hover {
    background: rgba(0, 0, 0, 0.15);
}