/* ==========================================================================
   MATRIX THEMING & LAYOUT SYSTEM
   Aesthetic: Cyberpunk Matrix Noir / Luxury Brutalism
   ========================================================================== */

:root {
    /* Color Palette */
    --matrix-green: #00ff66;
    --matrix-green-glow: rgba(0, 255, 102, 0.4);
    --matrix-green-dim: #003311;
    --matrix-red: #ff2a2a;
    --matrix-red-glow: rgba(255, 42, 42, 0.5);
    --matrix-red-dim: #440000;
    --matrix-blue: #00ccff;
    --matrix-blue-glow: rgba(0, 204, 255, 0.5);
    --matrix-blue-dim: #002b3d;
    
    --bg-dark: #050806;
    --bg-panel: rgba(10, 16, 12, 0.85);
    --bg-glass: rgba(15, 23, 18, 0.5);
    --border-glass: rgba(0, 255, 102, 0.15);
    
    --text-main: #dcfbe7;
    --text-muted: #62876f;
    --text-bright: #ffffff;
    
    /* Gradients */
    --carbon-gradient: linear-gradient(45deg, #090c0a 25%, transparent 25%), 
                       linear-gradient(-45deg, #090c0a 25%, transparent 25%), 
                       linear-gradient(45deg, transparent 75%, #090c0a 75%), 
                       linear-gradient(-45deg, transparent 75%, #090c0a 75%);
    --carbon-size: 8px;
    --carbon-bg: #0c110e;
}

/* Reset and Core Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Share Tech Mono', monospace;
    user-select: none;
    outline: none;
}

body.matrix-theme {
    background-color: var(--bg-dark);
    background-image: var(--carbon-gradient);
    background-size: var(--carbon-size) var(--carbon-size);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* CRT Screen Effects (Visual Overlays) */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 9999;
}

.crt-overlay::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(circle, transparent 55%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}

/* Screen Glitch Jitter Overlay (Triggered by JS) */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 255, 102, 0.0);
    z-index: 9998;
    pointer-events: none;
}

.glitch-active {
    animation: screen-glitch 0.25s infinite;
}

@keyframes screen-glitch {
    0% {
        background: rgba(0, 255, 102, 0.15);
        transform: translate(2px, 1px) skew(0.5deg);
        filter: hue-rotate(90deg) contrast(1.5);
    }
    20% {
        background: rgba(255, 0, 0, 0.1);
        transform: translate(-1px, -2px) skew(-0.5deg);
    }
    40% {
        background: rgba(0, 204, 255, 0.15);
        transform: translate(0px, 3px) skew(0deg);
        filter: invert(0.05);
    }
    60% {
        background: rgba(0, 255, 102, 0.05);
        transform: translate(-3px, -1px) skew(1deg);
    }
    80% {
        background: rgba(255, 0, 128, 0.1);
        transform: translate(2px, 2px) skew(-1deg);
    }
    100% {
        background: rgba(0, 255, 102, 0.0);
        transform: translate(0px, 0px) skew(0deg);
    }
}

/* Background Canvas */
#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0.35;
}

/* Sound Button Container */
.sound-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.sound-btn:hover {
    box-shadow: 0 0 15px var(--matrix-green-glow);
    background: var(--matrix-green-dim);
    color: var(--text-bright);
}

.sound-btn.active {
    border-color: var(--matrix-green);
    box-shadow: 0 0 20px var(--matrix-green-glow);
    background: rgba(0, 255, 102, 0.1);
}

/* Screen visibility classes */
.active-screen {
    display: flex !important;
    animation: fade-in 0.8s ease forwards;
}

.hidden-screen {
    display: none !important;
}

@keyframes fade-in {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   SECTION 1: THE ACCESS PORTAL (Gatekeeper)
   ========================================================================== */

#portal-screen {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

.portal-container {
    background: var(--bg-panel);
    border: 1px solid rgba(0, 255, 102, 0.2);
    width: 90%;
    max-width: 900px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 255, 102, 0.05);
    backdrop-filter: blur(10px);
    z-index: 2;
    text-align: center;
}

.portal-glitch-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: var(--matrix-green);
    margin-bottom: 25px;
    position: relative;
    text-shadow: 0 0 10px var(--matrix-green-glow);
}

