:root {
    --bg-color: #050508;
    --card-bg: rgba(12, 12, 18, 0.65);
    --card-bg-solid: #0c0c12;
    --text-primary: #e8e8ed;
    --text-secondary: #6b7280;
    --text-muted: #4b5563;
    --accent: #06b6d4;
    --accent-bright: #22d3ee;
    /* Cyberpunk Cyan */
    --accent-dim: rgba(6, 182, 212, 0.1);
    --accent-glow: rgba(6, 182, 212, 0.25);
    --alert: #ef4444;
    --success: #10b981;
    --grid-line: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --gradient-accent: linear-gradient(135deg, #06b6d4, #8b5cf6);
    --gradient-warm: linear-gradient(135deg, #f97316, #ef4444);
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --radius: 12px;
    --radius-lg: 20px;
    --font-head: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    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;
    scroll-behavior: smooth;
}

/* 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(--glass-border);
    font-family: var(--font-head);
    font-size: 0.9rem;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    background: rgba(5, 5, 8, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 50;
    box-shadow: 0 1px 0 var(--glass-border), 0 4px 30px rgba(0, 0, 0, 0.3);
}

.cmd-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-bright), transparent);
    opacity: 0.5;
}

.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(135deg, #fff 0%, var(--accent-bright) 50%, #8b5cf6 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

.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(--glass-border);
    display: inline-block;
    padding: 1.5rem 3rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
}

.meta-instruction::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.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(--glass-border);
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.1), 0 0 0 1px rgba(6, 182, 212, 0.1);
    transform: translateY(-4px);
}

.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: 0.5rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    position: sticky;
    top: 60px;
    /* Below header */
    z-index: 40;
    background: linear-gradient(to bottom, rgba(5, 5, 8, 0.95), rgba(5, 5, 8, 0.8) 70%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.6rem 1.8rem;
    font-family: var(--font-head);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent-bright);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.1));
    border-color: var(--accent);
    color: var(--accent-bright);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.15), inset 0 0 20px rgba(6, 182, 212, 0.05);
}

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

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

/* Special styling for THE NEXUS tab */
#tab-nexus {
    padding: 0 !important;
    margin: 0;
}

#tab-nexus.active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: #0a0a0f;
}

#nexus-frame {
    width: 100%;
    height: 100%;
    border: none;
    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(--glass-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cmd-input,
.cmd-textarea {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-family: var(--font-head);
    padding: 0.8rem;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.cmd-input:focus,
.cmd-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.12);
}

.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: linear-gradient(135deg, var(--accent), var(--accent-bright));
    color: #000;
    border: none;
    padding: 0.6rem 2rem;
    font-family: var(--font-head);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
}

/* Log Feed Styling */
.log-entry {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 3px solid transparent;
    border-image: linear-gradient(to bottom, var(--accent), #8b5cf6) 1;
    border-image-slice: 0 0 0 3;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

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

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

.log-entry:hover {
    border-image: linear-gradient(to bottom, var(--accent-bright), #a78bfa) 1;
    border-image-slice: 0 0 0 3;
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.08);
}

.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 solid rgba(6, 182, 212, 0.3);
    color: var(--accent);
    padding: 0.4rem 1rem;
    font-family: var(--font-head);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.btn-ghost:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.12);
    transform: translateY(-1px);
}

.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.3s ease;
    border-radius: 8px;
}

.btn-alert:hover {
    background: var(--alert);
    color: #000;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

/* 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;
}

/* === IMAGE & EDIT STYLING === */
.file-upload-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-head);
    font-size: 0.8rem;
}

.small-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-color: #555;
    color: #888;
}

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

.file-name {
    color: var(--accent);
    font-style: italic;
}

.log-image-container {
    margin: 1rem 0;
    max-width: 100%;
    border: 1px solid var(--grid-line);
    padding: 5px;
    background: #000;
}

