@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --bg:            #07080f;
    --panel-bg:      #0a0b18;
    --panel-border:  #1e2042;
    --led-bg:        #000d00;
    --led-fg:        #22ee22;
    --led-dim:       #0b380b;
    --led-yellow:    #ffcc00;
    --teal:          #00aacc;
    --teal-dark:     #003355;
    --orange:        #ff6600;
    --text:          #c8c8d8;
    --text-dim:      #50506a;
    --sb-bg:         #c4c0b8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: Tahoma, Verdana, Arial, sans-serif;
    font-size: 11px;
    background: var(--bg);
    background-image: radial-gradient(ellipse 100% 50% at 50% 0%, #080f28 0%, transparent 65%);
    color: var(--text);
    min-height: 100vh;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Top ticker ────────────────────────────────── */
.top-ticker {
    width: 100%;
    max-width: 820px;
    background: linear-gradient(to right, #001133, #002255, #001133);
    border: 1px solid #003388;
    border-bottom: none;
    color: #ffcc00;
    font-size: 11px;
    padding: 3px 0;
    letter-spacing: 0.5px;
}

/* ── Main window ───────────────────────────────── */
.main-window {
    width: 100%;
    max-width: 820px;
    background: var(--panel-bg);
    border: 2px solid #252548;
    box-shadow:
        inset 1px 1px 0 #30305a,
        inset -1px -1px 0 #080810,
        0 6px 30px rgba(0,0,0,0.9),
        0 0 50px rgba(0,80,200,0.08);
}

/* ── Title bar ─────────────────────────────────── */
.titlebar {
    background: linear-gradient(to bottom, #1464d8 0%, #0e4ab8 45%, #0a3898 55%, #0d4ec4 100%);
    padding: 4px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-bottom: 1px solid #0a38a8;
}
.titlebar-left {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}
.titlebar-icon { font-size: 13px; }
.titlebar-buttons { display: flex; gap: 2px; }

.tb-btn {
    width: 19px;
    height: 17px;
    font-size: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Tahoma, sans-serif;
    background: linear-gradient(to bottom, #dce8f5, #b4cce8);
    border: 1px solid;
    border-color: #a0c4e8 #2a5888 #2a5888 #a0c4e8;
    color: #002244;
}
.tb-close {
    background: linear-gradient(to bottom, #f0a0a0, #c83030);
    border-color: #e88080 #7a1010 #7a1010 #e88080;
    color: #fff;
}
.tb-btn:hover { filter: brightness(1.15); }

/* ── Menu bar ──────────────────────────────────── */
.menubar {
    background: linear-gradient(to bottom, #ece8e2, #d8d4cc);
    border-bottom: 1px solid #aaa8a0;
    padding: 1px 4px;
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 22px;
}
.menu-item {
    padding: 3px 9px;
    font-size: 11px;
    color: #000033;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.menu-item:hover, .menu-active {
    background: #2a64c8;
    color: #fff;
}
.menubar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding-right: 8px;
}
.live-badge {
    color: #cc0000;
    font-size: 10px;
    font-weight: bold;
    animation: blink-fast 1s step-end infinite;
}
@keyframes blink-fast {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* ── Content layout ────────────────────────────── */
.content-area {
    display: flex;
    gap: 0;
    padding: 6px;
    background: #0a0b18;
}
.left-col { flex: 1; min-width: 0; }
.right-col {
    width: 176px;
    min-width: 176px;
    padding-left: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* ── Panel ─────────────────────────────────────── */
.panel {
    background: #080910;
    border: 1px solid var(--panel-border);
    margin-bottom: 6px;
}
.panel:last-child { margin-bottom: 0; }

.panel-header {
    background: linear-gradient(to right, #003355 0%, #005580 40%, #003355 100%);
    color: #88ccee;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-bottom: 1px solid #004466;
}

/* ── LED Display ───────────────────────────────── */
.led-display {
    background: var(--led-bg);
    padding: 7px 10px 9px;
    font-family: 'VT323', monospace;
    font-size: 19px;
    color: var(--led-fg);
    text-shadow: 0 0 5px rgba(0,220,0,0.45);
    border-bottom: 1px solid #002200;
    line-height: 1.35;
}
.led-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
    overflow: hidden;
    white-space: nowrap;
}
.led-label {
    color: #1e7a1e;
    min-width: 26px;
    flex-shrink: 0;
    font-size: 17px;
}
.led-marquee {
    flex: 1;
    overflow: hidden;
}
.led-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.led-divider {
    color: #0d3a0d;
    font-size: 14px;
    overflow: hidden;
    white-space: nowrap;
    margin: 3px 0 4px;
    letter-spacing: 2px;
}
.led-time-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 2px;
}
.led-time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.led-time-label {
    font-size: 13px;
    color: #1e7a1e;
    line-height: 1;
}
.led-time-val {
    font-size: 26px;
    line-height: 1;
    letter-spacing: 1px;
}
.led-remaining {
    color: var(--led-yellow);
    text-shadow: 0 0 6px rgba(255,200,0,0.5);
}
.led-time-sep {
    color: #0d3a0d;
    font-size: 22px;
    align-self: center;
    padding-bottom: 2px;
}

/* ── Progress bar ──────────────────────────────── */
.progress-wrap {
    padding: 4px 8px 3px;
    background: #060710;
    border-bottom: 1px solid var(--panel-border);
}
.progress-track {
    height: 9px;
    background: #111130;
    border: 1px solid #282850;
    position: relative;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #004488, #0088ee);
    width: 0%;
    transition: width 1s linear;
    box-shadow: 0 0 5px rgba(0,140,255,0.4);
}
.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #333360;
    margin-top: 2px;
    font-family: Tahoma, sans-serif;
}

/* ── Visualizer ────────────────────────────────── */
.vis-wrap {
    position: relative;
    height: 76px;
    background: #000008;
    border-bottom: 1px solid var(--panel-border);
    overflow: hidden;
}
#visualizer { width: 100%; height: 100%; }
.frequency-bars {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 100%;
    padding: 0 4px;
    gap: 2px;
}
.bar {
    flex: 1;
    background: linear-gradient(to top, #00ee44, #00aaff);
    min-height: 2px;
    opacity: 0.85;
}

/* ── Controls ──────────────────────────────────── */
.controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: #0a0b18;
}
.play-btn {
    width: 38px;
    height: 28px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #4488cc, #1a5599);
    border: 1px solid;
    border-color: #77aadd #0f3366 #0f3366 #77aadd;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-btn:hover { background: linear-gradient(to bottom, #55aadd, #2266aa); }
.play-btn.playing {
    background: linear-gradient(to bottom, #cc4444, #881818);
    border-color: #ee6666 #551111 #551111 #ee6666;
}
.vol-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.vol-icon { font-size: 12px; color: var(--teal); }
.volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #101030;
    border: 1px solid #282850;
    cursor: pointer;
    outline: none;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 16px;
    background: linear-gradient(to bottom, #88aacc, #3366aa);
    border: 1px solid #225588;
    cursor: pointer;
}
.volume-slider::-moz-range-thumb {
    width: 11px;
    height: 16px;
    background: linear-gradient(to bottom, #88aacc, #3366aa);
    border: 1px solid #225588;
    cursor: pointer;
}
.vol-val {
    min-width: 22px;
    text-align: right;
    color: var(--teal);
    font-size: 11px;
}

/* ── Right column panels ───────────────────────── */
.counter-body {
    padding: 8px 6px;
    text-align: center;
    background: #040508;
}
.counter-num {
    font-family: 'VT323', monospace;
    font-size: 48px;
    color: var(--orange);
    text-shadow: 0 0 12px rgba(255,100,0,0.5);
    line-height: 1;
}
.counter-sub {
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
}
.clock-body {
    font-family: 'VT323', monospace;
    font-size: 30px;
    color: #00ccff;
    text-shadow: 0 0 8px rgba(0,180,255,0.4);
    text-align: center;
    padding: 6px 4px;
    background: #020308;
}
.construction-body {
    padding: 18px 8px;
    text-align: center;
    background: #040508;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.construction-warn {
    font-size: 28px;
    color: var(--orange);
    animation: blink-fast 0.9s step-end infinite;
}
.construction-text {
    font-size: 11px;
    font-weight: bold;
    color: var(--orange);
    letter-spacing: 1px;
}
.construction-sub {
    font-size: 9px;
    color: var(--text-dim);
}

/* ── Status bar ────────────────────────────────── */
.statusbar {
    background: linear-gradient(to bottom, #ccc8c0, #b8b4ac);
    border-top: 1px solid #a8a49c;
    padding: 2px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #000033;
    font-family: Tahoma, sans-serif;
}
.status-online { color: #003300; }
.statusbar-right { display: flex; gap: 6px; color: #333355; }
.status-pipe { color: #a0a098; }

/* ── Page footer ───────────────────────────────── */
.page-footer {
    margin-top: 7px;
    font-size: 10px;
    color: #2a2a42;
    display: flex;
    gap: 6px;
    align-items: center;
    font-family: Tahoma, sans-serif;
}
.foot-star { color: #1a1a2e; font-size: 9px; }

/* ── Scrollbar (XP style) ──────────────────────── */
::-webkit-scrollbar { width: 16px; }
::-webkit-scrollbar-track { background: #d4d0c8; border-left: 1px solid #a09898; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, #e8e4dc, #c8c4bc, #e8e4dc);
    border: 2px solid;
    border-color: #fff #888070 #888070 #fff;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 580px) {
    .content-area { flex-direction: column; }
    .right-col {
        width: 100%;
        padding-left: 0;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }
    .right-col .panel { flex: 1; min-width: 140px; margin-bottom: 0; }
    .led-time-row { gap: 8px; }
    .led-time-val { font-size: 22px; }
}
