/* Base styles */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    overscroll-behavior: none;
}

/* Font */
.font-geist-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Game mode cards */
.game-mode-card {
    background-color: #1c1c1e;
    border: 1px solid #2c2c2e;
    border-radius: 8px;
    padding: 0.875rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-mode-card:hover {
    background-color: #2c2c2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #3c3c3e;
}

.game-mode-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Color tiles */
.color-tile {
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: relative;
}

.color-tile:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.color-tile:active {
    transform: scale(0.97);
}

/* Custom range slider */
.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #323236;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.custom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.custom-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Grid size buttons */
.grid-size-button {
    background-color: #2c2c2e;
    color: #a0a0a0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.grid-size-button:hover {
    background-color: #3c3c3e;
    color: #d0d0d0;
}

.grid-size-button.active {
    background-color: #4a4a4c;
    color: white;
    border: 1px solid #6a6a6c;
}

/* Toggle switch */
#soundToggle:checked + .toggle-label {
    background-color: #6366f1;
}

#soundToggle:checked + .toggle-label:before {
    transform: translateX(1.5rem);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); opacity: 0.9; }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.shake-animation {
    animation: shake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Timer animation */
@keyframes countdown {
    from { width: 100%; }
    to { width: 0%; }
}

.timer-animation {
    animation: countdown linear forwards;
}

/* Level up animation */
@keyframes levelUp {
    0% { transform: scale(1); color: white; }
    50% { transform: scale(1.2); color: #34d399; }
    100% { transform: scale(1); color: white; }
}

.level-up-animation {
    animation: levelUp 0.8s ease-in-out;
}

/* Media queries */
@media (max-width: 640px) {
    .color-tile:hover {
        transform: scale(1.02);
    }
}
