/* ===== PINK TRAP CONSOLE — DESIGN SYSTEM ===== */
:root {
    /* Core palette: deep purple-black + hot pink */
    --bg-deep: #0A0A12;
    --bg-panel: #12121E;
    --bg-surface: #1A1A2E;
    --bg-elevated: #222238;

    --pink-hot: #FF2D6B;
    --pink-glow: #FF6B9D;
    --pink-dim: rgba(255, 45, 107, 0.12);
    --pink-border: rgba(255, 45, 107, 0.25);

    --cyan-accent: #4DEEEA;
    --purple-accent: #A855F7;

    --text-primary: #F0E6F6;
    --text-secondary: #9B8A9E;
    --text-muted: #6B5A6E;
    --white: #FFFFFF;

    --match-1: #FF4D6A;
    --match-2: #FFB020;
    --match-3: #A855F7;
    --match-4: #38BDF8;
    --match-5: #34D399;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(255, 45, 107, 0.15);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--bg-deep);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Noto Serif SC', serif;
    font-weight: 900;
    line-height: 1.3;
}

/* ===== SCANLINES OVERLAY ===== */
.scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* ===== SCREEN SYSTEM ===== */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

#titleScreen.active,
#endScreen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 45, 107, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 45, 107, 0); }
}

@keyframes glitchFlicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; transform: translateX(2px); }
    94% { opacity: 1; transform: translateX(-1px); }
    95% { opacity: 0.9; }
    96% { opacity: 1; transform: translateX(0); }
}

@keyframes scanReveal {
    from { background-position: -100% 0; }
    to { background-position: 200% 0; }
}

/* ===== TITLE SCREEN ===== */
#titleScreen {
    background: var(--bg-deep);
    text-align: center;
    padding: 40px 24px;
}

.title-bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse 60% 50% at 50% 50%, rgba(255, 45, 107, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 80% 20%, rgba(168, 85, 247, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 30% 40% at 15% 80%, rgba(77, 238, 234, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.title-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.title-label {
    color: var(--pink-hot);
    font-size: 0.75rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0.7;
    font-family: monospace, 'Noto Sans SC';
}

.game-title {
    font-size: clamp(3rem, 8vw, 5rem);
    background: linear-gradient(135deg, #FF2D6B, #FF6B9D, #A855F7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: 0.08em;
    animation: glitchFlicker 8s infinite;
}

.game-subtitle {
    font-family: 'Noto Serif SC', serif;
    color: rgba(240, 230, 246, 0.6);
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    margin-bottom: 40px;
    letter-spacing: 0.15em;
}

.title-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 2;
    margin-bottom: 48px;
}

.title-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-start {
    display: inline-block;
    background: transparent;
    color: var(--pink-hot);
    border: 1.5px solid var(--pink-hot);
    padding: 16px 48px;
    border-radius: 4px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.15em;
    font-family: 'Noto Sans SC', sans-serif;
    text-transform: uppercase;
}

.btn-start:hover {
    background: var(--pink-hot);
    color: var(--bg-deep);
    box-shadow: 0 0 30px rgba(255, 45, 107, 0.4);
    transform: translateY(-2px);
}

.btn-continue {
    background: var(--pink-hot);
    color: var(--bg-deep);
    box-shadow: 0 0 20px rgba(255, 45, 107, 0.3);
}

.title-footnote {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 1px;
    font-family: monospace, 'Noto Sans SC';
}

/* ===== STAGE SCREEN ===== */
#stageScreen {
    background: var(--bg-deep);
}

/* Top Bar */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-panel);
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--pink-border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.progress-wrapper {
    flex: 1;
}

.progress-bar {
    height: 3px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pink-hot), var(--pink-glow));
    border-radius: 2px;
    transition: width 0.6s ease;
    width: 0%;
    box-shadow: 0 0 8px rgba(255, 45, 107, 0.4);
}

.progress-dots {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.progress-dot {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--bg-surface);
    transition: all 0.3s;
    white-space: nowrap;
    font-family: monospace, 'Noto Sans SC';
    border: 1px solid transparent;
}

.progress-dot.completed {
    background: var(--pink-hot);
    color: var(--bg-deep);
    border-color: var(--pink-hot);
}

