/* ===== Simon Game Styles ===== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

/* ===== Screen Management ===== */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Main Menu ===== */
.menu-content {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.game-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: bold;
}

.game-emoji {
    font-size: 4rem;
    margin: 20px 0;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.difficulty-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 20px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.difficulty-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.difficulty-btn:active {
    transform: translateY(-1px);
}

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

.difficulty-info {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stars {
    font-size: 1.2rem;
}

.instructions {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.instructions p {
    color: #555;
    margin: 5px 0;
    line-height: 1.6;
}

.back-btn {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #f0f0f0;
}

/* ===== Game Board ===== */
#game-board {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

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

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
}

.icon-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.icon-btn.muted {
    opacity: 0.5;
}

.game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-message {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 30px;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-message.watching {
    color: #667eea;
    animation: pulse 1s ease infinite;
}

.status-message.playing {
    color: #2ecc71;
}

.status-message.error {
    color: #e74c3c;
    animation: shake 0.5s ease;
}

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

/* ===== Simon Board ===== */
.simon-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
    max-width: 450px;
    width: 100%;
}

.simon-button {
    position: relative;
    aspect-ratio: 1;
    border: 4px solid rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    overflow: hidden;
    min-height: 150px;
}

.simon-button:disabled {
    cursor: not-allowed;
}

.simon-button:not(:disabled):hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.simon-button:not(:disabled):active {
    transform: scale(0.98);
}

.button-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0);
    pointer-events: none;
    transition: all 0.15s ease;
}

/* Simon Button Colors */
.simon-button.red {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.simon-button.blue {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.simon-button.green {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.simon-button.yellow {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

/* Active/Lit State */
.simon-button.active {
    filter: brightness(1.5);
    transform: scale(1.08);
    box-shadow: 0 0 30px currentColor;
}

.simon-button.active .button-glow {
    background: rgba(255, 255, 255, 0.4);
}

.simon-button.red.active {
    box-shadow: 0 0 40px #e74c3c;
}

.simon-button.blue.active {
    box-shadow: 0 0 40px #3498db;
}

.simon-button.green.active {
    box-shadow: 0 0 40px #2ecc71;
}

.simon-button.yellow.active {
    box-shadow: 0 0 40px #f39c12;
}

/* Error Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.simon-button.error {
    animation: shake 0.5s ease;
    filter: brightness(0.7);
}

/* ===== Buttons ===== */
.primary-btn,
.secondary-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.primary-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
}

.secondary-btn {
    background: #e0e0e0;
    color: #2c3e50;
}

.secondary-btn:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

#exit-btn {
    margin-top: 10px;
}

/* ===== Game Over Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.modal-emoji {
    font-size: 4rem;
    margin: 20px 0;
}

.final-stats {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
}

.final-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.final-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.final-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.new-record {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
    font-weight: bold;
    font-size: 1.1rem;
    animation: celebration 0.6s ease;
}

.new-record.hidden {
    display: none;
}

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

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-buttons button {
    flex: 1;
}

/* ===== Responsive Design ===== */
@media (max-width: 600px) {
    .game-title {
        font-size: 2rem;
    }

    .game-emoji {
        font-size: 3rem;
    }

    .difficulty-name {
        font-size: 1.1rem;
    }

    .difficulty-info {
        font-size: 0.8rem;
    }

    .simon-board {
        gap: 10px;
        max-width: 350px;
    }

    .simon-button {
        min-height: 120px;
        border-radius: 15px;
    }

    .status-message {
        font-size: 1.1rem;
    }

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

    .modal-content {
        padding: 30px 20px;
    }

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

@media (max-width: 400px) {
    body {
        padding: 10px;
    }

    .menu-content,
    #game-board {
        padding: 20px 15px;
    }

    .simon-board {
        max-width: 280px;
    }

    .simon-button {
        min-height: 100px;
        border-radius: 12px;
    }

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

/* ===== Keyboard Hints (Desktop only) ===== */
@media (min-width: 768px) {
    .simon-button::before {
        content: attr(data-key);
        position: absolute;
        top: 10px;
        left: 10px;
        background: rgba(0, 0, 0, 0.3);
        color: white;
        padding: 5px 10px;
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: bold;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .simon-button:hover::before {
        opacity: 1;
    }
}