.terminal-boot {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 102, 0.1);
    border-radius: 6px;
    padding: 15px 20px;
    text-align: left;
    margin-bottom: 35px;
    height: 130px;
    overflow-y: hidden;
    font-size: 0.95rem;
}

.boot-line {
    margin-bottom: 6px;
    opacity: 0;
    transform: translateY(5px);
    animation: line-reveal 0.3s ease forwards;
}

.boot-line:nth-child(1) { animation-delay: 0.2s; }
.boot-line:nth-child(2) { animation-delay: 0.7s; }
.boot-line:nth-child(3) { animation-delay: 1.2s; }
.boot-line:nth-child(4) { animation-delay: 1.8s; }

@keyframes line-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.boot-line.warning {
    color: var(--matrix-red);
    text-shadow: 0 0 5px var(--matrix-red-glow);
}

/* Pill Chamber Selection UI */
.pill-chamber {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.pill-box {
    flex: 1;
    min-width: 280px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.pill-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background-color 0.3s ease;
}

/* Pill design (3D look) */
.pill-glass {
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.pill {
    width: 60px;
    height: 25px;
    border-radius: 12px;
    position: relative;
    transform: rotate(-30deg);
    animation: pill-float 4s ease-in-out infinite alternate;
    box-shadow: 0 10px 15px rgba(0,0,0,0.5);
}

@keyframes pill-float {
    0% { transform: rotate(-30deg) translateY(0px); }
    100% { transform: rotate(-30deg) translateY(-8px); }
}

.blue-pill {
    background: linear-gradient(to right, #0055ff, #00ccff, #0055ff);
    box-shadow: 0 0 15px rgba(0, 85, 255, 0.4);
}

.red-pill {
    background: linear-gradient(to right, #cc0000, #ff3333, #cc0000);
    box-shadow: 0 0 15px rgba(204, 0, 0, 0.4);
    animation-delay: -2s;
}

/* Shine effect on pill */
.pill::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 10%;
    width: 80%;
    height: 3px;
    background: rgba(255,255,255,0.6);
    border-radius: 5px;
    filter: blur(0.5px);
}

.pill-box h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 15px;
    letter-spacing: 2px;
    color: var(--text-bright);
}

.pill-box p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 25px;
    height: 70px;
}

.pill-action {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Hover States for Pills */
.blue-pill-box:hover {
    border-color: rgba(0, 204, 255, 0.4);
    box-shadow: 0 0 30px var(--matrix-blue-glow);
    background: rgba(0, 204, 255, 0.03);
    transform: translateY(-5px);
}
.blue-pill-box:hover::before {
    background: var(--matrix-blue);
}
.blue-pill-box:hover .pill-action {
    background: var(--matrix-blue-dim);
    color: var(--matrix-blue);
    border-color: var(--matrix-blue);
    box-shadow: 0 0 10px var(--matrix-blue-glow);
}

.red-pill-box:hover {
    border-color: rgba(255, 42, 42, 0.4);
    box-shadow: 0 0 30px var(--matrix-red-glow);
    background: rgba(255, 42, 42, 0.03);
    transform: translateY(-5px);
}
.red-pill-box:hover::before {
    background: var(--matrix-red);
}
.red-pill-box:hover .pill-action {
    background: var(--matrix-red-dim);
    color: var(--matrix-red);
    border-color: var(--matrix-red);
    box-shadow: 0 0 10px var(--matrix-red-glow);
}

/* Blue pill block screen state */
.blue-locked {
    filter: blur(2px) grayscale(0.5);
    pointer-events: none;
    transition: all 0.5s ease;
}

/* ==========================================================================
   SECTION 2: THE MAIN DASHBOARD
   ========================================================================== */

#dashboard-screen {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    padding: 20px;
    animation: dashboard-glitch-entrance 0.5s ease-out;
}

@keyframes dashboard-glitch-entrance {
    0% { filter: invert(1) blur(10px); transform: scale(1.05); }
    50% { filter: hue-rotate(180deg); }
    100% { filter: none; transform: scale(1); }
}

/* HUD Header Styling */
.hud-header {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
}

.hud-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hud-left .logo {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--matrix-green);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--matrix-green-glow);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--matrix-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--matrix-green);
    animation: led-pulse 1.5s infinite alternate;
}

