:root {
    --bg-dark: #0a0814;
    --bg-card: #120e26;
    --bg-card-border: #241c42;
    --accent-purple: #a855f7;
    --accent-cyan: #00f0ff;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    line-height: 1.5;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 18px;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    padding: 16px 24px;
    border-radius: 12px;
}

.badge-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 4px;
}

.app-header h1 {
    font-size: 1.6rem;
    letter-spacing: 1px;
    font-weight: 900;
}

.accent-purple { color: var(--accent-purple); }

.level-indicator { display: flex; align-items: center; gap: 12px; }

.level-pill {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid var(--accent-cyan);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.streak-pill {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-gold);
}

.header-actions { display: flex; gap: 10px; }

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--bg-card-border);
    background: #1e1738;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.btn:hover { background: #2a204d; border-color: var(--accent-purple); }
.btn-primary { background: var(--accent-purple); color: #fff; font-weight: 700; border: none; }
.btn-primary:hover { background: #9333ea; }
.btn-gold { background: var(--accent-gold); color: #000; font-weight: 700; border: none; }
.btn-gold:hover { background: #d97706; color: #fff; }
.btn-secondary { background: #17122e; color: var(--text-muted); }
.btn-mic { background: rgba(2, 132, 199, 0.2); border-color: #0284c7; color: #38bdf8; }

/* Category Selector */
.category-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .category-selector { grid-template-columns: repeat(2, 1fr); }
}

.cat-btn {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    color: var(--text-muted);
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cat-btn:hover { background: #1a1438; color: var(--text-main); border-color: var(--accent-purple); }
.cat-btn.active { background: #241645; color: #fff; border-color: var(--accent-purple); box-shadow: 0 0 15px rgba(168, 85, 247, 0.2); }

/* Main Grid */
.puzzle-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    flex: 1;
}

@media (max-width: 1000px) {
    .puzzle-grid { grid-template-columns: 1fr; }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.workspace-header h3 { font-size: 1.1rem; color: var(--accent-purple); }

.verification-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.15);
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Puzzle Box */
.puzzle-box {
    background: #0d091a;
    border: 1px solid var(--accent-purple);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.puzzle-question {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--text-main);
}

.rule-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.answer-group { display: flex; gap: 10px; }

.answer-group input {
    flex: 1;
    background: #17122e;
    border: 1px solid var(--bg-card-border);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-mono);
}

/* Tutor Card */
.tutor-card {
    background: #0d091a;
    border: 1px solid var(--bg-card-border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tutor-header { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-cyan); }
.tag-correct { color: var(--accent-green); font-weight: 700; }
.tag-incorrect { color: var(--accent-red); font-weight: 700; }

.tutor-body { font-size: 0.88rem; line-height: 1.5; color: var(--text-muted); }

/* Verifier Panel */
.panel-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 8px; }
.panel-header h3 { font-size: 0.95rem; color: var(--accent-purple); }
.json-tag { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-cyan); background: rgba(0, 240, 255, 0.15); padding: 2px 6px; border-radius: 10px; }

.json-code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #c084fc;
    background: #070512;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    white-space: pre-wrap;
    max-height: 220px;
    overflow-y: auto;
}

.stats-box {
    background: #0d091a;
    border: 1px solid var(--bg-card-border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-box h4 { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-gold); }
.stat-item { display: flex; justify-content: space-between; font-size: 0.82rem; font-family: var(--font-mono); color: var(--text-muted); }
.stat-item strong { color: var(--text-main); }

/* Author Details Footer */
.author-footer {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.footer-card {
    background: rgba(13, 21, 37, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 28px;
    text-align: center;
    max-width: 850px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.developed-by { font-size: 0.9rem; color: #94a3b8; }
.developed-by .author-name { color: #00f0ff; font-weight: 700; }
.developed-by .heart { color: #ef4444; display: inline-block; animation: heartPulse 1.5s infinite; }
@keyframes heartPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.footer-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; }
.footer-link { color: #00f0ff; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.footer-links .dot { color: #475569; }
.tech-badges { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.badge-pill { background: rgba(6, 182, 212, 0.08); border: 1px solid rgba(6, 182, 212, 0.3); color: #38bdf8; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-family: var(--font-mono); display: inline-flex; align-items: center; gap: 4px; }
.copyright-text { font-size: 0.75rem; color: #64748b; }
