:root {
  --accent-red: #a30000;
  --retro-blue: #008080;
  --retro-gray: #c0c0c0;
}
body {
    font-family: "Helvetica", "Arial", sans-serif;
    color: #FFFFFF;
    background-color: #FFFFFF;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 120px; /* Matches footer height (~90px) + buffer; adjust if needed */
}
.header {
    position: relative;
    width: 100%;
    height: 40px;
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding-left: 20px;
    padding-right: 20px;
}
.header h1 {
    font-family: "Courier New", monospace;
    font-size: 24px;
    font-weight: normal;
    text-shadow: 1px 1px 2px #000000;
    margin: 0;
    padding-left: 20px;
    color: #000000;
}
.header h1 a {
    text-decoration: none;
    color: inherit;
}
.earth-button {
    width: 50px;
    height: 50px;
    background: url('/nc_assets/img/earth.png') no-repeat center;
    background-size: cover;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.3s;
    margin-top: 15px;
}
.earth-button:hover {
    transform: scale(1.1);
}
.popup {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/nc_assets/img/moon.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: top 1s ease;
}
.popup.active {
    top: 0;
}
.popup-text {
    padding: 5px;
    border-radius: 5px;
    text-align: center;
    max-width: 80%;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.close-button {
    border: none;
    width: 20%;
    cursor: pointer;
    transition: background-color 0.3s;
}
.close-button:hover {
    color: #000000;
}
.spacer {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto 20px;
    text-align: center;
    transition: transform 0.3s ease;
}
.spacer svg {
    width: 100%;
    height: auto;
    fill: #FFFFFF;
}
.spacer svg path {
    stroke: #000000;
    stroke-width: 2px;
    transition: stroke 0.3s ease, stroke-width 0.3s ease, filter 0.3s ease;
}
.intro-text {
    text-align: center;
    padding: 20px 0;
    font-size: 16px;
    color: #000000;
}
.intro-text a {
    color: #A30000;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}
.intro-text a:hover {
    color: #000000;
}
.grid-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 10px;
    overflow: visible;
}
.art-grid {
    position: relative;
    width: 100vw;
    max-width: none;
    margin: 0 auto;
    padding: 20px;
    overflow: visible;
    height: auto;
   
}
.grid-sizer {
    width: 250px;
    height: 0;
    visibility: hidden;
}
.art-item {
    position: absolute;
    width: 250px;
    background-color: #000000;
    padding: 5px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 0;
    box-sizing: border-box;
}
.art-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(163, 0, 0, 0.5);
}
.art-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 8px;
}
.art-item p {
    margin: 0;
    font-size: 14px;
}
.radio-footer {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 10px 20px;
    margin-top: auto;
    z-index: 10;
    gap: 10px;
    overflow: visible;
    background-color: rgba(0, 0, 0, 0.8);
}
.radio-footer .footer-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 0;
    grid-column: 1 / -1;
}
.radio-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent-red);
    z-index: 0;
}
.radio-footer.hidden-metadata .left-section {
    transform: translateX(-150%);
    opacity: 0;
}
.left-section {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 450px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    will-change: transform, opacity;
    z-index: 1;
}
.album-art {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    border: 1px solid var(--accent-red);
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}
.track-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 350px;
    max-height: 80px;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}
.track-title {
    font-size: 1.2em;
    font-weight: bold;
    font-family: "OCR-A", monospace;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #FFFF00;
    margin-bottom: 2px;
}
.track-artist {
    font-size: 1.1em;
    color: #D3D3D3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.center-controls {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 1;
    min-width: 250px;
}
.live-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    color: #D3D3D3;
    font-size: 0.9em;
    width: auto;
    z-index: 1;
    gap: 5px;
}
#liveText {
    background: rgba(0, 0, 0, 0.8);
    padding: 0 10px;
    z-index: 1;
}
.controls {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}
.volume-wrapper {
    grid-column: 3;
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 1;
    position: relative;
}
.volume-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    width: 55px;
    height: 55px;
    cursor: pointer;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.volume-btn:hover,
