/* LxM Deduction — Solo Mode + AI Comparison */

:root {
    --font-display: 'Space Mono', monospace;
    --font-body: 'Inter', -apple-system, sans-serif;
    --bg: #0a0e17;
    --bg-card: #12172a;
    --bg-panel: #161d30;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #60a5fa;
    --accent-green: #4ade80;
    --accent-red: #f87171;
    --accent-gold: #fbbf24;
    --accent-purple: #a78bfa;
    --border: #2a2a4a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); min-height: 100vh; }

/* Nav */
.nav { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.nav-logo { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--accent); text-decoration: none; }
.nav-title { font-size: 14px; color: var(--text-muted); }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-creator-link { color: var(--accent); text-decoration: none; font-family: var(--font-display); font-size: 12px; border: 1px solid var(--accent); padding: 4px 10px; border-radius: 4px; transition: all 0.15s; }
.nav-creator-link:hover { background: var(--accent); color: #000; }
.lang-toggle { display: flex; gap: 4px; }
.lang-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 4px 8px; cursor: pointer; font-size: 12px; border-radius: 4px; }
.lang-btn.active { color: var(--accent); border-color: var(--accent); }

/* Pages */
.page { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Hero */
.hero-mini { text-align: center; padding: 40px 20px 30px; }
.hero-mini h1 { font-family: var(--font-display); font-size: 28px; margin-bottom: 8px; }
.hero-mini p { color: var(--text-muted); font-size: 14px; }

/* Scenario Grid */
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.scenario-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 20px; cursor: default; transition: border-color 0.2s; }
.scenario-card:hover { border-color: var(--accent); }
.scenario-card h3 { font-size: 16px; margin-bottom: 8px; }
.scenario-card .difficulty { font-size: 12px; padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 8px; }
.difficulty.easy { background: rgba(74, 222, 128, 0.15); color: var(--accent-green); }
.difficulty.medium { background: rgba(251, 191, 36, 0.15); color: var(--accent-gold); }
.difficulty.hard { background: rgba(248, 113, 113, 0.15); color: var(--accent-red); }
.difficulty.extreme { background: rgba(167, 139, 250, 0.15); color: var(--accent-purple); }
.scenario-card .desc { color: var(--text-muted); font-size: 13px; }
.scenario-card .meta { color: var(--text-muted); font-size: 12px; margin-top: 8px; }

/* SDI Badge */
.sdi-badge { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.sdi-stars { color: var(--accent-gold); font-size: 14px; letter-spacing: 1px; }
.sdi-number { color: var(--text-muted); font-family: var(--font-display); }
.sdi-grade { padding: 1px 6px; border-radius: 3px; font-weight: 600; font-size: 11px; text-transform: uppercase; }
.sdi-grade.medium { background: rgba(251, 191, 36, 0.15); color: var(--accent-gold); }
.sdi-grade.hard { background: rgba(248, 113, 113, 0.15); color: var(--accent-red); }
.sdi-grade.extreme { background: rgba(167, 139, 250, 0.15); color: var(--accent-purple); }
.sdi-grade.easy { background: rgba(74, 222, 128, 0.15); color: var(--accent-green); }

/* Game Layout */
.game-layout { display: grid; grid-template-columns: 240px 1fr 280px; gap: 16px; height: calc(100vh - 100px); }

/* Panels */
.panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; overflow-y: auto; }
.panel h3 { font-size: 14px; margin-bottom: 12px; color: var(--text-muted); }

/* Evidence List */
.evidence-item { padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; margin-bottom: 4px; transition: background 0.15s; display: flex; align-items: center; gap: 8px; }
.evidence-item:hover { background: rgba(96, 165, 250, 0.1); }
.evidence-item.read { color: var(--accent-green); }
.evidence-item.active { background: rgba(96, 165, 250, 0.15); border-left: 3px solid var(--accent); }
.evidence-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.evidence-item.read .evidence-dot { background: var(--accent-green); }
.read-counter { margin-top: 12px; font-size: 12px; color: var(--text-muted); }

/* Content */
.content-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.content-body { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.content-body h1, .content-body h2, .content-body h3 { margin-top: 16px; margin-bottom: 8px; }
.content-body table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.content-body th, .content-body td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; font-size: 13px; }
.content-body th { background: var(--bg-card); }

/* Submit Panel */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.suspect-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.suspect-btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; background: none; color: var(--text); cursor: pointer; font-size: 12px; transition: all 0.15s; }
.suspect-btn:hover { border-color: var(--accent); }
.suspect-btn.selected { background: var(--accent); color: #000; border-color: var(--accent); }
.select-input { width: 100%; padding: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 13px; }
.btn-primary { width: 100%; padding: 12px; background: var(--accent); color: #000; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); cursor: pointer; font-size: 12px; }
.btn-submit { margin-top: 8px; }
.notes-section { margin-top: 20px; }
.notes-section h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.notes-section textarea { width: 100%; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; color: var(--text); padding: 8px; font-size: 13px; resize: vertical; }

/* Result */
.result-card { max-width: 700px; margin: 40px auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 32px; text-align: center; }
.result-card h2 { font-size: 24px; margin-bottom: 20px; }
.result-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.result-correct { color: var(--accent-green); }
.result-wrong { color: var(--accent-red); }
.result-score { font-size: 36px; font-weight: 700; margin: 20px 0; }
.result-actions { margin-top: 24px; }
.result-actions .btn-primary { width: auto; padding: 10px 24px; }

/* Card actions */
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn-card { padding: 6px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); cursor: pointer; font-size: 12px; }
.btn-card:hover { border-color: var(--accent); color: var(--accent); }
.btn-solve { border-color: var(--accent); color: var(--accent); }
.btn-solve:hover { background: rgba(96, 165, 250, 0.1); }
.btn-ai-results { border-color: var(--accent-gold); color: var(--accent-gold); }
.btn-ai-results:hover { background: rgba(251, 191, 36, 0.1); }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; text-align: center; min-width: 300px; max-width: 600px; }
.modal-card h3 { margin-bottom: 16px; font-size: 16px; }
.ai-results-modal { max-width: 650px; }

