@font-face {
    font-family: 'PrintChar21';
    src: url('fonts/PrintChar21.ttf') format('truetype');
}

:root {
    --neon-blue: #00f3ff;
    --neon-pink: #ff00ff;
    --neon-green: #39ff14;
}

body {
    font-family: 'PrintChar21', monospace;
    background-color: #000;
    color: var(--neon-blue);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 20px;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    box-sizing: border-box;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0,0,0,0.9), rgba(0,0,0,0.7));
    z-index: 2;
    pointer-events: none;
}

.control-panel {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 5;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
    margin-top: 60px;
}

.status-text {
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
    font-size: 14px;
    margin-left: 20px;
}

.neon-button {
    background-color: transparent;
    border: 2px solid var(--neon-blue);
    padding: 12px 24px;
    color: var(--neon-blue);
    font-family: 'PrintChar21', monospace;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--neon-blue);
    font-size: 14px;
}

.neon-button:hover {
    background-color: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 20px var(--neon-blue);
    transform: scale(1.05);
}

.timer-container {
    position: relative;
    width: 95%;
    height: 75%;
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    grid-template-columns: repeat(10, 1fr);
    gap: 38px;
    z-index: 4;
    padding: 20px;
    box-sizing: border-box;
    overflow: visible;
    margin-top: 10px;
}

.timer {
    color: var(--neon-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 5px var(--neon-blue);
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--neon-blue);
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 16px;
    min-height: 40px;
    backdrop-filter: blur(5px);
}

.timer.red {
    color: var(--neon-pink);
    text-shadow: 0 0 5px var(--neon-pink);
    border-color: var(--neon-pink);
    background: rgba(255, 0, 255, 0.15);
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
        box-shadow: 0 0 5px var(--neon-pink);
    }
    to {
        transform: scale(1.05);
        box-shadow: 0 0 15px var(--neon-pink);
    }
}

.timer-ghost {
    position: absolute;
    pointer-events: none;
    color: var(--neon-blue);
    opacity: 0.5;
    filter: blur(2px);
    text-shadow: 0 0 15px var(--neon-blue);
    border: 1px solid var(--neon-blue);
    background: rgba(0, 243, 255, 0.05);
    border-radius: 8px;
    z-index: 2;
    font-size: 16px;
    transition: opacity 1.2s linear, transform 1.2s linear;
    display: none;
}
.timer-ghost[style*="left"] {
    display: flex;
}

/* Canvas overlay for connectors */
#connector-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* UI noise container */
.ui-noise-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3; /* Keep UI noise below control panel and timers */
}

/* UI noise elements */
.ui-noise {
    position: absolute;
    color: var(--neon-green);
    font-family: 'PrintChar21', monospace;
    font-size: 13px;
    opacity: 0.7;
    pointer-events: none;
    text-shadow: 0 0 8px var(--neon-green);
    background: rgba(0, 0, 0, 0.5); /* Added background to improve readability */
    padding: 5px 10px;
    border-radius: 4px;
}
.ui-noise.blink {
    animation: blink 1s steps(2, start) infinite;
}
@keyframes blink {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.1; }
}
.ui-noise.scroll {
    white-space: nowrap;
    overflow: hidden;
    width: 180px;
    animation: scroll-left 8s linear infinite;
}
@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.timer-yellow {
    color: #ffe600;
    border-color: #ffe600;
    background: rgba(255, 230, 0, 0.18);
    text-shadow: 0 0 8px #ffe600, 0 0 18px #fff200;
    box-shadow: 0 0 18px #ffe600;
    animation: yellow-pulse 1s infinite alternate;
}
@keyframes yellow-pulse {
    from { box-shadow: 0 0 8px #ffe600; }
    to { box-shadow: 0 0 24px #ffe600; }
}