.progress-dot.current {
    background: var(--bg-surface);
    color: var(--pink-hot);
    border-color: var(--pink-hot);
    font-weight: 700;
    animation: pulse 2s infinite;
}

.btn-exit {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-exit:hover {
    border-color: var(--pink-hot);
    color: var(--pink-hot);
}

/* ===== PHASES ===== */
.phase {
    display: none;
    padding: 32px 20px 60px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

.phase.active {
    display: block;
    animation: slideUp 0.4s ease;
}

/* ===== INTRO PHASE ===== */
#introPhase {
    text-align: center;
}

.age-badge {
    display: inline-block;
    background: var(--bg-surface);
    color: var(--pink-hot);
    font-family: monospace, 'Noto Serif SC', serif;
    font-size: 1.4rem;
    font-weight: 900;
    padding: 8px 28px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--pink-border);
    box-shadow: var(--shadow-glow);
    letter-spacing: 2px;
}

.stage-title {
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.4;
}

.scene-text {
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 2;
    margin-bottom: 32px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.quote-box {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 36px;
    border: 1px solid var(--pink-border);
    text-align: left;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    box-shadow: var(--shadow-glow);
}

.scan-tag {
    font-size: 0.72rem;
    color: var(--pink-hot);
    font-family: monospace, 'Noto Sans SC';
    letter-spacing: 1px;
    margin-bottom: 14px;
    text-transform: uppercase;
    opacity: 0.8;
}

.speaker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.speaker-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    filter: blur(2px);
    opacity: 0.5;
}

.speaker-name {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
}

.quote-box blockquote {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.9;
    border-left: 2px solid var(--pink-hot);
    padding-left: 16px;
}

.btn-action {
    display: inline-block;
    background: var(--pink-hot);
    color: var(--bg-deep);
    border: none;
    padding: 14px 36px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Noto Sans SC', sans-serif;
    box-shadow: 0 0 20px rgba(255, 45, 107, 0.3);
    letter-spacing: 0.05em;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 45, 107, 0.5);
}

/* ===== PHASE HEADER ===== */
.phase-header {
    text-align: center;
    margin-bottom: 28px;
}

.phase-badge {
    display: inline-block;
    background: var(--bg-surface);
    color: var(--pink-hot);
    padding: 6px 18px;
    border-radius: 3px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
    border: 1px solid var(--pink-border);
    font-family: monospace, 'Noto Sans SC';
    text-transform: uppercase;
}

.phase-instruction {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.phase-instruction small {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ===== QUOTE REMINDER (always visible in Toulmin phase) ===== */
.quote-reminder {
    background: var(--bg-panel);
    border: 1px solid var(--pink-border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 24px;
    font-family: 'Noto Serif SC', serif;
    font-size: 0.95rem;
    color: var(--pink-glow);
    line-height: 1.8;
    position: relative;
}

.quote-reminder::before {
    content: '原句';
    position: absolute;
    top: -8px;
    left: 12px;
    background: var(--bg-panel);
    padding: 0 6px;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: monospace, 'Noto Sans SC';
    letter-spacing: 1px;
}

/* ===== MATCHING GAME ===== */
.matching-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
    position: relative;
}

.match-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.match-lines line {
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.6;
}

.match-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--bg-panel);
    cursor: pointer;
    transition: all 0.25s;
    font-size: 0.95rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    color: var(--text-primary);
}

.match-item:hover:not(.matched) {
    border-color: var(--pink-border);
    background: var(--bg-surface);
}

