.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

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

h1 {
    flex: 1;
    text-align: center;
    color: #333;
    margin: 0;
}

.game-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mode-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-selector label {
    color: #666;
    font-weight: bold;
}

.mode-selector select,
.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
    border: none;
    font-weight: bold;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #f44336;
    color: white;
    border: none;
    font-weight: bold;
}

.btn-secondary:hover {
    background: #da190b;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

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

.info-item .label {
    color: #666;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
}

.info-item .value {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
}

.game-status {
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #666;
    font-weight: bold;
}

.game-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
    min-height: 300px;
    padding: 20px;
    background: #fafafa;
    border-radius: 5px;
}

.cotton-button {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fff8e1;
    cursor: pointer;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.cotton-button:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.cotton-button.target {
    background: #4CAF50;
    border-color: #45a049;
    animation: pulse 0.3s ease;
}

.cotton-button.wrong {
    background: #f44336;
    border-color: #da190b;
    animation: shake 0.3s ease;
}

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

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

.game-result {
    text-align: center;
    padding: 30px;
    background: #f5f5f5;
    border-radius: 10px;
    border: 2px solid #4CAF50;
}

.game-result h2 {
    color: #333;
    margin-top: 0;
}

.game-result p {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}

.game-result .btn-primary {
    margin-top: 20px;
}

@media (max-width: 600px) {
    .container {
        margin: 10px;
        padding: 15px;
    }

    .game-info {
        gap: 20px;
    }

    .game-area {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 8px;
        min-height: auto;
    }

    h1 {
        font-size: 24px;
    }
}
