/* Color Sequence Recall Game Styles */

:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --accent-color: #00d4ff;
    --correct-color: #00ff41;
    --wrong-color: #ff0033;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #2a2a4e;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    width: 100%;
    max-width: 800px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--primary-bg);
}

/* Header Styles */
.game-header {
    background: var(--secondary-bg);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--border-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.back-button {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.2s;
}

.back-button:hover {
    transform: translateX(-3px);
}

.game-title {
    font-size: 1.5rem;
    margin: 0;
    flex: 1;
    text-align: center;
    min-width: 200px;
}

.header-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
}

/* Main Game Area */
.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: relative;
}

/* Screen Management */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.screen.active {
    display: flex;
}

.screen-title {
    font-size: 2rem;
    margin: 0;
    text-align: center;
    color: var(--accent-color);
}

.screen-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: -1rem 0 0 0;
    text-align: center;
}

/* Difficulty Selection */
.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

.difficulty-btn {
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.difficulty-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.difficulty-icon {
    font-size: 2rem;
}

.difficulty-name {
    font-size: 1.5rem;
    font-weight: bold;
}

.difficulty-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Status Message */
.status-message {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    background: var(--secondary-bg);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.status-message.watching {
    color: var(--accent-color);
    animation: pulse 1.5s infinite;
}

.status-message.your-turn {
    color: var(--correct-color);
}

.status-message.correct {
    background: var(--correct-color);
    color: var(--primary-bg);
    animation: celebrate 0.5s;
}

.status-message.wrong {
    background: var(--wrong-color);
    color: var(--text-primary);
    animation: shake 0.5s;
}

/* Color Display Area */
.color-display-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.color-display {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 20px;
    border: 4px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: var(--secondary-bg);
    transition: all 0.3s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.color-display.active {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.color-display.fade-in {
    animation: fadeIn 0.15s ease-in;
}

.color-display.fade-out {
    animation: fadeOut 0.15s ease-out;
}

/* Progress Indicator */
.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.progress-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
}

.progress-dots {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 30px;
}

.progress-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.progress-dot.filled {
    border-color: var(--accent-color);
    transform: scale(1.1);
}

.progress-dot.correct {
    background: var(--correct-color);
    border-color: var(--correct-color);
    animation: pop 0.3s;
}

.progress-dot.wrong {
    background: var(--wrong-color);
    border-color: var(--wrong-color);
    animation: shake 0.3s;
}

/* Color Buttons */
.color-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.color-btn {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.color-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.color-btn:active:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
}

.color-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.color-btn.pulse {
    animation: colorPulse 0.3s;
}

/* Game Controls */
.controls,
.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: auto;
    padding-top: 2rem;
}

.control-btn {
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--secondary-bg);
    border: 2px solid var(--accent-color);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideUp 0.3s;
}

.modal-title {
    text-align: center;
    margin: 0;
    font-size: 2rem;
    color: var(--accent-color);
}

.modal-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-stat {
    background: var(--primary-bg);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.modal-stat.highlight {
    border: 2px solid var(--accent-color);
    grid-column: 1 / -1;
}

.modal-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-color);
}

.modal-message {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    padding: 1rem;
    background: var(--primary-bg);
    border-radius: 8px;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-btn {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--primary-bg);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
}

.modal-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.modal-btn.primary {
    background: var(--accent-color);
    color: var(--primary-bg);
    border-color: var(--accent-color);
}

.modal-btn.primary:hover {
    background: #00b8e6;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes colorPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1.1);
    }
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.05) rotate(2deg);
    }
    75% {
        transform: scale(1.05) rotate(-2deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header {
        padding: 0.75rem 1rem;
    }

    .game-title {
        font-size: 1.2rem;
    }

    .header-stats {
        gap: 0.5rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .screen-title {
        font-size: 1.5rem;
    }

    .color-display {
        font-size: 3rem;
    }

    .color-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .game-main {
        padding: 1rem;
    }

    .header-stats {
        width: 100%;
        justify-content: space-around;
    }

    .color-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .difficulty-btn {
        padding: 1rem;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}