.volume-btn:focus {
    color: var(--accent-red);
    outline: none;
    background: transparent !important;
}
.volume-slider {
    width: 0;
    opacity: 0;
    transition: width 0.3s, opacity 0.2s;
    accent-color: var(--accent-red);
    margin-left: 10px;
    height: 10px;
    background: #D3D3D3;
    border-radius: 5px;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
}
.volume-wrapper:hover .volume-slider,
.volume-slider:focus,
.volume-btn:focus + .volume-slider {
    width: 150px;
    opacity: 1;
}
.control-btn {
    background: none !important;
    border: none;
    color: #FFFFFF;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.control-btn:disabled {
    color: var(--accent-red);
    cursor: not-allowed;
}
.control-btn:hover:not(:disabled),
.control-btn:focus:not(:disabled) {
    color: var(--accent-red);
    transform: scale(1.1);
    outline: none;
    background: transparent !important;
}
.visualizer-toggle {
    flex: 0 0 18px;
    background: none;
    border: none;
    color: #FFFFFF;
    width: 90px !important;
    height: 90px !important;
    cursor: pointer;
    transition: color 0.3s;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.visualizer-toggle:hover,
.visualizer-toggle:focus {
    color: var(--accent-red);
    outline: none;
    background: transparent !important;
}
.live-indicator {
    font-size: 0.8em;
    color: var(--accent-red);
    font-weight: bold;
    margin-left: 10px;
    animation: blink 1s infinite;
}
@keyframes blink {
    50% { opacity: 0.5; }
}
.visitor-counter {
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    z-index: 100;
    padding: 5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}
.radio-footer .visitor-counter {
    grid-column: auto;
    grid-row: auto;
    justify-self: auto;
    padding-right: 0;
}
.visualizer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: transparent;
    display: none;
    z-index: -1;
}
.visualizer.active {
    display: block;
}
canvas {
    width: 100%;
    height: 100%;
}
.popup-panel {
    position: fixed;
    left: 0 !important;
    right: auto !important;
    top: auto !important;
    bottom: -480px;
    width: 300px !important;
    height: fit-content;
    overflow-y: visible;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 0;
    box-shadow: none;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out !important;
    opacity: 0;
    will-change: bottom, opacity;
}
.popup-panel.visible {
    bottom: 120px;
    opacity: 1;
}
.popup-panel .close-btn {
    position: absolute;
    top: -3px;
    font-size: 1em;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #FF0000;
    cursor: pointer;
}
.popup-panel .close-btn:hover,
.popup-panel .close-btn:focus {
    color: var(--accent-red);
}
.popup-panel .popup-header {
    margin: 0;
}
.popup-panel .popup-art {
    width: 100%;
    max-width: 280px;
    height: auto;
    border: 1px solid var(--accent-red);
    margin: 0 auto 10px;
    display: block;
}
.popup-panel .popup-title {
    font-size: 1.4em;
    margin: 0;
    color: #FFFF00;
    text-align: center;
}
.popup-panel .popup-artist {
    font-size: 1.2em;
    margin: 0;
    color: #D3D3D3;
    text-align: center;
}
.loading-indicator {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@media (max-width: 1024px) {
    .popup-panel {
        bottom: -400px;
        width: 80% !important;
        max-height: 350px;
    }
    .popup-panel.visible {
        bottom: 90px;
    }
}
@media (max-width: 768px) {
    .radio-footer {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        min-height: 90px;
        height: auto;
        padding: 5px 10px;
        align-items: flex-start;
    }
    .left-section {
        grid-column: 1;
        grid-row: 1;
        max-width: none;
        justify-self: start;
    }
    .center-controls {
        position: static;
        transform: none;
        grid-column: 1;
        grid-row: 2;
        flex-direction: row;
        gap: 10px;
        justify-content: center;
    }
    .volume-wrapper {
        grid-column: 1;
        grid-row: 3;
        justify-self: center;
        padding: 0;
    }
    .visitor-counter {
        bottom: 5px;
        right: 5px;
        font-size: 0.8em;
    }
    .radio-footer::before {
        display: none;
    }
    .live-container {
        display: none;
    }
    .visualizer {
        height: 60px;
    }
    .track-info {
        max-width: 200px;
    }
    .volume-wrapper:hover .volume-slider,
    .volume-slider:focus,
    .volume-btn:focus+.volume-slider {
        width: 100px;
    }
    .popup-panel {
        width: 90% !important;
        max-height: 300px;
    }
}
@media (max-width: 480px) {
    .radio-footer {
        padding: 5px;
        gap: 5px;
    }
    .album-art {
        flex: 0 0 60px;
        height: auto;
        max-height: 100%;
        margin-right: 5px;
    }
    .track-title {
        font-size: 1em;
    }
    .track-artist {
        font-size: 0.9em;
    }
    .volume-btn,
    .control-btn,
    .visualizer-toggle {
        width: 32px;
        height: 32px;
    }
    .controls {
        gap: 10px;
    }
    .volume-wrapper {
        padding: 0 10px;
    }
    .volume-wrapper:hover .volume-slider,
    .volume-slider:focus,
    .volume-btn:focus+.volume-slider {
        width: 80px;
    }
    .visualizer-toggle {
        margin-right: 20px;
    }
    .popup-panel {
        width: 100% !important;
        bottom: -300px;
        max-height: 250px;
    }
    .popup-panel.visible {
        bottom: 90px;
    }
    .popup-panel .popup-art {
        width: 200px;
        height: auto;
    }
    .popup-panel .popup-title {
        font-size: 1.2em;
    }
    .popup-panel .popup-artist {
        font-size: 1em;
    }
    .visitor-counter {
        bottom: 5px;
        right: 5px;
        padding: 3px;
    }
}