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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

#game-container {
    width: 100%;
    max-width: 550px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.game-title {
    font-size: 1.3rem;
    font-weight: 700;
}

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

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

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

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

#game-area {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #EDE9FE, #DDD6FE);
    border-radius: 12px;
    border-left: 4px solid #8B5CF6;
}

.task-icon {
    font-size: 1.5rem;
}

.task-text {
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
}

.code-editor {
    background: #1F2937;
    border-radius: 12px;
    overflow: hidden;
}

.editor-header {
    background: #374151;
    color: #9CA3AF;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 500;
}

.code-lines {
    padding: 16px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
}

.code-line {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.code-line:hover {
    background: rgba(255, 255, 255, 0.1);
}

.line-number {
    color: #6B7280;
    width: 30px;
    flex-shrink: 0;
}

.line-code {
    color: #E5E7EB;
}

.line-code .keyword {
    color: #F472B6;
}

.line-code .string {
    color: #86EFAC;
}

.line-code .number {
    color: #FCD34D;
}

.line-code .comment {
    color: #6B7280;
    font-style: italic;
}

.code-line.bug {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #EF4444;
}

.code-line.found {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid #10B981;
    animation: pulse 0.5s;
}

.bug-icon {
    position: absolute;
    right: 10px;
    font-size: 1.2rem;
}

.hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #FEF3C7;
    border-radius: 8px;
    color: #92400E;
    font-size: 0.9rem;
}

.btn-hint {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6B7280;
    background: #F3F4F6;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    align-self: center;
}

.btn-hint:hover {
    background: #E5E7EB;
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

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

.modal-content h2 {
    font-size: 1.8rem;
    color: #1F2937;
    margin-bottom: 20px;
}

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

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

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #10B981;
}

.result-label {
    font-size: 0.9rem;
    color: #6B7280;
}

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

.btn-primary {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #10B981, #059669);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    background: #F3F4F6;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

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

@keyframes pulse {

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

    50% {
        transform: scale(1.02);
    }
}