/* ═══════════════════════════════════════════════════
   FUN RADIO PLAYER — Single Panel Layout
   All zones positioned to match panel-desktop1.webp (1184x800)
   ═══════════════════════════════════════════════════ */

:root {
    --bg: #0a0c10;
    --text: #b0c8e0;
    --text-dim: #5a7a9a;
    --text-dark: #2a4060;
    --gold: #f0b90b;
    --green: #00ff88;
    --red: #ff3333;
    --blue: #5a8ab5;
    --font: 'Inter', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: flex; flex-direction: column; align-items: center;
}
a { color: var(--gold); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; }
::selection { background: rgba(240,185,11,0.3); color: #fff; }

/* ═══════════════════ THE PANEL ═══════════════════
   Single container. Background image defines the rack.
   All zones are absolute-positioned to align with the
   recessed areas in the 1184x800 graphic.
   ═══════════════════════════════════════════════════ */
.panel {
    position: relative;
    width: 100%;
    max-width: 1184px;
    /* Maintain the panel aspect ratio */
    aspect-ratio: 1184 / 800;
    margin: 0 auto;
    overflow: hidden;
}
.panel-bg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    user-select: none;
}

/* ══════════════ ZONE POSITIONING ══════════════
   Percentages calculated from the 1184x800 image.
   Each zone is absolute-positioned inside .panel.
   ═══════════════════════════════════════════════ */

/* Left recessed box: station selector
   Panel coords: ~(10,14) to ~(232,296)  */
.z-left {
    position: absolute;
    left: 0.85%;   top: 1.75%;
    width: 18.8%;  height: 35.2%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding: 1.2% 0.8%;
}

/* Center top: meters
   Panel coords: ~(242,14) to ~(870,178)  */
.z-meters {
    position: absolute;
    left: 20.4%;   top: 1.75%;
    width: 53.1%;  height: 20.5%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1%;
    padding: 0.5% 1%;
}

/* Center bottom strip: controls
   Panel coords: ~(242,192) to ~(870,296)  */
.z-controls {
    position: absolute;
    left: 20.4%;   top: 24%;
    width: 53.1%;  height: 13%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3%;
    padding: 0.5% 2%;
}

/* Right glass: TV info screen
   Panel coords: ~(886,14) to ~(1172,296)  */
.z-tv {
    position: absolute;
    left: 74.8%;   top: 1.75%;
    width: 24.2%;  height: 35.2%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Bottom panel: song log
   Panel coords: ~(22,330) to ~(1162,788)  */
.z-songlog {
    position: absolute;
    left: 1.85%;   top: 41.2%;
    width: 96.3%;  height: 57.3%;
    display: flex;
    flex-direction: column;
    padding: 1.5% 2%;
    overflow: hidden;
}

/* ═══════════════════ STATION BUTTONS ═══════════════════ */
.station-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.station-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    font-family: var(--mono);
    font-size: clamp(8px, 1.1vw, 13px);
    font-weight: 700;
    color: #6a7080;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    background: transparent;
    border: none;
    transition: color 0.2s;
    cursor: pointer;
    outline: none;
    border-radius: 2px;
}
.station-btn:hover { color: #a0b0c0; }
.station-btn.active {
    color: var(--green);
    text-shadow: 0 0 8px rgba(0,255,136,0.5);
}
.station-btn.playing { animation: txt-pulse 2s ease-in-out infinite; }
@keyframes txt-pulse {
    0%,100% { text-shadow: 0 0 8px rgba(0,255,136,0.5); }
    50% { text-shadow: 0 0 14px rgba(0,255,136,0.8), 0 0 24px rgba(0,255,136,0.3); }
}
.station-btn-led {
    width: 5px; height: 5px; border-radius: 50%;
    background: #222; flex-shrink: 0;
    transition: all 0.3s;
}
.station-btn.active .station-btn-led {
    background: var(--green);
    box-shadow: 0 0 6px rgba(0,255,136,0.6);
}

/* ═══════════════════ METERS ═══════════════════ */
.meter-bezel {
    position: relative;
    flex: 1;
    max-width: 48%;
    border: 2px solid #0c1018;
    border-top-color: #060a10;
    border-bottom-color: #1a2030;
    border-radius: 3px;
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.06),
        0 -2px 4px rgba(0,0,0,0.6) inset,
        0 2px 4px rgba(0,0,0,0.6) inset,
        2px 0 3px rgba(0,0,0,0.3) inset,
        -2px 0 3px rgba(0,0,0,0.3) inset;
}
.meter-bezel canvas { display: block; width: 100%; height: auto; }

