@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@400;600;700&display=swap');

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
    --bg:          #0f0f1a;
    --panel:       #1a1a2e;
    --border:      #2a2a4a;
    --accent:      #4fc3f7;
    --accent-dim:  #1a4a6a;
    --luck:        #ffd700;
    --luck-dim:    #4a3a00;
    --text:        #c8d6e5;
    --text-dim:    #5a6a7a;
    --green:       #00e676;
    --red:         #ff5252;
    --gold:        #ffd700;
    --purple:      #ce93d8;
    --stat-str:    #ef5350;
    --stat-int:    #42a5f5;
    --stat-agi:    #66bb6a;
    --stat-end:    #ffa726;
    --stat-cha:    #ab47bc;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ── SCREENS ────────────────────────────────────────────────── */
.screen {
    display: none;
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.4s ease;
    position: relative;
}
.screen.active { display: block; }
.hidden { display: none !important; }

/* ── KEYFRAMES ──────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes floatUp {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@keyframes numberRoll {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes glowPulse {
    0%, 100% { text-shadow: 0 0 10px currentColor, 0 0 20px currentColor; }
    50%       { text-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 0 60px currentColor; }
}

@keyframes scaleIn {
    0%   { opacity: 0; transform: scale(0.3); }
    60%  { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

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

@keyframes particleBurst {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

@keyframes scanline {
    0%   { top: -10%; }
    100% { top: 110%; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

@keyframes rankGlow {
    0%, 100% {
        text-shadow: 0 0 20px var(--gold), 0 0 40px var(--gold);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 40px var(--gold), 0 0 80px var(--gold), 0 0 120px var(--gold);
        transform: scale(1.05);
    }
}

@keyframes corruptedPulse {
    0%, 100% { border-color: #3a0a0a; box-shadow: 0 0 0px rgba(255, 82, 82, 0); }
    50%       { border-color: var(--red); box-shadow: 0 0 14px rgba(255, 82, 82, 0.25); }
}

/* ── TAPPABLE ───────────────────────────────────────────────── */
.tappable { cursor: pointer; transition: opacity 0.15s; }
.tappable:hover { opacity: 0.8; }

/* ── SOUND TOGGLE ───────────────────────────────────────────── */
.sound-toggle {
    position: absolute;
    top: 0;
    right: 0;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.sound-toggle:hover { opacity: 1; }

/* ── STATUS HEADER ──────────────────────────────────────────── */
.status-header {
    text-align: center;
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 20px 20px 14px;
    margin-bottom: 12px;
    position: relative;
}

.player-title {
    font-family: 'Share Tech Mono', monospace;
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 3px;
    margin-bottom: 4px;
    display: inline-block;
}

/* ── RANK BADGE ─────────────────────────────────────────────── */
.rank-badge {
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    padding: 1px 6px;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.rank-badge.rank-s {
    border-color: var(--gold);
    color: var(--gold);
    animation: rankGlow 2s ease-in-out infinite;
}

.rank-badge.rank-a { border-color: var(--purple); color: var(--purple); }
.rank-badge.rank-b { border-color: #ef5350; color: #ef5350; }
.rank-badge.rank-c { border-color: #ff9800; color: #ff9800; }
.rank-badge.rank-d { border-color: var(--green); color: var(--green); }
.rank-badge.rank-e { border-color: var(--accent); color: var(--accent); }
.rank-badge.rank-f { border-color: var(--text-dim); color: var(--text-dim); }

.player-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #fff;
    margin: 6px 0 4px;
}

.player-level {
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-dim);
    font-size: 0.85rem;
    letter-spacing: 2px;
}

/* ── LEVEL PROGRESS BAR ─────────────────────────────────────── */
.level-progress-wrap {
    background: var(--border);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0 4px;
}

.level-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    border-radius: 2px;
    width: 0%;
    transition: width 0.8s ease;
}

.level-progress-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* ── MOMENTUM ───────────────────────────────────────────────── */
.momentum-row {
    display: grid;
    grid-template-columns: 80px 1fr 46px;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.momentum-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: var(--text-dim);
}

.momentum-bar-wrap {
    background: var(--border);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.momentum-bar {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #00e676);
    border-radius: 2px;
    width: 0%;
    transition: width 1s ease;
}

.momentum-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--green);
    text-align: right;
}

/* ── HP / INTEGRITY BAR ─────────────────────────────────────── */
.hp-row {
    display: grid;
    grid-template-columns: 80px 1fr 72px;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    margin-top: 4px;
}

.hp-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: var(--text-dim);
}

.hp-bar-wrap {
    background: var(--border);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.hp-bar {
    height: 100%;
    /* Red-to-amber gradient — low HP reads as danger */
    background: linear-gradient(90deg, #ff5252, #ff9100);
    border-radius: 2px;
    width: 100%;
    transition: width 1s ease;
}

.hp-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.62rem;
    color: var(--red);
    text-align: right;
    white-space: nowrap;
}

/* ── CORRUPTED STATE ────────────────────────────────────────── */
/* Applied to #status-header when player.corrupted is true.
   One class toggle — no structural changes needed. */
.status-header.corrupted {
    border: 1px solid #3a0a0a;
    animation: corruptedPulse 2s ease infinite;
    padding: 12px;
    margin-bottom: 4px;
}

/* The title text is overridden in JS to [ SYSTEM COMPROMISED ]
   when corrupted; this ensures it renders in red */
.status-header.corrupted #player-title {
    color: var(--red);
    letter-spacing: 2px;
}

/* ── TOOLTIP BOX ────────────────────────────────────────────── */
.tooltip-box {
    display: none;
    background: #12122a;
    border: 1px solid var(--accent-dim);
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.6;
    padding: 12px 14px;
    margin-top: 8px;
    margin-bottom: 4px;
    text-align: left;
    animation: fadeIn 0.2s ease;
}

.tooltip-box.visible { display: block; }

.tooltip-box strong {
    color: var(--accent);
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.tip-flavour {
    display: block;
    margin-top: 8px;
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    padding-top: 6px;
}

/* ── STAT BLOCK ─────────────────────────────────────────────── */
.stat-block {
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 20px;
    margin-bottom: 12px;
}

.stat-row {
    display: grid;
    grid-template-columns: 130px 1fr 50px;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease;
}

.stat-row:last-child { border-bottom: none; }

.stat-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-dim);
}

.stat-bar-wrap {
    background: var(--border);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 10%;
    transition: width 0.7s ease;
}

.stat-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    text-align: right;
    animation: numberRoll 0.3s ease;
}

/* ── LUCK ───────────────────────────────────────────────────── */
.luck-divider { height: 1px; background: var(--luck-dim); margin: 8px 0; }
.luck-row .stat-label { color: var(--luck); }
.luck-row .stat-value { color: var(--luck); }
.luck-bar { background: var(--luck) !important; }
#tip-luck strong { color: var(--luck); }

/* ── FLOATING XP LABEL ──────────────────────────────────────── */
.float-xp {
    position: fixed;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: var(--green);
    pointer-events: none;
    z-index: 1000;
    animation: floatUp 0.9s ease forwards;
    white-space: nowrap;
    text-shadow: 0 0 8px var(--green);
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.nav-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.nav-btn:hover { background: var(--accent); color: var(--bg); }

.nav-btn.secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text-dim);
    margin-top: 12px;
}

.nav-btn.secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── BACK LINK ──────────────────────────────────────────────── */
.back-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.back-link:hover { color: var(--accent); }

/* ── QUEST SCREEN ───────────────────────────────────────────── */
.quest-header {
    text-align: center;
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s ease;
}

.quest-header:hover { border-color: var(--accent); }

.quest-header h2 {
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 4px;
    font-size: 1rem;
    color: var(--accent);
}

.quest-date {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.quest-list { display: flex; flex-direction: column; gap: 8px; }

/* ── QUEST CARD ─────────────────────────────────────────────── */
.quest-card {
    position: relative;
    border: 1px solid var(--border);
    border-left: 3px solid rgba(255,255,255,0.12);
    background: var(--panel);
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

/* Scanline shimmer on hover — gives the card a data-terminal feel */
.quest-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.015) 0%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}
.quest-card:hover::before { opacity: 1; }

.quest-card--done {
    border-left-color: var(--green);
    opacity: 0.5;
}
.quest-card.completing { animation: pulse 0.4s ease; }

/* ── Card header: stat tag + tier badge ── */
.qc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qc-stat {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 2.5px;
    font-weight: 600;
}

.qc-tier {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.5rem;
    letter-spacing: 2px;
    padding: 2px 7px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    text-transform: uppercase;
}
.qc-tier--1 { border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.3); }
.qc-tier--2 { border-color: rgba(255,200,80,0.35); color: rgba(255,200,80,0.6); }
.qc-tier--3 { border-color: rgba(255,80,80,0.4);   color: rgba(255,100,100,0.75); }

/* ── Card title ── */
.qc-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1.5px;
    line-height: 1.2;
    text-transform: uppercase;
}

/* ── Card description ── */
.qc-desc {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.65;
}

/* ── Model reference ── */
.qc-model {
    margin-top: 2px;
}
.qc-model-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.2);
    text-transform: uppercase;
}

/* ── Tactical Intel strip ── */
.qc-intel-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    background: rgba(66, 165, 245, 0.05);
    border: 1px solid rgba(66, 165, 245, 0.15);
    border-left: 2px solid rgba(66, 165, 245, 0.5);
    margin-top: 2px;
}

.qc-intel-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.qc-intel-mechanic {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    color: rgba(66, 165, 245, 0.7);
}

.qc-intel-guide-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qc-intel-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 1.5px;
    background: rgba(66, 165, 245, 0.08);
    border: 1px solid rgba(66, 165, 245, 0.3);
    color: rgba(66, 165, 245, 0.85);
    padding: 4px 9px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.qc-intel-btn:hover {
    background: rgba(66, 165, 245, 0.18);
    color: #fff;
}

/* ── Card footer: complete button + XP ── */
.qc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.qc-xp-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.qc-xp {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
}

.qc-xp-label {
    font-size: 0.62rem;
    letter-spacing: 1px;
    opacity: 0.7;
}

/* .quest-xp and .quest-xp-effective replaced by .qc-xp in new card layout */
.quest-xp-effective {
    font-size: 0.58rem;
    color: var(--accent);
    text-align: right;
    white-space: nowrap;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.5px;
}

.complete-btn {
    flex: 1;
    padding: 9px 14px;
    background: transparent;
    border: 1px solid var(--green);
    color: var(--green);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
}

.complete-btn:hover:not([disabled]) {
    background: var(--green);
    color: var(--bg);
    box-shadow: 0 0 12px rgba(76, 175, 128, 0.35);
}

.complete-btn[disabled] {
    border-color: var(--border);
    color: var(--text-dim);
    cursor: not-allowed;
    letter-spacing: 1px;
}

/* Tutorial hint — blink after operator returns from Status screen */
.complete-btn--blink {
    animation: complete-btn-blink 1.4s ease-in-out infinite;
}
@keyframes complete-btn-blink {
    0%, 100% { border-color: var(--green); color: var(--green); background: transparent; box-shadow: none; }
    50%       { border-color: var(--green); color: var(--bg); background: var(--green); box-shadow: 0 0 14px rgba(0,230,118,0.5); }
}

/* ── ONBOARDING LORE LINES ──────────────────────────────────── */
#lore-lines {
    text-align: left;
    margin: 16px 0 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.9;
    letter-spacing: 0.5px;
}

.lore-line {
    display: block;
}

/* ── TERMINAL CURSOR ────────────────────────────────────────── */
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--accent);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: cursorBlink 0.8s step-end infinite;
}

/* ── TERMINAL FLASH ─────────────────────────────────────────── */
/* Applied momentarily to #lore-lines during phase transitions */
@keyframes terminalFlash {
    0%   { opacity: 1; }
    30%  { opacity: 0.9; background: rgba(79, 195, 247, 0.12); }
    100% { opacity: 1; background: transparent; }
}

.terminal-flash {
    animation: terminalFlash 0.22s ease forwards;
}

/* ── LORE LINE VARIANTS ─────────────────────────────────────── */
.lore-signal { color: var(--accent); }
.lore-prompt { color: var(--text); font-style: italic; }

/* ── FLOATING CRITICAL LABEL ────────────────────────────────── */
.float-critical {
    color: var(--gold) !important;
    font-size: 0.7rem !important;
    text-shadow: 0 0 8px var(--gold) !important;
    letter-spacing: 2px;
}

/* ── ACCENT TOAST VARIANT (SYSTEM RESTORED) ─────────────────── */
.save-toast--accent {
    border-color: var(--accent);
    color: var(--accent);
}
.onboarding-box {
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 32px 24px;
    text-align: center;
}

#name-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    padding: 12px;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 16px;
    outline: none;
}

#name-input:focus { border-color: var(--accent); }

/* ── ONBOARDING STEP SECTIONS ───────────────────────────────── */
.onboarding-step-label {
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-bottom: 0.8em;
    text-align: left;
}

.onboarding-step-note {
    font-size: 0.78rem;
    color: var(--text-dim, #666);
    text-align: left;
    line-height: 1.6;
    margin-top: 0.4em;
}

.onboarding-step-note a { text-decoration: underline; }

/* Prominent key acquisition button — can't miss it */
.onboarding-key-cta {
    display: block;
    margin-top: 0.75em;
    padding: 10px 14px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.onboarding-key-cta:hover,
.onboarding-key-cta:active {
    background: var(--accent);
    color: var(--bg);
}

#onboarding-neural-section,
#onboarding-goal-section,
#onboarding-profile-section {
    width: 100%;
    text-align: left;
    margin-bottom: 0.8em;
}

#onboarding-neural-key,
#onboarding-goal-input,
#onboarding-profile-input,
#onboarding-neural-provider {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    padding: 10px 12px;
    outline: none;
    box-sizing: border-box;
    display: block;
}

#onboarding-neural-key:focus,
#onboarding-goal-input:focus,
#onboarding-profile-input:focus,
#onboarding-neural-provider:focus { border-color: var(--accent); }

/* ── OVERLAYS ───────────────────────────────────────────────── */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 20, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

.overlay.hidden { display: none; }

.overlay-content {
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 20px;
}

.overlay-system {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 4px;
    color: var(--accent);
    margin-bottom: 16px;
    animation: slideInUp 0.4s ease 0.1s both;
}

.overlay-headline {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 6px;
    color: var(--text-dim);
    margin-bottom: 20px;
    animation: slideInUp 0.4s ease 0.2s both;
}

.overlay-level {
    font-family: 'Share Tech Mono', monospace;
    font-size: 5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 16px;
    animation: scaleIn 0.6s ease 0.4s both, glowPulse 2s ease 1s infinite;
}

.overlay-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #fff;
    margin-bottom: 12px;
    animation: slideInUp 0.4s ease 0.8s both;
}

.overlay-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    animation: slideInUp 0.4s ease 1s both;
}

/* ── RANK UP OVERLAY ────────────────────────────────────────── */
.rankup-content .overlay-rank-letter {
    font-family: 'Share Tech Mono', monospace;
    font-size: 7rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 16px;
    animation: scaleIn 0.6s ease 0.4s both, rankGlow 1.5s ease 1s infinite;
}

/* ── DAY 1 CLEAR OVERLAY ────────────────────────────────────── */
.day1-clear-content {
    text-align: center;
}
.day1-clear-glyph {
    font-size: 5rem;
    color: var(--accent);
    line-height: 1;
    margin: 16px 0;
    animation: scaleIn 0.5s ease 0.3s both;
}
.day1-clear-body {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--text);
    line-height: 1.8;
    letter-spacing: 0.5px;
    margin: 16px 0 24px;
}

/* ── AWAKEN BOOT OVERLAY ────────────────────────────────────── */
.awaken-content {
    width: 100%;
    max-width: 400px;
    text-align: left;
    padding: 20px;
}

.boot-lines {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    line-height: 2;
    margin-bottom: 20px;
    min-height: 120px;
}

.boot-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 2rem;
    color: #fff;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 12px;
    animation: glowPulse 1.5s ease infinite;
}

.boot-status {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--green);
    letter-spacing: 3px;
    text-align: center;
}

/* ── OVERLAY PARTICLES ──────────────────────────────────────── */
.overlay-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    animation: particleBurst 1.2s ease forwards;
}

/* scanline effect on overlays */
.overlay::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(79, 195, 247, 0.08);
    animation: scanline 3s linear infinite;
    pointer-events: none;
}

/* .quest-model, .quest-model-name, .quest-card-right replaced by qc-* classes */

/* ══════════════════════════════════════════════════════════════
   SETTINGS SCREEN
══════════════════════════════════════════════════════════════ */

/* Gear button — top left of status screen, mirrors sound-toggle */
.settings-btn {
    position: absolute;
    top: 0;
    left: 0;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.2s;
    background: none;
    border: none;
    color: inherit;
    line-height: 1;
}
.settings-btn:hover { opacity: 1; }

/* Settings screen layout */
.settings-header {
    text-align: center;
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 20px;
    margin-bottom: 12px;
}

.settings-header h2 {
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 4px;
    font-size: 1rem;
    color: var(--accent);
}

.settings-section {
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 20px;
    margin-bottom: 12px;
}

.settings-section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Name edit field */
.settings-name-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    padding: 10px 12px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    outline: none;
    transition: border-color 0.2s;
}
.settings-name-input:focus { border-color: var(--accent); }

/* Danger zone */
.danger-zone {
    border: 1px solid #3a1a1a;
    background: #1a0f0f;
    padding: 20px;
    margin-bottom: 12px;
}

.danger-zone .settings-section-title {
    color: var(--red);
    border-bottom-color: #3a1a1a;
}

.danger-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.danger-btn:hover { background: var(--red); color: var(--bg); }

/* Confirmation panel — appears inside danger zone on reset click */
.confirm-box {
    background: #200f0f;
    border: 1px solid var(--red);
    padding: 18px;
    margin-top: 12px;
    text-align: center;
    animation: fadeIn 0.2s ease;
}

.confirm-box p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--text);
    line-height: 1.9;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.confirm-box p strong { color: var(--red); }

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.confirm-yes {
    padding: 10px;
    background: var(--red);
    border: 1px solid var(--red);
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.confirm-yes:hover { opacity: 0.8; }

.confirm-no {
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s;
}
.confirm-no:hover { border-color: var(--accent); color: var(--accent); }

/* Toast notification */
.save-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    border: 1px solid var(--green);
    color: var(--green);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 2px;
    padding: 10px 22px;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   OVERLAY SHARE / DISMISS BUTTONS
══════════════════════════════════════════════════════════════ */

.overlay-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 26px;
    padding: 11px 28px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: slideInUp 0.4s ease 1.2s both;
}
.overlay-share-btn:hover { background: var(--accent); color: var(--bg); }

/* Rank up overlay — share button uses gold */
.rankup-content .overlay-share-btn {
    border-color: var(--gold);
    color: var(--gold);
}
.rankup-content .overlay-share-btn:hover {
    background: var(--gold);
    color: var(--bg);
}

.overlay-dismiss-btn {
    display: block;
    margin-top: 14px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: color 0.2s;
    animation: slideInUp 0.4s ease 1.4s both;
}
.overlay-dismiss-btn:hover { color: var(--text); }

/* ══════════════════════════════════════════════════════════════
   GEAR SYSTEM
══════════════════════════════════════════════════════════════ */

.gear-desc {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.gear-options {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.gear-option-btn {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 12px 6px;
    cursor: pointer;
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    transition: border-color 0.2s, color 0.2s;
    line-height: 1.5;
}

.gear-option-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.gear-option-btn.gear-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(79, 195, 247, 0.06);
}

.gear-name {
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.gear-label {
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.gear-detail {
    font-size: 0.55rem;
    color: #3a4a5a;
    margin-top: 4px;
}

.gear-option-btn.gear-active .gear-detail {
    color: var(--accent-dim);
}

.gear-warning {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    line-height: 1.7;
    border-left: 2px solid var(--border);
    padding-left: 10px;
    margin-top: 4px;
}

.gear-warning.hidden { display: none; }

/* Gear 3 warning uses a faint gold accent to signal its weight */
#gear-warning-3 {
    border-left-color: rgba(255, 215, 0, 0.3);
    color: #7a7a5a;
}

#gear-warning-3 em {
    color: var(--text-dim);
    font-style: normal;
}

/* ══════════════════════════════════════════════════════════════
   REFLECTION PROMPT  (Gear 3 slot 3 quests)
══════════════════════════════════════════════════════════════ */

.reflection-wrap {
    margin: 12px 0 8px;
    border-left: 2px solid rgba(79, 195, 247, 0.3);
    padding-left: 12px;
}

.reflection-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: var(--accent);
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.reflection-hint {
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.reflection-input {
    width: 100%;
    background: #0a0a14;
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 10px;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
    line-height: 1.6;
    transition: border-color 0.2s;
}

.reflection-input:focus {
    outline: none;
    border-color: var(--accent);
}

.reflection-input::placeholder {
    color: #3a4a5a;
}

/* ── Field note additions ────────────────────────────────────── */

.fn-toggle {
    background: none;
    border: 1px solid rgba(79, 195, 247, 0.2);
    color: var(--text-dim);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    padding: 4px 10px;
    margin: 8px 0 4px;
    transition: border-color 0.2s, color 0.2s;
}

.fn-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.fn-wrap--hidden {
    display: none;
}

.fn-char-count {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    color: #3a4a5a;
    letter-spacing: 1px;
    text-align: right;
    margin-top: 3px;
}

.fn-saved {
    margin: 10px 0 6px;
    border-left: 2px solid rgba(79, 195, 247, 0.2);
    padding-left: 12px;
}

.fn-saved-text {
    font-size: 0.68rem;
    color: var(--text-dim);
    line-height: 1.6;
    letter-spacing: 0.3px;
    white-space: pre-wrap;
}

/* ══════════════════════════════════════════════════════════════
   STAGE 2 — GOLD + SHOP
══════════════════════════════════════════════════════════════ */

.gold-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 10px 14px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.gold-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--luck);
    white-space: nowrap;
}

.gold-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: var(--luck);
    font-weight: 700;
    flex: 1;
}

.map-nav-btn,
.shop-nav-btn,
.invite-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 1.5px;
    background: transparent;
    border: 1px solid var(--border);
    padding: 5px 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.invite-btn {
    color: var(--luck);
    border-color: var(--luck-dim);
}
.invite-btn:hover {
    background: var(--luck-dim);
    border-color: var(--luck);
}

.map-nav-btn  { color: var(--accent); border-color: rgba(79,195,247,0.3); }
.map-nav-btn:hover { background: rgba(79,195,247,0.08); border-color: var(--accent); }
.shop-nav-btn { color: var(--luck); border-color: var(--luck-dim); }
.shop-nav-btn:hover { background: var(--luck-dim); border-color: var(--luck); }

.shop-header {
    text-align: center;
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 20px 20px 16px;
    margin-bottom: 10px;
    cursor: pointer;
}

.shop-header h2 {
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 4px;
    font-size: 1rem;
    color: var(--luck);
    margin-bottom: 10px;
}

.shop-gold-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,215,0,0.06);
    border: 1px solid var(--luck-dim);
    padding: 6px 16px;
    margin-bottom: 12px;
}

.shop-gold-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: var(--luck);
}

.shop-gold-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--luck);
}

.shop-lore {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.62rem;
    color: var(--text-dim);
    line-height: 1.8;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    text-align: left;
}

.active-buffs {
    border: 1px solid rgba(79,195,247,0.25);
    background: rgba(79,195,247,0.04);
    padding: 12px 14px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease;
}
.active-buffs.hidden { display: none; }

.active-buffs-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 8px;
}

.active-buff-line {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: var(--text);
    line-height: 1.9;
    letter-spacing: 0.5px;
}

.shop-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.shop-card {
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 14px;
    transition: border-color 0.2s ease;
}
.shop-card:hover { border-color: var(--luck-dim); }
.shop-card--unaffordable { opacity: 0.45; }

.shop-card-top {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 10px;
}

.shop-item-emoji { font-size: 1.4rem; line-height: 1; padding-top: 2px; }

.shop-item-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: var(--luck);
    margin-bottom: 4px;
}

.shop-item-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.55;
    margin-bottom: 5px;
    font-style: italic;
}

.shop-item-effect {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: var(--accent);
    letter-spacing: 0.5px;
    line-height: 1.5;
}

.shop-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding-top: 2px;
    white-space: nowrap;
}

.shop-price-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--luck);
    line-height: 1;
}

.shop-price-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.5rem;
    letter-spacing: 1px;
    color: var(--luck-dim);
    text-transform: uppercase;
}

