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

:root {
  --bg: #0A0A0F;
  --panel: #13131F;
  --card: #1E1E30;
  --input-bg: #2D2D44;
  --yellow: #E8C547;
  --teal: #4ECDC4;
  --red: #FF4757;
  --text: #F0EEE8;
  --muted: #7A7A9A;
  --border: #2A2A40;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.5; }

/* APP */
.app { display: grid; grid-template-rows: auto 1fr; height: 100vh; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* HEADER */
.header { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 12px; border-bottom: 1px solid var(--border); gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse-red 1.4s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse-red { 0%,100%{box-shadow:0 0 0 0 rgba(255,71,87,.6)} 50%{box-shadow:0 0 0 6px rgba(255,71,87,0)} }
.station-name { color: var(--yellow); }
.header-meta { display: flex; align-items: center; gap: 14px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); }
.meta-badge { font-size: 10px; padding: 3px 7px; border: 1px solid var(--border); border-radius: 4px; }
.dj-badge { color: var(--yellow); border-color: var(--yellow); }
.listeners-badge { display: flex; align-items: center; gap: 5px; color: var(--teal); }
.listeners-badge span { color: var(--text); font-weight: 500; }

/* MAIN */
.main { display: grid; grid-template-columns: 320px 1fr; gap: 12px; padding: 12px 0; min-height: 0; }
.dj-main { grid-template-columns: 340px 1fr; }

/* PLAYER */
.player-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.now-playing { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.np-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--yellow); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px; }
.cover-wrap { position: relative; width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; margin-bottom: 14px; background: var(--card); }
.cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.vinyl { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--border); animation: spin 4s linear infinite; animation-play-state: paused; background: radial-gradient(circle at 50%,#3a3a55 0%,#1a1a2e 40%,#0a0a1a 60%); position: relative; }
.vinyl::after { content:''; width:14px;height:14px;border-radius:50%;background:var(--yellow);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%); }
.playing .vinyl { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.track-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 15px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-artist { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 12px; }
.eq-bars { display: flex; align-items: flex-end; gap: 3px; height: 24px; margin-bottom: 14px; }
.eq-bar { width: 5px; border-radius: 2px; background: var(--yellow); opacity: .85; animation: eq .8s ease-in-out infinite alternate; animation-play-state: paused; }
.playing .eq-bar { animation-play-state: running; }
.eq-bar:nth-child(1){height:30%;animation-duration:.7s} .eq-bar:nth-child(2){height:70%;animation-duration:.5s} .eq-bar:nth-child(3){height:50%;animation-duration:.9s} .eq-bar:nth-child(4){height:90%;animation-duration:.4s} .eq-bar:nth-child(5){height:40%;animation-duration:.6s} .eq-bar:nth-child(6){height:80%;animation-duration:.8s} .eq-bar:nth-child(7){height:60%;animation-duration:.55s} .eq-bar:nth-child(8){height:45%;animation-duration:.75s} .eq-bar:nth-child(9){height:75%;animation-duration:.65s} .eq-bar:nth-child(10){height:35%;animation-duration:.85s}
@keyframes eq { from{transform:scaleY(.3)} to{transform:scaleY(1)} }
.controls { display: flex; align-items: center; gap: 10px; }
.play-btn { width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--yellow); color: #0A0A0F; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .15s, box-shadow .15s; }
.play-btn:hover { transform: scale(1.07); box-shadow: 0 0 0 6px rgba(232,197,71,.15); }
.volume-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
input[type=range] { flex:1; height:3px; accent-color: var(--yellow); cursor: pointer; }

/* BROADCAST / VIDEO */
.broadcast-box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.video-wrap { border-radius: 8px; overflow: hidden; background: #000; aspect-ratio: 16/9; }
.video-wrap video { width: 100%; height: 100%; object-fit: cover; }

/* VIDEO REQUEST */
.video-request-box { background: var(--panel); border: 1px solid var(--yellow); border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#video-status-text { font-size: 13px; color: var(--yellow); }

/* CHAT */
.chat-col { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-height: 0; }
.chat-header { padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.chat-header-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 15px; }
.chat-header-actions { display: flex; align-items: center; gap: 10px; }
.online-indicator { display: flex; align-items: center; gap: 5px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--teal); }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: pulse-teal 2s ease-in-out infinite; }
@keyframes pulse-teal { 0%,100%{opacity:1} 50%{opacity:.4} }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.msg { display: flex; gap: 8px; padding: 4px 0; animation: fade-in .2s ease; }
@keyframes fade-in { from{opacity:0;transform:translateY(3px)} to{opacity:1} }
.msg-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 1px; }
.msg-nick { font-weight: 600; font-size: 13px; }
.msg-time { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); }
.msg-text { font-size: 13px; word-break: break-word; }
.msg.system .msg-text { color: var(--muted); font-style: italic; font-size: 12px; }

