* { box-sizing: border-box; margin: 0; padding: 0; }
body.drawing { user-select: none; }
html, body { height: 100%; font-family: 'Quicksand', sans-serif; background: #0a0a0a; color: #fff; }
#draw-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#app { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; gap: 1.5rem; }

#header { width: 100%; max-width: 400px; display: flex; align-items: center; justify-content: center; }
#wordmark { font-family: 'Bitcount Grid Single', monospace; font-size: 20px; letter-spacing: 0.1em; color: #fff; animation: glitch 9s infinite; }

@keyframes glitch {
  0%, 88%, 100% { text-shadow: none; transform: none; clip-path: none; }
  90%  { text-shadow: -2px 0 rgba(255,80,80,0.75), 2px 0 rgba(80,200,255,0.75); transform: skew(-0.8deg); }
  92%  { text-shadow: 2px 0 rgba(255,80,80,0.75), -2px 0 rgba(80,200,255,0.75); transform: skew(0.4deg); clip-path: inset(10% 0 75% 0); }
  94%  { text-shadow: none; transform: none; clip-path: none; }
}

#player-wrap { width: 100%; max-width: 400px; background: #111; border-radius: 14px; overflow: hidden; }
#video-area { width: 100%; aspect-ratio: 16/9; position: relative; background: #111; }
#sc-player { position: absolute; inset: 0; width: 100%; height: 100%; border: none; z-index: 1; }
#idle-screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #111; color: #2a2a2a; font-size: 14px; font-weight: 400; z-index: 2; }
#join-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); z-index: 10; }
#join-btn { background: #fff; color: #000; border: none; font-family: 'Quicksand', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; padding: 10px 26px; border-radius: 99px; cursor: pointer; }
#join-btn:hover { background: #e8e8e8; }
#now-meta { padding: 14px 16px; border-top: 0.5px solid #1a1a1a; display: none; flex-direction: column; gap: 4px; }
#now-top { display: flex; align-items: center; justify-content: space-between; }
#now-label { font-size: 10px; font-weight: 600; color: #c0392b; letter-spacing: 0.14em; text-transform: uppercase; }
#listeners { font-size: 10px; font-weight: 400; color: #444; }
#listeners.live { color: #666; }
#now-title { font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#now-who   { font-size: 12px; font-weight: 400; color: #555; }

#queue-info { font-size: 12px; font-weight: 400; color: #333; text-align: center; min-height: 1em; }

#submit-area { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 8px; }
#submit-label { font-size: 11px; font-weight: 500; color: #444; letter-spacing: 0.06em; text-transform: uppercase; }
#submit-row { display: flex; gap: 8px; }
#add-btn { flex-shrink: 0; background: #1a1a1a; border: 0.5px solid #2a2a2a; color: #888; font-family: 'Quicksand', sans-serif; font-size: 12px; font-weight: 500; padding: 0 16px; height: 42px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
#add-btn:hover { background: #222; color: #bbb; }
#add-btn:disabled { opacity: 0.3; cursor: not-allowed; }
input.url-input { flex: 1; background: #111; border: 0.5px solid #222; color: #fff; padding: 0 14px; height: 42px; font-family: 'Quicksand', sans-serif; font-size: 13px; font-weight: 400; border-radius: 10px; outline: none; }
input.url-input:focus { border-color: #444; }
input.url-input::placeholder { color: #2a2a2a; }
input.url-input:disabled { opacity: 0.4; cursor: not-allowed; }
#status-msg { font-size: 12px; font-weight: 400; color: #444; min-height: 1em; }
.s-ok   { color: #1DB954 !important; }
.s-err  { color: #c0392b !important; }
.s-info { color: #555    !important; }

#queue-list { width: 100%; max-width: 400px; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 0.5px solid #141414; }
.q-num  { font-size: 11px; font-weight: 400; color: #282828; width: 14px; text-align: right; flex-shrink: 0; }
.q-body { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.q-title { font-size: 12px; font-weight: 500; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-who   { font-size: 11px; font-weight: 400; color: #555; }
.q-time  { font-size: 11px; font-weight: 400; color: #666; flex-shrink: 0; white-space: nowrap; }
.q-loop  { font-size: 11px; color: #555; flex-shrink: 0; }
.q-active .q-title { color: #fff; }
.q-active .q-who   { color: #555; }
.q-dot { width: 5px; height: 5px; border-radius: 50%; background: #c0392b; flex-shrink: 0; }

@media (max-width: 600px) {
  html, body { overflow: hidden; height: 100dvh; }
  #app {
    height: 100vh;
    height: 100dvh;
    min-height: unset;
    padding: 1rem;
    gap: 0.625rem;
  }
  #player-wrap, #submit-area, #queue-list { max-width: 100%; }
  #video-area { aspect-ratio: 16 / 7; }
  input.url-input { font-size: 16px; }
}