.meter-screw {
    width: 10px; height: 10px; border-radius: 50%;
    position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
    z-index: 3;
    background: radial-gradient(circle at 40% 35%, #888, #444 60%, #222);
    border: 1px solid #111;
    box-shadow: 0 1px 2px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.15);
    cursor: pointer; padding: 0;
}
.screw-slot {
    display: block; width: 6px; height: 1px;
    background: rgba(0,0,0,0.6);
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%) rotate(45deg);
}

.meter-mid {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; flex-shrink: 0; padding: 0 2px;
}
.meter-vol-label {
    font-family: var(--mono); font-size: clamp(6px, 0.7vw, 9px);
    font-weight: 700; color: rgba(180,200,220,0.35); letter-spacing: 1px;
}
.vol-vert {
    writing-mode: vertical-lr; direction: rtl;
    width: 16px; height: 50px;
    background: rgba(0,0,0,0.3); border-radius: 2px;
}
.vol-vert::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 7px;
    background: linear-gradient(180deg, #888 0%, #555 50%, #333 100%);
    border: 1px solid #222; border-radius: 2px; cursor: pointer;
}
.vol-vert::-moz-range-thumb {
    width: 14px; height: 7px;
    background: linear-gradient(180deg, #888 0%, #555 50%, #333 100%);
    border: 1px solid #222; border-radius: 2px; cursor: pointer;
}

/* ═══════════════════ CONTROLS ═══════════════════ */
.ctrl-row-top {
    display: flex; gap: 4%; width: 100%; justify-content: center;
}
.ctrl-row-bot {
    display: flex; gap: 6px; justify-content: center;
}

.embossed-btn {
    background: rgba(10,12,20,0.55);
    border: 1px solid rgba(80,90,110,0.25);
    border-top-color: rgba(100,110,130,0.3);
    border-bottom-color: rgba(20,25,35,0.45);
    border-radius: 3px;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.03) inset,
        0 -1px 2px rgba(0,0,0,0.35) inset,
        0 1px 3px rgba(0,0,0,0.25);
    font-family: var(--mono);
    font-size: clamp(7px, 0.75vw, 10px);
    font-weight: 700;
    color: rgba(150,160,180,0.5);
    letter-spacing: 1px;
    padding: 3px 10px;
    transition: all 0.15s;
    cursor: pointer;
}
.embossed-btn:hover { color: rgba(200,210,230,0.7); border-color: rgba(100,110,130,0.4); }
.mute-btn { flex: 0 1 46%; text-align: center; }
.mute-btn.muted {
    color: var(--red);
    border-color: rgba(255,51,51,0.25);
    box-shadow: 0 0 8px rgba(255,51,51,0.12) inset, 0 1px 3px rgba(0,0,0,0.25);
    text-shadow: 0 0 6px rgba(255,51,51,0.35);
}

