:root {
    --bg-color: #050505;
    --card-bg: #0a0a0a;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --accent: #00f0ff;
    /* Cyberpunk Cyan */
    --accent-dim: rgba(0, 240, 255, 0.1);
    --alert: #ff2a2a;
    --success: #00ff41;
    --grid-line: #1a1a1a;
    --font-head: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Effects */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.1));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 100;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 99;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem 8rem 1rem;
    position: relative;
    z-index: 1;
}

/* Header */
.cmd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--grid-line);
    font-family: var(--font-head);
    font-size: 0.9rem;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    z-index: 50;
}

.logo .highlight {
    color: var(--accent);
}

.status-indicator {
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.blink {
    animation: blinker 2s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

/* Hero */
.hero {
    padding: 6rem 0;
    text-align: center;
}

.terminal-intro {
    font-family: var(--font-head);
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

h1 {
    font-family: var(--font-head);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
    text-transform: uppercase;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub-title {
    font-weight: 300;
    color: var(--accent);
    letter-spacing: 4px;
    margin-bottom: 3rem;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.meta-instruction {
    border: 1px solid var(--grid-line);
    display: inline-block;
    padding: 1.5rem 3rem;
    background: var(--card-bg);
}

.meta-instruction .label {
    font-family: var(--font-head);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.meta-instruction .emphasize {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.meta-instruction .desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Modules */
.module {
    margin-bottom: 6rem;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-family: var(--font-head);
    color: var(--accent);
    font-size: 0.9rem;
}

.module-header h3 {
    white-space: nowrap;
}

.module-header .line {
    height: 1px;
    background: var(--grid-line);
    width: 100%;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--grid-line);
    padding: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-dim);
}

.card h4 {
    font-family: var(--font-head);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.card.v2 h4,
.card.system.active h4 {
    color: var(--accent);
}

.card ul {
    list-style: none;
}

.card ul li {
    margin-bottom: 0.5rem;
    padding-left: 1.2rem;
    position: relative;
    font-size: 0.95rem;
}

.card ul li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--text-secondary);
    font-family: var(--font-head);
}

/* Action Box */
.action-box {
    background: linear-gradient(45deg, var(--card-bg), #0f0f0f);
    border: 1px solid var(--grid-line);
    padding: 2rem;
    border-left: 3px solid var(--accent);
}

.action-box h4 {
    font-family: var(--font-head);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.objective {
    margin-top: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
}

.tag {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 0.2rem 0.5rem;
    font-family: var(--font-head);
    font-size: 0.75rem;
    border-radius: 2px;
}

/* Career */
.strategy {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-family: var(--font-head);
}

.strike {
    text-decoration: line-through;
    color: var(--text-secondary);
    opacity: 0.5;
}

.strategy .highlight {
    color: var(--success);
}

.card.system {
    text-align: center;
}

.card.system .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.role {
    display: block;
    font-family: var(--font-head);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    background: #151515;
    padding: 0.2rem;
    display: inline-block;
}

.output-req {
    text-align: center;
    border: 1px dashed var(--grid-line);
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Bio HUD */
.hud-display {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    margin-bottom: 2rem;
    border: 1px solid var(--grid-line);
    background: #080808;
    padding: 1rem;
}

.monitor {
    border-right: 1px solid var(--grid-line);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.monitor h5 {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-head);
}

.decision-core {
    padding: 1rem;
}

.logic-gate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-family: var(--font-head);
    font-size: 0.85rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.result.defensive {
    color: #f0f;
}

/* Purple/Pink */
.result.offensive {
    color: var(--success);
}

.locations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.loc-card {
    border: 1px solid var(--grid-line);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.loc-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
}

.loc-card:nth-child(1)::before {
    background: #fff;
}

/* Japan/Zen */
.loc-card:nth-child(2)::before {
    background: #f00;
}

/* China/Wolf */

.loc-header {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.mode {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

/* Mind List */
.list-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1rem;
    border-bottom: 1px solid var(--grid-line);
}

.bullet {
    font-family: var(--font-head);
    color: var(--accent);
    min-width: 100px;
    font-size: 0.9rem;
}

/* Roadmap */
.timeline {
    border-left: 2px solid var(--grid-line);
    padding-left: 2rem;
}

.quarter {
    position: relative;
    margin-bottom: 3rem;
}

.quarter:last-child {
    margin-bottom: 0;
}

.quarter::before {
    content: "";
    position: absolute;
    left: -2.4rem;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--bg-color);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.q-marker {
    font-family: var(--font-head);
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.q-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border: 1px solid var(--grid-line);
}

.q-content h5 {
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.q-content .loc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

/* Footer */
.protocol-footer {
    border-top: 1px solid var(--grid-line);
    padding-top: 4rem;
    margin-top: 4rem;
}

.protocol-footer h3 {
    font-family: var(--font-head);
    color: var(--alert);
    font-size: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.checklist {
    max-width: 600px;
    margin: 0 auto 3rem auto;
    font-family: var(--font-head);
}

.check-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--grid-line);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.check-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.check-item input {
    margin-right: 0.5rem;
}

.check-item .time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.system-msg {
    text-align: center;
    color: var(--success);
    font-family: var(--font-head);
    font-size: 0.9rem;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* Navigation Tabs */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    position: sticky;
    top: 60px;
    /* Below header */
    z-index: 40;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.9), transparent);
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    font-family: var(--font-head);
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 10px var(--accent-dim);
}

.nav-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* Tab Content Logic */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Editor Styling */
.log-input-section {
    margin-bottom: 4rem;
}

.editor-container {
    background: var(--card-bg);
    border: 1px solid var(--grid-line);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cmd-input,
.cmd-textarea {
    background: #000;
    border: 1px solid var(--grid-line);
    color: var(--text-primary);
    font-family: var(--font-head);
    padding: 0.8rem;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
}

.cmd-input:focus,
.cmd-textarea:focus {
    border-color: var(--accent);
}

.cmd-textarea {
    min-height: 200px;
    resize: vertical;
}

.meta-inputs {
    display: flex;
    gap: 1rem;
}

.cmd-input.small {
    flex: 1;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#save-status {
    font-family: var(--font-head);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.6rem 2rem;
    font-family: var(--font-head);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--accent);
}

/* Log Feed Styling */
.log-entry {
    background: var(--card-bg);
    border: 1px solid var(--grid-line);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 2px solid var(--text-secondary);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-entry:hover {
    border-left-color: var(--accent);
}

.log-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-head);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--grid-line);
    padding-bottom: 0.5rem;
}

.log-title {
    font-family: var(--font-head);
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.log-body {
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #ccc;
}

.log-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.btn-delete {
    background: transparent;
    border: 1px solid var(--alert);
    color: var(--alert);
    padding: 0.2rem 0.5rem;
    font-family: var(--font-head);
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

/* === 3.5D FEATURE STYLING === */

/* Spark Button */
#spark-container {
    margin-left: auto;
    /* Push to right */
}

.btn-ghost {
    background: transparent;
    border: 1px dashed var(--accent);
    color: var(--accent);
    padding: 0.3rem 0.8rem;
    font-family: var(--font-head);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: var(--accent-dim);
    box-shadow: 0 0 10px var(--accent-dim);
}

.spark-overlay {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--accent);
    padding: 2rem;
    z-index: 200;
    max-width: 80%;
    text-align: center;
    font-family: var(--font-head);
    color: #fff;
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.2);
    animation: glitchIntro 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes glitchIntro {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Entropy Field (Thinking Glow) */
#entropy-field {
    transition: box-shadow 0.2s ease;
    border-radius: 2px;
}

#entropy-field.high-entropy {
    box-shadow: 0 0 30px rgba(255, 100, 0, 0.3);
    /* Orange/Red glow for high speed */
}

#entropy-field.low-entropy {
    box-shadow: 0 0 30px rgba(0, 100, 255, 0.2);
    /* Blue glow for deep thought */
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 1rem;
}

/* Incinerate Button */
.btn-alert {
    background: transparent;
    border: 1px solid var(--alert);
    color: var(--alert);
    padding: 0.6rem 1.5rem;
    font-family: var(--font-head);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-alert:hover {
    background: var(--alert);
    color: #000;
    box-shadow: 0 0 15px var(--alert);
}

/* Burn Animation */
@keyframes burnOut {
    0% {
        filter: brightness(1) blur(0);
        opacity: 1;
    }

    50% {
        filter: brightness(2) blur(4px) hue-rotate(-50deg);
        opacity: 0.8;
    }

    100% {
        filter: brightness(0) blur(20px);
        opacity: 0;
        transform: scale(0.9);
    }
}

.burning {
    animation: burnOut 1s forwards;
    pointer-events: none;
}

/* Lock Icon for Time-Locked logs (if we render them differently later) */
/* === v2.2 CONSCIOUSNESS FEATURES === */

/* Mind Galaxy Canvas */
#mind-galaxy {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Behind content */
    pointer-events: none;
    opacity: 0.8;
}

/* AI Micro-Commentary */
.ai-commentary {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dotted var(--grid-line);
    font-family: var(--font-head);
    font-size: 0.75rem;
    color: #555;
    /* Dim gray */
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.ai-commentary::before {
    content: "👁‍🗨";
    /* Observer Eye Icon */
    opacity: 0.6;
}

.ai-commentary.thinking {
    color: var(--accent);
    animation: pulse 1s infinite;
}