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

:root {
    --primary: #06B6D4;
    --background: #F8FAFC;
    --surface: #FFF;
    --text: #1E293B;
    --success: #10B981;
    --code-bg: #1E293B;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #06B6D4 0%, #8B5CF6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#game-container {
    width: 100%;
    max-width: 450px;
    background: var(--surface);
    border-radius: 24px;
    overflow: hidden;
}

#game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--background);
}

.game-title {
    font-weight: 700;
    font-size: 18px;
}

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

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

.stat-label {
    font-size: 11px;
    color: #64748B;
    text-transform: uppercase;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
}

#game-area {
    padding: 20px;
}

.instruction {
    text-align: center;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 16px;
    padding: 12px;
    background: #ECFEFF;
    border-radius: 12px;
}

.challenge {
    text-align: center;
    padding: 20px;
    background: #F0FDF4;
    border-radius: 16px;
    margin-bottom: 16px;
}

#target {
    font-size: 18px;
    font-weight: 600;
}

.code-area {
    background: var(--code-bg);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    color: #F8FAFC;
    font-family: 'Courier New', monospace;
}

.code-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.code-line input {
    width: 50px;
    padding: 8px;
    font-size: 18px;
    text-align: center;
    border: none;
    border-radius: 8px;
    background: #475569;
    color: white;
}

.code-block {
    padding: 12px 24px;
    background: #334155;
    border-radius: 8px;
    margin-left: 24px;
    font-size: 24px;
    text-align: center;
}

.preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: var(--background);
    border-radius: 12px;
    margin-bottom: 16px;
    min-height: 60px;
    justify-content: center;
}

.preview-item {
    font-size: 24px;
    animation: popIn 0.2s ease;
}

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

    to {
        transform: scale(1);
    }
}

.btn-primary {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.stars {
    font-size: 48px;
    margin-bottom: 16px;
}

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

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.result-label {
    font-size: 14px;
    color: #64748B;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-secondary {
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #E5E7EB;
    background: var(--background);
    color: var(--text);
}