.consume-btn {
    display: block;
    width: 100%;
    padding: 7px 12px;
    background: transparent;
    border: 1px solid var(--luck-dim);
    color: var(--luck);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.consume-btn:hover { background: var(--luck-dim); border-color: var(--luck); }
.consume-btn:disabled {
    border-color: var(--border);
    color: var(--text-dim);
    cursor: not-allowed;
    background: transparent;
}

/* ══════════════════════════════════════════════════════════════
   STAGE 3 — RELAUNCH BOOT + SYSTEM LOG
══════════════════════════════════════════════════════════════ */

.relaunch-boot {
    position: fixed; inset: 0;
    background: var(--bg, #0f0f1a);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 1;
    transition: opacity 0.35s ease;
}
.relaunch-boot.hidden { display: none; }
.relaunch-boot.relaunch-fade-out { opacity: 0; pointer-events: none; }

.relaunch-boot-inner { width: min(420px, 90vw); padding: 24px; }

.relaunch-lines {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 28px; min-height: 120px;
}

.relaunch-line {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem; letter-spacing: 1.5px;
    color: var(--text-dim, rgba(200,214,229,0.5));
    opacity: 0; transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    line-height: 1.6;
}
.relaunch-line.relaunch-line--visible { opacity: 1; transform: translateY(0); }
.relaunch-line.relaunch-line--highlight { color: var(--accent, #4fc3f7); }
.relaunch-line.relaunch-line--warning   { color: #ff4444; }

.relaunch-skip {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem; letter-spacing: 2px;
    color: var(--text-dim, rgba(200,214,229,0.3));
    text-align: right;
    animation: relaunch-blink 1.2s ease-in-out infinite;
}
@keyframes relaunch-blink { 0%,100%{opacity:0.3} 50%{opacity:0.8} }

.system-log {
    position: fixed; bottom: 16px; left: 12px;
    z-index: 8000;
    display: flex; flex-direction: column; gap: 4px;
    pointer-events: none;
    max-width: min(360px, calc(100vw - 24px));
}

.log-entry {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.62rem; letter-spacing: 1px;
    color: var(--accent, #4fc3f7);
    background: rgba(15,15,26,0.88);
    border-left: 2px solid var(--accent, #4fc3f7);
    padding: 5px 10px; line-height: 1.4;
    opacity: 0; transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.log-entry.log-entry--visible  { opacity: 1; transform: translateY(0); }
.log-entry.log-entry--fading   { opacity: 0; transition: opacity 0.5s ease; }
.log-entry.log-entry--warn     { color: #ff4444; border-left-color: #ff4444; }
.log-entry.log-entry--accent   { color: var(--accent,#4fc3f7); border-left-color: var(--accent,#4fc3f7); }

/* Transmission log — special one-time milestone entries */
/* Wider, longer linger, gold left border */
.log-entry.log-entry--transmission {
    color: var(--luck, #ffd700);
    border-left-color: var(--luck, #ffd700);
    border-left-width: 3px;
    font-size: 0.65rem;
}

/* ══════════════════════════════════════════════════════════════
   STAGE 4 — WORLD MAP
══════════════════════════════════════════════════════════════ */

/* ── MAP HEADER ──────────────────────────────────────────────── */
.map-header {
    text-align: center;
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 14px 20px 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.map-header:hover { border-color: var(--accent); }

.map-header h2 {
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 4px; font-size: 0.95rem;
    color: var(--accent); margin-bottom: 4px;
}

.map-header-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.58rem; letter-spacing: 2px;
    color: var(--text-dim);
}

/* ── MAP VIEWPORT ────────────────────────────────────────────── */
.map-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 480px;
    margin: 0 auto 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #080810;
}

/* ── RADAR SWEEP ─────────────────────────────────────────────── */
/*
 * FIX: The sweep div is scaled to 160% so the gradient line
 * always extends past all four edges of the viewport regardless
 * of rotation angle. Negative margin pulls it back to centre.
 * overflow:hidden on .map-viewport clips the excess cleanly.
 */
.map-radar-sweep {
    position: absolute;
    /* Oversized: 160% × 160%, centred via negative offset */
    width: 160%;
    height: 160%;
    top: -30%;
    left: -30%;
    pointer-events: none;
    z-index: 10;
    background: conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        transparent 300deg,
        rgba(79,195,247,0.03) 320deg,
        rgba(79,195,247,0.12) 345deg,
        rgba(79,195,247,0.22) 358deg,
        rgba(79,195,247,0.06) 360deg
    );
    animation: radar-rotate 8s linear infinite;
    mix-blend-mode: screen;
    /* The conic gradient is centred on the element itself,
       which is centred on the viewport — so rotation origin
       stays at the viewport centre. */
    transform-origin: 50% 50%;
}

.map-viewport.map--corrupted .map-radar-sweep {
    background: conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        transparent 300deg,
        rgba(255,68,68,0.03) 320deg,
        rgba(255,68,68,0.14) 345deg,
        rgba(255,68,68,0.28) 358deg,
        rgba(255,68,68,0.08) 360deg
    );
    animation: radar-rotate 4s linear infinite, radar-jitter 0.3s ease-in-out infinite;
}

@keyframes radar-rotate { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
@keyframes radar-jitter {
    0%,100%{opacity:1}
    48%{opacity:0.85}
    50%{opacity:0.6; transform:rotate(var(--rot,0deg)) translateX(1px)}
    52%{opacity:0.85}
}

/* ── MAP GRID ────────────────────────────────────────────────── */
.map-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    grid-template-rows: repeat(3,1fr);
    width: 100%; height: 100%;
    gap: 2px; padding: 2px;
    box-sizing: border-box;
}

.map-void {
    background: #04040a;
    background-image: radial-gradient(circle, rgba(79,195,247,0.06) 1px, transparent 1px);
    background-size: 12px 12px;
}

/* ── ZONE TILES ──────────────────────────────────────────────── */
.map-zone {
    position: relative; overflow: hidden;
    border: 1px solid rgba(79,195,247,0.12);
    background: #0a0a18;
    transition: border-color 0.4s ease;
    cursor: pointer;
}
.map-zone:hover          { border-color: rgba(79,195,247,0.35); }
.map-zone--hub           { border-color: rgba(79,195,247,0.25); background: #0d0d20; }
.map-zone.zone--selected { border-color: var(--accent) !important; box-shadow: inset 0 0 12px rgba(79,195,247,0.08); }

/* ── TERRAIN LAYER ───────────────────────────────────────────── */
.zone-terrain {
    position: absolute; inset: 0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem; line-height: 1.4;
    letter-spacing: 1px; word-break: break-all;
    overflow: hidden; padding: 3px;
    pointer-events: none;
    opacity: 0.18; color: var(--accent);
    transition: opacity 0.8s ease;
}
.map-zone.tier-0 .zone-terrain { opacity: 0.0; }
.map-zone.tier-1 .zone-terrain { opacity: 0.10; }
.map-zone.tier-2 .zone-terrain { opacity: 0.22; }
.map-zone.tier-3 .zone-terrain { opacity: 0.38; }

/* ── FOG OF WAR ──────────────────────────────────────────────── */
.zone-fog {
    position: absolute; inset: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    z-index: 2;
    background-image: radial-gradient(circle, rgba(8,8,16,0.0) 1px, rgba(8,8,16,0.85) 1px);
    background-size: 3px 3px;
}
.map-zone.tier-0 .zone-fog { opacity: 1.0; }
.map-zone.tier-1 .zone-fog { opacity: 0.78; }
.map-zone.tier-2 .zone-fog { opacity: 0.45; }
.map-zone.tier-3 .zone-fog { opacity: 0.10; }
.map-zone--hub.hub-locked   .zone-fog { opacity: 0.85; }
.map-zone--hub.hub-unlocked .zone-fog { opacity: 0.0; }

/* ── ZONE CONTENT TEXT ───────────────────────────────────────── */
.zone-content {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 6px 4px; text-align: center; gap: 2px;
}

.zone-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.52rem; letter-spacing: 1.5px;
    color: var(--accent); line-height: 1.3;
    text-shadow: 0 0 8px rgba(79,195,247,0.6);
    transition: opacity 0.4s ease;
}

.zone-stat-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.42rem; letter-spacing: 1px;
    color: var(--text-dim); opacity: 0.7;
}

.zone-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem; font-weight: 700;
    color: var(--accent); margin-top: 2px;
    text-shadow: 0 0 10px rgba(79,195,247,0.5);
    transition: color 0.4s ease;
}
.map-zone.tier-0 .zone-value { color: rgba(79,195,247,0.2); }
.map-zone.tier-1 .zone-value { color: rgba(79,195,247,0.5); }
.map-zone.tier-2 .zone-value { color: rgba(79,195,247,0.8); }
.map-zone.tier-3 .zone-value { color: #4fc3f7; }

.zone-tier {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.4rem; letter-spacing: 1px;
    color: var(--text-dim); opacity: 0.55; margin-top: 1px;
}
.map-zone.tier-0 .zone-name      { opacity: 0.3; }
.map-zone.tier-0 .zone-stat-name  { opacity: 0.2; }

/* ── HUB CONTENT ─────────────────────────────────────────────── */
.zone-content--hub { gap: 3px; }

.hub-pin {
    font-size: 1.4rem; color: var(--accent);
    text-shadow: 0 0 16px rgba(79,195,247,0.9), 0 0 32px rgba(79,195,247,0.4);
    animation: hub-pulse 2.4s ease-in-out infinite;
    line-height: 1;
}
@keyframes hub-pulse {
    0%,100%{transform:scale(1.0); opacity:1.0}
    50%    {transform:scale(1.12); opacity:0.7}
}

.hub-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.4rem; letter-spacing: 1.5px;
    color: var(--text-dim); opacity: 0.6;
}
.hub-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.52rem; letter-spacing: 1px;
    color: var(--accent); font-weight: 700;
}
.hub-rank {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.42rem; letter-spacing: 1px;
    color: var(--text-dim); opacity: 0.7;
}

/* ── MAP STATUS BAR ──────────────────────────────────────────── */
.map-status-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    margin-bottom: 10px;
    max-width: 480px; margin-left: auto; margin-right: auto;
}
.map-status-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem; letter-spacing: 2px; color: var(--text-dim);
}
.map-status-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem; letter-spacing: 1.5px; color: var(--accent);
    animation: status-blink 2s ease-in-out infinite;
}
@keyframes status-blink { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── ZONE LORE PANEL ─────────────────────────────────────────── */
/*
 * Slides up from below the map viewport when a zone is tapped.
 * Contains: zone designation, lore text, and (if tier 1+)
 * a VIEW ZONE DIRECTIVES button.
 */
.map-lore-panel {
    max-width: 480px;
    margin: 0 auto 10px;
    border: 1px solid var(--accent);
    background: rgba(10,10,24,0.96);
    overflow: hidden;
    /* Collapsed by default */
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}
.map-lore-panel.lore-panel--open {
    max-height: 320px;
    opacity: 1;
}

.lore-panel-inner {
    padding: 14px 16px 12px;
    display: flex; flex-direction: column; gap: 8px;
}

.lore-panel-zone-tag {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.5rem; letter-spacing: 2.5px;
    color: var(--text-dim); opacity: 0.6;
}

.lore-panel-zone-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem; letter-spacing: 2px;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(79,195,247,0.4);
}

.lore-panel-stat {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.52rem; letter-spacing: 1.5px;
    color: var(--text-dim); opacity: 0.6;
    margin-top: -4px;
}

.lore-panel-divider {
    border: none;
    border-top: 1px solid rgba(79,195,247,0.15);
    margin: 0;
}

.lore-panel-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.64rem; line-height: 1.75;
    letter-spacing: 0.4px;
    color: var(--text-dim);
}

/* Hub lore panel — slightly different accent for the centre */
.lore-panel--hub .lore-panel-zone-name { color: var(--accent); }
.lore-panel--hub                        { border-color: rgba(79,195,247,0.5); }

/* Uncharted panel — dimmer, warning feel */
.lore-panel--uncharted .lore-panel-text { opacity: 0.55; font-style: italic; }
.lore-panel--uncharted                  { border-color: rgba(79,195,247,0.25); }

.lore-panel-actions {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: 2px;
}

.lore-panel-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem; letter-spacing: 2px;
    background: transparent;
    border: 1px solid rgba(79,195,247,0.35);
    color: var(--accent);
    padding: 7px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.lore-panel-btn:hover {
    background: rgba(79,195,247,0.08);
    border-color: var(--accent);
}

/* ── QUEST FILTER INDICATOR ──────────────────────────────────── */
/*
 * Shown at the top of screen-quests when arriving from the map
 * with a zone filter active. Displays the zone name + a clear button.
 */
.quest-filter-bar {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid rgba(79,195,247,0.3);
    background: rgba(79,195,247,0.05);
    padding: 8px 14px;
    margin-bottom: 8px;
}
.quest-filter-bar.hidden { display: none; }

.quest-filter-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem; letter-spacing: 1.5px;
    color: var(--text-dim); flex-shrink: 0;
}
.quest-filter-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem; letter-spacing: 1.5px;
    color: var(--accent); flex: 1;
}
.quest-filter-clear {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem; letter-spacing: 1.5px;
    color: var(--text-dim);
    background: transparent; border: none;
    cursor: pointer; padding: 2px 4px;
    transition: color 0.15s ease;
    flex-shrink: 0;
}
.quest-filter-clear:hover { color: var(--accent); }

/* ── CORRUPTED MAP STATE ─────────────────────────────────────── */
.map-viewport.map--corrupted .map-grid {
    animation: map-corrupt-flicker 4s ease-in-out infinite;
}
@keyframes map-corrupt-flicker {
    0%,100%{filter:none;opacity:1}
    92%    {filter:none;opacity:1}
    93%    {filter:saturate(0) brightness(0.6);opacity:0.7}
    94%    {filter:none;opacity:1}
    97%    {filter:saturate(0) brightness(0.5);opacity:0.6}
    98%    {filter:none;opacity:1}
}

/* ── SCAN LINES ──────────────────────────────────────────────── */
.map-viewport::after {
    content: '';
    position: absolute; inset: 0;
    pointer-events: none; z-index: 20;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px, transparent 3px,
        rgba(0,0,0,0.08) 3px, rgba(0,0,0,0.08) 4px
    );
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 360px) {
    .zone-name      { font-size: 0.44rem; }
    .zone-stat-name { font-size: 0.36rem; }
    .zone-value     { font-size: 0.62rem; }
    .hub-pin        { font-size: 1.1rem;  }
}

/* ── Mobile readability boost ───────────────────────────────── */
/* Small screens need slightly larger body text — squinting is friction */
@media (max-width: 480px) {
    .qc-desc              { font-size: 0.92rem; }
    .qc-title             { font-size: 1.08rem; }
    .onboarding-step-note { font-size: 0.82rem; }
    .reflection-hint      { font-size: 0.75rem; }
    .complete-btn         { font-size: 0.73rem; padding: 10px 14px; }
}

/* ══════════════════════════════════════════════════════════════
   PWA INSTALL OVERLAY
══════════════════════════════════════════════════════════════ */

.install-content {
    width: min(440px, 92vw);
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg, #0f0f1a);
    border: 1px solid rgba(79, 195, 247, 0.3);
    text-align: left;
}

