body {
    background-color: #000;
    color: #0f0; /* Green terminal */
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;
    height: 100dvh;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

#container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 30px); /* Space for ticker */
    min-height: 0;
}

#header {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #0f0;
    margin-bottom: 10px;
    padding: 5px 10px;
    background: #000;
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 10px;
}

#left-spacer {
    flex: 1;
    min-width: 0;
}

#pause-toggle {
    background: #000;
    color: #ff0;
    border: 1px solid #ff0;
    padding: 2px 10px;
    font-size: 0.85em;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
}

#pause-toggle:hover {
    background: #ff0;
    color: #000;
}

#status {
    font-size: 0.85em;
    color: #0f0;
    white-space: nowrap;
}

#title-wrapper {
    flex: 1;
    min-width: 0;
    text-align: center;
}

#right-controls {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

#queue-status {
    font-size: 0.85em;
    color: #0f0;
}

#about-link a {
    color: #ff0;
    text-decoration: none;
    border: 1px solid #ff0;
    padding: 2px 8px;
    font-size: 0.85em;
}

#about-link a:hover {
    background-color: #ff0;
    color: #000;
}

#signal-strength {
    color: #fff;
    text-shadow: 0 0 5px #0f0;
}

@media (max-width: 980px) {
    #header {
        flex-wrap: wrap;
    }

    #left-spacer {
        display: none;
    }

    #title-wrapper {
        flex: 1 1 100%;
        order: 1;
    }

    #right-controls {
        flex: 1 1 100%;
        order: 2;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    #container {
        height: calc(100dvh - 45px);
    }

    #header {
        padding: 4px 6px;
        gap: 6px;
    }

    h1 {
        font-size: 1.45em;
    }

    #right-controls {
        gap: 8px;
    }

    #pause-toggle,
    #about-link a {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 4px 10px;
    }

    #ticker {
        height: 25px;
    }

    #ticker-content {
        font-size: 0.75em;
    }
}

h1 {
    text-align: center;
    color: red;
    text-shadow: 2px 2px 0px #fff;
    margin: 0;
    font-size: 2.2em;
    animation: glitch 1.5s infinite alternate;
}

#ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: #111;
    border-top: 1px solid #333;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    z-index: 100;
}

#ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 60s linear infinite;
    color: #ff0;
    font-weight: bold;
    font-size: 0.9em;
}

body.paused #ticker-content {
    animation-play-state: paused;
}

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

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* New Glitch Animations */
.glitch-flicker {
    animation: chromatic 0.3s infinite;
}

@keyframes chromatic {
    0% { text-shadow: 1px 0 red, -1px 0 blue; opacity: 1; }
    20% { text-shadow: -1px 0 red, 1px 0 blue; opacity: 0.9; }
    40% { text-shadow: 1px 1px red, -1px -1px blue; opacity: 1; }
    60% { text-shadow: -1px -1px red, 1px 1px blue; opacity: 0.8; }
    80% { text-shadow: 2px 0 red, -2px 0 blue; opacity: 1; }
    100% { text-shadow: 1px 0 red, -1px 0 blue; opacity: 1; }
}

.source-pulse {
    animation: pulse-green 3s infinite alternate;
}

@keyframes pulse-green {
    0% { color: #666; text-shadow: none; }
    100% { color: #0f0; text-shadow: 0 0 8px #0f0; }
}

#stream {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
#stream::-webkit-scrollbar { 
    display: none; 
}

.news-item {
    margin-bottom: 5px;
    padding: 5px;
    border-bottom: 1px dashed #333;
    transition: all 0.2s;
    font-size: 1.2em;
}

.news-item:hover {
    background-color: #111;
    cursor: pointer;
}

.news-item-focused {
    border: 1px solid #fff;
    background-color: #101010;
}

.source {
    color: #666;
    font-size: 0.8em;
    margin-right: 10px;
}

.timestamp {
    color: #444;
    font-size: 0.8em;
    margin-right: 10px;
}

/* Chaos Styles */
.breaking {
    color: red;
    font-weight: bold;
    font-size: 1.5em;
    border: 2px solid red;
    animation: flash 0.5s infinite;
}

.live {
    color: yellow;
    background-color: red;
    padding: 0 5px;
}

.war {
    color: orange;
    font-family: Impact, sans-serif;
    text-transform: uppercase;
}

.death {
    color: #888;
    font-style: italic;
}

@keyframes flash {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

body.paused .news-item {
    opacity: 0.75;
}

body.paused #pause-toggle {
    background: #ff0;
    color: #000;
}

#help-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
}

#help-modal[aria-hidden='false'] {
    display: flex;
}

#help-panel {
    background: #050505;
    border: 1px solid #0f0;
    color: #0f0;
    padding: 16px;
    width: min(90vw, 420px);
}

#help-panel h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #fff;
}

#help-panel p {
    margin: 6px 0;
    font-size: 0.92em;
}