.match-marker {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    background: var(--bg-surface);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
    font-family: monospace;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.match-text {
    flex: 1;
}

/* Label selected state */
.label-item.selected {
    border-color: var(--pink-hot);
    background: var(--bg-surface);
    box-shadow: 0 0 0 2px rgba(255, 45, 107, 0.2);
    animation: pulse 1.5s infinite;
}

/* Matched states - 5 colors */
.match-item.matched {
    cursor: default;
}

.match-item.match-color-1 { border-color: var(--match-1); background: rgba(255, 77, 106, 0.1); }
.match-item.match-color-1 .match-marker { background: var(--match-1); color: var(--bg-deep); border-color: var(--match-1); }

.match-item.match-color-2 { border-color: var(--match-2); background: rgba(255, 176, 32, 0.1); }
.match-item.match-color-2 .match-marker { background: var(--match-2); color: var(--bg-deep); border-color: var(--match-2); }

.match-item.match-color-3 { border-color: var(--match-3); background: rgba(168, 85, 247, 0.1); }
.match-item.match-color-3 .match-marker { background: var(--match-3); color: var(--bg-deep); border-color: var(--match-3); }

.match-item.match-color-4 { border-color: var(--match-4); background: rgba(56, 189, 248, 0.1); }
.match-item.match-color-4 .match-marker { background: var(--match-4); color: var(--bg-deep); border-color: var(--match-4); }

.match-item.match-color-5 { border-color: var(--match-5); background: rgba(52, 211, 153, 0.1); }
.match-item.match-color-5 .match-marker { background: var(--match-5); color: var(--bg-deep); border-color: var(--match-5); }

/* Shake animation */
.shake {
    animation: shake 0.4s ease !important;
}

.match-item.shake {
    border-color: #EF4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Match status */
.match-status {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.match-count {
    font-weight: 800;
    color: var(--pink-hot);
    font-size: 1.1rem;
    font-family: monospace, 'Noto Sans SC';
}

.match-hint {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ===== CONCEPT CHOICES ===== */
.concept-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.concept-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.concept-card:hover:not(.correct):not(.wrong):not(.dimmed) {
    border-color: var(--pink-border);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.concept-name {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.concept-source {
    font-size: 0.88rem;
    color: var(--pink-glow);
    font-weight: 600;
    margin-bottom: 14px;
    font-family: monospace, 'Noto Sans SC';
}

.concept-brief {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.concept-card.correct {
    border-color: var(--match-5);
    background: rgba(52, 211, 153, 0.08);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.15);
    transform: translateY(-2px);
}

.concept-card.wrong {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.08);
}

.concept-card.dimmed {
    opacity: 0.3;
    transform: scale(0.98);
    pointer-events: none;
}

/* ===== EXPLANATION ===== */
.explanation-card {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    margin-bottom: 32px;
    border: 1px solid var(--pink-border);
    border-left: 3px solid var(--pink-hot);
    box-shadow: var(--shadow-glow);
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.explanation-badge {
    background: var(--pink-hot);
    color: var(--bg-deep);
    padding: 5px 14px;
    border-radius: 3px;
    font-size: 0.88rem;
    font-weight: 700;
}

.explanation-source {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
    font-family: monospace, 'Noto Sans SC';
}

.she-says-label {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--pink-hot);
    font-family: monospace, 'Noto Sans SC';
    letter-spacing: 2px;
    margin-bottom: 14px;
    padding: 3px 12px;
    border: 1px solid var(--pink-border);
    border-radius: 3px;
    opacity: 0.9;
}

.explanation-text p {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.explanation-text p:last-child {
    margin-bottom: 0;
}

.explanation-text strong {
    color: var(--white);
    font-weight: 700;
}

.explanation-text ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 12px;
}

.explanation-text li {
    padding: 6px 0 6px 18px;
    position: relative;
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-primary);
}

.explanation-text li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: var(--pink-hot);
    font-size: 0.8rem;
    top: 8px;
}

.explanation-actions {
    text-align: center;
}

/* ===== END SCREEN ===== */
#endScreen {
    background: var(--bg-deep);
    text-align: center;
    padding: 40px 24px;
}

.end-bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse 60% 50% at 50% 40%, rgba(255, 45, 107, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.end-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.end-badge {
    display: inline-block;
    background: var(--bg-surface);
    color: var(--pink-hot);
    padding: 6px 20px;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 24px;
    border: 1px solid var(--pink-border);
    font-family: monospace, 'Noto Sans SC';
    text-transform: uppercase;
}

.end-title {
    font-size: clamp(2rem, 6vw, 3rem);
    color: var(--text-primary);
    margin-bottom: 40px;
    line-height: 1.3;
}

.end-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 48px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: monospace, 'Noto Serif SC', serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--pink-hot);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.end-quote-box {
    background: var(--bg-panel);
    border: 1px solid var(--pink-border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 32px;
}

.end-quote-box blockquote {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-style: italic;
    opacity: 0.9;
}

.end-quote-box cite {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: normal;
}

.end-message {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 2;
    margin-bottom: 40px;
}

/* ===== MILESTONE ===== */
#milestonePhase {
    display: none;
    text-align: center;
    padding-top: 60px;
}

#milestonePhase.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    animation: slideUp 0.5s ease;
}

.milestone-card {
    max-width: 480px;
    width: 100%;
    padding: 48px 32px;
}

.milestone-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 12px rgba(255, 45, 107, 0.4));
}

