:root {
    --bg-dark: #050505;
    --panel-bg: rgba(10, 10, 12, 0.75);
    --alert-orange: #FF3C0A;
    --gauss-green: #00FF00;
    --hud-cyan: #00F3FF;
    --net-purple: #B026FF;
    --unitology-red: #CC0000;
    --text-main: #e0e0e0;
    --border-color: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Share Tech Mono', monospace;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

.video-background {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6); 
    z-index: -1;
}

.dashboard-container {
    padding: 1.5rem 2rem; 
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    position: relative; 
}

/* HEADER STYLES */
.sys-header {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    border-bottom: 2px solid var(--alert-orange);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.header-left h1 {
    font-size: clamp(1rem, 1.2vw, 1.5rem);
    color: var(--alert-orange);
    letter-spacing: 2px;
    white-space: nowrap;
}

/* 5-STACK TICKER SYSTEM WITH CRT EFFECTS */
.ticker-stack {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin: 0 2rem;
    gap: 0.15rem;
}

.ticker-wrapper {
    display: flex;
    align-items: center;
    font-size: clamp(0.7rem, 0.8vw, 0.9rem);
    width: 100%;
    /* Adds a faint glow to all ticker text */
    text-shadow: 0 0 4px currentColor;
}

.text-green { color: var(--gauss-green); }
.text-orange { color: var(--alert-orange); }
.text-purple { color: var(--net-purple); }
.text-cyan { color: var(--hud-cyan); }
.text-unitology { color: var(--unitology-red); }

.text-green .marquee-window { background: rgba(0, 255, 0, 0.05); }
.text-orange .marquee-window { background: rgba(255, 60, 10, 0.05); }
.text-purple .marquee-window { background: rgba(176, 38, 255, 0.05); }
.text-cyan .marquee-window { background: rgba(0, 243, 255, 0.05); }
.text-unitology .marquee-window { background: rgba(204, 0, 0, 0.05); }

/* CRT Scanline Overlay for the windows */
.marquee-window::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 2px;
    z-index: 2;
    pointer-events: none;
}

.bracket { font-weight: bold; padding: 0 6px; }

/* ENLARGED MARKER ICON */
.marker-icon {
    width: 50px; /* Increased from 14px */
    height: 22px;
    margin: 0 8px 0 2px;
    filter: drop-shadow(0 0 6px var(--unitology-red));
    flex-shrink: 0;
}

.altman-praise {
    margin-left: 6px;
    margin-right: 2px;
    white-space: nowrap;
}

.altman-praise em {
    font-style: italic;
    letter-spacing: 0.5px;
}

.marquee-window {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 2px 0;
}

.verse-window {
    flex-grow: 1;
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    /* CRT Buzz Animation combined with the marquee scroll */
    animation: marquee 35s linear infinite, crt-buzz 0.15s infinite alternate; 
}

/* HIGH FREQUENCY CRT JITTER */
@keyframes crt-buzz {
    0% { text-shadow: 0 0 2px currentColor, 0.5px 0.5px 0px rgba(255, 0, 0, 0.4), -0.5px -0.5px 0px rgba(0, 255, 255, 0.4); opacity: 0.95; }
    50% { text-shadow: 0 0 3px currentColor, -0.5px 0.5px 0px rgba(255, 0, 0, 0.4), 0.5px -0.5px 0px rgba(0, 255, 255, 0.4); opacity: 1; }
    100% { text-shadow: 0 0 2px currentColor, 0.5px -0.5px 0px rgba(255, 0, 0, 0.4), -0.5px 0.5px 0px rgba(0, 255, 255, 0.4); opacity: 0.9; }
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-indicator {
    color: var(--gauss-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.9rem, 1vw, 1.2rem);
}

.pulse {
    width: 10px;
    height: 10px;
    background-color: var(--gauss-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gauss-green);
    animation: blink 2s infinite;
}

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

/* MAIN CONTENT GRID (Schedules & Gauges) */
.main-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0; 
}

.upper-deck {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 18vh; 
    width: 100%;
}