.install-tag {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 3px;
    color: var(--accent, #4fc3f7);
    opacity: 0.55;
}

.install-headline {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    letter-spacing: 3px;
    color: var(--accent, #4fc3f7);
    text-shadow: 0 0 12px rgba(79, 195, 247, 0.4);
}

.install-body {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    line-height: 1.8;
    letter-spacing: 0.4px;
    color: var(--text-dim, rgba(200, 214, 229, 0.6));
}

.install-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.install-confirm-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--accent, #4fc3f7);
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid var(--accent, #4fc3f7);
    padding: 11px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
}
.install-confirm-btn:hover { background: rgba(79, 195, 247, 0.16); }

.install-dismiss-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: var(--text-dim, rgba(200, 214, 229, 0.4));
    background: transparent;
    border: 1px solid var(--border, rgba(79, 195, 247, 0.15));
    padding: 8px 16px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-align: center;
}
.install-dismiss-btn:hover {
    color: var(--text-dim, rgba(200, 214, 229, 0.7));
    border-color: rgba(79, 195, 247, 0.3);
}
══════════════════════════════════════════════════════════════ */

/*
 * Uses the existing .overlay base class for backdrop.
 * briefing-content is narrower and left-aligned for a
 * terminal-log feel rather than the centred overlay style.
 */
.briefing-content {
    width: min(480px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    padding: 28px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    background: var(--bg, #0f0f1a);
    border: 1px solid rgba(79, 195, 247, 0.25);
    text-align: left;
}

.briefing-tag {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 3px;
    color: var(--accent, #4fc3f7);
    opacity: 0.6;
    margin-bottom: 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(79, 195, 247, 0.12);
}

.briefing-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Each line fades in individually */
.briefing-line {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.75;
    letter-spacing: 0.6px;
    color: var(--text-dim, rgba(200, 214, 229, 0.6));
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.briefing-line.briefing-line--visible {
    opacity: 1;
    transform: translateY(0);
}

/* The final "directives issued" line is highlighted */
.briefing-line.briefing-line--highlight {
    color: var(--accent, #4fc3f7);
    opacity: 0;  /* starts hidden, fades in with class */
}
.briefing-line.briefing-line--highlight.briefing-line--visible {
    opacity: 1;
}

/* The VIEW DIRECTIVES button fades in after the last line */
.briefing-directives-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 2.5px;
    color: var(--accent, #4fc3f7);
    background: transparent;
    border: 1px solid var(--accent, #4fc3f7);
    padding: 11px 20px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background 0.2s ease, opacity 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: translateY(8px);
}
.briefing-directives-btn:hover {
    background: rgba(79, 195, 247, 0.1);
}
.briefing-directives-btn.briefing-btn--visible {
    opacity: 1;
    transform: translateY(0);
}
/* hidden utility — JS adds/removes */
.briefing-directives-btn.hidden {
    display: none;
}

/* ════════════════════════════════════════════════════════════
   SYNC TERMINAL — Advanced Uplink (Stage 5b System 1)
   ════════════════════════════════════════════════════════════ */

/* ── Advisory overlay ─────────────────────────────────────── */
.sync-advisory-content {
    max-width: 340px;
    text-align: center;
    padding: 2rem 1.6rem;
}
.sync-advisory-tag {
    font-size: 0.72rem;
    color: var(--accent);
    font-family: var(--font-mono);
    letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
}
.sync-advisory-headline {
    font-size: 1.3rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.1em;
    margin-bottom: 1.1rem;
}
.sync-advisory-body {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    line-height: 1.75;
    margin-bottom: 1.6rem;
}
.sync-advisory-actions {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.sync-advisory-confirm-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s ease, color 0.15s ease;
}
.sync-advisory-confirm-btn:hover,
.sync-advisory-confirm-btn:active {
    background: var(--accent);
    color: var(--bg);
}
.sync-advisory-dismiss-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 0.4rem;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}
.sync-advisory-dismiss-btn:hover { opacity: 1; }

/* ── Settings: Ghost view ─────────────────────────────────── */
.sync-lore {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.65;
    margin-bottom: 1.1rem;
    font-family: var(--font-mono);
}
.sync-establish-btn { width: 100%; }

/* ── Settings: Linked view ────────────────────────────────── */
.sync-freq-display {
    background: rgba(79, 195, 247, 0.06);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 4px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
}
.sync-freq-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}
.sync-freq-code {
    font-size: 1.5rem;
    font-family: var(--font-mono);
    color: var(--accent);
    letter-spacing: 0.18em;
    font-weight: 700;
}
.sync-diagnostics {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.sync-diag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    padding: 0.28rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sync-diag-label   { color: var(--text-dim); letter-spacing: 0.06em; }
.sync-diag-value   { color: var(--text); letter-spacing: 0.08em; }
.sync-diag-active  { color: var(--accent); }
.sync-diag-offgrid { color: var(--text-dim); opacity: 0.55; }

/* ── Reconstitute section ─────────────────────────────────── */
.sync-divider {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    margin: 1rem 0 0.65rem;
    opacity: 0.5;
}
.sync-recover-lore {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    line-height: 1.5;
    margin-bottom: 0.65rem;
}
.sync-recover-wrap  { display: flex; flex-direction: column; gap: 0.5rem; }
.sync-recover-input { text-transform: uppercase; letter-spacing: 0.12em; }
.sync-recover-btn   { width: 100%; }

/* ── Status line ──────────────────────────────────────────── */
.sync-status {
    margin-top: 0.9rem;
    font-size: 0.74rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    min-height: 1.2rem;
    line-height: 1.5;
    letter-spacing: 0.04em;
    transition: color 0.2s ease;
}
.sync-status--warn   { color: var(--warn, #ff6b6b); }
.sync-status--accent { color: var(--accent); }

/* ════════════════════════════════════════════════════════════
   SYNC-LINK — Co-op Tether (Stage 5b System 2)
   ════════════════════════════════════════════════════════════ */

.synclink-resonance-label {
    color: var(--accent);
    font-weight: 700;
}
.synclink-divider {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    margin: 1rem 0 0.65rem;
    opacity: 0.5;
}
.synclink-generate-btn,
.synclink-join-btn,
.synclink-sever-btn { width: 100%; }
.synclink-join-btn  { margin-top: 0.5rem; }
.synclink-join-input { text-transform: uppercase; letter-spacing: 0.12em; }

.synclink-sever-btn {
    border-color: var(--warn, #ff6b6b) !important;
    color: var(--warn, #ff6b6b) !important;
    margin-top: 0.5rem;
}
.synclink-sever-btn:hover,
.synclink-sever-btn:active {
    background: var(--warn, #ff6b6b) !important;
    color: var(--bg) !important;
}

.synclink-diagnostics {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.synclink-active-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
    font-family: var(--font-mono);
}
.synclink-active-tag {
    font-size: 0.72rem;
    color: var(--accent);
    letter-spacing: 0.1em;
}
.synclink-active-id {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.2em;
}

/* ── Resonance overlay ────────────────────────────────────── */
.resonance-content {
    text-align: center;
    padding: 2.5rem 1.6rem 2rem;
    max-width: 320px;
}
.resonance-tag {
    font-size: 0.72rem;
    color: var(--accent);
    font-family: var(--font-mono);
    letter-spacing: 0.14em;
    margin-bottom: 0.5rem;
}
.resonance-headline {
    font-size: 2.4rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.18em;
    text-shadow: 0 0 40px rgba(79, 195, 247, 0.5);
    margin-bottom: 0.6rem;
}
.resonance-sub {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    letter-spacing: 0.08em;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   TELEGRAM COMMS — Per-Session Encrypted Channel (System 4)
   ════════════════════════════════════════════════════════════ */

.synclink-comms-btn {
    width: 100%;
    margin-bottom: 0.5rem;
    border-color: rgba(79, 195, 247, 0.5);
}

/* ── Comms prompt overlay ─────────────────────────────────── */
.comms-prompt-content {
    max-width: 340px;
    text-align: center;
    padding: 2rem 1.6rem;
}
.comms-prompt-tag {
    font-size: 0.72rem;
    color: var(--accent);
    font-family: var(--font-mono);
    letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
}
.comms-prompt-headline {
    font-size: 1.2rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}
.comms-prompt-body {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 1rem;
}
.comms-prompt-input {
    width: 100%;
    text-align: left;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.comms-prompt-status {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--warn, #ff6b6b);
    min-height: 1rem;
    margin-bottom: 0.6rem;
    letter-spacing: 0.06em;
}
.comms-prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.comms-prompt-confirm-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s ease, color 0.15s ease;
}
.comms-prompt-confirm-btn:hover,
.comms-prompt-confirm-btn:active {
    background: var(--accent);
    color: var(--bg);
}
.comms-prompt-skip-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    padding: 0.4rem;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}
.comms-prompt-skip-btn:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════════════
   STAGE 5a — THE NEURAL LINK EXPANSION
   ════════════════════════════════════════════════════════════════ */

/* ── Quest tactical guide section (daily directives) ─────────── */
.quest-tactical {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin: 0.35rem 0 0.25rem 0;
    padding: 0.35rem 0.5rem;
    border-left: 2px solid rgba(120, 200, 255, 0.25);
    background: rgba(255,255,255,0.02);
}

.quest-tactical-mechanic {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: rgba(120, 200, 255, 0.7);
}

.quest-tactical-title {
    font-size: 0.6rem;
    letter-spacing: 0.07em;
    color: var(--text-dim);
    font-weight: 600;
}

.quest-intel-btn {
    font-size: 0.55rem;
    font-family: var(--mono);
    letter-spacing: 0.08em;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 0.1rem 0;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s;
    margin-top: 0.1rem;
    display: inline-block;
}

.quest-intel-btn:hover { color: rgba(120, 200, 255, 0.9); }

/* ── World Boss section ───────────────────────────────────────── */
.world-boss-section {
    margin: 0 0 1.2rem 0;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 80, 80, 0.35);
    border-left: 3px solid rgba(255, 80, 80, 0.7);
    background: rgba(255, 80, 80, 0.04);
    animation: wb-pulse 4s ease-in-out infinite;
}

@keyframes wb-pulse {
    0%, 100% { border-left-color: rgba(255, 80, 80, 0.7); }
    50%       { border-left-color: rgba(255, 80, 80, 0.25); }
}

.wb-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: rgba(255, 100, 100, 0.9);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.wb-enemy {
    font-size: 0.58rem;
    color: var(--text-dim);
    letter-spacing: 0.07em;
    margin-bottom: 0.5rem;
}

.wb-bar-wrap {
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.wb-bar {
    height: 100%;
    background: #4caf80;
    transition: width 0.8s ease, background 0.4s;
    border-radius: 2px;
}
.wb-bar--amber    { background: #e8a040; }
.wb-bar--critical { background: rgba(255, 80, 80, 0.85); }

.wb-hp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wb-hp {
    font-size: 0.58rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
}

.wb-intel-btn {
    font-size: 0.55rem;
    font-family: var(--mono);
    letter-spacing: 0.08em;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.wb-intel-btn:hover {
    color: rgba(255, 100, 100, 0.9);
    border-color: rgba(255, 100, 100, 0.4);
}

/* ── Temporal Breach ──────────────────────────────────────────── */
.temporal-breach-section {
    margin: 0.8rem 0;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 200, 60, 0.3);
    border-left: 3px solid rgba(255, 200, 60, 0.7);
    background: rgba(255, 200, 60, 0.03);
}

.breach-header {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: rgba(255, 200, 60, 0.9);
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.breach-sub {
    font-size: 0.56rem;
    color: var(--text-dim);
    letter-spacing: 0.07em;
    margin-bottom: 0.65rem;
}

.incursion-card {
    padding: 0.75rem 0.85rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255, 200, 60, 0.15);
    border-left: 2px solid rgba(255, 200, 60, 0.5);
    margin-bottom: 0.5rem;
}

.incursion-card--complete { opacity: 0.45; }

.incursion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.incursion-label {
    font-size: 0.65rem;
    color: rgba(255, 200, 60, 0.9);
    font-weight: 600;
    letter-spacing: 0.07em;
    flex: 1;
}

.incursion-timer {
    font-size: 0.56rem;
    color: rgba(255, 80, 80, 0.8);
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.incursion-stat {
    font-size: 0.56rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}

.incursion-enemy  {
    font-size: 0.58rem;
    color: rgba(255, 110, 110, 0.8);
    letter-spacing: 0.06em;
    margin-bottom: 0.1rem;
}

.incursion-weapon {
    font-size: 0.58rem;
    color: rgba(120, 200, 255, 0.8);
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.incursion-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.35rem;
}

.incursion-intel-btn {
    font-size: 0.55rem;
    font-family: var(--mono);
    letter-spacing: 0.08em;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.incursion-intel-btn:hover {
    color: rgba(120, 200, 255, 0.9);
    border-color: rgba(120, 200, 255, 0.4);
}

.incursion-complete-btn {
    flex: 1;
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    background: transparent;
    border: 1px solid rgba(255, 200, 60, 0.4);
    color: rgba(255, 200, 60, 0.85);
    padding: 0.28rem 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.incursion-complete-btn:hover:not([disabled]) {
    background: rgba(255, 200, 60, 0.1);
}

.incursion-complete-btn[disabled] {
    color: var(--text-dim);
    border-color: var(--border);
    cursor: default;
}

/* ── Tactical Guide Overlay ───────────────────────────────────── */
.tactical-overlay { max-width: 460px; }

.tg-label {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tg-enemy {
    font-size: 0.6rem;
    color: rgba(255, 110, 110, 0.9);
    letter-spacing: 0.08em;
    margin-bottom: 0.15rem;
}

.tg-weapon {
    font-size: 0.6rem;
    color: rgba(120, 200, 255, 0.9);
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
}

.tg-body {
    font-size: 0.7rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 1.2rem;
    font-style: italic;
}

/* ── Neural Generator Overlay ─────────────────────────────────── */
.neural-gen-overlay { max-width: 460px; }

.ng-title {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.ng-hint {
    font-size: 0.62rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.ng-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.68rem;
    padding: 0.55rem;
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 0.4rem;
    line-height: 1.55;
}

.ng-input:focus {
    outline: none;
    border-color: rgba(120, 200, 255, 0.4);
}

.ng-status {
    font-size: 0.6rem;
    color: var(--accent);
    letter-spacing: 0.07em;
    min-height: 1.1em;
    margin-bottom: 0.45rem;
}

.ng-btn-row {
    display: flex;
    gap: 0.7rem;
    margin-bottom: 0.5rem;
}

.ng-submit-btn {
    flex: 1;
    font-family: var(--mono);
    font-size: 0.63rem;
    letter-spacing: 0.09em;
    background: rgba(120, 200, 255, 0.08);
    border: 1px solid rgba(120, 200, 255, 0.35);
    color: rgba(120, 200, 255, 0.9);
    padding: 0.45rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ng-submit-btn:hover:not([disabled]) { background: rgba(120, 200, 255, 0.16); }
.ng-submit-btn[disabled] { opacity: 0.4; cursor: default; }

.ng-ephemeral {
    font-size: 0.52rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    text-align: center;
    opacity: 0.55;
}

/* ── Neural Processor Settings ────────────────────────────────── */
.neural-status {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    margin-bottom: 0.65rem;
}

.neural-status--online {
    color: #4caf80;
    border-color: rgba(76, 175, 128, 0.4);
    background: rgba(76, 175, 128, 0.05);
}

.neural-status--offline { color: var(--text-dim); }

.neural-desc {
    font-size: 0.6rem;
    color: var(--text-dim);
    line-height: 1.55;
    margin-bottom: 0.75rem;
}

.neural-key-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.neural-field-label {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-top: 0.1rem;
}

.neural-provider-select {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.6rem;
    padding: 0.3rem 0.45rem;
    width: 100%;
    box-sizing: border-box;
}

.neural-key-input {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.68rem;
    padding: 0.38rem 0.5rem;
    width: 100%;
    box-sizing: border-box;
    letter-spacing: 0.04em;
}

.neural-key-input:focus {
    outline: none;
    border-color: rgba(120, 200, 255, 0.4);
}

.neural-key-hint {
    font-size: 0.56rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.neural-btn-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.neural-save-btn {
    flex: 1;
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.09em;
    background: rgba(120, 200, 255, 0.07);
    border: 1px solid rgba(120, 200, 255, 0.3);
    color: rgba(120, 200, 255, 0.9);
    padding: 0.38rem;
    cursor: pointer;
    transition: background 0.2s;
}

.neural-save-btn:hover { background: rgba(120, 200, 255, 0.14); }

.neural-remove-btn {
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.09em;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.38rem 0.65rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.neural-remove-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.neural-generate-row { margin-top: 0.75rem; }

.neural-gen-label {
    font-size: 0.56rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}

.neural-gen-btn-row {
    display: flex;
    gap: 0.5rem;
}

.neural-gen-btn {
    flex: 1;
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    background: rgba(255, 200, 60, 0.05);
    border: 1px solid rgba(255, 200, 60, 0.3);
    color: rgba(255, 200, 60, 0.85);
    padding: 0.42rem;
    cursor: pointer;
    transition: background 0.2s;
}

.neural-gen-btn:hover { background: rgba(255, 200, 60, 0.11); }

.neural-gen-btn--boss {
    background: rgba(255, 80, 80, 0.05);
    border-color: rgba(255, 80, 80, 0.3);
    color: rgba(255, 110, 110, 0.85);
}

.neural-gen-btn--boss:hover { background: rgba(255, 80, 80, 0.11); }

/* ════════════════════════════════════════════════════════════════
   NEURAL LINK SCREEN + UI FIXES
   ════════════════════════════════════════════════════════════════ */

/* ── Provider select — force dark background on options ── */
.neural-provider-select option {
    background: #1a1a2e;
    color: var(--text);
}

/* ── Gemini key link ── */
.neural-key-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
    transition: border-color 0.2s;
}
.neural-key-link:hover { border-bottom-color: var(--accent); }

/* ── Settings link button to Neural screen ── */
.neural-settings-link-btn {
    width: 100%;
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    background: transparent;
    border: 1px solid rgba(120, 200, 255, 0.25);
    color: rgba(120, 200, 255, 0.7);
    padding: 0.45rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
    margin-top: 0.35rem;
}
.neural-settings-link-btn:hover {
    background: rgba(120, 200, 255, 0.08);
    color: var(--accent);
}

/* ── Status screen Neural Link button ── */
.nav-btn--neural {
    position: relative;
    border-color: rgba(120, 200, 255, 0.3);
    color: rgba(120, 200, 255, 0.8);
    margin-top: 0.5rem;
}
.nav-btn--neural:hover {
    background: rgba(120, 200, 255, 0.08);
    border-color: var(--accent);
    color: var(--accent);
}
.nav-btn--neural-active {
    border-color: rgba(255, 200, 60, 0.6) !important;
    color: rgba(255, 200, 60, 0.9) !important;
    animation: neural-pulse 2s ease-in-out infinite;
}
@keyframes neural-pulse {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 0 12px rgba(255, 200, 60, 0.2); }
}

.neural-link-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: rgba(255, 200, 60, 0.9);
    color: var(--bg);
    font-family: var(--mono);
    font-size: 0.55rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.neural-link-badge.hidden { display: none; }

/* ── Error status styling ── */
.ng-status--error {
    color: var(--red) !important;
    font-size: 0.66rem !important;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.4rem;
    border: 1px solid rgba(255, 82, 82, 0.3);
    background: rgba(255, 82, 82, 0.05);
    margin-bottom: 0.2rem;
}

/* ── Tabs ── */
.neural-screen-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
}
.ns-tab {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    padding: 0.5rem 1.2rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}
.ns-tab--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.ns-tab:hover:not(.ns-tab--active) { color: var(--text); }

/* ── Panel ── */

/* ── Explainer box ── */
.ns-explainer {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-left: 3px solid rgba(120, 200, 255, 0.4);
    background: rgba(120, 200, 255, 0.03);
    margin-bottom: 1rem;
}
.ns-explainer-title {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: rgba(120, 200, 255, 0.8);
    margin-bottom: 0.4rem;
}
.ns-explainer-body {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ── Generate button ── */
.ns-generate-btn-wrap { margin-bottom: 1.2rem; }
.ns-generate-btn {
    width: 100%;
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    background: rgba(255, 200, 60, 0.06);
    border: 1px solid rgba(255, 200, 60, 0.4);
    color: rgba(255, 200, 60, 0.9);
    padding: 0.65rem;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}
.ns-generate-btn:hover {
    background: rgba(255, 200, 60, 0.12);
    box-shadow: 0 0 10px rgba(255, 200, 60, 0.1);
}
.ns-generate-btn--boss {
    background: rgba(255, 80, 80, 0.05);
    border-color: rgba(255, 80, 80, 0.4);
    color: rgba(255, 110, 110, 0.9);
}
.ns-generate-btn--boss:hover {
    background: rgba(255, 80, 80, 0.1);
    box-shadow: 0 0 10px rgba(255, 80, 80, 0.1);
}

/* ── Section label ── */
.ns-list-label {
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
}

/* ── Empty state ── */
.ns-empty {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    padding: 1rem 0;
    text-align: center;
    opacity: 0.6;
}

/* ── Entity cards ── */
.ns-entity-card {
    border: 1px solid var(--border);
    border-left: 3px solid rgba(255, 200, 60, 0.5);
    background: var(--panel);
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.ns-entity-card--boss {
    border-left-color: rgba(255, 80, 80, 0.6);
}
.ns-entity-card--done {
    opacity: 0.45;
    border-left-color: var(--green);
}

.ns-entity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}
.ns-entity-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255, 200, 60, 0.95);
    flex: 1;
    line-height: 1.3;
}
.ns-entity-label--boss { color: rgba(255, 100, 100, 0.95); }

.ns-entity-timer {
    font-family: var(--mono);
    font-size: 0.58rem;
    color: rgba(255, 200, 60, 0.7);
    white-space: nowrap;
    flex-shrink: 0;
}
.ns-entity-timer--expired { color: var(--red); }

.ns-entity-meta {
    font-family: var(--mono);
    font-size: 0.58rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.ns-entity-enemy {
    font-family: var(--mono);
    font-size: 0.62rem;
    color: rgba(255, 110, 110, 0.85);
    letter-spacing: 0.05em;
}
.ns-entity-weapon {
    font-family: var(--mono);
    font-size: 0.62rem;
    color: rgba(120, 200, 255, 0.85);
    letter-spacing: 0.05em;
}
.ns-entity-guide {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.6;
    font-style: italic;
    padding-top: 0.2rem;
    border-top: 1px solid var(--border);
    margin-top: 0.2rem;
}

/* ── Boss HP bar ── */
.ns-boss-hp-wrap {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 2px;
    overflow: hidden;
}
.ns-boss-hp-bar {
    height: 100%;
    background: #4caf80;
    border-radius: 2px;
    transition: width 0.8s ease, background 0.4s;
}
.ns-boss-hp-bar--amber    { background: #e8a040; }
.ns-boss-hp-bar--critical { background: #ff5252; }

/* ── Complete button on entity card ── */
.ns-complete-btn {
    width: 100%;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    background: transparent;
    border: 1px solid rgba(255, 200, 60, 0.4);
    color: rgba(255, 200, 60, 0.9);
    padding: 0.45rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.2rem;
}
.ns-complete-btn:hover:not([disabled]) { background: rgba(255, 200, 60, 0.1); }
.ns-entity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ns-complete-btn[disabled] {
    border-color: var(--green);
    color: var(--green);
    cursor: default;
    opacity: 0.7;
}

/* ── Neural Link screen header (matches other screen headers) ── */
.neural-header {
    text-align: center;
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.neural-header:hover { border-color: var(--accent); }
.neural-header h2 {
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 4px;
    font-size: 1rem;
    color: var(--accent);
}

/* ── Test connection button ── */
.neural-test-btn {
    width: 100%;
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.09em;
    background: transparent;
    border: 1px solid rgba(120, 200, 255, 0.2);
    color: var(--text-dim);
    padding: 0.38rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-top: 0.4rem;
}
.neural-test-btn:hover { color: var(--accent); border-color: rgba(120,200,255,0.4); }
.neural-test-btn[disabled] { opacity: 0.4; cursor: default; }

/* ── World Boss stat hint on status screen ── */
.wb-stat-hint {
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-top: 0.2rem;
}
.wb-linked-stats {
    color: var(--text-dim);
    opacity: 0.6;
}

/* ── Neural Link seed cards ── */
.ng-seeds {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.ng-seeds-loading {
    font-family: var(--mono);
    font-size: 0.58rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-align: center;
    padding: 0.4rem 0;
    opacity: 0.6;
}
.ng-seeds-label {
    font-family: var(--mono);
    font-size: 0.52rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.15rem;
    opacity: 0.7;
}
.ng-seed-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-left: 2px solid rgba(120, 200, 255, 0.3);
    background: rgba(120, 200, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.ng-seed-card:hover {
    border-left-color: rgba(120, 200, 255, 0.7);
    background: rgba(120, 200, 255, 0.07);
}
.ng-seed-card--selected {
    border-left-color: var(--accent);
    background: rgba(79, 195, 247, 0.08);
}
.ng-seed-type {
    font-family: var(--mono);
    font-size: 0.5rem;
    letter-spacing: 0.12em;
    color: rgba(120, 200, 255, 0.6);
}
.ng-seed-text {
    font-size: 0.7rem;
    color: var(--text);
    line-height: 1.4;
}

/* ── Boss defeated overlay ── */
.boss-defeated-overlay {
    text-align: center;
}
.bd-label {
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--green);
    margin: 1rem 0 0.5rem;
    line-height: 1.4;
}
.bd-enemy {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: rgba(255, 100, 100, 0.7);
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
}
.bd-weapon {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: rgba(120, 200, 255, 0.7);
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
}
.bd-body {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 1.2rem;
}

/* ── Defeated boss entry in history list ── */
.ns-entity-card--defeated {
    border-left-color: rgba(0, 230, 118, 0.4);
    opacity: 0.6;
}
.ns-entity-label--defeated {
    color: rgba(0, 230, 118, 0.8);
}
.ns-list-label--defeated {
    margin-top: 1.2rem;
}

/* ════════════════════════════════════════════════════════════════
   STAGE 6A — CHARACTER CREATION: ARCHETYPE SCAN + SIGIL PICKER
   ════════════════════════════════════════════════════════════════ */

/* ── Archetype scan screen wrapper ── */
.archetype-scan-wrap {
    padding: 24px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

.archetype-scan-header {
    text-align: left;
}

.archetype-sys-label {
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.archetype-scan-lines {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.9;
    letter-spacing: 1px;
    min-height: 96px;
}

/* ── Archetype cards grid ── */
.archetype-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.archetype-card {
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 16px 14px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
    --archetype-colour: var(--accent);
}

.archetype-card:hover {
    border-color: var(--archetype-colour, var(--accent));
    box-shadow: 0 0 14px color-mix(in srgb, var(--archetype-colour, var(--accent)) 30%, transparent);
}

.archetype-card--selected {
    border-color: var(--archetype-colour, var(--accent)) !important;
    box-shadow: 0 0 20px color-mix(in srgb, var(--archetype-colour, var(--accent)) 40%, transparent) !important;
}

.archetype-card--dim {
    opacity: 0.35;
}

.archetype-card-id {
    font-size: 0.62rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.archetype-card-name {
    font-size: 0.95rem;
    color: #fff;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 8px;
}

.archetype-card-desc {
    font-size: 0.68rem;
    color: var(--text-dim);
    line-height: 1.55;
    margin-bottom: 12px;
}

.archetype-card-confirm {
    font-size: 0.62rem;
    color: var(--archetype-colour, var(--accent));
    letter-spacing: 2px;
    opacity: 0.7;
}

.archetype-card:hover .archetype-card-confirm,
.archetype-card--selected .archetype-card-confirm {
    opacity: 1;
}

/* Per-archetype colour accents on card hover/selected */
.archetype-card[data-archetype="ghost"]     { --archetype-colour: #42a5f5; }
.archetype-card[data-archetype="architect"] { --archetype-colour: #ab47bc; }
.archetype-card[data-archetype="enforcer"]  { --archetype-colour: #ef5350; }
.archetype-card[data-archetype="phantom"]   { --archetype-colour: #ffa726; }

/* ── Sigil picker ── */
.sigil-picker {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.4s ease;
}

.sigil-picker-label {
    font-size: 0.72rem;
    color: var(--accent);
    letter-spacing: 3px;
}

.sigil-picker-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    line-height: 1.5;
}

.sigil-options {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.sigil-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 16px;
    border: 1px solid var(--border);
    background: var(--panel);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    min-width: 100px;
}

.sigil-option:hover {
    border-color: var(--accent);
}

.sigil-option--selected {
    border-color: var(--accent) !important;
    box-shadow: 0 0 16px rgba(79, 195, 247, 0.3);
}

/* The sigil shape: a solid colour block with clip-path applied via JS */
.sigil-shape {
    width: 56px;
    height: 72px;
    background: var(--accent);
    /* clip-path applied dynamically in JS */
    transition: box-shadow 0.25s ease;
}

.sigil-option-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    letter-spacing: 2px;
}

/* ── Archetype identity row on status screen ── */
.archetype-identity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    margin-bottom: 2px;
}

.status-sigil {
    width: 18px;
    height: 24px;
    flex-shrink: 0;
    /* clip-path and bg applied via JS */
}

.archetype-badge {
    font-size: 0.62rem;
    letter-spacing: 3px;
    padding: 2px 8px;
    border: 1px solid currentColor;
    /* color and border-color applied via JS */
    opacity: 0.85;
}


/* ════════════════════════════════════════════════════════════════
   STAGE 6B — TUTORIAL DIRECTIVE: ORIENTATION PROTOCOL CARD
   ════════════════════════════════════════════════════════════════ */

/* Accent-bordered card with a subtle top glow — visually distinct
   from standard quest cards without being loud */
.quest-card--tutorial {
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(79, 195, 247, 0.12), inset 0 0 0 0 transparent;
    position: relative;
}

/* Thin accent line at the top of the card */
.quest-card--tutorial::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* Orientation protocol label — replaces the stat/tier header */
.qc-tutorial-label {
    font-size: 0.65rem;
    color: var(--accent);
    letter-spacing: 3px;
    font-weight: 700;
}

/* ── Tutorial navigation section ── */
/* Shown inside the tutorial card above the footer.
   Prompts the operator to visit the status screen, then return here. */
.qc-tutorial-nav {
    margin: 14px 0 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qc-tutorial-status-btn {
    font-family: var(--mono, 'Share Tech Mono', monospace);
    font-size: 0.7rem;
    letter-spacing: 2px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-transform: uppercase;
    width: 100%;
}
.qc-tutorial-status-btn:hover,
.qc-tutorial-status-btn:active {
    background: rgba(79, 195, 247, 0.08);
}

.qc-tutorial-nav-hint {
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    line-height: 1.5;
    text-align: center;
    opacity: 0.7;
}


/* ════════════════════════════════════════════════════════════════
   LOG ARCHIVE BUTTON (gold row)
   ════════════════════════════════════════════════════════════════ */
.log-archive-btn {
    font-family: var(--mono, 'Share Tech Mono', monospace);
    font-size: 0.6rem;
    letter-spacing: 2px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    border-radius: 2px;
}
.log-archive-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}


/* ════════════════════════════════════════════════════════════════
   LOG ARCHIVE SCREEN
   ════════════════════════════════════════════════════════════════ */
.log-archive-header {
    padding: 20px 0 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.log-archive-header h2 {
    font-family: var(--mono, 'Share Tech Mono', monospace);
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 3px;
    margin-bottom: 4px;
}
.log-archive-sub {
    font-family: var(--mono, 'Share Tech Mono', monospace);
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 2px;
}
.log-archive-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 72vh;
    overflow-y: auto;
}
.la-entry {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 7px 0;
    border-bottom: 1px solid rgba(42,42,74,0.5);
    font-family: var(--mono, 'Share Tech Mono', monospace);
    font-size: 0.62rem;
    line-height: 1.5;
    color: var(--text-dim);
}
.la-entry--accent       { color: var(--accent); }
.la-entry--warn         { color: var(--red); }
.la-entry--transmission { color: var(--gold); }
.la-ts {
    font-size: 0.52rem;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.6;
}
.la-msg { flex: 1; word-break: break-word; }
.la-empty {
    font-family: var(--mono, 'Share Tech Mono', monospace);
    font-size: 0.65rem;
    color: var(--text-dim);
    text-align: center;
    padding: 40px 0;
    letter-spacing: 2px;
}


/* ════════════════════════════════════════════════════════════════
   TERMINAL FLOOR — HEIGHT AND LAYOUT FIX
   The scene needs to fill the viewport. The structures were
   being cramped at the bottom with dead space above because
   min-height + flex-direction:column wasn't stretching to the
   full available height. We use 100vh with a minimum cap instead,
   and push the stage to occupy all remaining vertical space.
   ════════════════════════════════════════════════════════════════ */
#screen-terminal {
    min-height: calc(100vh - 80px);  /* fill viewport, account for body padding */
    height: calc(100vh - 80px);
}
.tf-stage {
    flex: 1;
    align-items: flex-end;
    padding-top: 60px;    /* more breathing room above the structures */
}
/* The background grid should fill the full screen height */
.tf-grid-lines {
    /* Override the inset to make the grid fill more space */
    inset: -40% -20%;
}


/* ════════════════════════════════════════════════════════════════
   STAGE 6C — TERMINAL FLOOR (WORLD STRIP)
   ════════════════════════════════════════════════════════════════ */

/* ── Keyframes ─────────────────────────────────────────────────── */

/* Perspective grid scrolls slowly toward viewer, giving depth illusion */
@keyframes tf-grid-scroll {
    0%   { background-position: 50% 0%; }
    100% { background-position: 50% 100%; }
}

/* Structures illuminate: opacity 0 → 1 staggered per structure */
@keyframes tf-illuminate {
    from { opacity: 0; filter: brightness(0.1); }
    to   { opacity: 1; filter: brightness(1); }
}

/* Avatar materialises: drops from above with a brief bounce */
@keyframes tf-avatar-drop {
    0%   { transform: translateY(-28px); opacity: 0; }
    70%  { transform: translateY(4px);   opacity: 1; }
    100% { transform: translateY(0);     opacity: 1; }
}

/* Slow breathing glow on each structure's inner element */
@keyframes tf-structure-breathe {
    0%, 100% { box-shadow: 0 0 6px rgba(79,195,247,0.15); }
    50%       { box-shadow: 0 0 14px rgba(79,195,247,0.35); }
}

/* Active state pulse — OPERATIONS when directives incomplete */
@keyframes tf-pulse-warn {
    0%, 100% { box-shadow: 0 0 4px rgba(255,82,82,0.2); }
    50%       { box-shadow: 0 0 16px rgba(255,82,82,0.7); }
}

/* NEURAL blink indicator — when active incursions/bosses present */
@keyframes tf-blink-neural {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* Avatar glow pulse */
@keyframes tf-avatar-glow {
    0%, 100% { filter: brightness(1); }
    50%       { filter: brightness(1.4); }
}

/* ── Screen wrapper ─────────────────────────────────────────────── */
#screen-terminal {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    display: none;
    flex-direction: column;
    padding: 0;
}
#screen-terminal.active { display: flex; }

/* ── Layer 1: Perspective background grid ─────────────────────── */
.tf-bg-grid {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.tf-grid-lines {
    position: absolute;
    inset: -20% -20%;
    /* Perspective grid: a repeating pattern that recedes to a vanishing point.
       Uses two background images:
         - Horizontal bands (narrowing toward top to simulate perspective)
         - Vertical lines converging at centre
       Colour: barely visible dark-blue on near-black */
    background-image:
        linear-gradient(to bottom,
            transparent 0%,
            rgba(79,195,247,0.04) 1px,
            transparent 1px,
            transparent 7%
        ),
        linear-gradient(to right,
            transparent 0%,
            rgba(79,195,247,0.025) 1px,
            transparent 1px,
            transparent 12%
        );
    background-size: 100% 7%, 12% 100%;
    animation: tf-grid-scroll 18s linear infinite;
    transform-origin: 50% 100%;
    transform: perspective(300px) rotateX(25deg) scaleX(1.4);
    opacity: 0.7;
}

/* ── Arrival overlay (cinematic text, one-time) ──────────────── */
.tf-arrival-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 24px;
    pointer-events: all;
}
.tf-arrival-lines {
    font-family: var(--mono, 'Share Tech Mono', monospace);
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 1px;
    line-height: 2.2;
    margin-bottom: 32px;
}
.tf-arrival-line {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.tf-arrival-line--visible { opacity: 1; }
.tf-arrival-line--dim     { color: var(--text-dim); }
.tf-arrival-tap {
    font-family: var(--mono, 'Share Tech Mono', monospace);
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    animation: blink 1.2s step-end infinite;
    margin-top: 8px;
}

/* ── Layer 2: Stage (structures container) ─────────────────────── */
.tf-stage {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;          /* structures sit on the ground plane */
    justify-content: space-around;
    padding: 40px 12px 0;
    gap: 4px;
    flex: 1;
}

/* ── Structure base ─────────────────────────────────────────── */
.tf-structure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    /* Starts dark — JS illuminates staggered on arrival */
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.2s ease;
}
.tf-structure:hover { transform: translateY(-2px); }
.tf-structure:active { transform: translateY(0); }

/* Illuminated state (added by JS after arrival or on return visit) */
.tf-structure--lit { opacity: 1; }

/* Active state: structure has something requiring attention */
.tf-structure--active .tf-struct-inner {
    animation: tf-pulse-warn 1.6s ease-in-out infinite;
}

.tf-struct-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: tf-structure-breathe 4s ease-in-out infinite;
}
.tf-struct-label {
    font-family: var(--mono, 'Share Tech Mono', monospace);
    font-size: 0.42rem;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-align: center;
    line-height: 1.3;
    margin-top: 2px;
    transition: color 0.3s;
}
.tf-structure--lit .tf-struct-label { color: var(--accent); }

/* Blink indicator (small dot) */
.tf-struct-blink {
    position: absolute;
    top: 3px;
    right: -4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--red);
    display: none;
}
.tf-struct-blink--active {
    display: block;
    animation: tf-blink-neural 0.9s step-end infinite;
}
/* Neural blink uses same keyframe but different colour when needed */
.tf-struct-blink--neural.tf-struct-blink--active {
    background: var(--purple);
}

/* ── Structure: FIELD ARCHIVE (comms tower/antenna) ──────────── */
.tf-structure--archive .tf-struct-inner { gap: 0; }

.tf-antenna-mast {
    width: 3px;
    height: 56px;
    background: var(--accent);
    opacity: 0.7;
    position: relative;
}
.tf-antenna-mast::before,
.tf-antenna-mast::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 2px;
    background: var(--accent);
    opacity: 0.5;
}
.tf-antenna-mast::before { top: 12px; width: 18px; }
.tf-antenna-mast::after  { top: 24px; width: 12px; }

.tf-antenna-arms {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}
.tf-antenna-arm {
    width: 2px;
    height: 18px;
    background: var(--accent);
    opacity: 0.5;
    transform-origin: top center;
}
.tf-antenna-arm--l { transform: rotate(-28deg); }
.tf-antenna-arm--r { transform: rotate(28deg); }

.tf-antenna-base {
    width: 28px;
    height: 6px;
    background: linear-gradient(to bottom, var(--panel), var(--border));
    border: 1px solid var(--border);
}

/* ── Structure: SUPPLY CACHE (container stack) ────────────────── */
.tf-structure--cache .tf-struct-inner { gap: 3px; }

.tf-container {
    border: 1px solid var(--border);
    background: var(--panel);
    position: relative;
}
.tf-container::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(79,195,247,0.08);
}
.tf-container--top { width: 36px; height: 14px; }
.tf-container--mid { width: 44px; height: 16px; }
.tf-container--bot { width: 50px; height: 18px; }

/* ── Structure: COMMAND POST (terminal + monitor) ─────────────── */
.tf-structure--command .tf-struct-inner { gap: 0; }

.tf-monitor {
    width: 42px;
    height: 30px;
    border: 2px solid var(--accent);
    border-bottom: none;
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px 2px 0 0;
    position: relative;
}
.tf-monitor-screen {
    width: 28px;
    height: 18px;
    background: rgba(79,195,247,0.12);
    border: 1px solid rgba(79,195,247,0.25);
    animation: tf-structure-breathe 3s ease-in-out infinite;
}
.tf-desk {
    width: 52px;
    height: 8px;
    background: var(--border);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
}

/* ── Structure: OPERATIONS (mission board / briefing wall) ───── */
.tf-structure--ops .tf-struct-inner { gap: 0; }

.tf-board {
    width: 38px;
    height: 52px;
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 4px;
}
.tf-board-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    height: 100%;
}
.tf-board-grid > div {
    background: rgba(79,195,247,0.08);
    border: 1px solid rgba(79,195,247,0.12);
}

/* ── Structure: NEURAL LINK (server rack) ─────────────────────── */
.tf-structure--neural .tf-struct-inner { gap: 2px; }

.tf-rack {
    width: 32px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 4px 3px;
}
.tf-rack-unit {
    height: 7px;
    background: rgba(79,195,247,0.06);
    border: 1px solid rgba(79,195,247,0.1);
    position: relative;
}
.tf-rack-unit::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-dim);
}
.tf-rack-unit--active::before {
    background: var(--accent);
    box-shadow: 0 0 4px var(--accent);
    animation: tf-blink-neural 1.4s step-end infinite;
}

/* ── Layer 3: Ground plane + avatar ──────────────────────────── */
.tf-ground-wrap {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 32px;
}
.tf-ground-line {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent) 20%, var(--accent) 80%, transparent);
    opacity: 0.35;
}

/* Avatar container — slides horizontally with CSS transition */
.tf-avatar {
    position: absolute;
    bottom: 17px;           /* sits on the ground line */
    left: 0;
    width: 20px;
    height: 28px;
    transform: translateX(0);
    transition: transform 0.4s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.tf-avatar-shape {
    width: 18px;
    height: 26px;
    /* clip-path applied by JS from player sigil */
    /* default fallback: simple rectangle */
    clip-path: polygon(30% 0%, 70% 0%, 75% 25%, 80% 25%, 80% 50%, 70% 50%, 72% 65%, 80% 68%, 78% 85%, 60% 85%, 58% 100%, 42% 100%, 40% 85%, 22% 85%, 20% 68%, 28% 65%, 30% 50%, 20% 50%, 20% 25%, 25% 25%);
    background: var(--accent);  /* overridden by JS with archetype colour */
    animation: tf-avatar-glow 3s ease-in-out infinite;
}

/* Avatar appearing for the first time */
.tf-avatar--materialise { animation: tf-avatar-drop 0.5s ease both; }

/* ── Back link ────────────────────────────────────────────────── */
.tf-back-link {
    position: relative;
    z-index: 10;
    margin: 12px 0 4px;
    text-align: center;
    padding-bottom: 4px;
}

/* ── Nav button variant for Terminal Floor ──────────────────── */
.nav-btn--terminal-floor {
    background: transparent;
    border-color: var(--accent-dim);
    color: var(--text-dim);
    font-size: 0.7rem;
    letter-spacing: 3px;
    margin-top: 6px;
}
.nav-btn--terminal-floor:hover {
    border-color: var(--accent);
    color: var(--accent);
}
/* ════════════════════════════════════════════════════════════
   BASE MAP — facility node styles
   ════════════════════════════════════════════════════════════ */

/* Facility node — shared base on top of existing .map-zone */
.map-facility {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.map-facility:hover {
    border-color: rgba(79,195,247,0.5);
    box-shadow: inset 0 0 14px rgba(79,195,247,0.07);
}

.map-facility:active {
    background: rgba(79,195,247,0.05);
}

.facility-label {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 2px;
    color: rgba(200,214,229,0.7);
    text-align: center;
    line-height: 1.3;
    padding: 0 4px;
    text-shadow: 0 0 8px rgba(79,195,247,0.3);
}

/* COMMAND POST — centre anchor, slightly elevated */
.map-facility--command {
    border-color: rgba(79,195,247,0.35);
    background: rgba(13,13,32,0.9);
}
.map-facility--command .facility-label {
    color: var(--accent);
    font-size: 0.65rem;
    letter-spacing: 2.5px;
}

.facility-command-pin {
    font-size: 1.1rem;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(79,195,247,0.4);
    margin-bottom: 6px;
    animation: hub-pulse 2.4s ease-in-out infinite;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Active blink indicator */
.facility-blink {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff4444;
    box-shadow: 0 0 6px rgba(255,68,68,0.8);
    animation: blink-pulse 1.2s ease-in-out infinite;
}

@keyframes blink-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.15; }
}

/* Base Map arrival overlay reuses tf-arrival-overlay styles — no extra needed */

/* ── Map avatar ─────────────────────────────────────────────── */
#map-avatar {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(79,195,247,0.9);
    pointer-events: none;
    z-index: 10;
    transition: left 0.35s ease, top 0.35s ease;
}

#map-avatar.map-avatar--walking {
    animation: avatar-walk 0.35s steps(2) forwards;
}

@keyframes avatar-walk {
    0%   { opacity: 1;    text-shadow: 0 0 10px rgba(79,195,247,0.9); }
    50%  { opacity: 0.55; text-shadow: 0 0 4px  rgba(79,195,247,0.4); }
    100% { opacity: 1;    text-shadow: 0 0 10px rgba(79,195,247,0.9); }
}

/* ── Dot trail ──────────────────────────────────────────────── */
.map-trail-dot {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    color: rgba(79,195,247,0.25);
    pointer-events: none;
    z-index: 9;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.map-trail-dot--visible {
    opacity: 1;
}

/* ═══════════════════════════════════════════════
   SETTINGS TABS (Item 7)
   ═══════════════════════════════════════════════ */

.stab-bar {
    display: flex;
    gap: 2px;
    padding: 0 0 18px 0;
    border-bottom: 1px solid rgba(79, 195, 247, 0.12);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.stab {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 2px;
    color: rgba(200, 214, 229, 0.4);
    background: transparent;
    border: 1px solid rgba(200, 214, 229, 0.1);
    padding: 7px 13px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    flex: 1;
    text-align: center;
    min-width: 60px;
}
.stab:hover {
    color: rgba(200, 214, 229, 0.7);
    border-color: rgba(79, 195, 247, 0.25);
}
.stab--active {
    color: var(--accent, #4fc3f7);
    border-color: rgba(79, 195, 247, 0.5);
    background: rgba(79, 195, 247, 0.06);
}
.stab--danger {
    color: rgba(255, 83, 112, 0.45);
    border-color: rgba(255, 83, 112, 0.15);
}
.stab--danger:hover {
    color: rgba(255, 83, 112, 0.7);
    border-color: rgba(255, 83, 112, 0.35);
}
.stab--danger.stab--active {
    color: #ff5370;
    border-color: rgba(255, 83, 112, 0.6);
    background: rgba(255, 83, 112, 0.06);
}

.stab-panel {
    width: 100%;
}

/* Operator profile textarea in SYSTEM tab */
.settings-profile-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(79, 195, 247, 0.03);
    border: 1px solid rgba(79, 195, 247, 0.18);
    color: var(--text, #c8d6e5);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.68rem;
    line-height: 1.7;
    padding: 10px 12px;
    resize: vertical;
    outline: none;
    margin-bottom: 8px;
}
.settings-profile-input:focus {
    border-color: rgba(79, 195, 247, 0.45);
}


/* ═══════════════════════════════════════════════
   SUGGESTED STRIKES (Item 6)
   ═══════════════════════════════════════════════ */

.suggested-strikes-section {
    width: 100%;
    margin: 14px 0 4px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ss-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ss-icon {
    font-size: 0.8rem;
    opacity: 0.7;
}
.ss-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 2.5px;
}

.ss-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ss-card {
    background: rgba(79, 195, 247, 0.04);
    border: 1px solid rgba(79, 195, 247, 0.15);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ss-card-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    color: var(--accent, #4fc3f7);
}
.ss-card-desc {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    line-height: 1.65;
    color: rgba(200, 214, 229, 0.55);
}
.ss-card-xp {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.56rem;
    letter-spacing: 1px;
    color: rgba(200, 214, 229, 0.35);
    margin-top: 2px;
}

.ss-view-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: rgba(200, 214, 229, 0.4);
    background: transparent;
    border: 1px solid rgba(200, 214, 229, 0.12);
    padding: 8px 12px;
    cursor: pointer;
    text-align: center;
    transition: color 0.15s ease, border-color 0.15s ease;
    width: 100%;
}
.ss-view-btn:hover {
    color: var(--accent, #4fc3f7);
    border-color: rgba(79, 195, 247, 0.3);
}
.ss-neural-prompt {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    color: var(--accent, #4fc3f7);
    background: transparent;
    border: 1px solid rgba(79, 195, 247, 0.25);
    padding: 10px 12px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    display: block;
    margin-top: 6px;
    transition: background 0.15s ease, border-color 0.15s ease;
    line-height: 1.5;
}
.ss-neural-prompt:hover {
    background: rgba(79, 195, 247, 0.06);
    border-color: rgba(79, 195, 247, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   SYD GES — style_additions.css
   New component styles for the Gamified Evolution System.
   Append these to the existing /css/style.css (do not replace it).

   INSTRUCTION: Paste the full contents of this file at the end
   of /terminal/css/style.css.

   Naming: GES uses the same CSS custom properties already defined
   in style.css (--accent, --bg, --surface, --stat-str, etc.).
   New properties added here:
     --stat-luck: #c8a2c8   (lilac — luck is derived, visually softer)
     --danger:    #ff4d4d   (danger zone actions)
   ═══════════════════════════════════════════════════════════════ */

/* ─── NEW CSS CUSTOM PROPERTIES ──────────────────────────────── */
:root {
    --stat-luck: #c8a2c8;
    --danger:    #ff4d4d;
    --sig-gold:  #f0c040;
}

/* ─── ONBOARDING TERMINAL ────────────────────────────────────── */
.screen-inner--terminal {
    display:         flex;
    flex-direction:  column;
    justify-content: flex-start;
    padding:         40px 24px 80px;
    min-height:      100vh;
}

.onboarding-lines {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    margin-bottom:  32px;
    cursor:         pointer;
}

.onboarding-line {
    font-family: var(--font-mono);
    font-size:   0.9rem;
    color:       var(--text-secondary);
    opacity:     0;
    transform:   translateY(6px);
    transition:  opacity 0.35s ease, transform 0.35s ease;
    line-height: 1.6;
}
.onboarding-line--visible {
    opacity:   1;
    transform: none;
}
.onboarding-line--signal { color: var(--accent); }
.onboarding-line--spacer { height: 8px; }

.onboarding-name-input {
    display:     flex;
    align-items: center;
    gap:         8px;
    margin-top:  24px;
}
.onboarding-prompt-label {
    font-family:  var(--font-mono);
    font-size:    0.85rem;
    color:        var(--accent);
    white-space:  nowrap;
}
.onboarding-inline-input {
    background:   transparent;
    border:       none;
    border-bottom: 1px solid var(--accent);
    color:        var(--text-primary);
    font-family:  var(--font-mono);
    font-size:    0.9rem;
    padding:      4px 0;
    outline:      none;
    flex:         1;
    caret-color:  var(--accent);
}

/* ─── SCAN SCREEN ────────────────────────────────────────────── */
.screen-inner--scan {
    display:        flex;
    flex-direction: column;
    padding:        24px 24px 80px;
    min-height:     100vh;
}

.scan-progress-bar {
    width:         100%;
    height:        3px;
    background:    var(--surface);
    border-radius: 2px;
    margin-bottom: 6px;
    overflow:      hidden;
}
.scan-progress-fill {
    height:        100%;
    background:    var(--accent);
    border-radius: 2px;
    transition:    width 0.6s ease;
}
.scan-progress-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    margin-bottom: 32px;
    letter-spacing: 0.08em;
}

.scan-intro,
.scan-game,
.scan-complete {
    flex: 1;
}

.scan-syd-voice {
    display:        flex;
    flex-direction: column;
    gap:            12px;
    margin-bottom:  40px;
}
.scan-voice-line {
    font-family:  var(--font-mono);
    font-size:    1rem;
    color:        var(--text-primary);
    opacity:      0;
    transform:    translateY(8px);
    transition:   opacity 0.4s ease, transform 0.4s ease;
    line-height:  1.7;
}
.scan-voice-line--visible {
    opacity:   1;
    transform: none;
}

.scan-game-header {
    margin-bottom: 24px;
}
.scan-game-tag {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--accent);
    letter-spacing: 0.1em;
}

/* Placeholder cards — used during stub phase */
.scan-placeholder {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    text-align:      center;
    padding:         48px 24px;
    border:          1px solid var(--border);
    border-radius:   4px;
    gap:             16px;
}
.scan-placeholder-icon {
    font-size: 2.5rem;
    color:     var(--accent);
    opacity:   0.6;
}
.scan-placeholder-label {
    font-family:   var(--font-mono);
    font-size:     1rem;
    color:         var(--text-primary);
    font-weight:   700;
    letter-spacing: 0.12em;
}
.scan-placeholder-sub {
    font-size:  0.85rem;
    color:      var(--text-secondary);
    max-width:  280px;
    line-height: 1.6;
}
.scan-placeholder-dev {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--accent);
    opacity:     0.5;
}

.scan-complete {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    gap:             16px;
    min-height:      300px;
}
.scan-complete-icon {
    font-size: 3rem;
    color:     var(--accent);
}
.scan-complete-label {
    font-family: var(--font-mono);
    font-size:   1rem;
    color:       var(--accent);
    letter-spacing: 0.12em;
}
.scan-complete-sub {
    font-size: 0.85rem;
    color:     var(--text-secondary);
}

/* ─── PATH SCREENS ───────────────────────────────────────────── */
.screen-inner--centered {
    display:         flex;
    flex-direction:  column;
    justify-content: flex-start;
    align-items:     center;
    padding:         40px 24px 80px;
    min-height:      100vh;
    width:           100%;
}
.screen-inner--narrow {
    padding:   32px 24px 80px;
    max-width: 520px;
    margin:    0 auto;
    width:     100%;
}

.path-select {
    width:     100%;
    max-width: 480px;
}

.path-syd-voice {
    margin-bottom: 32px;
}
.path-voice-line {
    font-family: var(--font-mono);
    font-size:   0.95rem;
    color:       var(--text-primary);
    line-height: 1.7;
    margin-bottom: 8px;
    opacity:     0;
    transform:   translateY(6px);
    transition:  opacity 0.4s ease, transform 0.4s ease;
}
.path-voice-line--visible {
    opacity:   1;
    transform: none;
}

.path-track-choices {
    display:        flex;
    flex-direction: column;
    gap:            16px;
}
.path-track-btn {
    display:        flex;
    flex-direction: column;
    gap:            4px;
    text-align:     left;
    background:     var(--surface);
    border:         1px solid var(--border);
    border-radius:  4px;
    padding:        20px;
    cursor:         pointer;
    transition:     border-color 0.2s ease, background 0.2s ease;
}
.path-track-btn:hover {
    border-color: var(--accent);
    background:   rgba(79, 195, 247, 0.05);
}
.path-track-tag {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.path-track-label {
    font-size:   1rem;
    font-weight: 600;
    color:       var(--text-primary);
}
.path-track-sub {
    font-size:  0.83rem;
    color:      var(--text-secondary);
    line-height: 1.5;
    margin-top:  4px;
}

.path-input-group {
    margin-bottom: 20px;
}
.path-input-label {
    display:       block;
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
.path-textarea {
    width:       100%;
    min-height:  160px;
    background:  var(--surface);
    border:      1px solid var(--border);
    border-radius: 4px;
    color:       var(--text-primary);
    font-family: var(--font-mono);
    font-size:   0.88rem;
    padding:     12px;
    resize:      vertical;
    outline:     none;
    line-height: 1.6;
    box-sizing:  border-box;
}
.path-textarea--short { min-height: 80px; }
.path-textarea:focus  { border-color: var(--accent); }

.path-progress-bar {
    width:         100%;
    height:        3px;
    background:    var(--surface);
    border-radius: 2px;
    margin-bottom: 6px;
    overflow:      hidden;
}
.path-progress-fill {
    height:        100%;
    background:    var(--accent);
    border-radius: 2px;
    transition:    width 0.5s ease;
}
.path-progress-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--text-secondary);
    margin-bottom: 28px;
}

.path-action-row {
    display:     flex;
    gap:         12px;
    align-items: center;
    margin-top:  8px;
}
.path-skip-btn {
    background:  transparent;
    border:      none;
    color:       var(--text-secondary);
    font-family: var(--font-mono);
    font-size:   0.8rem;
    cursor:      pointer;
    padding:     8px 0;
    text-decoration: underline;
}
.path-skip-btn:hover { color: var(--text-primary); }

.path-back-btn {
    display:       block;
    background:    transparent;
    border:        none;
    color:         var(--text-secondary);
    font-family:   var(--font-mono);
    font-size:     0.8rem;
    cursor:        pointer;
    margin-bottom: 24px;
    padding:       0;
}
.path-back-btn:hover { color: var(--accent); }

.path-privacy-note {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
    margin-top:  16px;
    opacity:     0.7;
}

/* Role mapping cards */
.role-mapping-wrap { width: 100%; max-width: 480px; }
.role-card-stack {
    display:        flex;
    flex-direction: column;
    gap:            14px;
    margin-top:     24px;
}
.role-card {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    text-align:     left;
    background:     var(--surface);
    border:         1px solid var(--border);
    border-radius:  4px;
    padding:        18px;
    cursor:         pointer;
    transition:     border-color 0.2s, background 0.2s;
}
.role-card:hover { border-color: var(--accent); background: rgba(79,195,247,0.05); }
.role-card-name {
    font-family:   var(--font-mono);
    font-size:     0.85rem;
    font-weight:   700;
    color:         var(--accent);
    letter-spacing: 0.08em;
}
.role-card-narrative {
    font-size:  0.82rem;
    color:      var(--text-secondary);
    line-height: 1.5;
}
.role-card-roles {
    display:   flex;
    flex-wrap: wrap;
    gap:       6px;
    margin-top: 6px;
}
.role-tag {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    background:  rgba(255,255,255,0.05);
    border:      1px solid var(--border);
    border-radius: 2px;
    padding:     2px 8px;
}

/* Path loading */
.path-loading {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             20px;
    padding-top:     80px;
}
.path-loading-icon {
    font-size: 3rem;
    color:     var(--accent);
    animation: pulse 1.6s infinite;
}
.path-loading-label {
    font-family:   var(--font-mono);
    font-size:     0.85rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    text-align:    center;
}
.path-loading-bar {
    width:         240px;
    height:        3px;
    background:    var(--border);
    border-radius: 2px;
    overflow:      hidden;
}
.path-loading-fill {
    height:     100%;
    background: var(--accent);
    transition: width 0.6s ease;
    width:      0%;
}
.path-loading-sub {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
    opacity:     0.6;
}
.path-loading-tip {
    font-size:    0.82rem;
    color:        var(--text-secondary);
    line-height:  1.6;
    max-width:    300px;
    text-align:   center;
    min-height:   3em;
    transition:   opacity 0.4s ease;
    margin-top:   8px;
    font-style:   italic;
}

/* Aspiration */
.aspiration-wrap { width: 100%; max-width: 480px; }

/* ─── STATUS WINDOW ──────────────────────────────────────────── */
.screen-inner--status {
    display:        flex;
    flex-direction: column;
    min-height:     100vh;
    padding:        0;
}

.status-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         16px 20px 12px;
    border-bottom:   1px solid var(--border);
    position:        sticky;
    top:             0;
    background:      var(--bg);
    z-index:         10;
}
.status-header-name {
    font-family:   var(--font-mono);
    font-size:     0.85rem;
    font-weight:   700;
    color:         var(--text-primary);
    letter-spacing: 0.06em;
}
.status-header-badges {
    display:     flex;
    align-items: center;
    gap:         8px;
}
.status-header-level {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--text-secondary);
}
.status-header-sig--btn {
    background:  transparent;
    border:      none;
    padding:     0;
    cursor:      pointer;
    font-family: inherit;
    font-size:   inherit;
    color:       inherit;
    line-height: inherit;
}

.status-header-sig {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--sig-gold);
}

.status-tab-nav {
    display:          flex;
    border-bottom:    1px solid var(--border);
    overflow-x:       auto;
    scrollbar-width:  none;
    position:         sticky;
    top:              53px;
    background:       var(--bg);
    z-index:          9;
}
.status-tab-nav::-webkit-scrollbar { display: none; }

.status-tab-btn {
    flex:          0 0 auto;
    background:    transparent;
    border:        none;
    border-bottom: 2px solid transparent;
    padding:       10px 16px;
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--text-secondary);
    cursor:        pointer;
    letter-spacing: 0.08em;
    transition:    color 0.2s, border-color 0.2s;
    white-space:   nowrap;
}
.status-tab-btn--active {
    color:        var(--accent);
    border-color: var(--accent);
}

.status-tab-content {
    flex:       1;
    overflow-y: auto;
    padding:    20px 20px 80px;
}

/* OPERATIVE TAB */
.status-operative-tab { display: flex; flex-direction: column; gap: 24px; }
.sot-identity { display: flex; flex-direction: column; gap: 6px; }
.sot-title {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--accent);
    letter-spacing: 0.12em;
}
.sot-name {
    font-size:   1.4rem;
    font-weight: 700;
    color:       var(--text-primary);
    letter-spacing: 0.04em;
}
.sot-badges { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.sot-level-badge, .sot-sig-badge {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    padding:     3px 8px;
    border:      1px solid var(--border);
    border-radius: 2px;
}
.sot-sig-badge { color: var(--sig-gold); border-color: var(--sig-gold); }

.sot-bar-label {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.06em;
}
.sot-bar {
    width:         100%;
    height:        6px;
    background:    var(--surface);
    border-radius: 3px;
    overflow:      hidden;
}
.sot-bar--stat { height: 4px; }
.sot-bar-fill {
    height:     100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.sot-bar-fill--xp       { background: var(--accent); }
.sot-bar-fill--momentum { background: #81d4fa; }
.sot-bar-fill--capacity { background: #80cbc4; }
.sot-bar-fill--amber    { background: #ffb74d; }
.sot-bar-fill--critical { background: var(--danger); }

.sot-metrics { display: flex; flex-direction: column; gap: 16px; }
.sot-metric  { display: flex; flex-direction: column; gap: 6px; }
.sot-metric-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--text-secondary);
    letter-spacing: 0.1em;
}
.sot-metric-value {
    font-family: var(--font-mono);
    font-size:   0.8rem;
    color:       var(--text-primary);
    margin-top:  2px;
}

.sot-stat-preview { margin-top: 4px; }
.sot-stat-preview-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}
.sot-stat-rows { display: flex; flex-direction: column; gap: 10px; }
.sot-stat-row  { display: flex; align-items: center; gap: 10px; }
.sot-stat-label {
    font-family:  var(--font-mono);
    font-size:    0.72rem;
    font-weight:  700;
    width:        28px;
    flex-shrink:  0;
    letter-spacing: 0.06em;
}
.sot-stat-val {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-primary);
    width:       28px;
    text-align:  right;
    flex-shrink: 0;
}

.sot-nav-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* STATS TAB */
.status-stats-tab { display: flex; flex-direction: column; gap: 20px; }
.stats-tab-syd-voice {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--accent);
    opacity:     0.8;
}
.stats-full-list { display: flex; flex-direction: column; gap: 20px; }
.stats-row {
    padding:       14px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    cursor:        pointer;
    transition:    border-color 0.2s;
}
.stats-row:hover { border-color: var(--accent); }
.stats-row--luck { cursor: default; }
.stats-row-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    margin-bottom:   8px;
}
.stats-row-label {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    font-weight:   700;
    letter-spacing: 0.1em;
}
.stats-row-val {
    font-family: var(--font-mono);
    font-size:   0.85rem;
    color:       var(--text-primary);
}
.stats-row-desc {
    font-size:  0.8rem;
    color:      var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
}
.stats-explainer {
    margin-top:    10px;
    padding-top:   10px;
    border-top:    1px solid var(--border);
}
.stats-explainer-text {
    font-family: var(--font-mono);
    font-size:   0.8rem;
    color:       var(--accent);
    line-height: 1.6;
}
.stats-trait-locked {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--text-secondary);
    opacity:       0.6;
    letter-spacing: 0.08em;
    text-align:    center;
    padding:       20px 0;
}

/* DIRECTIVES TAB */
.status-directives-tab { display: flex; flex-direction: column; gap: 16px; }
.directives-all-done {
    padding:       12px 16px;
    border:        1px solid var(--accent);
    border-radius: 4px;
    background:    rgba(79,195,247,0.05);
}
.directives-done-msg {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    color:         var(--accent);
    letter-spacing: 0.08em;
}
.directives-done-sub {
    font-size:  0.8rem;
    color:      var(--text-secondary);
    margin-top: 4px;
}

/* Directive cards */
.directive-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-left:   3px solid var(--card-stat-colour, var(--accent));
    border-radius: 4px;
    padding:       16px;
    margin-bottom: 12px;
    transition:    opacity 0.2s;
}
.directive-card--complete { opacity: 0.5; }
.dc-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    margin-bottom:   8px;
}
.dc-stat-tag {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    font-weight:   700;
    letter-spacing: 0.1em;
}
.dc-tier-tag {
    font-family: var(--font-mono);
    font-size:   0.65rem;
    color:       var(--text-secondary);
    opacity:     0.6;
}
.dc-title {
    font-family:   var(--font-mono);
    font-size:     0.85rem;
    font-weight:   700;
    color:         var(--text-primary);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.dc-desc {
    font-size:   0.83rem;
    color:       var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
}
.dc-footer { display: flex; flex-direction: column; gap: 10px; }
.dc-action-row {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    gap:             10px;
}
.dc-complete-btn, .dc-note-toggle, .dc-intel-btn {
    font-family:   var(--font-mono);
    font-size:     0.75rem;
    letter-spacing: 0.08em;
    padding:       8px 14px;
    border-radius: 3px;
    cursor:        pointer;
    transition:    background 0.15s, color 0.15s;
}
.dc-complete-btn {
    background: var(--accent);
    color:      var(--bg);
    border:     none;
    font-weight: 700;
}
.dc-complete-btn:disabled {
    background: var(--surface);
    color:      var(--text-secondary);
    cursor:     not-allowed;
}
.dc-note-toggle {
    background: transparent;
    color:      var(--text-secondary);
    border:     1px solid var(--border);
}
.dc-intel-btn {
    background: transparent;
    color:      var(--accent);
    border:     1px solid var(--accent);
    margin-bottom: 8px;
}
.dc-xp-line {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    opacity:     0.7;
}
.dc-complete-badge {
    font-family:   var(--font-mono);
    font-size:     0.75rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}

/* Field notes */
.fn-wrap { display: flex; flex-direction: column; gap: 6px; }
.fn-wrap--hidden { display: none; }
.fn-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.08em;
}
.fn-textarea {
    width:       100%;
    min-height:  80px;
    background:  rgba(255,255,255,0.03);
    border:      1px solid var(--border);
    border-radius: 3px;
    color:       var(--text-primary);
    font-family: var(--font-mono);
    font-size:   0.82rem;
    padding:     10px;
    resize:      vertical;
    outline:     none;
    box-sizing:  border-box;
}
.fn-textarea:focus { border-color: var(--accent); }
.fn-count {
    font-family: var(--font-mono);
    font-size:   0.68rem;
    color:       var(--text-secondary);
    text-align:  right;
}
.directive-empty__msg {
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    color:         var(--text-secondary);
    text-align:    center;
    padding:       40px 0;
    letter-spacing: 0.08em;
}

/* Encounter card */
.encounter-card-wrap { margin-top: 8px; }
.encounter-card {
    padding:       16px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
}
.encounter-card--done { opacity: 0.5; }
.encounter-card-label {
    display:       block;
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
.encounter-card-desc {
    font-size:   0.82rem;
    color:       var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Journal */
.journal-wrap {
    padding:       16px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
}
.journal-header { margin-bottom: 8px; }
.journal-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.journal-syd-prompt {
    font-family: var(--font-mono);
    font-size:   0.82rem;
    color:       var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}
.journal-footer {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    margin-top:      8px;
}

/* PATH TAB */
.status-path-tab { display: flex; flex-direction: column; gap: 20px; }
.path-tab-block {
    padding:       14px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
}
.path-tab-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
.path-tab-value {
    font-family:   var(--font-mono);
    font-size:     1rem;
    font-weight:   700;
    color:         var(--text-primary);
}
.path-tab-value--text {
    font-size:   0.85rem;
    font-weight: 400;
    line-height: 1.6;
    color:       var(--text-secondary);
}
.path-tab-spec {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    margin-top:  4px;
}
.path-skill-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.path-skill-tag {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    background:  rgba(255,255,255,0.05);
    border:      1px solid var(--border);
    border-radius: 2px;
    padding:     2px 8px;
}
.path-affinity-block { border-color: var(--accent); }
.path-affinity-locked {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--text-secondary);
    opacity:       0.5;
    letter-spacing: 0.08em;
    text-align:    center;
    padding:       20px 0;
}
.path-tab-empty {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    text-align:      center;
    padding:         60px 20px;
    gap:             12px;
}
.path-tab-empty-msg {
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.path-tab-empty-sub { font-size: 0.82rem; color: var(--text-secondary); }

/* SETTINGS TAB */
.status-settings-tab { display: flex; flex-direction: column; gap: 24px; }
.settings-section { display: flex; flex-direction: column; gap: 10px; }
.settings-section--danger { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 20px; }
.settings-section-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.settings-row-btn {
    background:    var(--surface);
    border:        1px solid var(--border);
    color:         var(--text-primary);
    font-family:   var(--font-mono);
    font-size:     0.8rem;
    padding:       10px 16px;
    border-radius: 3px;
    cursor:        pointer;
    text-align:    left;
    transition:    border-color 0.2s;
    letter-spacing: 0.06em;
}
.settings-row-btn:hover { border-color: var(--accent); }
.settings-row-btn--danger {
    color:        var(--danger);
    border-color: var(--danger);
}
.settings-row-btn--inline { flex-shrink: 0; }
.settings-name-row {
    display:     flex;
    gap:         10px;
    align-items: center;
}
.settings-input {
    flex:          1;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 3px;
    color:         var(--text-primary);
    font-family:   var(--font-mono);
    font-size:     0.85rem;
    padding:       10px 12px;
    outline:       none;
}
.settings-input:focus { border-color: var(--accent); }
.settings-gear-row { display: flex; flex-direction: column; gap: 8px; }
.settings-gear-btn {
    background:    var(--surface);
    border:        1px solid var(--border);
    color:         var(--text-secondary);
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    padding:       10px 14px;
    border-radius: 3px;
    cursor:        pointer;
    text-align:    left;
    transition:    all 0.2s;
}
.settings-gear-btn--active {
    border-color: var(--accent);
    color:        var(--accent);
    background:   rgba(79,195,247,0.06);
}
.settings-gear-note {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    line-height: 1.5;
    opacity:     0.7;
}
.settings-sync-status {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
}
.settings-confirm { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.settings-confirm-msg {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--danger);
}

/* ─── ENCOUNTER SCREEN ────────────────────────────────────────── */
.screen-inner--narrow { padding: 32px 24px 80px; max-width: 520px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.encounter-wrap { display: flex; flex-direction: column; gap: 20px; }
.encounter-wrap--done {
    align-items:     center;
    justify-content: center;
    min-height:      60vh;
}
.encounter-header {
    display:     flex;
    align-items: center;
    gap:         12px;
}
.enc-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.enc-back-btn {
    background:  transparent;
    border:      none;
    color:       var(--text-secondary);
    font-family: var(--font-mono);
    font-size:   0.78rem;
    cursor:      pointer;
    padding:     0;
}
.enc-back-btn:hover { color: var(--accent); }
.enc-situation-text {
    font-family: var(--font-mono);
    font-size:   0.92rem;
    color:       var(--text-primary);
    line-height: 1.7;
    padding:     16px;
    background:  var(--surface);
    border:      1px solid var(--border);
    border-radius: 4px;
}
.enc-options { display: flex; flex-direction: column; gap: 10px; }
.enc-option-btn {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    color:         var(--text-primary);
    font-family:   var(--font-mono);
    font-size:     0.83rem;
    padding:       14px 16px;
    text-align:    left;
    cursor:        pointer;
    line-height:   1.5;
    transition:    border-color 0.2s, background 0.2s;
}
.enc-option-btn:hover { border-color: var(--accent); background: rgba(79,195,247,0.04); }
.enc-option-btn--selected { border-color: var(--accent); background: rgba(79,195,247,0.1); color: var(--accent); }

.enc-free-text-wrap { display: flex; flex-direction: column; gap: 6px; }
.enc-free-text-label {
    font-family:   var(--font-mono);
    font-size:     0.68rem;
    color:         var(--text-secondary);
    letter-spacing: 0.08em;
}
.enc-textarea {
    width:       100%;
    min-height:  80px;
    background:  var(--surface);
    border:      1px solid var(--border);
    border-radius: 3px;
    color:       var(--text-primary);
    font-family: var(--font-mono);
    font-size:   0.83rem;
    padding:     10px;
    resize:      vertical;
    outline:     none;
    box-sizing:  border-box;
}
.enc-textarea:focus { border-color: var(--accent); }
.enc-footer-actions {
    display:     flex;
    gap:         12px;
    align-items: center;
    margin-top:  4px;
}
.enc-skip-btn {
    background:  transparent;
    border:      none;
    color:       var(--text-secondary);
    font-family: var(--font-mono);
    font-size:   0.78rem;
    cursor:      pointer;
    text-decoration: underline;
}
.enc-submit-btn { flex: 1; }
.enc-feedback { display: flex; flex-direction: column; gap: 14px; }
.enc-feedback--teaching .enc-feedback-text {
    font-family: var(--font-mono);
    font-size:   0.88rem;
    color:       var(--text-primary);
    line-height: 1.7;
}
.enc-feedback-picked, .enc-feedback-free {
    padding:       12px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 3px;
}
.enc-feedback-picked-label, .enc-feedback-free-label {
    display:       block;
    font-family:   var(--font-mono);
    font-size:     0.68rem;
    color:         var(--text-secondary);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.enc-feedback-text {
    font-family: var(--font-mono);
    font-size:   0.85rem;
    color:       var(--accent);
    line-height: 1.6;
}
.enc-feedback-sub {
    font-size:  0.82rem;
    color:      var(--text-secondary);
    line-height: 1.6;
}
.enc-loading {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             20px;
    padding-top:     80px;
}
.enc-loading-icon {
    font-size:  3rem;
    color:      var(--accent);
    animation:  pulse 1.6s infinite;
}
.enc-loading-label {
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.enc-done-body {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    text-align:      center;
    gap:             16px;
    padding:         60px 20px;
}
.enc-done-icon    { font-size: 3rem; color: var(--accent); opacity: 0.5; }
.enc-done-label   { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); letter-spacing: 0.1em; }
.enc-done-sub     { font-size: 0.82rem; color: var(--text-secondary); }

/* ─── MINIGAMES ──────────────────────────────────────────────── */
.screen-inner--scroll { padding: 24px 20px 80px; overflow-y: auto; min-height: 100vh; }
.screen-inner--game   { padding: 24px 20px 80px; min-height: 100vh; }

.minigames-wrap  { display: flex; flex-direction: column; gap: 20px; }
.minigames-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             12px;
}
.mg-label {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.mg-sig-balance {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--sig-gold);
}
.mg-back-btn {
    background:  transparent;
    border:      none;
    color:       var(--text-secondary);
    font-family: var(--font-mono);
    font-size:   0.78rem;
    cursor:      pointer;
    padding:     0;
}
.mg-back-btn:hover { color: var(--accent); }

.minigames-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap:                   14px;
}
.minigames-section-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--text-secondary);
    letter-spacing: 0.1em;
    margin-top:    8px;
    border-top:    1px solid var(--border);
    padding-top:   16px;
}

.mg-card {
    display:        flex;
    flex-direction: column;
    gap:            8px;
    background:     var(--surface);
    border:         1px solid var(--border);
    border-radius:  4px;
    padding:        16px;
    transition:     border-color 0.2s;
}
.mg-card:hover { border-color: var(--accent); }
.mg-card--locked { opacity: 0.5; }
.mg-card--scan-replay { border-style: dashed; }
.mg-card-icon  { font-size: 1.8rem; color: var(--accent); }
.mg-card-name  { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; color: var(--text-primary); letter-spacing: 0.08em; }
.mg-card-desc  { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.mg-card-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-stat-tag {
    font-family: var(--font-mono);
    font-size:   0.68rem;
    color:       var(--accent);
    border:      1px solid var(--accent);
    border-radius: 2px;
    padding:     1px 6px;
    opacity:     0.8;
}
.mg-card-footer {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    margin-top:      4px;
}
.mg-cost { font-family: var(--font-mono); font-size: 0.72rem; color: var(--sig-gold); }

.minigame-active-wrap { display: flex; flex-direction: column; gap: 20px; }
.mg-active-header {
    display:     flex;
    align-items: center;
    gap:         12px;
}

/* ─── FIRST TRANSMISSION OVERLAY ─────────────────────────────── */
.overlay-inner--briefing {
    display:        flex;
    flex-direction: column;
    gap:            20px;
    padding:        48px 28px;
    max-width:      480px;
    margin:         0 auto;
}
.briefing-lines { display: flex; flex-direction: column; gap: 14px; }
.briefing-line {
    font-family:   var(--font-mono);
    font-size:     0.88rem;
    color:         var(--text-secondary);
    line-height:   1.7;
    opacity:       0;
    transform:     translateY(6px);
    transition:    opacity 0.5s ease, transform 0.5s ease;
}
.briefing-line--visible { opacity: 1; transform: none; }
.briefing-line--highlight { color: var(--accent); font-weight: 700; letter-spacing: 0.06em; }
.briefing-btn--visible { opacity: 1 !important; }

/* ─── RELAUNCH BOOT ──────────────────────────────────────────── */
.relaunch-boot {
    position:   fixed;
    inset:      0;
    z-index:    900;
    background: var(--bg);
    display:    flex;
    align-items: center;
    justify-content: center;
}
.relaunch-inner  { padding: 40px 24px; max-width: 420px; width: 100%; }
.relaunch-lines  { display: flex; flex-direction: column; gap: 8px; }
.relaunch-line {
    font-family: var(--font-mono);
    font-size:   0.82rem;
    color:       var(--text-secondary);
    opacity:     0;
    transform:   translateY(4px);
    transition:  opacity 0.25s ease, transform 0.25s ease;
}
.relaunch-line--visible { opacity: 1; transform: none; }

/* ─── LEVEL UP OVERLAY ───────────────────────────────────────── */
.overlay-inner--levelup {
    position:       relative;
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            16px;
    padding:        60px 28px 48px;
    text-align:     center;
}
.lu-particles {
    position: absolute;
    inset:    0;
    pointer-events: none;
}
.lu-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); letter-spacing: 0.14em; }
.lu-level { font-family: var(--font-mono); font-size: 5rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.lu-title { font-family: var(--font-mono); font-size: 0.88rem; color: var(--accent); letter-spacing: 0.1em; }
.lu-sub   { font-size: 0.8rem; color: var(--text-secondary); }
.lu-dismiss { margin-top: 8px; }

/* ─── SYSTEM LOG ─────────────────────────────────────────────── */
.system-log {
    position:       fixed;
    bottom:         20px;
    left:           50%;
    transform:      translateX(-50%);
    z-index:        800;
    font-family:    var(--font-mono);
    font-size:      0.75rem;
    letter-spacing: 0.08em;
    padding:        8px 16px;
    border-radius:  3px;
    max-width:      90vw;
    text-align:     center;
    transition:     opacity 0.5s ease;
    pointer-events: none;
}
.system-log--default { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.system-log--accent  { background: rgba(79,195,247,0.12); color: var(--accent); border: 1px solid var(--accent); }
.system-log--system  { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--border); }

/* ─── FLOATING XP ────────────────────────────────────────────── */
.float-xp {
    position:       absolute;
    font-family:    var(--font-mono);
    font-size:      0.85rem;
    color:          var(--accent);
    font-weight:    700;
    pointer-events: none;
    animation:      floatUp 1s ease forwards;
    z-index:        999;
}
.float-critical { font-size: 0.72rem; color: #ffd54f; }
@keyframes floatUp {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(-40px); opacity: 0; }
}

/* ─── INSTALL BANNER ─────────────────────────────────────────── */
.install-banner {
    position:       fixed;
    bottom:         0;
    left:           0;
    right:          0;
    z-index:        700;
    background:     var(--surface);
    border-top:     1px solid var(--border);
    padding:        16px 20px;
    display:        flex;
    align-items:    center;
    justify-content: space-between;
    gap:            16px;
}
.install-banner-msg   { font-size: 0.82rem; color: var(--text-secondary); flex: 1; }
.install-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── SOUND TOGGLE ───────────────────────────────────────────── */
.sound-toggle {
    position:    fixed;
    top:         16px;
    right:       16px;
    z-index:     600;
    background:  transparent;
    border:      1px solid var(--border);
    color:       var(--text-secondary);
    font-size:   0.85rem;
    width:       32px;
    height:      32px;
    border-radius: 50%;
    cursor:      pointer;
    display:     flex;
    align-items: center;
    justify-content: center;
    transition:  border-color 0.2s, color 0.2s;
}
.sound-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ─── SHARED UTILITIES ───────────────────────────────────────── */
.hidden { display: none !important; }
.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* Buttons — base styles (if not already in style.css) */
.btn {
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    font-weight:   700;
    letter-spacing: 0.08em;
    padding:       12px 20px;
    border-radius: 3px;
    cursor:        pointer;
    transition:    background 0.15s, color 0.15s, border-color 0.15s;
    text-align:    center;
}
.btn--primary {
    background: var(--accent);
    color:      var(--bg);
    border:     none;
}
.btn--primary:hover { background: #81d4fa; }
.btn--secondary {
    background: transparent;
    color:      var(--accent);
    border:     1px solid var(--accent);
}
.btn--secondary:hover { background: rgba(79,195,247,0.08); }
.btn--ghost {
    background: transparent;
    color:      var(--text-secondary);
    border:     1px solid var(--border);
}
.btn--sm { padding: 8px 14px; font-size: 0.75rem; }

/* Neural link screen */
.screen-header {
    display:       flex;
    align-items:   center;
    gap:           12px;
    margin-bottom: 24px;
}
.screen-sys-label {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--accent);
    letter-spacing: 0.12em;
}
.btn-back {
    background:  transparent;
    border:      none;
    color:       var(--text-secondary);
    font-family: var(--font-mono);
    font-size:   0.78rem;
    cursor:      pointer;
    padding:     0;
}
.btn-back:hover { color: var(--accent); }

/* ─── SIGNAL BREACH ──────────────────────────────────────────── */
.sb-rule-text {
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    color:         var(--text-secondary);
    margin-bottom: 14px;
    min-height:    2.4em;
    line-height:   1.5;
}
.sb-round-label {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
}
.sb-timer-bar-wrap {
    width:         100%;
    height:        4px;
    background:    var(--surface);
    border-radius: 2px;
    margin-bottom: 20px;
    overflow:      hidden;
}
.sb-timer-bar {
    height:        100%;
    background:    var(--accent);
    border-radius: 2px;
    width:         100%;
    transition:    width 0.05s linear, background 0.3s ease;
}
.sb-timer-bar--critical { background: var(--danger); }

.sb-grid {
    display:               grid;
    grid-template-columns: repeat(4, 1fr);
    gap:                   10px;
    margin-bottom:         16px;
}
.sb-node {
    aspect-ratio:  1;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    cursor:        pointer;
    transition:    background 0.15s, border-color 0.15s, transform 0.1s;
    position:      relative;
}
.sb-node:hover:not(:disabled) {
    border-color: var(--accent);
    transform:    scale(1.05);
}
.sb-node--lit {
    background:    rgba(79, 195, 247, 0.25);
    border-color:  var(--accent);
    box-shadow:    0 0 8px rgba(79, 195, 247, 0.4);
}
.sb-node--decoy { background: rgba(255, 255, 255, 0.04); }
.sb-node--correct {
    background:    rgba(128, 203, 196, 0.35);
    border-color:  #80cbc4;
    box-shadow:    0 0 10px rgba(128, 203, 196, 0.5);
}
.sb-node--wrong {
    background:    rgba(255, 77, 77, 0.25);
    border-color:  var(--danger);
}
.sb-node:disabled { cursor: default; }

.sb-feedback {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    text-align:    center;
    min-height:    1.4em;
    letter-spacing: 0.06em;
}
.sb-feedback--correct { color: #80cbc4; }
.sb-feedback--wrong   { color: var(--danger); }

/* ─── PRECISION SHOOTER ──────────────────────────────────────── */
.ps-wave-label {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
}
.ps-instruction {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    color:         var(--text-secondary);
    margin-bottom: 12px;
    min-height:    1.4em;
}
.ps-arena {
    width:         100%;
    height:        240px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    overflow:      hidden;
    margin-bottom: 12px;
    position:      relative;
}
.ps-canvas {
    width:   100%;
    height:  100%;
    display: block;
    cursor:  crosshair;
    touch-action: none;
}
.ps-score-row {
    display:     flex;
    align-items: center;
    gap:         4px;
}
.ps-score-label {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--text-secondary);
}
.ps-score-val {
    font-family: var(--font-mono);
    font-size:   1rem;
    font-weight: 700;
    color:       var(--accent);
}

/* ─── FINAL TRANSMISSION ─────────────────────────────────────── */
.ft-round-label {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
}
.ft-progress-wrap {
    width:         100%;
    height:        3px;
    background:    var(--surface);
    border-radius: 2px;
    margin:        10px 0 20px;
    overflow:      hidden;
}
.ft-progress-fill {
    height:        100%;
    background:    var(--accent);
    border-radius: 2px;
    transition:    width 0.4s ease;
}
.ft-situation {
    padding:       14px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 16px;
}
.ft-situation-text {
    font-family: var(--font-mono);
    font-size:   0.88rem;
    color:       var(--text-primary);
    line-height: 1.7;
}
.ft-options {
    display:        flex;
    flex-direction: column;
    gap:            10px;
}
.ft-option {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    color:         var(--text-primary);
    font-family:   var(--font-mono);
    font-size:     0.83rem;
    padding:       14px 16px;
    text-align:    left;
    cursor:        pointer;
    line-height:   1.5;
    transition:    border-color 0.15s, background 0.15s;
}
.ft-option:hover:not(:disabled) {
    border-color: var(--accent);
    background:   rgba(79, 195, 247, 0.05);
}
.ft-option--selected {
    border-color: var(--accent);
    color:        var(--accent);
    background:   rgba(79, 195, 247, 0.1);
}
.ft-option:disabled { cursor: default; opacity: 0.7; }

/* ─── SCAN BRIDGE ────────────────────────────────────────────── */
.scan-bridge {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    min-height:      280px;
    gap:             12px;
}
.scan-bridge-label {
    font-family:   var(--font-mono);
    font-size:     0.85rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.scan-bridge-sub {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
    animation:   pulse 1.2s infinite;
}

/* ─── RANK CONFIRMATION ──────────────────────────────────────── */
.rank-confirm-wrap { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 20px; }
.rank-confirm-options { display: flex; flex-direction: column; gap: 10px; }
.rank-confirm-btn {
    display:        flex;
    flex-direction: column;
    gap:            4px;
    text-align:     left;
    background:     var(--surface);
    border:         1px solid var(--border);
    border-radius:  4px;
    padding:        16px 18px;
    cursor:         pointer;
    transition:     border-color 0.2s, background 0.2s;
}
.rank-confirm-btn:hover { border-color: var(--accent); background: rgba(79,195,247,0.05); }
.rank-confirm-btn--accept { border-color: var(--accent); }
.rank-confirm-label {
    font-family:   var(--font-mono);
    font-size:     0.85rem;
    font-weight:   700;
    color:         var(--accent);
    letter-spacing: 0.08em;
}
.rank-confirm-sub {
    font-size:  0.8rem;
    color:      var(--text-secondary);
    line-height: 1.4;
}
.rank-confirm-note {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
    opacity:     0.65;
    line-height: 1.5;
}

/* ─── RE-IMAGINER QUESTION HINTS ─────────────────────────────── */
.reimaginer-q {
    font-size:   0.95rem;
    font-weight: 600;
    color:       var(--text-primary);
    margin-bottom: 4px;
}
.reimaginer-hint {
    font-size:  0.82rem;
    color:      var(--text-secondary);
    font-family: inherit;
    opacity:    0.8;
}

/* ─── MORNING TRANSMISSION OVERLAY ──────────────────────────── */
.overlay-inner--morning {
    display:        flex;
    flex-direction: column;
    gap:            20px;
    padding:        48px 28px 40px;
    max-width:      480px;
    margin:         0 auto;
    width:          100%;
}
.morning-lines {
    display:        flex;
    flex-direction: column;
    gap:            10px;
}
.morning-line {
    font-family:  var(--font-mono);
    font-size:    0.82rem;
    color:        var(--text-secondary);
    line-height:  1.7;
    opacity:      0;
    transform:    translateY(5px);
    transition:   opacity 0.4s ease, transform 0.4s ease;
}
.morning-line--visible  { opacity: 1; transform: none; }
.morning-line--highlight {
    color:        var(--accent);
    font-weight:  700;
    letter-spacing: 0.06em;
}
.morning-btn--visible { opacity: 1 !important; }

/* ─── CLOSE-OF-DAY OVERLAY ───────────────────────────────────── */
.overlay-inner--close-day {
    display:        flex;
    flex-direction: column;
    gap:            24px;
    padding:        48px 28px 40px;
    max-width:      480px;
    margin:         0 auto;
    width:          100%;
}
.close-day-lines {
    display:        flex;
    flex-direction: column;
    gap:            10px;
}
.close-day-line {
    font-family:  var(--font-mono);
    font-size:    0.82rem;
    color:        var(--text-secondary);
    line-height:  1.7;
    opacity:      0;
    transform:    translateY(5px);
    transition:   opacity 0.45s ease, transform 0.45s ease;
}
.close-day-line--visible  { opacity: 1; transform: none; }
.close-day-line--highlight {
    color:        var(--accent);
    font-weight:  700;
    letter-spacing: 0.06em;
}
.close-day-actions {
    display:        flex;
    flex-direction: column;
    gap:            10px;
}
.close-day-btn--visible { opacity: 1 !important; }
.close-day-skip {
    background:    transparent;
    border:        none;
    color:         var(--text-secondary);
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    cursor:        pointer;
    text-decoration: underline;
    text-align:    center;
    padding:       4px 0;
    opacity:       0;
    transition:    opacity 0.4s ease;
}

/* ─── CLOSE DAY BUTTON (journal section) ─────────────────────── */
.journal-close-day-row {
    margin-top:   12px;
    border-top:   1px solid var(--border);
    padding-top:  12px;
}
.journal-close-day-btn {
    background:    transparent;
    border:        1px solid var(--border);
    color:         var(--text-secondary);
    font-family:   var(--font-mono);
    font-size:     0.75rem;
    letter-spacing: 0.08em;
    padding:       8px 14px;
    border-radius: 3px;
    cursor:        pointer;
    width:         100%;
    text-align:    center;
    transition:    border-color 0.2s, color 0.2s;
}
.journal-close-day-btn:hover {
    border-color: var(--accent);
    color:        var(--accent);
}

/* ─── MINI-GAME SHARED ───────────────────────────────────────── */
.mg-game-body {
    display:        flex;
    flex-direction: column;
    gap:            16px;
    flex:           1;
}
.mg-game-instruction {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    color:         var(--text-secondary);
    min-height:    1.4em;
    text-align:    center;
}
.mg-wave-label {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--text-secondary);
    text-align:    center;
    letter-spacing: 0.08em;
}

/* ─── MINI-GAME RESULT ───────────────────────────────────────── */
.mg-result-wrap {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             20px;
    padding:         40px 20px;
}
.mg-result-grade {
    font-family:   var(--font-mono);
    font-size:     5rem;
    font-weight:   700;
    line-height:   1;
}
.mg-result-name {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.mg-result-rewards {
    width:   100%;
    display: flex;
    flex-direction: column;
    gap:     10px;
    border:  1px solid var(--border);
    border-radius: 4px;
    padding: 16px;
    background: var(--surface);
}
.mg-result-row {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
}
.mg-result-label {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
    letter-spacing: 0.06em;
}
.mg-result-val {
    font-family: var(--font-mono);
    font-size:   0.82rem;
    font-weight: 700;
    color:       var(--text-primary);
}
.mg-result-done { width: 100%; }

/* ─── CASCADE ────────────────────────────────────────────────── */
.cas-arena {
    display:        flex;
    flex-direction: column;
    gap:            8px;
}
.cas-cols {
    display:     flex;
    gap:         8px;
    height:      220px;
    overflow:    hidden;
    background:  var(--surface);
    border:      1px solid var(--border);
    border-radius: 4px;
    padding:     4px;
    position:    relative;
}
.cas-col {
    flex:     1;
    position: relative;
}
.cas-node {
    position:    absolute;
    top:         0;
    left:        50%;
    transform:   translateX(-50%);
    width:       44px;
    height:      44px;
    background:  var(--surface);
    border:      1px solid var(--accent);
    border-radius: 4px;
    font-size:   1.3rem;
    display:     flex;
    align-items: center;
    justify-content: center;
    cursor:      pointer;
    transition:  background 0.15s, border-color 0.15s;
    color:       var(--accent);
}
.cas-node:hover  { background: rgba(79,195,247,0.1); }
.cas-node--held  { background: rgba(79,195,247,0.3); border-color: #fff; box-shadow: 0 0 8px rgba(79,195,247,0.5); }
.cas-node--clear { background: rgba(128,203,196,0.4); border-color: #80cbc4; }
.cas-node--wrong { border-color: var(--danger); background: rgba(255,77,77,0.15); }

.cas-held-slot {
    display:     flex;
    align-items: center;
    gap:         10px;
    padding:     8px 12px;
    background:  var(--surface);
    border:      1px solid var(--border);
    border-radius: 4px;
}
.cas-held-label  { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-secondary); letter-spacing: 0.08em; }
.cas-held-symbol { font-size: 1.5rem; color: var(--accent); min-width: 32px; }

/* ─── DRIFT ──────────────────────────────────────────────────── */
.drift-canvas {
    width:         100%;
    height:        160px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    cursor:        crosshair;
    display:       block;
    touch-action:  none;
}

/* ─── ECHO ───────────────────────────────────────────────────── */
.echo-grid {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   12px;
    max-width:             240px;
    margin:                0 auto;
}
.echo-node {
    aspect-ratio:  1;
    background:    var(--surface);
    border:        2px solid var(--border);
    border-radius: 6px;
    cursor:        pointer;
    transition:    background 0.1s, border-color 0.1s;
}
.echo-node:hover:not(:disabled) { border-color: var(--accent); }
.echo-node--flash { background: rgba(79,195,247,0.5); border-color: var(--accent); }
.echo-node--tap   { background: rgba(79,195,247,0.25); border-color: var(--accent); }
.echo-node--wrong { background: rgba(255,77,77,0.3); border-color: var(--danger); }
.echo-node:disabled { cursor: default; opacity: 0.6; }
.echo-feedback {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    color:         var(--accent);
    text-align:    center;
    min-height:    1.4em;
    letter-spacing: 0.08em;
}

/* ─── FLOW ───────────────────────────────────────────────────── */
.flow-arena {
    display:     flex;
    gap:         16px;
    align-items: center;
}
.flow-track {
    flex:            1;
    height:          200px;
    background:      var(--surface);
    border:          1px solid var(--border);
    border-radius:   4px;
    position:        relative;
    overflow:        hidden;
}
.flow-zone {
    position:    absolute;
    left:        0;
    right:       0;
    background:  rgba(79,195,247,0.15);
    border-top:  1px solid rgba(79,195,247,0.4);
    border-bottom: 1px solid rgba(79,195,247,0.4);
    transition:  background 0.2s;
}
.flow-zone--active { background: rgba(128,203,196,0.25); }
.flow-bar {
    position:      absolute;
    left:          10%;
    right:         10%;
    height:        12px;
    background:    var(--accent);
    border-radius: 6px;
    transition:    bottom 0.05s linear;
    transform:     translateY(50%);
}
.flow-tap-btn {
    width:         80px;
    height:        80px;
    background:    var(--surface);
    border:        2px solid var(--accent);
    border-radius: 50%;
    color:         var(--accent);
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    font-weight:   700;
    cursor:        pointer;
    letter-spacing: 0.08em;
    flex-shrink:   0;
    transition:    background 0.1s, transform 0.1s;
    touch-action:  manipulation;
}
.flow-tap-btn:active {
    background:  rgba(79,195,247,0.2);
    transform:   scale(0.95);
}

/* ─── RESONANCE ──────────────────────────────────────────────── */
.resonance-scene { display: flex; flex-direction: column; gap: 14px; }
.resonance-progress-bar-wrap {
    width:         100%;
    height:        3px;
    background:    var(--surface);
    border-radius: 2px;
    overflow:      hidden;
}
.resonance-progress-fill {
    height:     100%;
    background: var(--accent);
    transition: width 0.4s ease;
}
.resonance-said {
    font-family: var(--font-mono);
    font-size:   0.92rem;
    color:       var(--text-primary);
    line-height: 1.6;
    padding:     14px;
    background:  var(--surface);
    border:      1px solid var(--border);
    border-radius: 4px;
    font-style:  italic;
}
.resonance-prompt {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--accent);
    letter-spacing: 0.1em;
}
.resonance-options { display: flex; flex-direction: column; gap: 8px; }
.resonance-opt {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    color:         var(--text-primary);
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    padding:       12px 14px;
    text-align:    left;
    cursor:        pointer;
    line-height:   1.5;
    transition:    border-color 0.15s, background 0.15s;
}
.resonance-opt:hover:not(:disabled) { border-color: var(--accent); background: rgba(79,195,247,0.05); }
.resonance-opt--selected { border-color: var(--accent); color: var(--accent); background: rgba(79,195,247,0.1); }
.resonance-opt:disabled  { cursor: default; opacity: 0.7; }

/* ─── BATCH 5: STATS TAB ─────────────────────────────────────── */
.stats-section-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
/* Explainer now slides open/closed cleanly */
.stats-explainer {
    overflow:   hidden;
    margin-top: 10px;
    padding:    10px 12px;
    background: rgba(79, 195, 247, 0.05);
    border-left: 2px solid var(--accent);
    border-radius: 0 3px 3px 0;
}
.stats-explainer-text {
    font-family: var(--font-mono);
    font-size:   0.8rem;
    color:       var(--text-secondary);
    line-height: 1.7;
}

/* ─── TRAIT SIGNALS SECTION ──────────────────────────────────── */
.stats-traits-block {
    margin-top:    24px;
    display:       flex;
    flex-direction: column;
    gap:           16px;
}
.stats-traits-intro {
    font-family:  var(--font-mono);
    font-size:    0.78rem;
    color:        var(--text-secondary);
    line-height:  1.6;
    opacity:      0.8;
}
.stats-traits-no-data {
    font-family:   var(--font-mono);
    font-size:     0.75rem;
    color:         var(--text-secondary);
    opacity:       0.5;
    letter-spacing: 0.06em;
}

.trait-row {
    padding:       12px 14px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
}
.trait-row-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    margin-bottom:   8px;
}
.trait-label {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    font-weight:   700;
    color:         var(--accent);
    letter-spacing: 0.08em;
}
.trait-score {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-primary);
    font-weight: 700;
}
.sot-bar--trait { height: 3px; margin-bottom: 10px; }
.sot-bar-fill--trait { background: var(--accent); opacity: 0.7; }
.trait-desc {
    font-family:  var(--font-mono);
    font-size:    0.78rem;
    color:        var(--text-secondary);
    line-height:  1.65;
}

/* ─── TRAIT SIGNALS LOCKED ───────────────────────────────────── */
.stats-traits-locked-block {
    margin-top:      24px;
    padding:         20px;
    background:      var(--surface);
    border:          1px solid var(--border);
    border-radius:   4px;
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    text-align:      center;
    gap:             10px;
}
.stats-traits-locked-icon {
    font-size:  2rem;
    color:      var(--accent);
    opacity:    0.3;
}
.stats-traits-locked-label {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    opacity:       0.7;
}
.stats-traits-locked-sub {
    font-family:  var(--font-mono);
    font-size:    0.78rem;
    color:        var(--text-secondary);
    line-height:  1.6;
    max-width:    280px;
}
.stats-traits-locked-level {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--text-secondary);
    letter-spacing: 0.06em;
}
.stats-traits-locked-bar-wrap {
    width:         200px;
    height:        3px;
    background:    rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow:      hidden;
}
.stats-traits-locked-bar {
    height:     100%;
    background: var(--accent);
    opacity:    0.5;
    transition: width 0.6s ease;
}

/* ─── BATCH 5: PATH TAB ──────────────────────────────────────── */
.path-tab-rank {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--text-secondary);
    margin-top:    4px;
    letter-spacing: 0.06em;
}
.path-gap-skills-label {
    font-family:   var(--font-mono);
    font-size:     0.68rem;
    color:         var(--text-secondary);
    letter-spacing: 0.1em;
    margin-top:    12px;
    margin-bottom: 6px;
    opacity:       0.7;
}
.path-gap-gemini-note {
    font-family:  var(--font-mono);
    font-size:    0.7rem;
    color:        var(--text-secondary);
    opacity:      0.5;
    margin-top:   10px;
    line-height:  1.5;
}
.path-affinity-locked-block {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    padding:       16px;
}
.path-affinity-teaser {
    font-family:  var(--font-mono);
    font-size:    0.8rem;
    color:        var(--text-secondary);
    line-height:  1.7;
    margin-bottom: 14px;
}
.path-affinity-level-row {
    display:     flex;
    align-items: center;
    gap:         12px;
}
.path-affinity-level-label {
    font-family:  var(--font-mono);
    font-size:    0.7rem;
    color:        var(--accent);
    white-space:  nowrap;
    opacity:      0.7;
}
.path-affinity-bar-wrap {
    flex:          1;
    height:        3px;
    background:    rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow:      hidden;
}
.path-affinity-bar {
    height:     100%;
    background: var(--accent);
    opacity:    0.5;
    transition: width 0.6s ease;
}

/* ─── BATCH 5: SETTINGS TAB ──────────────────────────────────── */
.settings-neural-status {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    color:         var(--text-secondary);
    padding:       8px 12px;
    border:        1px solid var(--border);
    border-radius: 3px;
    background:    var(--surface);
}
.settings-neural-status--active {
    color:        #80cbc4;
    border-color: #80cbc4;
    background:   rgba(128, 203, 196, 0.06);
}

/* ─── NEURAL LINK SCREEN ─────────────────────────────────────── */
.neural-link-wrap {
    display:        flex;
    flex-direction: column;
    gap:            12px;
    padding:        4px 0;
}
.neural-link-label {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    font-weight:   700;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.neural-link-desc {
    font-family:  var(--font-mono);
    font-size:    0.8rem;
    color:        var(--text-secondary);
    line-height:  1.6;
}

/* ═══════════════════════════════════════════════════════════════
   SYD GES — style_additions_pass1_2.css
   Pass 1 + Pass 2 UI/UX overhaul additions.
   INSTRUCTION: Append these to /css/style.css after the existing
   style_additions.css content.

   Pass 1 covers:
     - New STATUS tab (merged OPERATIVE + STATS)
     - Momentum and capacity inline explainers (tappable)
     - Header drawer (rename, rank, level)
     - Encounter tab inside status window
     - Directives tab quick-bar
     - Tab dot indicator on ENCOUNTER tab
     - Header padding fix (content overlap)
     - PATH tab rank clarification note
     - SETTINGS tab sound toggle

   Pass 2 covers:
     - Scan reveal screen
     - Neural key request screen
     - Synthesis reveal screen
     - Orientation screen
     - Re-imaginer question visual distinction
   ═══════════════════════════════════════════════════════════════ */

/* ─── PASS 1: HEADER CLEANUP ─────────────────────────────────── */
/* PASS 1: sig badge removed from header — no .status-header-sig */
/* PASS 1: header sticky overlap fix — add bottom padding to tab content */
.status-header {
    position: sticky;
    top:      0;
    z-index:  10;
    cursor:   default;
}

/* Ensure tab content doesn't hide behind sticky header */
.status-tab-content {
    padding-top: 20px;
}

/* Header name is now tappable */
.status-header-name {
    cursor:  pointer;
    padding: 4px 0;
}
.status-header-name:active {
    opacity: 0.7;
}

/* Level badge — tappable */
.status-header-level {
    cursor:  pointer;
    padding: 4px 6px;
}
.status-header-level:active {
    opacity: 0.7;
}

/* Rank badge in header — tappable */
.status-header .rank-badge {
    cursor:  pointer;
    padding: 4px 8px;
}
.status-header .rank-badge:active {
    opacity: 0.7;
}

/* ─── PASS 1: ENCOUNTER TAB DOT INDICATOR ────────────────────── */
.tab-dot {
    display:          inline-block;
    width:            6px;
    height:           6px;
    border-radius:    50%;
    background:       var(--accent);
    margin-left:      5px;
    vertical-align:   middle;
    position:         relative;
    top:              -1px;
    animation:        tab-dot-pulse 2s ease-in-out infinite;
}

@keyframes tab-dot-pulse {
    0%, 100% { opacity: 1;    transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ─── PASS 1: HEADER DRAWER ──────────────────────────────────── */
.header-drawer {
    background:     var(--surface);
    border:         1px solid var(--border, rgba(255,255,255,0.08));
    border-top:     none;
    padding:        16px 20px 20px;
    z-index:        9;
    opacity:        0;
    transform:      translateY(-6px);
    transition:     opacity 0.25s ease, transform 0.25s ease;
}

.header-drawer--visible {
    opacity:   1;
    transform: translateY(0);
}

.header-drawer-inner {
    display:        flex;
    flex-direction: column;
    gap:            10px;
}

.header-drawer-label {
    font-family:  var(--font-mono);
    font-size:    0.75rem;
    color:        var(--accent);
    letter-spacing: 0.08em;
    margin:       0;
}

.header-drawer-desc {
    font-size:   0.9rem;
    color:       var(--text-primary);
    margin:      0;
    line-height: 1.5;
}

.header-drawer-sub {
    font-size:  0.8rem;
    color:      var(--text-secondary);
    margin:     0;
    font-family: var(--font-mono);
}

.header-drawer-row {
    display:     flex;
    gap:         8px;
    align-items: center;
}

.header-drawer-close {
    background:   transparent;
    border:       1px solid var(--border, rgba(255,255,255,0.08));
    color:        var(--text-secondary);
    font-family:  var(--font-mono);
    font-size:    0.75rem;
    padding:      8px 12px;
    cursor:       pointer;
    align-self:   flex-start;
    letter-spacing: 0.05em;
    min-height:   44px;
}
.header-drawer-close:active { opacity: 0.7; }

/* XP bar inside level drawer */
.hd-xp-bar-wrap {
    display:        flex;
    flex-direction: column;
    gap:            4px;
}
.hd-xp-bar {
    width:         100%;
    height:        4px;
    background:    var(--surface-raised, rgba(255,255,255,0.06));
    border-radius: 2px;
    overflow:      hidden;
}
.hd-xp-bar-fill {
    height:        100%;
    background:    var(--accent);
    border-radius: 2px;
    transition:    width 0.6s ease;
}
.hd-xp-label {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
}

/* ─── PASS 1: STATUS MAIN TAB ────────────────────────────────── */
.status-main-tab {
    padding:        16px 0 80px;
    display:        flex;
    flex-direction: column;
    gap:            16px;
}

.sot-divider {
    height:     1px;
    background: var(--border, rgba(255,255,255,0.06));
    margin:     4px 0;
}

/* Tappable metric rows */
.sot-metric--tappable {
    cursor: pointer;
    padding: 10px 0;
}
.sot-metric--tappable:active { opacity: 0.8; }

.sot-metric-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    margin-bottom:   6px;
}

.sot-metric-hint {
    font-size:    0.65rem;
    color:        var(--text-secondary);
    font-family:  var(--font-sans, inherit);
    font-weight:  400;
    margin-left:  6px;
    text-transform: none;
    letter-spacing: 0;
    opacity:      0.7;
}

/* Inline explainers — expand under metric or stat rows */
.sot-inline-explainer {
    margin-top:  10px;
    padding:     10px 12px;
    background:  var(--surface-raised, rgba(255,255,255,0.04));
    border-left: 2px solid var(--accent);
}

.sot-inline-explainer-text {
    font-size:   0.85rem;
    color:       var(--text-secondary);
    margin:      0;
    line-height: 1.6;
}

/* Stat bars section label */
.stats-section-label {
    font-family:    var(--font-mono);
    font-size:      0.7rem;
    color:          var(--accent);
    letter-spacing: 0.08em;
    margin:         0 0 10px;
}

/* ─── PASS 1: DIRECTIVES TAB QUICK BAR ───────────────────────── */
.directives-quick-bar {
    display:         flex;
    gap:             8px;
    padding:         12px 0 16px;
    border-bottom:   1px solid var(--border, rgba(255,255,255,0.06));
    margin-bottom:   16px;
}

.dq-btn {
    flex:           1;
    background:     var(--surface, rgba(255,255,255,0.04));
    border:         1px solid var(--border, rgba(255,255,255,0.08));
    color:          var(--text-secondary);
    font-family:    var(--font-mono);
    font-size:      0.7rem;
    padding:        10px 8px;
    text-align:     center;
    cursor:         pointer;
    letter-spacing: 0.04em;
    min-height:     44px;
    transition:     color 0.2s ease, border-color 0.2s ease;
}

.dq-btn:active,
.dq-btn:hover {
    color:        var(--accent);
    border-color: var(--accent);
}

/* ─── PASS 1: ENCOUNTER TAB ──────────────────────────────────── */
.encounter-tab-wrap {
    padding:        0 0 80px;
}

.encounter-tab-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         12px 0 16px;
    border-bottom:   1px solid var(--border, rgba(255,255,255,0.06));
    margin-bottom:   20px;
}

.enc-optional-note {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    opacity:     0.7;
}

.enc-tab-done {
    padding:         60px 0;
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             12px;
    text-align:      center;
}

/* ─── PASS 1: PATH TAB RANK CLARIFICATION ────────────────────── */
.path-rank-clarification {
    background:  var(--surface, rgba(255,255,255,0.04));
    border-left: 2px solid var(--text-secondary);
    padding:     10px 14px;
    margin-bottom: 16px;
}

.path-rank-note {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--text-secondary);
    margin:      0;
    line-height: 1.5;
}

/* ─── PASS 2: RE-IMAGINER QUESTION VISUAL FIX ────────────────── */
/* Question text: larger, accent colour, visually distinct from inputs */
.reimaginer-q {
    font-size:      1.1rem !important;
    color:          var(--text-primary) !important;
    font-family:    var(--font-sans, inherit) !important;
    font-weight:    500 !important;
    line-height:    1.5 !important;
    letter-spacing: 0 !important;
    margin-bottom:  6px !important;
}

/* Hint text: clearly secondary */
.reimaginer-hint {
    font-size:   0.85rem !important;
    color:       var(--text-secondary) !important;
    font-style:  italic !important;
    opacity:     0.8 !important;
    margin-top:  0 !important;
}

/* Question fade transition — applied on re-render by setting opacity */
.reimaginer-wrap {
    animation: reimaginer-fade-in 0.3s ease;
}

@keyframes reimaginer-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── PASS 2: SCAN REVEAL SCREEN ─────────────────────────────── */
.scan-reveal-wrap {
    display:        flex;
    flex-direction: column;
    gap:            24px;
    padding:        32px 0 80px;
}

.scan-reveal-header {
    text-align: center;
}

.scan-reveal-label {
    font-family:    var(--font-mono);
    font-size:      0.75rem;
    color:          var(--accent);
    letter-spacing: 0.1em;
}

.scan-reveal-syd {
    display:        flex;
    flex-direction: column;
    gap:            10px;
    padding:        16px;
    background:     var(--surface, rgba(255,255,255,0.04));
    border-left:    2px solid var(--accent);
}

.scan-reveal-syd-line {
    font-size:   0.9rem;
    color:       var(--text-primary);
    margin:      0;
    line-height: 1.6;
}

.scan-reveal-traits {
    display:        flex;
    flex-direction: column;
    gap:            14px;
}

.srt-row {
    display:        flex;
    flex-direction: column;
    gap:            5px;
}

.srt-row-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
}

.srt-name {
    font-family:    var(--font-mono);
    font-size:      0.72rem;
    color:          var(--text-secondary);
    letter-spacing: 0.06em;
}

.srt-pct {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--accent);
}

.srt-bar-wrap {
    width:         100%;
    height:        4px;
    background:    var(--surface-raised, rgba(255,255,255,0.06));
    border-radius: 2px;
    overflow:      hidden;
}

.srt-bar {
    height:        100%;
    background:    var(--accent);
    border-radius: 2px;
    width:         0%;
    transition:    width 0.6s ease;
}

.scan-reveal-proceed {
    align-self:  center;
    margin-top:  8px;
    min-width:   240px;
}

/* ─── PASS 2: NEURAL KEY REQUEST SCREEN ──────────────────────── */
.neural-request-wrap {
    display:        flex;
    flex-direction: column;
    gap:            20px;
    padding:        40px 0 80px;
}

.nr-header {
    display:        flex;
    flex-direction: column;
    gap:            12px;
}

.nr-syd-line {
    font-size:   0.95rem;
    color:       var(--text-primary);
    margin:      0;
    line-height: 1.6;
}

.nr-get-key-btn {
    display:    block;
    text-align: center;
    text-decoration: none;
    padding:    16px 20px;
    min-height: 54px;
    font-size:  0.9rem;
}

.nr-input-group {
    display:         flex;
    gap:             10px;
    align-items:     stretch;
}

.nr-key-input {
    flex:      1;
    font-size: 0.9rem;
    padding:   12px 14px;
}

.nr-privacy-note {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    margin:      0;
    opacity:     0.7;
    line-height: 1.5;
}

.nr-skip-btn {
    background:   transparent;
    border:       none;
    color:        var(--text-secondary);
    font-family:  var(--font-mono);
    font-size:    0.8rem;
    cursor:       pointer;
    padding:      12px 0;
    text-align:   center;
    text-decoration: underline;
    min-height:   44px;
    opacity:      0.8;
}
.nr-skip-btn:active { opacity: 0.5; }

/* ─── PASS 2: SYNTHESIS REVEAL SCREEN ───────────────────────── */
.synthesis-reveal-wrap {
    display:        flex;
    flex-direction: column;
    gap:            20px;
    padding:        32px 0 80px;
    animation:      reimaginer-fade-in 0.4s ease;
}

.sr-header {
    text-align: center;
}

.sr-label {
    font-family:    var(--font-mono);
    font-size:      0.75rem;
    color:          var(--accent);
    letter-spacing: 0.1em;
}

.sr-path-block {
    text-align:  center;
    padding:     20px 0;
    border-top:  1px solid var(--border, rgba(255,255,255,0.06));
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}

.sr-path-name {
    font-size:      1.6rem;
    font-weight:    600;
    color:          var(--text-primary);
    margin:         0 0 6px;
    letter-spacing: -0.01em;
    line-height:    1.2;
}

.sr-role {
    font-family: var(--font-mono);
    font-size:   0.8rem;
    color:       var(--text-secondary);
    margin:      0 0 14px;
    min-height:  1em;
}

.sr-rank-row {
    display:         inline-flex;
    align-items:     center;
    gap:             10px;
    justify-content: center;
}

.sr-rank-context {
    font-family:  var(--font-mono);
    font-size:    0.75rem;
    color:        var(--text-secondary);
    max-width:    240px;
    text-align:   left;
    line-height:  1.4;
}

.sr-gaps-block,
.sr-affinity-block {
    display:        flex;
    flex-direction: column;
    gap:            8px;
}

.sr-section-label {
    font-family:    var(--font-mono);
    font-size:      0.7rem;
    color:          var(--accent);
    letter-spacing: 0.08em;
    margin:         0;
}

.sr-affinity-note {
    font-family:  var(--font-mono);
    font-size:    0.78rem;
    color:        var(--text-secondary);
    margin:       0;
    font-style:   italic;
    line-height:  1.5;
}

.sr-syd-voice {
    display:        flex;
    flex-direction: column;
    gap:            10px;
    padding:        16px;
    background:     var(--surface, rgba(255,255,255,0.04));
    border-left:    2px solid var(--accent);
}

.sr-syd-line {
    font-size:   0.9rem;
    color:       var(--text-primary);
    margin:      0;
    line-height: 1.6;
}

/* ─── PASS 2: ORIENTATION SCREEN ─────────────────────────────── */
.orientation-wrap {
    display:        flex;
    flex-direction: column;
    gap:            24px;
    padding:        40px 0 80px;
    animation:      reimaginer-fade-in 0.4s ease;
}

.or-header {
    text-align: center;
}

.or-label {
    font-family:    var(--font-mono);
    font-size:      0.75rem;
    color:          var(--accent);
    letter-spacing: 0.1em;
}

.or-syd-voice {
    display:        flex;
    flex-direction: column;
    gap:            14px;
}

.or-syd-line {
    font-size:   0.95rem;
    color:       var(--text-primary);
    margin:      0;
    line-height: 1.65;
}

.or-syd-line strong {
    color:       var(--accent);
    font-weight: 600;
}

.or-continue-btn {
    align-self: center;
    min-width:  240px;
}

/* ─── PASS 1: SOUND TOGGLE — GLOBAL BUTTON NOW HIDDEN ────────── */
/* Sound toggle moved to SETTINGS tab. The button stub in index.html is hidden. */
.sound-toggle.hidden {
    display: none !important;
}

/* ─── MIN TOUCH TARGET GUARANTEE ─────────────────────────────── */
/* All buttons must be at least 44px tall on touch */
.btn, .settings-row-btn, .dc-complete-btn,
.enc-option-btn, .enc-skip-btn, .enc-submit-btn,
.path-track-btn, .role-card, .rank-confirm-btn,
.dq-btn, .nr-skip-btn, .header-drawer-close,
.scan-reveal-proceed, .nr-get-key-btn, .or-continue-btn {
    min-height: 44px;
}

/* ══════════════════════════════════════════════════════════════
   RESPEC — BLOCK F CSS ADDITIONS
   Appended to style.css. All new components from Blocks A–F.
   Variables:
     --text-primary    → alias for --text
     --text-secondary  → alias for --text-dim
     --font-mono       → Share Tech Mono (already imported)
     --surface         → alias for --panel
     --surface-raised  → slightly lighter surface
     --danger          → alias for --red
     --sig-gold        → gold colour for SIG balance
══════════════════════════════════════════════════════════════ */

/* ── VARIABLE ALIASES ────────────────────────────────────────── */
/* Bridges the old variable names to the new ones used in Blocks A–F */
:root {
    --text-primary:   var(--text);
    --text-secondary: var(--text-dim);
    --font-mono:      'Share Tech Mono', monospace;
    --surface:        var(--panel);
    --surface-raised: #1f1f38;
    --danger:         var(--red);
    --sig-gold:       #ffd54f;
    --stat-luck:      var(--luck);
}

/* ── SOT DIVIDER ──────────────────────────────────────────────── */
.sot-divider {
    height:     1px;
    background: var(--border);
    margin:     4px 0;
}

/* ── SOT METRIC — TAPPABLE ──────────────────────────────────── */
.sot-metric--tappable {
    cursor: pointer;
}
.sot-metric--tappable:hover .sot-bar-fill {
    opacity: 0.85;
}
.sot-metric-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
}
.sot-metric-hint {
    font-size:  0.65rem;
    color:      var(--text-secondary);
    font-weight: normal;
    margin-left: 6px;
    opacity:    0.6;
}
.sot-xp-block { display: flex; flex-direction: column; gap: 6px; }
.sot-inline-explainer {
    margin-top:  8px;
    padding:     10px 12px;
    background:  rgba(79,195,247,0.05);
    border-left: 2px solid var(--accent);
}
.sot-inline-explainer-text {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--accent);
    line-height: 1.6;
}

/* ── STATUS MAIN SCROLL ─────────────────────────────────────── */
.status-main-scroll {
    display:        flex;
    flex-direction: column;
    gap:            20px;
}
.status-section-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.status-section { display: flex; flex-direction: column; gap: 12px; }
.status-section--career-skills { /* gap handled by career-skills-list */ }
.status-section--path          { /* gap handled by path-inline-block */ }
.status-section--settings      { /* gap handled by settings-section */ }

/* ── SOT IDENTITY — SETTINGS SHORTCUT ─────────────────────── */
.sot-settings-shortcut {
    margin-left:  auto;
    background:   transparent;
    border:       1px solid var(--border);
    color:        var(--text-secondary);
    font-size:    0.9rem;
    width:        28px;
    height:       28px;
    border-radius: 50%;
    cursor:       pointer;
    display:      flex;
    align-items:  center;
    justify-content: center;
    transition:   border-color 0.2s, color 0.2s;
    flex-shrink:  0;
    line-height:  1;
    padding:      0;
}
.sot-settings-shortcut:hover {
    border-color: var(--accent);
    color:        var(--accent);
}

/* ── OPS TAB ─────────────────────────────────────────────────── */
.ops-tab-wrap {
    display:        flex;
    flex-direction: column;
}
.ops-segment-bar {
    display:          flex;
    border-bottom:    1px solid var(--border);
    margin-bottom:    0;
    position:         sticky;
    top:              0;
    background:       var(--bg);
    z-index:          5;
}
.ops-segment-btn {
    flex:          1;
    background:    transparent;
    border:        none;
    border-bottom: 2px solid transparent;
    padding:       10px 8px;
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--text-secondary);
    cursor:        pointer;
    letter-spacing: 0.06em;
    transition:    color 0.2s, border-color 0.2s;
    text-align:    center;
    min-height:    44px;
}
.ops-segment-btn--active {
    color:        var(--accent);
    border-color: var(--accent);
}
.ops-segment-content {
    padding: 20px 0 80px;
}

/* ── TAB DOT INDICATOR ──────────────────────────────────────── */
.tab-dot {
    display:       inline-block;
    width:         5px;
    height:        5px;
    background:    var(--accent);
    border-radius: 50%;
    margin-left:   4px;
    vertical-align: middle;
    margin-bottom: 1px;
}

/* ── DIRECTIVES QUICK BAR ───────────────────────────────────── */
.directives-quick-bar {
    display: flex;
    gap:     10px;
    margin-bottom: 4px;
}
.dq-btn {
    flex:          1;
    background:    var(--surface);
    border:        1px solid var(--border);
    color:         var(--text-secondary);
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    letter-spacing: 0.06em;
    padding:       10px 8px;
    border-radius: 3px;
    cursor:        pointer;
    transition:    border-color 0.2s, color 0.2s;
    text-align:    center;
    min-height:    44px;
}
.dq-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── CAREER DIRECTIVE CARD ───────────────────────────────────── */
.directive-card--career {
    border-left-color: var(--stat-cha);
}
.dc-career-tag {
    margin-bottom: 4px;
}
.dc-career-skill-label {
    font-family:   var(--font-mono);
    font-size:     0.65rem;
    color:         var(--stat-cha);
    letter-spacing: 0.06em;
    opacity:       0.85;
    background:    rgba(171, 71, 188, 0.08);
    border:        1px solid rgba(171, 71, 188, 0.25);
    border-radius: 2px;
    padding:       1px 7px;
    display:       inline-block;
}

/* ── INTEL BUTTON + PANEL ───────────────────────────────────── */
/* .dc-intel-btn already defined above — extend here */
.dc-intel-panel {
    padding:       10px 12px;
    background:    rgba(79,195,247,0.05);
    border:        1px solid rgba(79,195,247,0.18);
    border-radius: 3px;
    margin-top:    2px;
    margin-bottom: 8px;
    animation:     fadeIn 0.2s ease;
}
.dc-intel-text {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.6;
}

/* ── ENCOUNTER DOMAIN TAG ────────────────────────────────────── */
/* .enc-header-labels stacks the transmission label above the domain tag */
.enc-header-labels {
    display:        flex;
    flex-direction: column;
    gap:            4px;
}
.enc-domain-tag {
    font-family:   var(--font-mono);
    font-size:     0.62rem;
    color:         var(--text-secondary);
    letter-spacing: 0.1em;
    opacity:       0.7;
}
.enc-feedback-neural-note {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    opacity:     0.55;
    margin-top:  4px;
}

/* ── ENCOUNTER TAB WRAP ─────────────────────────────────────── */
.encounter-tab-wrap {
    display:        flex;
    flex-direction: column;
    gap:            20px;
}
.encounter-tab-header {
    display:     flex;
    align-items: center;
    gap:         12px;
}
.enc-optional-note {
    font-family: var(--font-mono);
    font-size:   0.65rem;
    color:       var(--text-secondary);
    opacity:     0.6;
    margin-left: auto;
}
.enc-tab-done {
    padding:     60px 20px;
    text-align:  center;
}
.encounter-loading {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             20px;
    padding:         60px 20px;
    text-align:      center;
}
.enc-loading-icon {
    font-size:  2.5rem;
    color:      var(--accent);
    animation:  pulse 1.6s infinite;
}
.enc-loading-label {
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.enc-situation-text--small {
    font-size:  0.82rem;
    opacity:    0.8;
}
.encounter-situation--reasoning { margin-bottom: -8px; }

/* ── HEADER DRAWER ────────────────────────────────────────────── */
.header-drawer {
    position:   relative;
    background: var(--surface);
    border:     1px solid var(--border);
    padding:    16px 20px;
    z-index:    8;
    opacity:    0;
    transform:  translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.header-drawer--visible {
    opacity:   1;
    transform: translateY(0);
}
.header-drawer-inner { display: flex; flex-direction: column; gap: 8px; }
.header-drawer-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.header-drawer-desc {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.5;
}
.header-drawer-sub {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    opacity:     0.7;
}
.header-drawer-row {
    display:     flex;
    gap:         10px;
    align-items: center;
}
.header-drawer-close {
    background:   transparent;
    border:       none;
    color:        var(--text-secondary);
    font-family:  var(--font-mono);
    font-size:    0.72rem;
    cursor:       pointer;
    padding:      4px 0;
    text-decoration: underline;
    margin-top:   4px;
    align-self:   flex-start;
}
.header-drawer-close:hover { color: var(--accent); }
.hd-xp-bar-wrap { display: flex; flex-direction: column; gap: 6px; }
.hd-xp-bar {
    width:         100%;
    height:        4px;
    background:    var(--surface);
    border-radius: 2px;
    overflow:      hidden;
}
.hd-xp-bar-fill {
    height:     100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}
.hd-xp-label {
    font-family: var(--font-mono);
    font-size:   0.68rem;
    color:       var(--text-secondary);
}

/* ── PATH INLINE BLOCKS (STATUS TAB) ─────────────────────────── */
.path-inline-block {
    padding:       12px 14px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    display:       flex;
    flex-direction: column;
    gap:            6px;
    transition:    border-color 0.2s;
}
.path-inline-block.tappable:hover { border-color: var(--accent); }
.path-inline-label {
    font-family:   var(--font-mono);
    font-size:     0.68rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.path-inline-value {
    font-family:   var(--font-mono);
    font-size:     1rem;
    font-weight:   700;
    color:         var(--text-primary);
}
.path-inline-value--text {
    font-size:   0.84rem;
    font-weight: 400;
    line-height: 1.6;
    color:       var(--text-secondary);
}
.path-inline-expand {
    margin-top:  4px;
    padding-top: 8px;
    border-top:  1px solid var(--border);
    animation:   fadeIn 0.2s ease;
}
.path-expand-text {
    font-family: var(--font-mono);
    font-size:   0.8rem;
    color:       var(--text-secondary);
    line-height: 1.6;
}
.path-expand-label {
    font-family:   var(--font-mono);
    font-size:     0.68rem;
    color:         var(--accent);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.path-rank-row {
    display:     flex;
    align-items: center;
    gap:         10px;
    margin-top:  2px;
}
.path-rank-note {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    opacity:     0.65;
    line-height: 1.5;
    font-style:  italic;
}
.path-gap-prose {
    font-family: var(--font-mono);
    font-size:   0.8rem;
    color:       var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}
.path-gap-skills-label {
    font-family:   var(--font-mono);
    font-size:     0.65rem;
    color:         var(--text-secondary);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    opacity:       0.7;
}
.path-gap-gemini-note {
    font-family: var(--font-mono);
    font-size:   0.68rem;
    color:       var(--text-secondary);
    opacity:     0.55;
    margin-top:  6px;
}
.path-skill-tag--tappable {
    cursor:     pointer;
    transition: background 0.15s, border-color 0.15s;
}
.path-skill-tag--tappable:hover {
    border-color: var(--accent);
    color:        var(--accent);
    background:   rgba(79,195,247,0.08);
}
.path-skill-tag--active {
    border-color: var(--accent);
    color:        var(--accent);
    background:   rgba(79,195,247,0.12);
}
.path-skill-expand {
    margin-top:  8px;
    padding:     10px 12px;
    background:  rgba(79,195,247,0.05);
    border-left: 2px solid var(--accent);
    animation:   fadeIn 0.2s ease;
}
.path-skill-expand-text {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.6;
}
.path-affinity-locked-block {
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.path-affinity-teaser {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--text-secondary);
    line-height: 1.6;
    opacity:     0.7;
}
.path-affinity-level-row {
    display:     flex;
    align-items: center;
    gap:         10px;
}
.path-affinity-level-label {
    font-family: var(--font-mono);
    font-size:   0.68rem;
    color:       var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.path-affinity-bar-wrap {
    flex:          1;
    height:        4px;
    background:    var(--surface);
    border-radius: 2px;
    overflow:      hidden;
}
.path-affinity-bar {
    height:        100%;
    background:    var(--accent);
    border-radius: 2px;
    transition:    width 0.5s ease;
    opacity:       0.4;
}
.path-affinity-stat {
    font-family:   var(--font-mono);
    font-size:     0.85rem;
    font-weight:   700;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.path-aspiration-edit { display: flex; flex-direction: column; gap: 8px; }

/* ── TRAIT SECTION ──────────────────────────────────────────── */
.stats-traits-block { display: flex; flex-direction: column; gap: 14px; }
.stats-traits-intro {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.6;
    opacity:     0.8;
}
.trait-row { display: flex; flex-direction: column; gap: 5px; }
.trait-row-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
}
.trait-label {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--text-secondary);
    letter-spacing: 0.06em;
}
.trait-score {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--accent);
}
.trait-desc {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--text-secondary);
    line-height: 1.55;
    opacity:     0.8;
}
.sot-bar--trait { height: 3px; }
.sot-bar-fill--trait { background: var(--accent); opacity: 0.6; }
.stats-traits-no-data {
    font-family:   var(--font-mono);
    font-size:     0.75rem;
    color:         var(--text-secondary);
    opacity:       0.5;
    text-align:    center;
    padding:       20px 0;
}
.stats-traits-locked-block {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    text-align:     center;
    gap:            10px;
    padding:        32px 20px;
    background:     var(--surface);
    border:         1px solid var(--border);
    border-radius:  4px;
}
.stats-traits-locked-icon { font-size: 2rem; color: var(--accent); opacity: 0.3; }
.stats-traits-locked-label {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
    opacity:       0.6;
}
.stats-traits-locked-sub {
    font-size:  0.8rem;
    color:      var(--text-secondary);
    max-width:  280px;
    line-height: 1.5;
}
.stats-traits-locked-level {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--accent);
    opacity:     0.5;
}
.stats-traits-locked-bar-wrap {
    width:         80%;
    height:        3px;
    background:    var(--surface);
    border-radius: 2px;
    overflow:      hidden;
}
.stats-traits-locked-bar {
    height:        100%;
    background:    var(--accent);
    border-radius: 2px;
    opacity:       0.4;
    transition:    width 0.5s ease;
}

/* ── CAREER SKILLS SECTION ──────────────────────────────────── */
.career-skills-empty {
    padding:    20px 0;
    display:    flex;
    flex-direction: column;
    gap:        10px;
}
.career-skills-empty-msg {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.6;
}
.career-skills-neural-note {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.06em;
    opacity:       0.7;
}
.career-skills-list { display: flex; flex-direction: column; gap: 10px; }
.career-skill-row {
    padding:       12px 14px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    display:       flex;
    flex-direction: column;
    gap:            8px;
    cursor:        pointer;
    transition:    border-color 0.2s;
}
.career-skill-row:hover { border-color: var(--accent); }
.career-skill-row--open { border-color: var(--accent); }
.cs-row-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    gap:             8px;
}
.cs-name-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.cs-name {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    font-weight:   700;
    color:         var(--text-primary);
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
}
.cs-enhanced-badge {
    font-size:  0.65rem;
    color:      var(--sig-gold);
    flex-shrink: 0;
}
.cs-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cs-stat-tag {
    font-family:  var(--font-mono);
    font-size:    0.65rem;
    font-weight:  700;
    letter-spacing: 0.06em;
}
.cs-score {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-primary);
    min-width:   28px;
    text-align:  right;
}
.cs-bar-wrap {
    display:     flex;
    align-items: center;
    gap:         8px;
}
.cs-bar-track {
    position:      relative;
    flex:          1;
    height:        5px;
    background:    var(--surface);
    border-radius: 3px;
    overflow:      visible;
}
.cs-bar-fill {
    height:        100%;
    border-radius: 3px;
    transition:    width 0.5s ease;
    max-width:     100%;
}
.cs-softcap-marker {
    position:      absolute;
    top:           -3px;
    width:         2px;
    height:        11px;
    background:    rgba(255,255,255,0.25);
    border-radius: 1px;
    transform:     translateX(-50%);
    pointer-events: none;
}
.cs-softcap-label {
    font-family: var(--font-mono);
    font-size:   0.62rem;
    color:       var(--text-secondary);
    opacity:     0.5;
    flex-shrink: 0;
    min-width:   18px;
    text-align:  right;
}
.cs-description {
    padding-top: 8px;
    border-top:  1px solid var(--border);
    animation:   fadeIn 0.2s ease;
}
.cs-description-text {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.6;
}
.cs-description-note {
    font-family: var(--font-mono);
    font-size:   0.68rem;
    color:       var(--text-secondary);
    opacity:     0.55;
    margin-top:  6px;
}