.log-image {
    max-width: 100%;
    display: block;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.log-image:hover {
    opacity: 1;
}

.edited-badge {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #555;
    font-style: italic;
    font-family: var(--font-head);
}

.btn-edit {
    background: transparent;
    border: 1px solid #555;
    color: #555;
    padding: 0.2rem 0.5rem;
    font-family: var(--font-head);
    font-size: 0.7rem;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.2s;
}

.btn-edit:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Edit Mode State */
.editor-container.editing-mode {
    border-color: var(--alert);
    box-shadow: 0 0 10px rgba(255, 42, 42, 0.2);
}

.editor-container.editing-mode::before {
    content: "WARNING: EDITING PAST RECORD";
    display: block;
    color: var(--alert);
    font-family: var(--font-head);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

/* === LOGIN SYSTEM === */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease;
    overflow: hidden;
}

#login-overlay::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    animation: aurora-drift 12s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -20px) rotate(1deg);
    }

    66% {
        transform: translate(-20px, 15px) rotate(-1deg);
    }

    100% {
        transform: translate(10px, -10px) rotate(0.5deg);
    }
}

#login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-box {
    width: 90%;
    max-width: 420px;
    padding: 3rem;
    border: 1px solid var(--glass-border);
    background: rgba(12, 12, 18, 0.7);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(6, 182, 212, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-bright), #8b5cf6, transparent);
}

.login-box::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), transparent, rgba(139, 92, 246, 0.08));
    z-index: -1;
}

.login-header {
    margin-bottom: 2.5rem;
    width: 100%;
}

.login-header h2 {
    font-family: var(--font-head);
    font-size: 2.2rem;
    background: linear-gradient(135deg, #fff, var(--accent-bright));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 0.75rem;
    letter-spacing: 3px;
}

.login-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

.login-input-group input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.login-input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15), inset 0 0 10px rgba(6, 182, 212, 0.05);
}

.full-width {
    width: 100%;
    border-radius: 10px;
}

.auth-status {
    margin-top: 1.5rem;
    font-family: var(--font-head);
    font-size: 0.8rem;
    color: #555;
    min-height: 1.2em;
}

.access-granted {
    color: var(--success) !important;
    text-shadow: 0 0 10px var(--success);
}

.access-denied {
    color: var(--alert) !important;
    text-shadow: 0 0 10px var(--alert);
    animation: shake 0.5s;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Upload Effect */
.uploading {
    position: relative;
}

.uploading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 240, 255, 0.2) 50%, transparent 100%);
    transform: translateY(-100%);
    animation: scanUpload 1s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10;
    backdrop-filter: blur(1px);
}

@keyframes scanUpload {
    0% {
        transform: translateY(-150%);
    }

    100% {
        transform: translateY(150%);
    }
}

.upload-flash {
    animation: flashSuccess 0.8s ease-out;
}

@keyframes flashSuccess {
    0% {
        box-shadow: 0 0 0 rgba(0, 240, 255, 0);
        border-color: var(--grid-line);
    }

    10% {
        box-shadow: 0 0 50px rgba(0, 240, 255, 0.4);
        border-color: var(--accent);
        transform: scale(1.01);
    }

    100% {
        box-shadow: 0 0 0 rgba(0, 240, 255, 0);
        border-color: var(--grid-line);
        transform: scale(1);
    }
}

/* === DELETION EFFECTS === */
@keyframes glitch-out {
    0% {
        transform: translate(0);
        opacity: 1;
    }

    20% {
        transform: translate(-5px, 5px) skewX(10deg);
        filter: hue-rotate(90deg);
        opacity: 0.8;
    }

    40% {
        transform: translate(5px, -5px) skewX(-10deg);
        filter: hue-rotate(180deg) invert(1);
        opacity: 0.6;
    }

    60% {
        transform: translate(-5px, 0) scale(1.1);
        filter: hue-rotate(270deg) contrast(2);
        opacity: 0.4;
    }

    80% {
        transform: translate(5px, 0) scale(0.9);
        filter: hue-rotate(360deg) blur(5px);
        opacity: 0.2;
    }

    100% {
        transform: scale(0);
        opacity: 0;
        filter: blur(10px);
    }
}

