:root {
    --primary-color: #3b82f6;
    --secondary-color: #60a5fa;
    --accent-color: #f59e0b;
    --background-color: #f0f9ff;
    --text-color: #1e293b;
    --success-color: #22c55e;
    --error-color: #ef4444;
}

* {
    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;
}

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

.game-title {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

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

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 10px;
}

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

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

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* Main Game Area */
#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    background-color: #f8fafc;
}

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

.grid-container {
    display: grid;
    gap: 10px;
    background-color: #e2e8f0;
    padding: 15px;
    border-radius: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.grid-item {
    background-color: white;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    user-select: none;
    aspect-ratio: 1;
}

.grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1);
}

.grid-item:active {
    transform: translateY(1px);
}

.grid-item.revealed {
    /* No special style needed for revealed, just showing the content */
}

.grid-item.correct {
    background-color: #dcfce7;
    border: 2px solid var(--success-color);
    animation: pulse-green 0.5s;
}

.grid-item.wrong {
    background-color: #fee2e2;
    border: 2px solid var(--error-color);
    animation: shake 0.5s;
}

.grid-item.hidden-content span {
    visibility: hidden;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    transition: transform 0.2s, background-color 0.2s;
    margin-top: 20px;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

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

.btn-secondary {
    background-color: white;
    color: var(--text-color);
    border: 2px solid #e2e8f0;
    padding: 12px 24px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.hidden {
    display: none !important;
}

/* Modal Styles */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    width: 400px;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stars {
    font-size: 3rem;
    margin-bottom: 20px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 25px 0;
}

.result-stat {
    display: flex;
    flex-direction: column;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

    to {
        opacity: 1;
    }
}

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

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

@keyframes pulse-green {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}