/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

/* Variables */
:root {
    --primary-magenta: #ff00ff;
    --secondary-cyan: #00f5ff;
    --bg-black: #000000;
    --warning-yellow: #f59e0b; 
    --critical-red: #ff0000;
}

/* Base Styles */
body {
    background-color: var(--bg-black);
    color: #f0f9ff;
    font-family: 'JetBrains Mono', monospace;
    overflow-x: hidden;
    margin: 0;
}

h1, h2, h3, h4, .header-font {
    font-family: 'Chakra Petch', sans-serif;
    text-transform: uppercase;
}

/* Background Canvas for Ancient Rain */
#ancient-rain {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.50;
}

/* --- Animations --- */
@keyframes erratic-shake {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-6px, 4px); }
    20% { transform: translate(6px, -4px); }
    30% { transform: translate(-4px, 6px); }
    50% { transform: translate(-6px, -6px); }
    70% { transform: translate(-4px, -4px); }
    90% { transform: translate(-6px, 4px); }
    100% { transform: translate(0, 0); }
}

@keyframes erratic-flash {
    0%, 100% { color: var(--primary-magenta); text-shadow: 0 0 15px var(--primary-magenta); }
    20% { color: var(--secondary-cyan); text-shadow: 0 0 25px var(--secondary-cyan); opacity: 0.4; }
    40% { color: white; opacity: 0.9; }
    60% { color: var(--primary-magenta); opacity: 0.1; }
    80% { color: var(--secondary-cyan); opacity: 1; }
}

@keyframes scanline {
    0% { top: -100px; }
    100% { top: 100vh; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

@keyframes pulse-red {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.1); opacity: 1; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- UI Components --- */
.tagline-glitch {
    cursor: pointer;
    display: inline-block;
    transition: all 0.05s ease;
}

.tagline-glitch:hover {
    animation: erratic-shake 0.04s infinite, erratic-flash 0.06s infinite;
}

.crt-overlay {
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 100;
}

.scanline {
    width: 100%; height: 100px;
    z-index: 99;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(255, 0, 255, 0.03) 50%, rgba(0, 0, 0, 0) 100%);
    position: fixed;
    top: -100px;
    animation: scanline 8s linear infinite;
    pointer-events: none;
}

/* Page Management */
.page { display: none; min-height: 100vh; padding-top: 80px; position: relative; z-index: 10; }
.page.active { display: block; animation: fadeIn 0.4s ease-out; }

/* Gameplay Bars */
.ego-bar { background-color: var(--primary-magenta); box-shadow: 0 0 15px var(--primary-magenta); }
.stress-bar { background-color: var(--secondary-cyan); box-shadow: 0 0 15px var(--secondary-cyan); }

/* Cards & Layout */
.archetype-card {
    background: rgba(5, 5, 5, 0.9);
    border: 1px solid rgba(255, 0, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.archetype-card:hover {
    border-color: var(--secondary-cyan);
    background: rgba(0, 245, 255, 0.05);
    transform: scale(1.02);
}

.portrait-container {
    width: 3.5rem; height: 3.5rem; flex-shrink: 0;
    background: #050505; border: 1px solid rgba(255, 0, 255, 0.2);
    overflow: hidden;
}
.portrait-container img {
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0.5; filter: grayscale(100%) sepia(100%) hue-rotate(280deg);
}

/* Timeline */
.timeline-line {
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--primary-magenta), var(--secondary-cyan), transparent);
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    transform: translateX(-50%);
}
.timeline-node {
    position: relative;
    z-index: 20;
    cursor: pointer;
    transition: all 0.3s ease;
}
.timeline-node:hover { transform: scale(1.1); }
.timeline-dot {
    width: 20px; height: 20px;
    background: var(--bg-black);
    border: 2px solid var(--primary-magenta);
    box-shadow: 0 0 10px var(--primary-magenta);
}

.marquee-container { overflow: hidden; white-space: nowrap; }
.marquee-content { display: inline-block; animation: marquee 35s linear infinite; }

/* --- Tracker Specific --- */
.stat-bar-container {
    background: rgba(255, 255, 255, 0.05);
    height: 6px;
    position: relative;
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}
.hud-card {
    background: rgba(5, 5, 5, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: border-color 0.3s ease;
}
.hud-card.low-durability { border-color: var(--warning-yellow); }
.hud-card.offline { border-color: #ff0000; box-shadow: 0 0 20px rgba(255, 0, 0, 0.2); }

.emergency-overlay {
    position: absolute; inset: 0; z-index: 50;
    background: rgba(255, 0, 0, 0.2);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.berserk-text {
    font-size: 3rem; font-weight: 900; color: white;
    text-shadow: 0 0 20px #ff0000;
    animation: pulse-red 0.5s infinite alternate;
}
.shutdown-overlay {
    position: absolute; inset: 0; z-index: 50;
    background: rgba(0, 0, 0, 0.8);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.shutdown-text {
    font-size: 2.5rem; font-weight: 900; color: #444; letter-spacing: 0.2em;
}

.input-dark {
    background: #111; border: 1px solid #333; color: white;
    font-size: 10px; padding: 2px 4px; text-align: center; outline: none;
}
.input-dark:focus { border-color: var(--primary-magenta); }

.crit-display {
    background: #1a0000;
    border-left: 3px solid #ff0000;
    animation: slideDown 0.3s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-magenta); }

/* Styles the SendFox feedback messages to match your UI */
.sendfox-form-response {
    background: var(--bg-black) !important;
    color: var(--primary-magenta) !important;
    border: 1px solid var(--primary-magenta) !important;
    padding: 12px 20px;
    /* Centering logic */
    margin: 15px auto 0 auto !important; 
    text-align: center;
    display: block !important;
    width: fit-content;
    min-width: 280px;
    
    /* Aesthetic styles from original code */
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.1);
    animation: fadeIn 0.3s ease-out;
}

/* --- Requisition Terminal Animations --- */
@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

@keyframes decryption-pulse {
    0% { opacity: 0.5; text-shadow: 0 0 5px var(--secondary-cyan); }
    50% { opacity: 1; text-shadow: 0 0 20px var(--secondary-cyan); }
    100% { opacity: 0.5; text-shadow: 0 0 5px var(--secondary-cyan); }
}

.animate-error {
    animation: error-shake 0.4s ease-in-out;
    color: var(--critical-red);
}

.animate-success {
    animation: decryption-pulse 0.5s infinite;
    color: var(--secondary-cyan);
}