@keyframes burn-out {
    0% {
        opacity: 1;
        filter: brightness(1);
    }

    30% {
        opacity: 1;
        filter: brightness(3) contrast(2) sepia(1) hue-rotate(-50deg);
        background-color: #fff;
    }

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

.log-entry.glitch-out {
    animation: glitch-out 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    pointer-events: none;
}

.log-entry.burning-out {
    animation: burn-out 0.8s ease-out forwards;
    pointer-events: none;
}

/* === SYSTEM STATUS HUD === */
.status-hud {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 3rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.05), rgba(0, 240, 255, 0.02));
    border: 1px solid var(--grid-line);
    border-left: 3px solid var(--accent);
    position: relative;
}

.status-hud::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v1H0zM0 0v60h1V0z' fill='%23ffffff' fill-opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.5;
}

.hud-segment {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--grid-line);
    transition: all 0.3s ease;
}

.hud-segment:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-dim);
    transform: translateY(-2px);
}

.hud-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 5px var(--accent));
}

.hud-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.hud-label {
    font-family: var(--font-head);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.hud-value {
    font-family: var(--font-head);
    font-size: 1rem;
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 0 10px var(--accent-dim);
}

.hud-select {
    background: #000;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-head);
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.hud-select:hover {
    box-shadow: 0 0 10px var(--accent-dim);
}

.hud-select:focus {
    outline: none;
    box-shadow: 0 0 15px var(--accent);
}

.progress-bar-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--grid-line);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--accent);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-head);
    font-size: 0.75rem;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 5px #000, 0 0 10px #000;
    z-index: 1;
}

@media (max-width: 768px) {
    .status-hud {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        padding: 1rem;
    }

    .hud-segment {
        padding: 0.8rem;
    }

    .hud-icon {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .status-hud {
        grid-template-columns: 1fr;
    }
}

/* === ENERGY POOL VISUALIZATION === */
.energy-pool-container {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.03), rgba(0, 255, 65, 0.03));
    border: 1px solid var(--grid-line);
    border-left: 3px solid var(--accent);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.energy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.energy-balance {
    padding: 0.3rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid currentColor;
    text-shadow: 0 0 10px currentColor;
}

.energy-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.energy-bar-wrapper {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--grid-line);
    position: relative;
    overflow: hidden;
}

.energy-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    font-family: var(--font-head);
    font-size: 0.75rem;
    font-weight: 700;
    transition: width 1s ease-out;
    box-shadow: 0 0 15px currentColor;
}

.energy-bar .bar-label {
    color: #fff;
    text-shadow: 0 0 5px #000;
}

.energy-bar .bar-value {
    color: #fff;
    text-shadow: 0 0 5px #000;
}

.energy-details {
    border-top: 1px solid var(--grid-line);
    padding-top: 1rem;
}

.energy-column {
    padding: 0.5rem;
}

.energy-item {
    transition: background 0.2s;
}

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

@media (max-width: 768px) {
    .energy-details {
        grid-template-columns: 1fr !important;
    }

    .energy-bar {
        font-size: 0.65rem;
        padding: 0 0.5rem;
    }
}

/* === ENERGY POOL V2 (ENHANCED & COMPACT) === */
.energy-pool-container-v2 {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.05), rgba(0, 255, 65, 0.03));
    border: 1px solid var(--grid-line);
    border-left: 4px solid var(--accent);
    padding: 1.2rem;
    /* Reduced from 2rem */
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.energy-pool-container-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(400px);
        opacity: 0;
    }
}

/* Header V2 */
.energy-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    /* Reduced from 2rem */
    padding-bottom: 0.7rem;
    /* Reduced from 1rem */
    border-bottom: 1px solid var(--grid-line);
}

.energy-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.energy-icon {
    font-size: 2rem;
    /* Reduced from 2.5rem */
    filter: drop-shadow(0 0 20px var(--accent));
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 10px var(--accent));
    }

    50% {
        filter: drop-shadow(0 0 25px var(--accent));
    }
}

.energy-title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    /* Reduced from 1.3rem */
    color: var(--accent);
    margin: 0;
    letter-spacing: 1.5px;
    /* Reduced from 2px */
    text-shadow: 0 0 10px var(--accent-dim);
}

