/* SortTap Game Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

.container {
    max-width: 100vw;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.game-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.menu-screen, .game-screen, .result-screen {
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.menu-screen {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    max-width: 400px;
}

.game-info-section, .mode-section, .layout-section, .color-section, .animation-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #fff;
    font-weight: 600;
}

.option-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
    justify-content: center;
}

/* Game description styles */
.game-description {
    background: rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.9;
}

.time-info {
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.3;
    opacity: 0.9;
}

.time-info p {
    margin: 4px 0;
}

.mode-section .option-buttons,
.layout-section .option-buttons,
.color-section .option-buttons,
.animation-section .option-buttons {
    grid-template-columns: repeat(2, 1fr);
}

#timeOptions .option-buttons {
    grid-template-columns: repeat(2, 1fr);
}

.option-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    min-width: 70px;
    text-align: center;
    white-space: nowrap;
}

.option-btn:hover, .option-btn.selected {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.start-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    color: white;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
    max-width: 200px;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(0,0,0,0.2);
    padding: 12px 16px;
    border-radius: 12px;
    flex-wrap: nowrap;
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.info-label {
    font-size: 0.75rem;
    opacity: 0.8;
    white-space: nowrap;
}

.info-value {
    font-size: 1rem;
    font-weight: bold;
    white-space: nowrap;
}

.timer {
    color: #ff6b6b;
    font-size: 1.2rem !important;
}

.numbers-container {
    position: relative;
    width: 100%;
    height: 60vh;
    margin: 20px 0;
    background: rgba(0,0,0,0.1);
    border-radius: 15px;
    overflow: hidden;
}

.number-btn {
    position: absolute;
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 6px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.number-btn:hover {
    z-index: 2;
    transform: scale(1.05);
    box-shadow: 4px 4px 10px rgba(0,0,0,0.3);
}

/* Enhanced mobile press feedback */
.number-btn:active {
    transform: translateY(2px) scale(0.95);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    transition: all 0.1s ease;
}

/* Press animation class for mobile */
.number-btn.pressing {
    transform: translateY(3px) scale(0.92);
    box-shadow: 0px 0px 2px rgba(0,0,0,0.6);
    filter: brightness(0.9);
    transition: all 0.15s ease-out;
}

/* Release animation */
.number-btn.releasing {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 6px 6px 12px rgba(0,0,0,0.25);
    filter: brightness(1.1);
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.number-btn.found {
    background: linear-gradient(145deg, #4ecdc4, #44a08d);
    color: white;
    opacity: 0.6;
    cursor: not-allowed;
}

.number-btn.paused {
    color: transparent !important;
    text-shadow: none !important;
}

/* Enhanced press effects for multi-color buttons */
.number-btn.color-1.pressing,
.number-btn.color-2.pressing,
.number-btn.color-3.pressing,
.number-btn.color-4.pressing,
.number-btn.color-5.pressing,
.number-btn.color-6.pressing,
.number-btn.color-7.pressing,
.number-btn.color-8.pressing,
.number-btn.color-9.pressing,
.number-btn.color-10.pressing {
    filter: brightness(0.8) saturate(1.2);
}

.number-btn.color-1.releasing,
.number-btn.color-2.releasing,
.number-btn.color-3.releasing,
.number-btn.color-4.releasing,
.number-btn.color-5.releasing,
.number-btn.color-6.releasing,
.number-btn.color-7.releasing,
.number-btn.color-8.releasing,
.number-btn.color-9.releasing,
.number-btn.color-10.releasing {
    filter: brightness(1.15) saturate(1.1);
}

/* Multi-color number buttons with white text */
.number-btn.color-1 { 
    background: linear-gradient(145deg, #e74c3c, #c0392b); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.number-btn.color-2 { 
    background: linear-gradient(145deg, #1abc9c, #16a085); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.number-btn.color-3 { 
    background: linear-gradient(145deg, #3498db, #2980b9); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.number-btn.color-4 { 
    background: linear-gradient(145deg, #27ae60, #229954); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.number-btn.color-5 { 
    background: linear-gradient(145deg, #f39c12, #d68910); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.number-btn.color-6 { 
    background: linear-gradient(145deg, #e91e63, #ad1457); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.number-btn.color-7 { 
    background: linear-gradient(145deg, #9b59b6, #8e44ad); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.number-btn.color-8 { 
    background: linear-gradient(145deg, #34495e, #2c3e50); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.number-btn.color-9 { 
    background: linear-gradient(145deg, #17a2b8, #138496); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.number-btn.color-10 { 
    background: linear-gradient(145deg, #fd7e14, #e8590c); 
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.game-controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.result-screen {
    background: rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.result-title {
    font-size: 2rem;
    margin-bottom: 20px;
}

.result-title.win {
    color: #4ecdc4;
}

.result-title.lose {
    color: #ff6b6b;
}

.result-stats {
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Enhanced mobile touch styles */
@media (hover: none) and (pointer: coarse) {
    .number-btn {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .number-btn:hover {
        transform: none;
        box-shadow: 3px 3px 6px rgba(0,0,0,0.2);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .game-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .menu-screen {
        padding: 15px;
        max-width: 350px;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .option-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .option-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
        min-width: 60px;
        border-radius: 15px;
    }

    .start-btn {
        padding: 10px 25px;
        font-size: 1rem;
        margin-top: 12px;
    }

    .numbers-container {
        height: 50vh;
    }

    .game-info {
        padding: 10px 12px;
        margin-bottom: 12px;
        gap: 6px;
    }

    .info-item {
        gap: 1px;
    }

    .info-label {
        font-size: 0.7rem;
    }

    .info-value {
        font-size: 0.9rem;
    }

    .timer {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .menu-screen {
        padding: 12px;
        max-width: 320px;
    }

    .game-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .difficulty-section, .mode-section, .layout-section {
        margin-bottom: 15px;
    }

    .option-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .option-btn {
        padding: 5px 6px;
        font-size: 0.75rem;
        min-width: 50px;
        border-radius: 12px;
    }

    .start-btn {
        padding: 8px 20px;
        font-size: 0.95rem;
        margin-top: 10px;
    }

    .game-info {
        padding: 8px 10px;
        margin-bottom: 10px;
        gap: 4px;
        border-radius: 10px;
    }

    .info-label {
        font-size: 0.65rem;
    }

    .info-value {
        font-size: 0.85rem;
    }

    .timer {
        font-size: 0.9rem !important;
    }

    .numbers-container {
        height: 45vh;
    }
}

/* Animation for number shuffle */
.number-btn.shuffling {
    animation: shuffle 0.5s ease-in-out;
}

@keyframes shuffle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.9) rotate(5deg); }
}

/* Pulse animation for timer */
.timer.warning {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Wiggle animation for numbers */
@keyframes wiggle {
    0%, 100% { 
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    25% { 
        transform: translateX(1px) translateY(-1px) rotate(0.5deg);
    }
    50% { 
        transform: translateX(-1px) translateY(1px) rotate(-0.5deg);
    }
    75% { 
        transform: translateX(1px) translateY(1px) rotate(0.3deg);
    }
}

@keyframes wiggle-alt {
    0%, 100% { 
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    20% { 
        transform: translateX(-1px) translateY(1px) rotate(-0.3deg);
    }
    40% { 
        transform: translateX(1px) translateY(-1px) rotate(0.4deg);
    }
    60% { 
        transform: translateX(-1px) translateY(-1px) rotate(-0.2deg);
    }
    80% { 
        transform: translateX(1px) translateY(1px) rotate(0.3deg);
    }
}

/* Apply wiggle animation to numbers */
.number-btn.wiggle-1 {
    animation: wiggle 3s infinite ease-in-out;
    animation-delay: 0s;
}

.number-btn.wiggle-2 {
    animation: wiggle-alt 3.5s infinite ease-in-out;
    animation-delay: 0.5s;
}

.number-btn.wiggle-3 {
    animation: wiggle 4s infinite ease-in-out;
    animation-delay: 1s;
}

.number-btn.wiggle-4 {
    animation: wiggle-alt 3.2s infinite ease-in-out;
    animation-delay: 1.5s;
}

.number-btn.wiggle-5 {
    animation: wiggle 3.8s infinite ease-in-out;
    animation-delay: 2s;
}

/* Pause wiggle animation when game is paused */
.number-btn.paused {
    animation-play-state: paused !important;
    pointer-events: none;
}

/* Prevent press effects when paused */
.number-btn.paused.pressing,
.number-btn.paused.releasing {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}