.milestone-badge {
    display: inline-block;
    background: var(--bg-surface);
    color: var(--cyan-accent);
    padding: 5px 16px;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 20px;
    border: 1px solid rgba(77, 238, 234, 0.25);
    font-family: monospace, 'Noto Sans SC';
    text-transform: uppercase;
}

.milestone-title {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.milestone-range {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-family: monospace, 'Noto Sans SC';
    letter-spacing: 1px;
    margin-bottom: 36px;
}

.milestone-stats {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin-bottom: 32px;
}

.milestone-stats .stat-item {
    text-align: center;
}

.milestone-stats .stat-number {
    font-family: monospace, 'Noto Serif SC', serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--pink-hot);
    line-height: 1;
    margin-bottom: 6px;
}

.milestone-stats .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.milestone-message {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 40px;
    font-family: 'Noto Serif SC', serif;
    font-style: italic;
    opacity: 0.85;
}

/* ===== LEVEL SELECT ===== */
#levelScreen {
    background: var(--bg-deep);
    padding: 0;
}

.level-bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse 60% 50% at 50% 50%, rgba(255, 45, 107, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.level-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.level-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.level-heading {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    color: var(--text-primary);
}

.level-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.level-tab {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Noto Sans SC', sans-serif;
}

.level-tab.active {
    background: var(--pink-hot);
    color: var(--bg-deep);
    border-color: var(--pink-hot);
}

.level-tab:hover:not(.active) {
    border-color: var(--pink-border);
    color: var(--text-primary);
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.level-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    transition: all 0.3s;
}

.level-card.unlocked {
    cursor: pointer;
    border-color: var(--pink-border);
}

.level-card.unlocked:hover {
    border-color: var(--pink-hot);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.level-card.completed {
    cursor: pointer;
    border-color: var(--match-5);
    background: rgba(52, 211, 153, 0.05);
}

.level-card.completed:hover {
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.15);
    transform: translateY(-3px);
}

.level-card.locked {
    opacity: 0.35;
    cursor: not-allowed;
}

.level-card-num {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace, 'Noto Sans SC';
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.level-card-age {
    font-family: monospace, 'Noto Serif SC', serif;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--pink-hot);
    margin-bottom: 6px;
}

.level-card.completed .level-card-age {
    color: var(--match-5);
}

.level-card-title {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.level-card-status {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.level-card.completed .level-card-status {
    color: var(--match-5);
    font-weight: 700;
}

.level-card.unlocked .level-card-status {
    color: var(--pink-glow);
}

.level-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 48px 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .matching-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .level-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .match-lines {
        display: none;
    }

    .concept-choices {
        grid-template-columns: 1fr;
    }

    .end-stats {
        gap: 24px;
    }

    .quote-box {
        padding: 20px;
    }

    .explanation-card {
        padding: 24px 18px;
    }

    .phase {
        padding: 24px 16px 48px;
    }
}

@media (max-width: 480px) {
    .progress-dots {
        gap: 2px;
    }

    .progress-dot {
        font-size: 0.62rem;
        padding: 2px 4px;
    }

    .level-grid {
        gap: 8px;
    }

    .level-card {
        padding: 16px 12px;
    }

    .level-card-age {
        font-size: 1.1rem;
    }

    .match-item {
        padding: 10px 12px;
        font-size: 0.88rem;
    }

    .concept-card {
        padding: 20px 16px;
    }

    .end-stats {
        flex-direction: column;
        gap: 20px;
    }

    .top-bar {
        padding: 10px 12px 8px;
    }
}