.energy-net-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0.6rem 1rem;
    /* Reduced from 0.8rem 1.5rem */
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--net-color);
    box-shadow: 0 0 20px var(--net-color);
}

.net-label {
    font-family: var(--font-head);
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.net-value {
    font-family: var(--font-head);
    font-size: 1.6rem;
    /* Reduced from 2rem */
    color: var(--net-color);
    font-weight: 700;
    text-shadow: 0 0 15px var(--net-color);
}

/* Energy Bars V2 */
.energy-bars-v2 {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    /* Reduced from 1.2rem */
    margin: 1.2rem 0;
    /* Reduced from 2rem 0 */
}

.energy-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-head);
}

.bar-emoji {
    font-size: 1.3rem;
}

.bar-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

.bar-percentage {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.bar-count {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.bar-track {
    height: 28px;
    /* Reduced from 40px */
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--grid-line);
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

.bar-inbound {
    background: linear-gradient(90deg, #00ff41, #00ff41aa);
    box-shadow: 0 0 20px #00ff41;
}

.bar-outbound {
    background: linear-gradient(90deg, #ff6b6b, #ff6b6baa);
    box-shadow: 0 0 20px #ff6b6b;
}

.bar-balanced {
    background: linear-gradient(90deg, #00f0ff, #00f0ffaa);
    box-shadow: 0 0 20px #00f0ff;
}

/* Projects Grid */
.energy-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    /* Reduced from 1.5rem */
    margin: 1.2rem 0;
    /* Reduced from 2rem 0 */
}

.energy-projects-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.column-header {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid currentColor;
}

.column-icon {
    font-size: 1.5rem;
}

.column-title {
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.energy-projects-column.sources .column-header {
    border-color: #00ff41;
}

.energy-projects-column.sources .column-title {
    color: #00ff41;
}

.energy-projects-column.drains .column-header {
    border-color: #ff6b6b;
}

.energy-projects-column.drains .column-title {
    color: #ff6b6b;
}

.energy-projects-column.balanced .column-header {
    border-color: #00f0ff;
}

.energy-projects-column.balanced .column-title {
    color: #00f0ff;
}

.column-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.column-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Project Cards */
.energy-project-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--grid-line);
    padding: 0.7rem;
    /* Reduced from 1rem */
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.energy-project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-dim);
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.5);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.project-name {
    font-size: 0.85rem;
    /* Reduced from 0.9rem */
    font-weight: 600;
    color: #fff;
}

.project-energy {
    font-family: var(--font-head);
    font-size: 1rem;
    /* Reduced from 1.1rem */
    font-weight: 700;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
}

.project-status {
    padding: 0.2rem 0.5rem;
    font-family: var(--font-head);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(0, 240, 255, 0.2);
    color: #00f0ff;
    border: 1px solid #00f0ff;
}

.status-completed {
    background: rgba(0, 255, 65, 0.2);
    color: #00ff41;
    border: 1px solid #00ff41;
}

.status-paused {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
    border: 1px solid #ffa500;
}

.project-progress {
    color: var(--text-secondary);
}

.project-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.8s ease-out;
    box-shadow: 0 0 10px currentColor;
}

/* Summary Stats */
.energy-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    /* Reduced from 1rem */
    margin-top: 1.2rem;
    /* Reduced from 2rem */
    padding-top: 1rem;
    /* Reduced from 1.5rem */
    border-top: 1px solid var(--grid-line);
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.7rem;
    /* Reduced from 1rem */
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--grid-line);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: var(--font-head);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.5;
    font-style: italic;
}