/* ── JOURNAL ADDITIONS ──────────────────────────────────────── */
.journal-close-day-row { margin-top: 8px; }
.journal-close-day-btn {
    background:   transparent;
    border:       none;
    color:        var(--text-secondary);
    font-family:  var(--font-mono);
    font-size:    0.75rem;
    letter-spacing: 0.08em;
    cursor:       pointer;
    padding:      8px 0;
    text-decoration: underline;
    transition:   color 0.2s;
    min-height:   44px;
}
.journal-close-day-btn:hover { color: var(--accent); }

/* ── GAMES SEGMENT ────────────────────────────────────────────── */
.games-segment-wrap {
    display:        flex;
    flex-direction: column;
    gap:            20px;
}
.games-segment-header { /* intentionally minimal */ }
.games-syd-line {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.6;
    padding:     10px 12px;
    background:  var(--surface);
    border-left: 2px solid var(--accent);
    opacity:     0.8;
}
.games-sig-balance {
    display:     flex;
    align-items: center;
    gap:         8px;
    padding:     10px 14px;
    background:  rgba(255, 213, 79, 0.06);
    border:      1px solid rgba(255, 213, 79, 0.2);
    border-radius: 3px;
}
.games-sig-icon  { font-size: 1rem; color: var(--sig-gold); }
.games-sig-value {
    font-family: var(--font-mono);
    font-size:   1.1rem;
    font-weight: 700;
    color:       var(--sig-gold);
    line-height: 1;
}
.games-sig-label {
    font-family:   var(--font-mono);
    font-size:     0.65rem;
    color:         var(--sig-gold);
    letter-spacing: 0.08em;
    opacity:       0.7;
}
.games-list { display: flex; flex-direction: column; gap: 12px; }

