@font-face {
    font-family: 'JetBrains Mono';
    src: url('/assets/fonts/jetbrains-mono-regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/assets/fonts/jetbrains-mono-bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

body {
    margin: 0;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background: #000;
}

#globeContainer {
    width: calc(100% - 400px);
    height: 100vh;
    position: relative;
    overflow: hidden;
    /* Seamless tile, rendered 1:1 so stars stay single-pixel crisp */
    background: #000 url('/assets/images/night-sky.png') repeat;
}

#globeViz {
    width: 100%;
    height: 100vh;
}

#controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #00ff00;
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
    border: 1px solid #00ff00;
    font-size: 12px;
}

button {
    margin: 5px;
    padding: 5px 10px;
    cursor: pointer;
    background: #000;
    color: #00ff00;
    border: 1px solid #00ff00;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 12px;
}

button:hover {
    background: #00ff00;
    color: #000;
}

#musicToggle {
    position: absolute;
    top: 10px;
    right: 55px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #0080ff;
    color: #0080ff;
    padding: 5px 10px;
    margin: 0;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

#musicToggle:hover {
    background: rgba(0, 128, 255, 0.15);
    text-shadow: 0 0 8px #0080ff;
}

#musicToggle.active {
    border-color: #00ff00;
    color: #00ff00;
}

#musicToggle.active:hover {
    background: rgba(0, 255, 0, 0.1);
    text-shadow: 0 0 8px #00ff00;
}

#musicToggle .bars {
    display: flex;
    align-items: end;
    gap: 2px;
    height: 12px;
}

#musicToggle .bar {
    width: 2px;
    background: currentColor;
    opacity: 0.3;
}

#musicToggle.active .bar {
    animation: barPulse 1.2s ease-in-out infinite;
    opacity: 1;
}

#musicToggle.active .bar:nth-child(1) {
    height: 4px;
    animation-delay: 0s;
}

#musicToggle.active .bar:nth-child(2) {
    height: 8px;
    animation-delay: 0.15s;
}

#musicToggle.active .bar:nth-child(3) {
    height: 12px;
    animation-delay: 0.3s;
}

#musicToggle.active .bar:nth-child(4) {
    height: 6px;
    animation-delay: 0.45s;
}

#musicToggle.active .bar:nth-child(5) {
    height: 10px;
    animation-delay: 0.6s;
}

.bar:nth-child(1) {
    height: 4px;
}

.bar:nth-child(2) {
    height: 8px;
}

.bar:nth-child(3) {
    height: 6px;
}

.bar:nth-child(4) {
    height: 10px;
}

.bar:nth-child(5) {
    height: 5px;
}

@keyframes barPulse {

    0%,
    100% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(1);
    }
}


.origin-label {
    /* Anchored at the source coordinate; sit just above it */
    transform: translate(-50%, -130%);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    color: #ff7a5c;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 80, 50, 0.55);
    border-radius: 2px;
    padding: 1px 5px;
    pointer-events: none;
    /* Duration matches LABEL_FADE_MS in live.js */
    transition: opacity 0.6s ease;
    animation: labelIn 0.3s ease-out;
}

@keyframes labelIn {
    from {
        opacity: 0;
    }
}

.origin-label.fade-out {
    opacity: 0;
}

.origin-label svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

#eventHistory {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    background: rgba(0, 0, 20, 0.9);
    color: #00ff00;
    padding: 20px;
    border-left: 2px solid #0080ff;
    font-size: 14px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    overflow-y: hidden;
    text-shadow: 0 0 5px #00ff00;
    /* Oldest entries dissolve at the bottom instead of hard-clipping */
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 120px), transparent);
    mask-image: linear-gradient(to bottom, black calc(100% - 120px), transparent);
}

#eventHistory h1 {
    margin: 0 0 10px 0;
    color: #0080ff;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 16px;
    text-shadow: 0 0 10px #0080ff;
}

.arc-entry {
    margin: 5px 0;
    padding: 8px;
    background: rgba(0, 40, 80, 0.5);
    border-left: 3px solid #ff0000;
    font-size: 11px;
    border-radius: 2px;
    animation: slideDown 0.3s ease-out;
    overflow: hidden;
    line-height: 1.4;
    position: relative;
}

.arc-entry.alert {
    border-left-color: #ff0000;
}

.arc-entry.warning {
    border-left-color: #ffff00;
}

.arc-entry.ok {
    border-left-color: #00ff00;
}

.arc-entry .icon-container {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: radial-gradient(circle, rgba(0, 128, 255, 0.3) 0%, rgba(0, 128, 255, 0.15) 40%, rgba(0, 128, 255, 0.05) 60%, transparent 80%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arc-entry .icon-container img {
    width: 24px;
    height: 24px;
    filter: brightness(1.5) saturate(0.8);
    opacity: 0.9;
}

.arc-entry .timestamp {
    color: #0080ff;
    font-weight: bold;
    margin-right: 8px;
}

.arc-entry .message {
    color: #ff6666;
    margin-right: 8px;
}

.arc-entry .location {
    color: #0080ff;
    font-size: 10px;
}

.arc-entry .arrow {
    color: #0080ff;
    margin: 0 5px;
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        max-height: 150px;
        opacity: 1;
        transform: translateY(0);
    }
}

/* Kiosk mode styles */
#kioskBar {
    display: none;
}