/* Responsive */
@media (max-width: 968px) {
    .energy-projects-grid {
        grid-template-columns: 1fr;
    }

    .energy-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .energy-header-v2 {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .energy-title {
        font-size: 1.1rem;
    }

    .bar-header {
        flex-wrap: wrap;
    }
}

/* === QUICK ACTIONS BAR (Fixed Bottom Right) === */
.quick-actions-bar {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    /* Vertical stack on default */
    gap: 1rem;
    z-index: 1000;
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(10, 10, 15, 0.9);
    border: 2px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.action-btn:hover {
    transform: scale(1.1) translateY(-5px);
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 30px var(--accent);
}

.action-btn .icon {
    font-size: 1.5rem;
    z-index: 2;
}

.action-btn .label {
    position: absolute;
    right: 70px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    border: 1px solid var(--grid-line);
}

.action-btn:hover .label {
    opacity: 1;
    transform: translateX(0);
}

/* === QUICK LOG MODAL === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    background: rgba(12, 12, 18, 0.9);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 80px rgba(6, 182, 212, 0.08);
    padding: 2rem;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--grid-line);
    padding-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    color: var(--accent);
    font-family: var(--font-head);
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--grid-line);
    padding: 1rem;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.meta-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-family: var(--font-mono);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--grid-line);
    color: var(--text-secondary);
    padding: 0.8rem 2rem;
    cursor: pointer;
    font-family: var(--font-head);
    transition: all 0.2s;
}

.btn-cancel:hover {
    border-color: #fff;
    color: #fff;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--accent);
}

/* === FOCUS TIMER WIDGET === */
.focus-widget {
    position: fixed;
    bottom: 9rem;
    /* Above quick actions */
    right: 2rem;
    width: 250px;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid var(--accent);
    /* Default cyan */
    padding: 1.5rem;
    z-index: 900;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.focus-widget.hidden {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}

/* Focus mode color (Red/Orange) overrides */
body.focus-active .focus-widget,
body.focus-active .action-btn#btn-focus-timer {
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

body.focus-active .timer-display {
    color: #ff6b6b;
    text-shadow: 0 0 15px #ff6b6b;
}

body.focus-active .action-btn#btn-focus-timer {
    color: #ff6b6b;
}

body.focus-active .action-btn#btn-focus-timer:hover {
    background: #ff6b6b;
    color: #000;
}


.timer-display {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
    margin-bottom: 1rem;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.timer-controls button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--grid-line);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-controls button:hover {
    background: #fff;
    color: #000;
}

.timer-mode {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.timer-mode span {
    cursor: pointer;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

.timer-mode span.active {
    color: #fff;
    border-color: var(--accent);
}

/* === TOAST NOTIFICATIONS === */
#toast-container {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: rgba(12, 12, 18, 0.95);
    border-left: 4px solid var(--accent);
    padding: 1rem 2rem;
    color: #fff;
    font-family: var(--font-head);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: slide-down 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    border-radius: 10px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast.success {
    border-color: #00ff41;
}

.toast.error {
    border-color: #ff2a2a;
}

.toast.info {
    border-color: #00f0ff;
}

@keyframes slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin-anim {
    animation: spin 1s linear infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .quick-actions-bar {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .action-btn {
        width: 50px;
        height: 50px;
    }

    .focus-widget {
        right: 50%;
        transform: translateX(50%);
        bottom: 6rem;
    }

    .focus-widget.hidden {
        transform: translateX(50%) translateY(20px);
    }
}

/* === BUILD FORGE === */
.build-forge {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), rgba(239, 68, 68, 0.03));
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-left: 4px solid #f97316;
    padding: 1.5rem;
    margin-top: 2rem;
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.forge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.forge-header h3 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: #ff6b35;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

.year-progress {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.progress-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.progress-bar-container {
    width: 150px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #ffa500);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px #ff6b35;
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #ff6b35;
    font-weight: 700;
}

.forge-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
}

/* Sculpture */
.sculpture-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.sculpture {
    width: 150px;
    height: 180px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.sculpture-base {
    width: 120px;
    height: 20px;
    background: linear-gradient(180deg, #444, #222);
    border-radius: 5px 5px 0 0;
}

.sculpture-body {
    width: 100px;
    height: 140px;
    background: linear-gradient(180deg, #666, #333);
    border-radius: 10px 10px 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.sculpture-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, #ff6b35, #ffa500);
    transition: height 0.5s ease;
    box-shadow: 0 0 20px #ff6b35;
}

.sculpture-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffa500;
    border-radius: 50%;
    animation: particle-fly 0.8s ease-out forwards;
}

@keyframes particle-fly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0);
    }
}

.sculpture-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.hammer-count {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: #ff6b35;
}

/* Goals */
.goals-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.goals-container h4 {
    font-family: var(--font-head);
    font-size: 0.9rem;
    color: var(--accent);
    margin: 0;
    letter-spacing: 1px;
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.goal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--grid-line);
    transition: all 0.3s;
}

.goal-item:hover {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
}

.goal-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.goal-icon {
    font-size: 1.5rem;
}

.goal-name {
    font-size: 0.9rem;
    color: #fff;
}

.goal-progress {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.hammer-btn {
    background: #ff6b35;
    border: none;
    color: #000;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-family: var(--font-head);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hammer-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px #ff6b35;
}

.hammer-btn:active {
    transform: scale(0.95);
}

.hammer-btn.hammering {
    animation: hammer-shake 0.3s ease;
}

@keyframes hammer-shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-15deg);
    }

    75% {
        transform: rotate(15deg);
    }
}