/* VIDEO CALL PANEL */
.video-call-panel { border-top: 1px solid var(--border); flex-shrink: 0; }
.video-call-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-size: 13px; background: var(--card); }
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #000; }
.video-slot { position: relative; aspect-ratio: 4/3; background: #111; overflow: hidden; }
.video-slot video, .video-slot div { width: 100%; height: 100%; object-fit: cover; }
.video-label { position: absolute; bottom: 6px; left: 8px; font-size: 10px; color: #fff; background: rgba(0,0,0,.5); padding: 2px 6px; border-radius: 4px; z-index: 1; font-family: 'JetBrains Mono', monospace; }

/* CHAT FOOTER */
.chat-footer { border-top: 1px solid var(--border); padding: 10px 14px; flex-shrink: 0; }
.nick-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.nick-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); }
.nick-input { background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 12px; padding: 5px 9px; outline: none; width: 120px; }
.nick-input:focus { border-color: var(--teal); }
.nick-saved { font-size: 11px; color: var(--teal); display: none; }
.input-row { display: flex; gap: 8px; }
.msg-input { flex: 1; background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 13px; padding: 8px 11px; outline: none; min-width: 0; }
.msg-input::placeholder { color: var(--muted); }
.msg-input:focus { border-color: var(--yellow); }
.send-btn { background: var(--yellow); color: #0A0A0F; border: none; border-radius: 8px; font-weight: 700; font-size: 13px; padding: 0 14px; cursor: pointer; }
.send-btn:hover { opacity: .88; }

/* BUTTONS */
.btn-apply { background: var(--yellow); color: #0A0A0F; border: none; border-radius: 6px; font-weight: 600; font-size: 12px; padding: 7px 14px; cursor: pointer; transition: opacity .15s; }
.btn-apply:hover { opacity: .88; }
.btn-cancel { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; padding: 6px 12px; cursor: pointer; }
.btn-cancel:hover { color: var(--text); }
.btn-end-call { background: var(--red); color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; padding: 5px 12px; cursor: pointer; }
.btn-video-request { background: transparent; color: var(--teal); border: 1px solid var(--teal); border-radius: 6px; font-size: 11px; padding: 4px 10px; cursor: pointer; white-space: nowrap; transition: background .15s; }
.btn-video-request:hover { background: rgba(78,205,196,.1); }

/* ON AIR BADGE */
.on-air-badge { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--red); font-weight: 600; animation: pulse-red 1.4s ease-in-out infinite; }

/* REQUEST ITEMS */
.request-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); gap: 8px; }
.request-item:last-child { border-bottom: none; }
.request-nick { font-size: 13px; font-weight: 600; }
.request-actions { display: flex; gap: 6px; }
.btn-accept { background: var(--teal); color: #0A0A0F; border: none; border-radius: 5px; font-size: 11px; font-weight: 600; padding: 4px 10px; cursor: pointer; }
.btn-reject { background: transparent; color: var(--red); border: 1px solid var(--red); border-radius: 5px; font-size: 11px; padding: 4px 10px; cursor: pointer; }

/* RESPONSIVE */
@media (max-width: 760px) {
  .main, .dj-main { grid-template-columns: 1fr; }
  .chat-col { height: 50vh; }
  .cover-wrap { max-width: 180px; }
}