/* Full game card (OPS/GAMES segment) */
.game-card {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    padding:       14px 16px;
    display:       flex;
    flex-direction: column;
    gap:            10px;
    transition:    border-color 0.2s;
}
.game-card:hover { border-color: rgba(79,195,247,0.3); }
.game-card-header {
    display:     flex;
    align-items: center;
    gap:         10px;
}
.game-card-icon  { font-size: 1.4rem; color: var(--accent); flex-shrink: 0; }
.game-card-name  {
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    font-weight:   700;
    color:         var(--text-primary);
    letter-spacing: 0.08em;
    flex:          1;
}
.game-card-stat-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.game-card-stat-tag {
    font-family: var(--font-mono);
    font-size:   0.62rem;
    color:       var(--accent);
    border:      1px solid var(--accent);
    border-radius: 2px;
    padding:     1px 5px;
    opacity:     0.75;
}
.game-card-desc {
    font-size:   0.8rem;
    color:       var(--text-secondary);
    line-height: 1.5;
}
.game-card-instr-toggle {
    background:   transparent;
    border:       none;
    color:        var(--text-secondary);
    font-family:  var(--font-mono);
    font-size:    0.68rem;
    cursor:       pointer;
    padding:      4px 0;
    text-decoration: underline;
    align-self:   flex-start;
    transition:   color 0.2s;
}
.game-card-instr-toggle:hover { color: var(--accent); }
.game-card-instr-panel {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    padding:        10px 12px;
    background:     rgba(255,255,255,0.03);
    border:         1px solid var(--border);
    border-radius:  3px;
    animation:      fadeIn 0.2s ease;
}
.game-instr-line {
    font-family: var(--font-mono);
    font-size:   0.76rem;
    color:       var(--text-secondary);
    line-height: 1.5;
}
.game-card-footer {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    gap:             10px;
    padding-top:     4px;
    border-top:      1px solid var(--border);
}
.game-card-cost {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--sig-gold);
}
.game-card-enter-btn {
    background:    var(--accent);
    border:        none;
    color:         var(--bg);
    font-family:   var(--font-mono);
    font-size:     0.75rem;
    font-weight:   700;
    letter-spacing: 0.06em;
    padding:       8px 16px;
    border-radius: 3px;
    cursor:        pointer;
    transition:    background 0.15s;
    min-height:    36px;
}
.game-card-enter-btn:hover:not(:disabled) { background: #81d4fa; }
.game-card-enter-btn--locked,
.game-card-enter-btn:disabled {
    background:   var(--surface);
    color:        var(--text-secondary);
    cursor:       not-allowed;
    border:       1px solid var(--border);
}

/* Scan replay link row */
.games-scan-replay {
    padding-top: 16px;
    border-top:  1px solid var(--border);
}
.games-scan-replay-label {
    font-family: var(--font-mono);
    font-size:   0.7rem;
    color:       var(--text-secondary);
    display:     flex;
    align-items: center;
    gap:         6px;
}
.games-scan-replay-link {
    background:       transparent;
    border:           none;
    color:            var(--text-secondary);
    font-family:      var(--font-mono);
    font-size:        0.7rem;
    cursor:           pointer;
    text-decoration:  underline;
    padding:          0;
    letter-spacing:   0.04em;
    text-align:       left;
    transition:       color 0.2s;
    line-height:      1.5;
}
.games-scan-replay-link:hover { color: var(--accent); }
.games-scan-replay-note {
    font-family: var(--font-mono);
    font-size:   0.65rem;
    color:       var(--text-secondary);
    opacity:     0.5;
    margin-top:  4px;
}
/* Standalone screen scan replay row */
.mg-scan-replay-row {
    padding-top: 16px;
    border-top:  1px solid var(--border);
    display:     flex;
    flex-direction: column;
    gap:         4px;
}
.mg-intro-line {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.5;
    opacity:     0.8;
}

/* Scan replay picker */
.mg-replay-picker-wrap {
    display:        flex;
    flex-direction: column;
    gap:            20px;
}
.mg-replay-intro {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.5;
}
.mg-replay-list { display: flex; flex-direction: column; gap: 12px; }
.mg-replay-card {
    padding:       14px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    display:       flex;
    flex-direction: column;
    gap:            8px;
}
.mg-replay-name {
    font-family:   var(--font-mono);
    font-size:     0.8rem;
    font-weight:   700;
    color:         var(--accent);
    letter-spacing: 0.08em;
}
.mg-replay-desc {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
    line-height: 1.4;
}

/* First-play prompt */
.mg-firstplay-wrap {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    gap:             20px;
    min-height:      60vh;
    text-align:      center;
    padding:         40px 20px;
}
.mg-firstplay-icon  { font-size: 2.5rem; color: var(--accent); opacity: 0.7; }
.mg-firstplay-label {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.12em;
}
.mg-firstplay-text {
    font-family: var(--font-mono);
    font-size:   0.9rem;
    color:       var(--text-primary);
    line-height: 1.7;
    max-width:   320px;
}
.mg-firstplay-btn { min-width: 200px; margin-top: 12px; }

/* Game result screen */
.mg-result-wrap {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    gap:             20px;
    padding:         60px 20px 80px;
    text-align:      center;
}
.mg-result-grade {
    font-family: var(--font-mono);
    font-size:   5rem;
    font-weight: 700;
    line-height: 1;
    animation:   scaleIn 0.4s ease;
}
.mg-result-name {
    font-family:   var(--font-mono);
    font-size:     0.82rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.mg-result-rewards {
    width:         100%;
    max-width:     280px;
    display:       flex;
    flex-direction: column;
    gap:            10px;
}
.mg-result-row {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         8px 0;
    border-bottom:   1px solid var(--border);
}
.mg-result-row:last-child { border-bottom: none; }
.mg-result-label {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
}
.mg-result-val {
    font-family: var(--font-mono);
    font-size:   0.85rem;
    font-weight: 700;
    color:       var(--text-primary);
}
.mg-result-done { margin-top: 8px; min-width: 200px; }

/* ── PATH TRACK SELECTION ────────────────────────────────────── */
.path-track-btn {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    text-align:     left;
    /* Use --panel not --surface for slightly more contrast */
    background:     var(--panel);
    border:         1px solid var(--border);
    border-radius:  4px;
    padding:        20px 18px;
    cursor:         pointer;
    transition:     border-color 0.2s, background 0.2s;
    width:          100%;
    min-height:     44px;
}
.path-track-btn:hover {
    border-color: var(--accent);
    background:   rgba(79,195,247,0.04);
}
.path-track-tag {
    font-family:   var(--font-mono);
    font-size:     0.68rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.path-track-label {
    font-family:   var(--font-mono);
    font-size:     0.88rem;
    font-weight:   700;
    color:         var(--text-primary);
    letter-spacing: 0.04em;
}
.path-track-sub {
    font-size:   0.8rem;
    color:       var(--text-secondary);
    line-height: 1.5;
}

/* ── SCAN GAME SHARED ────────────────────────────────────────── */
.scan-game { display: flex; flex-direction: column; gap: 14px; }
.scan-game-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
}
.scan-game-tag {
    font-family:   var(--font-mono);
    font-size:     0.7rem;
    color:         var(--accent);
    letter-spacing: 0.1em;
}
.mg-game-body { display: flex; flex-direction: column; gap: 14px; }
.mg-game-instruction {
    font-family: var(--font-mono);
    font-size:   0.78rem;
    color:       var(--text-secondary);
    line-height: 1.5;
}
.mg-wave-label {
    font-family:   var(--font-mono);
    font-size:     0.72rem;
    color:         var(--text-secondary);
    letter-spacing: 0.06em;
}
.mg-active-header {
    display:     flex;
    align-items: center;
    gap:         12px;
    margin-bottom: 4px;
}

/* ── DRIFT GAME ──────────────────────────────────────────────── */
.drift-arena {
    width:         100%;
    height:        80px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    overflow:      hidden;
    position:      relative;
    margin-bottom: 8px;
    touch-action:  none;
}
.drift-zone {
    position:      absolute;
    top:           0;
    height:        100%;
    background:    rgba(79, 195, 247, 0.18);
    border-left:   2px solid var(--accent);
    border-right:  2px solid var(--accent);
    transition:    left 0.05s linear, width 0.3s ease;
}
.drift-marker {
    position:   absolute;
    top:        50%;
    transform:  translateY(-50%);
    width:      3px;
    height:     60%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: left 0.05s linear;
}
.drift-in-zone .drift-marker { background: var(--accent); }
.drift-score-row {
    display:     flex;
    align-items: center;
    gap:         6px;
}
.drift-score-label {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
}
.drift-score-val {
    font-family: var(--font-mono);
    font-size:   0.85rem;
    color:       var(--accent);
    font-weight: 700;
}

/* ── ECHO GAME ───────────────────────────────────────────────── */
.echo-sequence {
    display:         flex;
    justify-content: center;
    gap:             14px;
    min-height:      52px;
    align-items:     center;
    padding:         12px 0;
    letter-spacing:  8px;
    font-size:       1.8rem;
    color:           var(--accent);
}
.echo-input-row {
    display:         flex;
    justify-content: center;
    gap:             10px;
    flex-wrap:       wrap;
}
.echo-symbol-btn {
    font-size:     1.4rem;
    width:         52px;
    height:        52px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    cursor:        pointer;
    transition:    border-color 0.15s, background 0.15s;
    color:         var(--text-primary);
}
.echo-symbol-btn:hover   { border-color: var(--accent); background: rgba(79,195,247,0.06); }
.echo-symbol-btn--correct { border-color: #80cbc4; background: rgba(128,203,196,0.12); }
.echo-symbol-btn--wrong   { border-color: var(--danger); background: rgba(255,82,82,0.1); }
.echo-round-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-secondary); }
.echo-status {
    font-family:   var(--font-mono);
    font-size:     0.78rem;
    color:         var(--accent);
    text-align:    center;
    min-height:    1.4em;
    letter-spacing: 0.06em;
}

/* ── FLOW GAME ───────────────────────────────────────────────── */
.flow-arena {
    width:         100%;
    height:        80px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    overflow:      hidden;
    position:      relative;
    margin-bottom: 8px;
    touch-action:  none;
    cursor:        pointer;
}
.flow-bar {
    position:      absolute;
    bottom:        0;
    left:          0;
    right:         0;
    background:    var(--accent);
    opacity:       0.7;
    transition:    height 0.04s linear;
}
.flow-zone-lower,
.flow-zone-upper {
    position:        absolute;
    left:            0;
    right:           0;
    background:      rgba(0, 230, 118, 0.1);
    border-top:      1px dashed rgba(0, 230, 118, 0.4);
    pointer-events:  none;
}
.flow-in-zone .flow-bar { background: var(--green); opacity: 0.8; }
.flow-score-row { display: flex; align-items: center; gap: 6px; }
.flow-score-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-secondary); }
.flow-score-val   { font-family: var(--font-mono); font-size: 0.85rem; color: var(--green); font-weight: 700; }