.goals-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.milestone-msg {
    margin-top: 1rem;
    padding: 1rem;
    text-align: center;
    font-family: var(--font-head);
    color: #ff6b35;
    display: none;
}

.milestone-msg.active {
    display: block;
    animation: pulse-glow 1s ease-in-out infinite;
}

/* Mobile */
@media (max-width: 768px) {
    .forge-content {
        grid-template-columns: 1fr;
    }

    .sculpture-container {
        order: -1;
    }

    .forge-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === AURORA BACKGROUND === */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.aurora-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.aurora-orb-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    left: -100px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15), transparent 70%);
    animation: aurora-float-1 20s ease-in-out infinite alternate;
}

.aurora-orb-2 {
    width: 500px;
    height: 500px;
    top: 40%;
    right: -150px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12), transparent 70%);
    animation: aurora-float-2 25s ease-in-out infinite alternate;
}

.aurora-orb-3 {
    width: 450px;
    height: 450px;
    bottom: -100px;
    left: 30%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1), transparent 70%);
    animation: aurora-float-3 18s ease-in-out infinite alternate;
}

@keyframes aurora-float-1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(80px, 40px) scale(1.1);
    }

    100% {
        transform: translate(-40px, 80px) scale(0.95);
    }
}

@keyframes aurora-float-2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-60px, -30px) scale(1.15);
    }

    100% {
        transform: translate(30px, -60px) scale(0.9);
    }
}

@keyframes aurora-float-3 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, -40px) scale(1.05);
    }

    100% {
        transform: translate(-30px, 50px) scale(1.1);
    }
}

/* === SCROLL REVEAL ANIMATIONS === */
.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.scroll-reveal:nth-child(2) {
    transition-delay: 0.08s;
}

.scroll-reveal:nth-child(3) {
    transition-delay: 0.16s;
}

.scroll-reveal:nth-child(4) {
    transition-delay: 0.24s;
}

.scroll-reveal:nth-child(5) {
    transition-delay: 0.32s;
}

.scroll-reveal:nth-child(6) {
    transition-delay: 0.4s;
}

/* === STATUS HUD GLASSMORPHISM === */
.status-hud {
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hud-segment {
    border-radius: 8px;
}

/* === ENERGY POOL GLASSMORPHISM === */
.energy-pool-container,
.energy-pool-container-v2 {
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.energy-project-card {
    border-radius: 8px;
}

/* === SUMMARY STAT GLASSMORPHISM === */
.summary-stat {
    border-radius: 8px;
}

/* === GOAL ITEM UPGRADE === */
.goal-item {
    border-radius: 8px;
}

.hammer-btn {
    border-radius: 8px;
}

/* === FOCUS WIDGET GLASSMORPHISM === */
.focus-widget {
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.timer-controls button {
    border-radius: 50%;
}

/* === QUICK ACTION REFINEMENT === */
.action-btn .label {
    border-radius: 8px;
}

/* === SPARK OVERLAY GLASSMORPHISM === */
.spark-overlay {
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}