@keyframes led-pulse {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.status-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hud-center {
    display: flex;
    gap: 30px;
}

.hud-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-stat-box .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.hud-stat-box .val {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    margin-top: 2px;
}

.alarm-high {
    color: var(--matrix-red);
    animation: text-pulse-red 1s infinite alternate;
}

@keyframes text-pulse-red {
    0% { text-shadow: 0 0 1px var(--matrix-red-glow); }
    100% { text-shadow: 0 0 8px var(--matrix-red-glow), 0 0 15px var(--matrix-red-glow); }
}

.green-text {
    color: var(--matrix-green);
}

.hud-right {
    width: 250px;
}

.resistance-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

.resistance-progress .percent {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--matrix-green);
    text-shadow: 0 0 8px var(--matrix-green-glow);
}

.bar-container {
    height: 6px;
    background: rgba(0, 255, 102, 0.05);
    border: 1px solid rgba(0, 255, 102, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--matrix-green);
    box-shadow: 0 0 8px var(--matrix-green-glow);
    transition: width 0.5s cubic-bezier(0.1, 0.8, 0.1, 1);
}

/* Dashboard Content Grid */
.dashboard-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr 340px;
    gap: 20px;
    margin-bottom: 20px;
    min-height: 0; /* Important for scroll nested elements */
}

.grid-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid rgba(0, 255, 102, 0.1);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 255, 102, 0.02);
}

.card-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-bright);
}

.card-header .tag {
    font-size: 0.65rem;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    padding: 2px 6px;
    border-radius: 3px;
    box-shadow: 0 0 5px rgba(0, 255, 102, 0.2);
}

.card-header .tag.green-bg {
    background: rgba(0, 255, 102, 0.1);
}

/* LEFT COLUMN: COMMS PANEL */
.comms-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    flex: 1;
    overflow-y: auto;
}

.avatar-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
    border: 2px solid var(--matrix-green);
    box-shadow: 0 0 20px rgba(0, 255, 102, 0.2);
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9) contrast(1.1) sepia(0.2) hue-rotate(60deg);
    transition: all 0.3s ease;
}

.avatar-container:hover .avatar-img {
    filter: brightness(1) contrast(1.2) sepia(0) hue-rotate(0deg);
    transform: scale(1.03);
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 255, 102, 0.08) 50%, rgba(0, 0, 0, 0.2) 50%);
    background-size: 100% 6px;
    pointer-events: none;
}

/* CSS Audio Waves */
.audio-waves {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 25px;
    width: 60px;
    opacity: 0.8;
}

.audio-waves .stroke {
    display: block;
    width: 4px;
    background: var(--matrix-green);
    border-radius: 2px;
    animation: sound-bounce 1.2s ease-in-out infinite alternate;
}

.audio-waves .stroke:nth-child(1) { height: 30%; animation-delay: -1s; }
.audio-waves .stroke:nth-child(2) { height: 60%; animation-delay: -0.4s; }
.audio-waves .stroke:nth-child(3) { height: 90%; animation-delay: -0.8s; }
.audio-waves .stroke:nth-child(4) { height: 40%; animation-delay: -0.2s; }
.audio-waves .stroke:nth-child(5) { height: 80%; animation-delay: -0.6s; }
.audio-waves .stroke:nth-child(6) { height: 50%; animation-delay: -0.9s; }
.audio-waves .stroke:nth-child(7) { height: 30%; animation-delay: -0.1s; }

@keyframes sound-bounce {
    0% { height: 10%; }
    100% { height: 100%; }
}

.comms-status {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(0, 255, 102, 0.08);
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 0.8rem;
}

.comms-status h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-bright);
    margin-bottom: 8px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.status-line {
    margin-bottom: 4px;
}

.comms-instructions {
    background: rgba(0, 255, 102, 0.03);
    border: 1px dashed rgba(0, 255, 102, 0.3);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0, 255, 102, 0.02);
}