body.kiosk #kioskBar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 24px;
    background: rgba(0, 0, 20, 0.95);
    border-bottom: 1px solid #0080ff;
    z-index: 20;
    position: relative;
}

body.kiosk #kioskBar svg {
    height: 28px;
    width: auto;
    overflow: visible;
    filter: drop-shadow(0 0 8px #00ff00) drop-shadow(0 0 20px rgba(0, 255, 0, 0.4));
}

body.kiosk #kioskTitle {
    color: #00ff00;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 8px #00ff00, 0 0 20px rgba(0, 255, 0, 0.6), 0 0 40px rgba(0, 255, 0, 0.4), 0 0 60px rgba(0, 255, 0, 0.2);
}

body.kiosk #kioskClock {
    color: #0080ff;
    text-shadow: 0 0 8px #0080ff, 0 0 20px rgba(0, 128, 255, 0.6), 0 0 40px rgba(0, 128, 255, 0.3);
    margin-left: 12px;
}

body.kiosk #kioskTitle .rec-dot {
    width: 20px;
    height: 20px;
    background: #ff0000;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff0000, 0 0 12px rgba(255, 0, 0, 0.5);
    animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 6px #ff0000, 0 0 12px rgba(255, 0, 0, 0.5);
    }

    50% {
        opacity: 0.4;
        box-shadow: 0 0 2px #ff0000;
    }
}

body.kiosk #controls,
body.kiosk #footer {
    display: none;
}

/* Icon-only audio toggle at the top right of the globe, below the kiosk
   bar (the button is absolute within #globeContainer, which starts under
   the bar). Music needs a tap to start anyway (autoplay policy). */
body.kiosk #musicToggle {
    top: 12px;
    right: 16px;
    padding: 10px 12px;
}

body.kiosk #musicToggle .label {
    display: none;
}

body.kiosk #eventHistory h1 {
    display: none;
}

body.kiosk #globeContainer {
    width: 100%;
    height: calc(66vh - 40px);
    position: relative;
}

body.kiosk #globeViz {
    height: calc(66vh - 40px);
}

body.kiosk #eventHistory {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 34vh;
    border-left: none;
    border-top: none;
    background: transparent;
    padding: 0;
}

body.kiosk .arc-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 20px;
}

body.kiosk .arc-entry .kiosk-left {
    display: flex;
    flex-direction: column;
}

body.kiosk .arc-entry .kiosk-right {
    text-align: right;
    font-size: 16px;
    color: #0080ff;
    text-shadow: 0 0 5px #0080ff, 0 0 15px rgba(0, 128, 255, 0.6), 0 0 30px rgba(0, 128, 255, 0.4);
    white-space: nowrap;
    margin-left: 20px;
}

body.kiosk .arc-entry .message {
    text-shadow: 0 0 5px currentColor, 0 0 15px currentColor, 0 0 30px currentColor;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    #globeContainer {
        width: 100%;
        height: 65vh;
        position: fixed;
        top: 0;
        left: 0;
    }

    #globeViz {
        height: 65vh;
    }

    #eventHistory {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 35vh;
        box-sizing: border-box;
        border-left: none;
        border-top: 2px solid #0080ff;
        /* Bottom padding keeps entries clear of the overlaying #footer */
        padding: 10px 10px 70px;
    }

    .arc-entry {
        padding: 5px;
        margin: 3px 0;
        font-size: 10px;
    }


    #controls {
        padding: 8px;
        font-size: 11px;
    }

    #controls button {
        font-size: 11px;
        padding: 4px 8px;
    }


    .arc-entry .timestamp {
        font-size: 10px;
    }

    .arc-entry .location {
        font-size: 9px;
    }

    #musicToggle {
        right: 10px;
    }

    #controls div[style*="margin-top: 15px"] {
        margin-top: 10px !important;
    }

    #controls div[style*="margin: 3px 0"] {
        margin: 2px 0 !important;
    }

}

@media (max-width: 480px) {
    #eventHistory {
        padding: 8px 8px 70px;
    }

    .arc-entry {
        font-size: 9px;
        padding: 4px;
    }

    #controls {
        padding: 6px;
        font-size: 10px;
    }
}

#footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 440px;
    background: rgba(0, 0, 0, 0.85);
    color: #00ff00;
    padding: 15px 20px;
    border-top: 1px solid #0080ff;
    font-size: 12px;
    z-index: 10;
    text-align: center;
    text-shadow: 0 0 5px #00ff00;
}

#footer a {
    color: #0080ff;
    text-decoration: none;
    font-weight: bold;
    text-shadow: 0 0 8px #0080ff;
}

#footer a:hover {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

@media (max-width: 768px) {
    #footer {
        right: 0;
        font-size: 11px;
        padding: 10px 15px;
    }
}