/* ── RESONANCE GAME ──────────────────────────────────────────── */
.resonance-situation {
    padding:       14px;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
}
.resonance-situation-text {
    font-family: var(--font-mono);
    font-size:   0.88rem;
    color:       var(--text-primary);
    line-height: 1.7;
}
.resonance-options { display: flex; flex-direction: column; gap: 10px; }
.resonance-option {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    color:         var(--text-primary);
    font-family:   var(--font-mono);
    font-size:     0.83rem;
    padding:       14px 16px;
    text-align:    left;
    cursor:        pointer;
    line-height:   1.5;
    transition:    border-color 0.15s, background 0.15s;
    min-height:    44px;
}
.resonance-option:hover:not(:disabled) { border-color: var(--accent); background: rgba(79,195,247,0.04); }
.resonance-option--correct { border-color: var(--green); background: rgba(0,230,118,0.08); color: var(--green); }
.resonance-option--wrong   { border-color: var(--danger); background: rgba(255,82,82,0.06); opacity: 0.7; }
.resonance-option:disabled { cursor: default; }
.resonance-score-row { display: flex; justify-content: space-between; align-items: center; }
.resonance-score-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-secondary); }
.resonance-score-val   { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); font-weight: 700; }
.resonance-round-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-secondary); }

/* ── CASCADE ARENA ──────────────────────────────────────────── */
.cas-arena {
    display:  flex;
    gap:      8px;
    height:   240px;
    overflow: hidden;
}
.cas-cols {
    flex:    1;
    display: flex;
    gap:     6px;
}
.cas-col {
    flex:     1;
    position: relative;
    overflow: hidden;
}
.cas-node {
    position:      absolute;
    width:         100%;
    height:        44px;
    display:       flex;
    align-items:   center;
    justify-content: center;
    font-size:     1.4rem;
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    cursor:        pointer;
    transition:    border-color 0.15s, background 0.15s, transform 0.1s;
    user-select:   none;
}
.cas-node:hover:not(:disabled) { border-color: var(--accent); transform: scale(1.04); }
.cas-node--held   { border-color: var(--accent); background: rgba(79,195,247,0.2); box-shadow: 0 0 10px rgba(79,195,247,0.3); }
.cas-node--clear  { border-color: var(--green);  background: rgba(0,230,118,0.15); }
.cas-node--wrong  { border-color: var(--danger);  background: rgba(255,82,82,0.1); }
.cas-node--missed { opacity: 0.2; }
.cas-node:disabled { cursor: default; }
.cas-held-slot {
    width:        60px;
    display:      flex;
    flex-direction: column;
    align-items:  center;
    justify-content: center;
    gap:          6px;
    background:   var(--surface);
    border:       1px solid var(--border);
    border-radius: 4px;
    padding:      8px 4px;
}
.cas-held-label  { font-family: var(--font-mono); font-size: 0.58rem; color: var(--text-secondary); letter-spacing: 0.06em; }
.cas-held-symbol { font-size: 1.6rem; color: var(--accent); min-height: 2rem; display: flex; align-items: center; }
.cas-pairs-row   { display: flex; align-items: center; gap: 6px; }
.cas-pairs-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-secondary); }
.cas-pairs-val   { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); font-weight: 700; }