.instruction-title {
    color: var(--matrix-green);
    font-weight: 800;
    margin-bottom: 8px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.instruction-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.pointer-arrow {
    font-size: 0.8rem;
    color: var(--matrix-green);
    animation: pulse-arrow 1.2s infinite alternate;
    font-weight: 800;
}

@keyframes pulse-arrow {
    0% { transform: translateY(0); opacity: 0.4; }
    100% { transform: translateY(5px); opacity: 1; text-shadow: 0 0 5px var(--matrix-green-glow); }
}

/* CENTER COLUMN: INTERACTIVE TERMINAL */
.terminal-card {
    min-height: 0; /* Grid scroll containment */
}

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
    background: rgba(0,0,0,0.5);
    scroll-behavior: smooth;
}

/* Custom terminal scrollbar */
.terminal-body::-webkit-scrollbar {
    width: 6px;
}
.terminal-body::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 102, 0.2);
    border-radius: 3px;
}
.terminal-body::-webkit-scrollbar-thumb:hover {
    background: var(--matrix-green);
}

.term-line {
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-break: break-all;
}

.term-line.highlight {
    color: var(--matrix-green);
    font-weight: bold;
}

.term-line.quote {
    color: var(--text-bright);
    border-left: 2px solid var(--matrix-green);
    padding-left: 12px;
    margin: 15px 0;
    font-style: italic;
    line-height: 1.6;
}

.term-line.system {
    color: var(--matrix-red);
}

.term-line.input-cmd {
    color: var(--matrix-green);
    font-weight: bold;
}

.terminal-input-container {
    border-top: 1px solid rgba(0, 255, 102, 0.15);
    background: rgba(0,0,0,0.6);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-prompt {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--matrix-green);
    text-shadow: 0 0 5px var(--matrix-green-glow);
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-bright);
    font-size: 1rem;
    caret-color: var(--matrix-green);
}

#terminal-input::placeholder {
    color: rgba(98, 135, 111, 0.45);
}

/* RIGHT COLUMN: ESCAPE PROTOCOLS */
.protocols-card {
    min-height: 0;
}

.protocols-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    overflow-y: auto;
}

.protocol-item {
    background: var(--bg-glass);
    border: 1px solid rgba(0, 255, 102, 0.1);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.protocol-info {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.proto-num {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-muted);
    border: 1px solid rgba(0,255,102,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.proto-details h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.proto-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.proto-action-btn {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(0, 255, 102, 0.3);
    color: var(--matrix-green);
    font-size: 0.75rem;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.proto-action-btn:hover {
    background: rgba(0, 255, 102, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.15);
    border-color: var(--matrix-green);
}

/* Completed Protocol Item States */
.protocol-item[data-completed="true"] {
    border-color: var(--matrix-green);
    background: rgba(0, 255, 102, 0.03);
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.05);
}

.protocol-item[data-completed="true"] .proto-num {
    color: var(--matrix-green);
    border-color: var(--matrix-green);
    text-shadow: 0 0 5px var(--matrix-green-glow);
}

.protocol-item[data-completed="true"] .proto-action-btn {
    background: var(--matrix-green-dim);
    color: var(--text-bright);
    border-color: var(--matrix-green);
    cursor: default;
    pointer-events: none;
}

/* ElevenLabs Conversational Widget Override UI Hook */
/* The official widget floats at the bottom-right. We make sure it glows on our page. */
elevenlabs-convai {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999;
}

/* Custom CSS to inject a pulsating green ring under the ElevenLabs floating button if possible.
   Since it resides in Shadow DOM, we style the elements outside or position pointing boxes. */
.pointer-arrow::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--matrix-green);
    bottom: 25px;
    right: 25px;
    position: fixed;
    animation: beacon-pulse 2s infinite ease-out;
    pointer-events: none;
    z-index: 998;
}

@keyframes beacon-pulse {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* BOTTOM TICKER FOOTER */
.ticker-footer {
    height: 35px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-glass);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.ticker-wrap {
    display: flex;
    white-space: nowrap;
    animation: ticker 25s linear infinite;
}

.ticker-item {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 40px;
    letter-spacing: 2px;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* Responsive Scaling */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        overflow-y: auto;
    }
    
    #dashboard-screen {
        overflow-y: auto;
        height: auto;
    }
    
    .hud-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .hud-center {
        width: 100%;
        justify-content: center;
    }
    
    .hud-right {
        width: 100%;
    }
}
