:root {
    --primary-color: #8b5cf6;
    /* Violet */
    --secondary-color: #a78bfa;
    --accent-color: #f59e0b;
    --background-color: #f5f3ff;
    --text-color: #4c1d95;
}

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

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

#game-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 600px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#game-header {
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 8px;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.9;
}

.stat-value {
    font-weight: bold;
    font-family: monospace;
    font-size: 1.2rem;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
}

#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 30px;
}

.display-area {
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sequence-display {
    font-size: 4rem;
    height: 100px;
    display: flex;
    gap: 20px;
    transition: all 0.3s;
}

.seq-item {
    width: 100px;
    height: 100px;
    background-color: white;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #ddd;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.instruction {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
    text-align: center;
    min-height: 40px;
}

.input-area {
    width: 100%;
    display: flex;
    justify-content: center;
}

.grid-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 600px;
}

.option-btn {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
    background-color: white;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 4px 0 var(--secondary-color);
}

.option-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0;
}

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 320px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.1s;
    margin-top: 15px;
}

.btn-secondary {
    background-color: transparent;
    color: #64748b;
    border: 2px solid #cbd5e1;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 10px;
}