/* ── PRECISION SHOOTER ───────────────────────────────────────── */
.ps-stats-bar { display: flex; gap: 12px; align-items: center; }
.ps-stat {
    font-family: var(--font-mono);
    font-size:   0.75rem;
    color:       var(--text-secondary);
}
.ps-stat strong { color: var(--accent); }

/* ── SMALL SCREEN ────────────────────────────────────────────── */
@media (max-width: 380px) {
    body { padding: 8px; }
    .status-tab-content { padding: 16px 12px 80px; }
    .ops-segment-content { padding: 16px 0 80px; }
    .dc-title  { font-size: 0.8rem; }
    .dc-desc   { font-size: 0.78rem; }
    .ops-segment-btn { font-size: 0.65rem; padding: 10px 6px; }
}

/* ══════════════════════════════════════════════════════════════
   SIGNAL TRANSLATION — Call 2B output screen (onboarding + OPS)
══════════════════════════════════════════════════════════════ */

.signal-translation-wrap {
    display:        flex;
    flex-direction: column;
    gap:            20px;
    padding:        32px 0 80px;
    animation:      reimaginer-fade-in 0.4s ease;
}
.signal-translation-wrap--loading {
    align-items:  center;
    padding-top:  60px;
    gap:          16px;
}
.st-header { text-align: center; }
.st-label {
    font-family:    var(--font-mono);
    font-size:      0.75rem;
    color:          var(--accent);
    letter-spacing: 0.1em;
    margin-bottom:  4px;
}
.st-sub {
    font-size:   0.85rem;
    color:       var(--text-secondary);
    line-height: 1.5;
    margin:      0;
}
.st-role-block {
    display:        flex;
    flex-direction: column;
    gap:            16px;
}
.st-role-section {
    background:    var(--surface);
    border:        1px solid var(--border);
    border-radius: 4px;
    padding:       16px;
    display:       flex;
    flex-direction: column;
    gap:            8px;
}
.st-role-section--target {
    border-color: var(--accent);
}
.st-role-tag {
    font-family:    var(--font-mono);
    font-size:      0.65rem;
    letter-spacing: 0.1em;
    color:          var(--accent);
    margin:         0;
}
.st-role-name {
    font-size:   1rem;
    font-weight: 600;
    color:       var(--text-primary);
    margin:      0;
}
.st-headline {
    font-family:  var(--font-mono);
    font-size:    0.78rem;
    color:        var(--text-secondary);
    font-style:   italic;
    line-height:  1.45;
    margin:       0;
}
.st-bullets {
    list-style:     none;
    padding:        0;
    margin:         0;
    display:        flex;
    flex-direction: column;
    gap:            8px;
}
.st-bullet {
    font-size:    0.82rem;
    color:        var(--text-primary);
    line-height:  1.5;
    padding-left: 1.1rem;
    position:     relative;
}
.st-bullet::before {
    content:  '▸';
    position: absolute;
    left:     0;
    color:    var(--accent);
    font-size: 0.7rem;
    top:      0.1rem;
}
.st-gap-block {
    background:    var(--surface);
    border-left:   2px solid var(--gold);
    padding:       12px 14px;
    border-radius: 0 4px 4px 0;
}
.st-gap-label {
    font-family:    var(--font-mono);
    font-size:      0.65rem;
    letter-spacing: 0.1em;
    color:          var(--gold);
    margin-bottom:  4px;
}
.st-gap-note {
    font-size:   0.82rem;
    color:       var(--text-primary);
    line-height: 1.5;
    margin:      0;
}
.st-footer-note {
    font-family:  var(--font-mono);
    font-size:    0.75rem;
    color:        var(--text-secondary);
    margin:       0;
}
.st-actions {
    display:        flex;
    flex-direction: column;
    gap:            10px;
}
.st-copy-btn {
    background:     transparent;
    border:         1px solid var(--border);
    color:          var(--text-secondary);
    font-family:    var(--font-mono);
    font-size:      0.72rem;
    letter-spacing: 0.08em;
    padding:        8px 14px;
    cursor:         pointer;
    border-radius:  3px;
    transition:     border-color 0.2s, color 0.2s;
    align-self:     flex-start;
    min-height:     44px;
}
.st-copy-btn:hover {
    border-color: var(--accent);
    color:        var(--accent);
}
.st-loading-line {
    font-family:  var(--font-mono);
    font-size:    0.82rem;
    color:        var(--text-secondary);
    text-align:   center;
}
.st-loading-bar {
    width:         100%;
    max-width:     260px;
    height:        2px;
    background:    var(--border);
    border-radius: 1px;
    overflow:      hidden;
}
.st-loading-fill {
    height:     100%;
    background: var(--accent);
    width:      0%;
    transition: width 0.3s ease;
}
.st-skip-small {
    background:      none;
    border:          none;
    color:           var(--text-secondary);
    font-family:     var(--font-mono);
    font-size:       0.72rem;
    cursor:          pointer;
    text-decoration: underline;
    padding:         4px 0;
}