.calendar-panel {
    flex: 1;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.panel-header {
    background: rgba(0, 0, 0, 0.6);
    padding: 0.15rem 0.5rem;
    font-size: clamp(0.6rem, 0.7vw, 0.8rem);
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
}

.panel-content {
    flex-grow: 1;
    position: relative;
    padding: 0; 
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* GAUGE SIZING & POSITIONING */
.header-gauge {
    width: clamp(90px, 7vw, 120px);
    aspect-ratio: 1 / 1; 
    flex: 0 0 auto; 
}

.gauge-stack {
    position: absolute;
    bottom: 2rem;
    left: 2rem; 
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 1rem;
    z-index: 10; 
}

.gauge-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.stack-gauge {
    width: clamp(140px, 10vw, 180px);
    aspect-ratio: 1 / 1; 
    flex: 0 0 auto; 
}

/* OCTAGON ARCHITECTURE */
.octagon-wrapper {
    background: var(--gauss-green);
    padding: 2px; 
    clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
    transition: filter 0.3s ease;
    box-shadow: 0 0 15px var(--gauss-green);
    display: flex;
    flex-direction: column;
}

.octagon-wrapper.highlight-orange {
    background: var(--alert-orange);
    box-shadow: 0 0 15px var(--alert-orange);
}

.octagon-inner {
    background: var(--panel-bg);
    height: 100%;
    width: 100%;
    clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.25rem;
    position: relative;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(0, 255, 0, 0.02) 0px,
        rgba(0, 255, 0, 0.02) 2px,
        transparent 2px,
        transparent 6px
    );
}

.highlight-orange .octagon-inner {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 60, 10, 0.03) 0px,
        rgba(255, 60, 10, 0.03) 2px,
        transparent 2px,
        transparent 6px
    );
}

.gauge-label {
    font-size: clamp(0.7rem, 0.8vw, 1rem);
    color: var(--text-main);
    letter-spacing: 1px;
    z-index: 5;
}

.gauge-sublabel {
    font-size: clamp(0.55rem, 0.6vw, 0.75rem);
    color: var(--border-color);
    margin-bottom: 0.25rem;
    z-index: 5;
}
.oct-grid {
    position: absolute;
    bottom: 40px;
    right: 40px;
    display: grid;
    /* Creates a 3x3 grid to perfectly align 5 octagons flat-to-flat */
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    gap: 6px; 
    z-index: 10;
}

/* Grid placement for the cross formation */
.oct-module.top    { grid-column: 2; grid-row: 1; }
.oct-module.left   { grid-column: 1; grid-row: 2; }
.oct-module.center { grid-column: 2; grid-row: 2; filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.6)); }
.oct-module.right  { grid-column: 3; grid-row: 2; }
.oct-module.bottom { grid-column: 2; grid-row: 3; }
/* THE FOUR CORNERS */
.oct-module.top-left { 
    grid-column: 1; /* Far left column */
    grid-row: 1;    /* Top row */
}

.oct-module.top-right { 
    grid-column: 3; /* Far right column */
    grid-row: 1;    /* Top row */
}

.oct-module.bottom-left { 
    grid-column: 1; /* Far left column */
    grid-row: 3;    /* Bottom row */
}

.oct-module.bottom-right { 
    grid-column: 3; /* Far right column */
    grid-row: 3;    /* Bottom row */
}
/* The outer layer acting as the tactical border */
.oct-module {
    width: 100%;
    height: 100%;
    background: #00f3ff; /* Outer border color */
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease-in-out;
}

/* The inner dark core */
.oct-core {
    width: 76px; /* 4px smaller than outer to create a 2px border */
    height: 76px;
    background: rgba(10, 15, 20, 0.85); /* Deep dark background */
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #00f3ff;
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Hover effect for tactile feedback */
.oct-module:hover {
    background: #ff3c0a; /* Shifts to your Polity Alert Orange */
    transform: scale(1.05);
    cursor: pointer;
}

.oct-module:hover .oct-core {
    color: #ff3c0a;
}

/* Base CSS for your future celestial orb */
.celestial-core {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 10%, #00f3ff 40%, transparent 80%);
    box-shadow: 0 0 15px #00f3ff, inset 0 0 10px #ffffff;
    animation: slow-pulse 3s infinite alternate;
}

@keyframes slow-pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.1); opacity: 1; }
}