body {
    background: radial-gradient(circle at 20% 20%, #eef5ff, #f7f4ff 50%, #f4fff6 100%);
}

.mindmap-hero {
    padding: 3rem 0 1rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    align-items: center;
}

.hero-copy h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.hero-copy p {
    color: #334155;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.muted {
    color: #6b7280;
}

.small {
    font-size: 0.9rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hero-panel {
    justify-self: end;
    width: 100%;
}

.hero-panel-inner {
    background: white;
    border-radius: 18px;
    box-shadow: 0 16px 60px rgba(15, 23, 42, 0.1);
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.panel-header,
.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.panel-footer {
    margin-top: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.stat-pill {
    background: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(14, 165, 233, 0.28);
}

.stat-pill:nth-child(2) {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.stat-pill:nth-child(3) {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

.stat-pill:nth-child(4) {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
}

.stat-label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.mindmap-stage {
    padding: 1rem 0 3rem;
}

.control-bar {
    background: #0f172a;
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
}

.level-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.level-name {
    font-weight: 800;
    font-size: 1.1rem;
}

.status-badge {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.control-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-ghost,
.ghost-btn {
    background: transparent;
    border: 1px solid #0f172a;
    color: #0f172a;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.btn-ghost:hover,
.ghost-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.control-bar .btn-ghost,
.control-bar .ghost-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.24);
    color: white;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #e5f1ff;
    color: #0f172a;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}

.chip.ghost-btn {
    padding: 0.35rem 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.16);
    min-width: 34px;
    justify-content: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: #e6f4ff;
    color: #0f172a;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}

.new-pill {
    background: #0f172a;
    color: white;
}

.score-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.score-chip {
    background: white;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    font-weight: 700;
    color: #0f172a;
}

.score-chip.accent {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    color: white;
    border: none;
}

.mindmap-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 1.5rem;
}

.board-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
}

.board-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.topic-label {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.progress-block {
    min-width: 220px;
}

.progress-count {
    font-weight: 700;
    color: #0f172a;
}

.progress-bar {
    background: #f1f5f9;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    margin-top: 0.4rem;
}

.progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    transition: width 0.25s ease;
}

.map-board {
    position: relative;
    margin-top: 1rem;
    min-height: 520px;
    border-radius: 16px;
    background: radial-gradient(circle at 30% 30%, #f8fbff, #e9f3ff 70%);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    touch-action: manipulation;
}

.pause-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    left: auto;
    z-index: 100;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.pause-btn:hover {
    transform: scale(1.08);
    background: rgba(15, 23, 42, 1);
}

.pause-btn:active {
    transform: scale(0.95);
}

.pause-overlay {
    position: absolute;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    border-radius: 16px;
}

.pause-overlay.hidden {
    display: none;
}

.pause-overlay h2 {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
}

.pause-overlay .resume-btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
}

.pause-overlay .resume-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.45);
}

.pause-overlay .resume-btn:active {
    transform: translateY(0);
}

.map-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.map-lines line {
    stroke: #0ea5e9;
    stroke-width: 3.5;
    stroke-linecap: round;
    opacity: 0.9;
}

.node-layer {
    position: absolute;
    inset: 0;
}

.map-node {
    position: absolute;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.7rem 0.9rem;
    min-width: 120px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border 0.18s ease;
    user-select: none;
    text-align: center;
    touch-action: manipulation;
}

.map-node .label {
    font-weight: 800;
    color: #0f172a;
    display: block;
}

.map-node .note {
    display: block;
    font-size: 0.85rem;
    color: #475569;
    margin-top: 0.2rem;
}

.map-node:hover {
    transform: translate(-50%, -50%) translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.map-node.selected {
    border-color: #0ea5e9;
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.25);
}

.map-node.linked {
    border-color: #22c55e;
    background: #f0fdf4;
}

.map-node.hint {
    animation: pulseHint 1s ease-in-out infinite;
    border-color: #f97316;
}

.map-node.core {
    background: linear-gradient(135deg, #0ea5e9, #22d3ee);
    color: white;
    border-color: #0284c7;
}

.map-node.core .label,
.map-node.core .note {
    color: white;
}

.map-node.example {
    background: #fff7ed;
    border-color: #fdba74;
}

.map-node.challenge {
    background: #fef2f2;
    border-color: #f87171;
}

.map-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.7rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.9));
    text-align: center;
    padding: 1.25rem;
    color: #0f172a;
    font-weight: 700;
}

.map-overlay.hidden {
    display: none;
}

.overlay-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.board-footer {
    margin-top: 0.8rem;
    padding: 0.9rem 1rem;
    background: #0f172a;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    min-height: 52px;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card {
    background: white;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.target-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.target-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    border: 1px dashed #cbd5e1;
}

.target-list .done {
    color: #16a34a;
    font-weight: 800;
}

.spotlight-body {
    color: #0f172a;
    font-weight: 600;
    line-height: 1.5;
}

.quiz-card {
    background: linear-gradient(180deg, #0f172a, #111827);
    color: white;
}

.quiz-question {
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.quiz-options button {
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.quiz-options button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
}

.quiz-feedback {
    margin-top: 0.5rem;
    font-weight: 700;
}

.meta-list {
    padding-left: 1rem;
    color: #0f172a;
    font-weight: 600;
}

.meta-list li + li {
    margin-top: 0.35rem;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

.overlay-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem 2rem 1.5rem 1.5rem;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    text-align: center;
    position: relative;
}

.end-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: #22c55e;
    color: white;
    border-radius: 999px;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.control-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.overlay-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-weight: 800;
}

.overlay-close:hover {
    background: #e2e8f0;
}

@keyframes pulseHint {
    0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.45); }
    70% { box-shadow: 0 0 0 12px rgba(249, 115, 22, 0); }
    100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

@media (max-width: 1024px) {
    .mindmap-grid {
        grid-template-columns: 1fr;
    }

    .map-board {
        min-height: 440px;
    }
}

@media (max-width: 768px) {
    .control-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .board-head {
        flex-direction: column;
    }

    .board-footer {
        font-size: 0.95rem;
    }
}