/* ─── SYD INTRO VOICE (CV Reframe screen) ───────────────────── */
.st-syd-intro {
    display:        flex;
    flex-direction: column;
    gap:            10px;
    padding:        14px 16px;
    background:     var(--surface);
    border-left:    2px solid var(--accent);
    margin-bottom:  4px;
}
.st-syd-line {
    font-size:   0.88rem;
    color:       var(--text-primary);
    margin:      0;
    line-height: 1.6;
}

/* ─── ROLE SECTION HEADER (inline copy button) ──────────────── */
.st-role-section-header {
    display:         flex;
    justify-content: space-between;
    align-items:     flex-start;
    gap:             12px;
    margin-bottom:   10px;
}
.st-copy-btn--inline {
    flex-shrink:    0;
    background:     transparent;
    border:         1px solid var(--accent);
    color:          var(--accent);
    font-family:    var(--font-mono);
    font-size:      0.65rem;
    letter-spacing: 0.08em;
    padding:        5px 10px;
    cursor:         pointer;
    border-radius:  3px;
    transition:     background 0.2s, color 0.2s;
    min-height:     36px;
    align-self:     flex-start;
    margin-top:     2px;
    white-space:    nowrap;
}
.st-copy-btn--inline:hover {
    background: var(--accent);
    color:      var(--bg);
}
.st-gap-sub {
    font-family: var(--font-mono);
    font-size:   0.72rem;
    color:       var(--text-secondary);
    margin-top:  6px;
}
.st-continue-main {
    align-self: center;
    min-width:  260px;
    margin-top: 8px;
}

/* ─── ROLE CARD — SPLIT LAYOUT (Round 1 path cards) ─────────── */
.role-card--split {
    padding: 0;
    overflow: hidden;
}
.role-card-split-row {
    display: flex;
    gap:     0;
    border-bottom: 1px solid var(--border);
}
.role-card-now,
.role-card-direction {
    flex:    1;
    padding: 12px 14px;
}
.role-card-now {
    border-right: 1px solid var(--border);
}
.role-card-direction {
    background: rgba(79, 195, 247, 0.04);
}
.role-card-split-label {
    display:        block;
    font-family:    var(--font-mono);
    font-size:      0.58rem;
    letter-spacing: 0.12em;
    color:          var(--text-secondary);
    margin-bottom:  4px;
}
.role-card-split-value {
    display:     block;
    font-size:   0.85rem;
    font-weight: 600;
    color:       var(--text-primary);
    line-height: 1.3;
}
.role-card-direction .role-card-split-value {
    color: var(--accent);
}
.role-card--split .role-card-narrative {
    padding:     10px 14px 0;
    margin:      0;
    font-size:   0.8rem;
    line-height: 1.5;
}
.role-card--split .role-card-roles {
    padding:     0 14px 14px;
    margin-top:  8px;
}

@media (max-width: 380px) {
    .role-card-now,
    .role-card-direction { padding: 10px 10px; }
    .role-card-split-value { font-size: 0.78rem; }
    .status-tab-btn  { font-size: 0.68rem; padding: 10px 12px; }
    .sot-name { font-size: 1.2rem; }
    .screen-inner--narrow { padding: 24px 16px 80px; }
}

/* ─── CALL 2 FAILURE SCREEN ─────────────────────────────────── */
.call-failure-wrap {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            20px;
    padding-top:    80px;
    text-align:     center;
}
.call-failure-label {
    font-family:    var(--font-mono);
    font-size:      0.75rem;
    color:          var(--red);
    letter-spacing: 0.1em;
}
.call-failure-reason {
    font-size:   0.88rem;
    color:       var(--text-primary);
    line-height: 1.6;
    max-width:   320px;
}
.call-failure-actions {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            12px;
    margin-top:     8px;
}
.call-failure-local-btn {
    background:      none;
    border:          none;
    color:           var(--text-secondary);
    font-family:     var(--font-mono);
    font-size:       0.75rem;
    cursor:          pointer;
    text-decoration: underline;
    padding:         4px 0;
    min-height:      44px;
}

/* ─── SCAN REVEAL — TRAIT EXPLAINERS ────────────────────────── */
.srt-row--tappable {
    cursor: pointer;
}
.srt-row--tappable:hover .srt-name {
    color: var(--accent);
}
.srt-explainer {
    font-size:    0.78rem;
    color:        var(--text-secondary);
    line-height:  1.5;
    padding-top:  6px;
    padding-left: 2px;
    border-left:  1px solid var(--border);
    padding-left: 8px;
    margin-top:   4px;
    animation:    fadeIn 0.2s ease;
}

/* ─── SCAN GAME — VISUAL IMPROVEMENTS ──────────────────────── */
.sb-node--lit {
    animation: sb-pulse 1.4s ease-in-out infinite;
}
@keyframes sb-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}
.sb-timer-bar {
    transition: width 0.08s linear;
}

/* ═══════════════════════════════════════════════════════════════
   ADDENDUM — title screen, scan briefs, career rank, SIG badge
   Added: feedback batch April 2026
═══════════════════════════════════════════════════════════════ */

/* ─── TITLE SCREEN ───────────────────────────────────────────── */
.title-screen-wrap {
    display:         flex;
    flex-direction:  column;
    justify-content: center;
    min-height:      100vh;
    padding:         0 0 80px;
    gap:             0;
}

.title-screen-logo {
    font-family:    var(--font-mono);
    font-size:      2.8rem;
    font-weight:    700;
    color:          var(--accent);
    letter-spacing: 0.18em;
    margin-bottom:  40px;
}

.title-screen-lines {
    display:        flex;
    flex-direction: column;
    gap:            12px;
    margin-bottom:  48px;
}

.title-screen-line {
    font-family:  var(--font-mono);
    font-size:    1rem;
    color:        var(--text-primary);
    line-height:  1.75;
    opacity:      0.92;
}

.title-screen-btn {
    align-self:  flex-start;
    min-width:   200px;
}

/* ─── SCAN BRIEF ─────────────────────────────────────────────── */
.scan-brief {
    display:        flex;
    flex-direction: column;
    gap:            16px;
    padding-top:    8px;
}

.scan-brief-tag {
    font-family:    var(--font-mono);
    font-size:      0.75rem;
    color:          var(--accent);
    letter-spacing: 0.12em;
}

.scan-brief-line {
    font-family:  var(--font-mono);
    font-size:    0.95rem;
    color:        var(--text-primary);
    line-height:  1.7;
    opacity:      0.9;
}

.scan-brief-btn {
    margin-top: 8px;
    align-self: flex-start;
}

/* ─── CAREER RANK LABEL ──────────────────────────────────────── */
.career-rank-label,
.sr-career-rank-label {
    font-family:    var(--font-mono);
    font-size:      1.1rem;
    font-weight:    700;
    color:          var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sr-rank-row {
    display:     flex;
    align-items: center;
    gap:         12px;
    margin-top:  8px;
    flex-wrap:   wrap;
}

.sr-rank-context {
    font-size:   0.85rem;
    color:       var(--text-secondary);
    line-height: 1.5;
}

/* ─── SIG BADGE BUTTON ───────────────────────────────────────── */
.sot-sig-badge--btn {
    background:  transparent;
    border:      1px solid var(--sig-gold);
    color:       var(--sig-gold);
    font-family: var(--font-mono);
    font-size:   0.75rem;
    padding:     3px 8px;
    border-radius: 2px;
    cursor:      pointer;
    transition:  background 0.15s ease, opacity 0.15s ease;
    min-height:  28px;
}
.sot-sig-badge--btn:active {
    background: rgba(240, 192, 64, 0.12);
    opacity:    0.8;
}

/* ─── SIGNAL TRANSLATION PERSIST NOTE ───────────────────────── */
.st-persist-note {
    font-family:  var(--font-mono);
    font-size:    0.75rem;
    color:        var(--text-secondary);
    line-height:  1.6;
    opacity:      0.7;
    margin-top:   8px;
    margin-bottom: 24px;
}

/* ─── CLOUD SYNC OPT-IN SCREEN ──────────────────────────────── */
.cloud-sync-optin-wrap {
    display:        flex;
    flex-direction: column;
    gap:            20px;
    padding:        40px 0 80px;
}

.cso-label {
    font-family:    var(--font-mono);
    font-size:      0.75rem;
    color:          var(--accent);
    letter-spacing: 0.12em;
}

.cso-syd-line {
    font-family:  var(--font-mono);
    font-size:    0.9rem;
    color:        var(--text-primary);
    line-height:  1.7;
    margin:       0;
}

.cso-skip-btn {
    background:      transparent;
    border:          none;
    color:           var(--text-secondary);
    font-family:     var(--font-mono);
    font-size:       0.8rem;
    cursor:          pointer;
    padding:         12px 0;
    text-align:      left;
    text-decoration: underline;
    min-height:      44px;
    opacity:         0.8;
}
.cso-skip-btn:active { opacity: 0.5; }

/* ─── CLOUD SYNC MANAGE SCREEN ───────────────────────────────── */
.csm-wrap {
    display:        flex;
    flex-direction: column;
    gap:            20px;
    padding:        40px 0 80px;
}
.csm-label {
    font-family:    var(--font-mono);
    font-size:      0.75rem;
    color:          var(--accent);
    letter-spacing: 0.12em;
}
.csm-syd-line {
    font-family:  var(--font-mono);
    font-size:    0.9rem;
    color:        var(--text-primary);
    line-height:  1.7;
    margin:       0;
}
.csm-id-block {
    background:    var(--panel);
    border:        1px solid var(--border);
    border-radius: 4px;
    padding:       14px 16px;
    display:       flex;
    flex-direction: column;
    gap:           8px;
}
.csm-id-label {
    font-family:    var(--font-mono);
    font-size:      0.68rem;
    color:          var(--text-secondary);
    letter-spacing: 0.1em;
}
.csm-id-value {
    font-family:    var(--font-mono);
    font-size:      0.85rem;
    color:          var(--accent);
    word-break:     break-all;
    letter-spacing: 0.04em;
}
.csm-id-note {
    font-family:  var(--font-mono);
    font-size:    0.72rem;
    color:        var(--text-secondary);
    line-height:  1.6;
    opacity:      0.8;
}

/* ─── TITLE SCREEN RESTORE BUTTON ───────────────────────────── */
.title-restore-btn {
    display:        block;
    margin:         12px auto 0;
    background:     transparent;
    border:         none;
    color:          var(--text-secondary, #5a6a7a);
    font-family:    var(--font-mono, monospace);
    font-size:      0.72rem;
    letter-spacing: 0.08em;
    cursor:         pointer;
    padding:        8px 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.title-restore-btn:active {
    color: var(--accent);
}

/* ─── RESTORE FLOW ───────────────────────────────────────────── */
.restore-wrap {
    padding:        24px 20px;
    display:        flex;
    flex-direction: column;
    gap:            12px;
}
.restore-label {
    font-family:    var(--font-mono, monospace);
    font-size:      0.72rem;
    letter-spacing: 0.12em;
    color:          var(--accent);
    margin:         0;
}
.restore-syd-line {
    font-size:   0.88rem;
    color:       var(--text-primary);
    line-height: 1.6;
    margin:      0;
}
.restore-caveat {
    font-size: 0.78rem;
    color:     var(--text-secondary, #5a6a7a);
}
.restore-error {
    font-family: var(--font-mono, monospace);
    font-size:   0.78rem;
    color:       var(--danger, #ef5350);
    margin:      0;
}
.restore-input-group {
    margin: 4px 0;
}
.restore-uid-input {
    font-family: var(--font-mono, monospace);
    width:       100%;
    box-sizing:  border-box;
}
.restore-cancel-btn {
    background:  transparent;
    border:      none;
    color:       var(--text-secondary, #5a6a7a);
    font-family: var(--font-mono, monospace);
    font-size:   0.72rem;
    cursor:      pointer;
    padding:     4px 0;
    text-align:  center;
}
.restore-preview {
    background:    rgba(79, 195, 247, 0.06);
    border:        1px solid rgba(79, 195, 247, 0.2);
    border-radius: 4px;
    padding:       12px 16px;
}
.restore-preview-name {
    font-family:    var(--font-mono, monospace);
    font-size:      1rem;
    color:          var(--accent);
    margin:         0 0 4px;
    letter-spacing: 0.06em;
}
.restore-preview-meta {
    font-family: var(--font-mono, monospace);
    font-size:   0.72rem;
    color:       var(--text-secondary, #5a6a7a);
    margin:      0;
}

/* ─── CLOUD SYNC OPT-IN MODE TOGGLE ─────────────────────────── */
.cso-mode-row {
    display: flex;
    gap:     8px;
    margin:  4px 0 8px;
}
.cso-mode-btn {
    flex:           1;
    background:     transparent;
    border:         1px solid var(--border);
    color:          var(--text-secondary, #5a6a7a);
    font-family:    var(--font-mono, monospace);
    font-size:      0.72rem;
    letter-spacing: 0.08em;
    padding:        8px 4px;
    cursor:         pointer;
    border-radius:  2px;
    transition:     border-color 0.15s, color 0.15s;
}
.cso-mode-btn--active {
    border-color: var(--accent);
    color:        var(--accent);
}

/* ─── SETTINGS RESTORE LINK ──────────────────────────────────── */
.settings-restore-link {
    display:     block;
    background:  transparent;
    border:      none;
    color:       var(--text-secondary, #5a6a7a);
    font-family: var(--font-mono, monospace);
    font-size:   0.72rem;
    cursor:      pointer;
    padding:     6px 0 0;
    text-align:  left;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.settings-restore-link:active {
    color: var(--accent);
}

/* ─── MARKET SIGNAL — ROLE MAPPING ──────────────────────────── */
.ms-fetch-btn {
    display:        block;
    width:          100%;
    background:     transparent;
    border:         1px solid var(--border);
    color:          var(--text-secondary, #5a6a7a);
    font-family:    var(--font-mono, monospace);
    font-size:      0.72rem;
    letter-spacing: 0.06em;
    padding:        10px 14px;
    text-align:     left;
    cursor:         pointer;
    margin-bottom:  12px;
    border-radius:  2px;
    transition:     border-color 0.2s, color 0.2s;
}
.ms-fetch-btn:not(:disabled):hover {
    border-color: var(--accent);
    color:        var(--accent);
}
.ms-fetch-btn:disabled {
    opacity: 0.5;
    cursor:  default;
}
.ms-loading-text {
    font-family:    var(--font-mono, monospace);
    font-size:      0.68rem;
    color:          var(--text-secondary, #5a6a7a);
    letter-spacing: 0.06em;
    margin:         0 0 6px;
}
.ms-loading-bar {
    width:         100%;
    height:        2px;
    background:    var(--border);
    border-radius: 1px;
    overflow:      hidden;
    margin-bottom: 12px;
}
@keyframes msBarPulse {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}
.ms-loading-bar-fill {
    width:      50%;
    height:     100%;
    background: var(--accent, #4fc3f7);
    animation:  msBarPulse 1.2s ease-in-out infinite;
}
.ms-acquired-row {
    display:     flex;
    align-items: center;
    gap:         12px;
    margin-bottom: 10px;
}
.ms-view-btn {
    background:     transparent;
    border:         1px solid var(--accent, #4fc3f7);
    color:          var(--accent, #4fc3f7);
    font-family:    var(--font-mono, monospace);
    font-size:      0.68rem;
    letter-spacing: 0.08em;
    padding:        4px 10px;
    cursor:         pointer;
    border-radius:  2px;
    transition:     background 0.15s;
    white-space:    nowrap;
}
.ms-view-btn:hover {
    background: rgba(79, 195, 247, 0.1);
}
.ms-fetched-note {
    font-family:  var(--font-mono, monospace);
    font-size:    0.68rem;
    color:        #66bb6a;
    margin:       0 0 10px;
    letter-spacing: 0.06em;
}
.ms-block {
    margin-top:    10px;
    padding:       10px 12px;
    border-left:   2px solid var(--border);
    background:    rgba(255,255,255,0.02);
    border-radius: 0 2px 2px 0;
    display:       flex;
    flex-direction: column;
    gap:           4px;
}
.ms-label {
    font-family:    var(--font-mono, monospace);
    font-size:      0.6rem;
    letter-spacing: 0.12em;
    color:          var(--text-secondary, #5a6a7a);
}
.ms-demand {
    font-family:    var(--font-mono, monospace);
    font-size:      0.78rem;
    font-weight:    700;
    letter-spacing: 0.1em;
}
.ms-trend-inline {
    font-size:   0.75rem;
    font-weight: 400;
    font-family: var(--font-mono, monospace);
    color:       var(--text-secondary, #5a6a7a);
    letter-spacing: 0.04em;
}
.ms-who {
    font-size:   0.75rem;
    color:       var(--text-secondary, #5a6a7a);
    line-height: 1.5;
    margin:      0;
}
.ms-who-value {
    color: var(--text-primary);
}