* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    touch-action: manipulation;
    user-select: none;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 600;
}

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

.stat-label {
    font-size: 0.9rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #DA70D6;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 12px;
    background: #3a3a4a;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #DA70D6, #BA55D3);
    border-radius: 6px;
    transition: width 0.1s linear;
    width: 100%;
}

.progress-bar.warning {
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
}

/* Message Display */
.message {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.message.success {
    color: #DA70D6;
}

.message.error {
    color: #ff6b6b;
}

/* Game Grid */
.game-grid {
    display: grid;
    gap: 15px;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    margin-bottom: 30px;
}

.game-grid.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.game-grid.grid-3x4 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    aspect-ratio: 3/4;
}

.game-grid.grid-4x4 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.game-grid.grid-5x4 {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    aspect-ratio: 5/4;
}

.game-grid.grid-5x5 {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
}

/* Circles */
.circle {
    background: #3a3a4a;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s ease;
    aspect-ratio: 1;
    min-width: 60px;
    min-height: 60px;
}

.circle:active {
    transform: scale(0.95);
}

.circle.active {
    background: linear-gradient(135deg, #FF0080, #FF8C00, #FFD700, #00FF7F, #00CED1, #4169E1, #9400D3);
    animation: pulse 1s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.circle.active::after {
    content: '🦄';
}

.circle.wrong {
    background: #ff6b6b !important;
    animation: shake 0.3s ease-in-out;
}

.circle.success {
    background: linear-gradient(135deg, #FF0080, #FF8C00, #FFD700, #00FF7F, #00CED1, #4169E1, #9400D3);
    animation: pop 0.2s ease-out;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px #FF0080, 0 0 30px rgba(255, 140, 0, 0.4), 0 0 25px rgba(0, 255, 127, 0.3);
    }
    50% {
        box-shadow: 0 0 40px #FF0080, 0 0 60px rgba(255, 140, 0, 0.6), 0 0 80px rgba(0, 206, 209, 0.4), 0 0 50px rgba(65, 105, 225, 0.3);
    }
}

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

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

/* Start Button */
.start-button {
    background: linear-gradient(135deg, #DA70D6, #BA55D3);
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(218, 112, 214, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.start-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(218, 112, 214, 0.6);
}

.start-button:active {
    transform: scale(0.98);
}

.start-button.hidden {
    display: none;
}

/* Game Over Overlay */
.game-over-stats {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-top: 10px;
}