.transport-btn {
    width: clamp(32px, 5vw, 58px);
    height: clamp(32px, 5vw, 58px);
    padding: 0; background: none; border: none;
    cursor: pointer; transition: transform 0.1s;
    border-radius: 50%; overflow: hidden;
}
.transport-btn:hover { transform: scale(1.06); }
.transport-btn:active { transform: scale(0.95); }
.transport-img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* ═══════════════════ TV SCREEN ═══════════════════ */
.z-tv {
    background: #060810;
}
.tv-scanlines {
    position: absolute; inset: 0; z-index: 2;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.12) 0px,
        rgba(0,0,0,0.12) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
}
.tv-content {
    position: relative; z-index: 1;
    padding: 6% 6%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.tv-line {
    font-family: var(--mono);
    letter-spacing: 1px;
    line-height: 1.35;
    text-transform: uppercase;
}
.tv-station {
    font-size: clamp(8px, 1vw, 14px);
    font-weight: 700;
    color: var(--green);
    text-shadow: 0 0 8px rgba(0,255,136,0.4);
    margin-bottom: 1px;
}
.tv-call {
    font-size: clamp(7px, 0.85vw, 11px);
    color: #22d3ee;
}
.tv-info {
    font-size: clamp(6px, 0.65vw, 9px);
    color: rgba(180,200,220,0.55);
    white-space: normal;
    line-height: 1.3;
    flex: 1;
    overflow-y: auto;
    margin: 3px 0;
}
.tv-genre {
    font-size: clamp(7px, 0.8vw, 11px);
    color: var(--gold);
    margin-top: auto;
}
.tv-address, .tv-phone {
    font-size: clamp(5px, 0.6vw, 8px);
    color: rgba(140,160,180,0.4);
}

/* ═══════════════════ SONG LOG ═══════════════════ */
.songlog-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px; flex-shrink: 0;
}
.songlog-title {
    font-family: var(--mono);
    font-size: clamp(9px, 1.1vw, 15px);
    font-weight: 700; letter-spacing: 3px;
    color: rgba(180,200,220,0.35);
}
.songlog-station {
    font-family: var(--mono);
    font-size: clamp(8px, 1vw, 13px);
    font-weight: 700; color: var(--green);
    text-shadow: 0 0 6px rgba(0,255,136,0.3);
}
.songlog-list {
    flex: 1;
    overflow-y: auto;
}
.songlog-empty {
    font-family: var(--mono);
    font-size: clamp(8px, 0.9vw, 12px);
    color: rgba(120,140,160,0.35);
    padding: 10px 0;
    letter-spacing: 1px;
}
.songlog-item {
    display: flex; align-items: baseline; gap: 12px;
    padding: 3px 0;
    font-family: var(--mono);
    font-size: clamp(7px, 0.85vw, 11px);
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.songlog-item:first-child { color: var(--text); }
.songlog-item:nth-child(n+2) { color: rgba(140,160,180,0.45); }
.songlog-time {
    min-width: 70px; flex-shrink: 0;
    color: rgba(100,120,140,0.35);
}
.songlog-track {
    flex: 1; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

.songlog-list::-webkit-scrollbar { width: 4px; }
.songlog-list::-webkit-scrollbar-track { background: transparent; }
.songlog-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }
.z-left::-webkit-scrollbar { width: 3px; }
.z-left::-webkit-scrollbar-track { background: transparent; }
.z-left::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }

/* ═══════════════════ FOOTER ═══════════════════ */
.site-footer {
    padding: 10px 20px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    max-width: 1184px; width: 100%;
}
.footer-brand { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--text-dim); }
.brand-gold { color: var(--gold); }
.footer-copy { font-size: 10px; color: var(--text-dark); }
.footer-links { margin-left: auto; display: flex; gap: 16px; }
.footer-links a { font-size: 11px; color: var(--text-dim); }
.footer-links a:hover { color: var(--gold); }

/* ═══════════════════ SCROLLBAR ═══════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 768px) {
    .panel { aspect-ratio: auto; height: auto; }
    .panel-bg { display: none; }
    .panel {
        background: linear-gradient(180deg, #1a1e28 0%, #12161e 50%, #0c1018 100%);
        border: 2px solid #2a3a50;
        border-radius: 6px;
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .z-left, .z-meters, .z-controls, .z-tv, .z-songlog {
        position: static;
        width: 100%; height: auto;
    }
    .z-left { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .station-btns { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .z-meters { flex-wrap: wrap; }
    .z-tv { min-height: 120px; padding: 12px; }
    .z-songlog { min-height: 150px; }
}
