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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.level {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    color: #667eea;
}

.game-box, .input-box, .config {
    margin-bottom: 20px;
}

.config label, .input-box label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.difficulty-btn {
    padding: 10px;
    font-size: 14px;
    background: #ddd;
    color: #333;
    border: 2px solid #999;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0;
}

.difficulty-btn:hover {
    background: #ccc;
}

.difficulty-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.number-display {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    color: #667eea;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 8px;
    min-height: 60px;
}

input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
}

input:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

button {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}

button:hover {
    background: #764ba2;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.result {
    text-align: center;
    margin-top: 20px;
    font-size: 18px;
    color: #333;
}

.hidden {
    display: none;
}

.leave-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    background: #ff6b6b;
    margin-top: 0;
    margin-bottom: 20px;
    float: right;
}

.leave-btn:hover {
    background: #ff5252;
}

.restart-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    background: #51cf66;
    margin-top: 10px;
    margin-right: 10px;
    display: inline-block;
}

.restart-btn:hover {
    background: #40c057;
}

.back-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    background: #667eea;
    margin-top: 10px;
    display: inline-block;
}

.back-btn:hover {
    background: #764ba2;
}

#mathMode {
    margin-right: 10px;
    cursor: pointer;
}

.config label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
    cursor: pointer;
}

.math-box {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #ffc107;
}

.math-problem {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #333;
    margin: 15px 0;
}

#mathAnswer {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

#mathSubmitButton {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    background: #ffc107;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 0;
    margin-bottom: 10px;
}

#mathSubmitButton:hover {
    background: #ffb300;
}

.math-result {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
}