/* AI Comparison Table */
.ai-comparison-title { font-size: 16px; margin: 24px 0 12px; color: var(--text); }
.ai-comparison { width: 100%; border-collapse: collapse; margin: 12px 0; text-align: left; }
.ai-comparison th { padding: 8px 12px; border-bottom: 2px solid var(--border); font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.ai-comparison td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ai-row { transition: background 0.15s; }
.ai-row:hover { background: rgba(96, 165, 250, 0.05); }
.ai-row.nearest-model { background: rgba(96, 165, 250, 0.12); border-left: 3px solid var(--accent); }
.ai-row.nearest-model td { font-weight: 600; }

/* Nearest model label */
.nearest-label { margin-top: 12px; font-size: 14px; color: var(--accent); }
.nearest-label strong { color: var(--text); }

/* SDI Context */
.sdi-context { font-size: 13px; color: var(--text-muted); padding: 8px 12px; background: rgba(96, 165, 250, 0.05); border-radius: 6px; border-left: 3px solid var(--accent); margin: 12px 0; text-align: left; }
.result-sdi { margin-top: 20px; }

/* Tier headers */
.tier-header td { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); padding: 10px 12px 4px; border-bottom: 1px solid var(--accent); background: rgba(96, 165, 250, 0.05); }
.tier-header.slm-header td { color: #22c55e; border-bottom-color: #22c55e; background: rgba(34, 197, 94, 0.05); }

/* Difficulty inversion */
.difficulty-inversion { background: rgba(250, 204, 21, 0.08); }
.difficulty-inversion td { color: #facc15; }
.inversion-badge { font-size: 10px; background: #facc15; color: #000; padding: 1px 6px; border-radius: 4px; font-weight: 700; margin-left: 4px; }
.model-note { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Failure modes insight */
.failure-insight { margin-top: 16px; padding: 12px 16px; background: rgba(96, 165, 250, 0.04); border-radius: 8px; border: 1px solid var(--border); text-align: left; }
.failure-insight h4 { font-size: 13px; color: var(--text-muted); margin: 0 0 8px; }
.failure-insight p { font-size: 12px; margin: 4px 0; line-height: 1.5; }
.failure-cloud { color: var(--accent); }
.failure-slm { color: #22c55e; }

@media (max-width: 900px) {
    .game-layout { grid-template-columns: 1fr; height: auto; }
}
