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

:root {
  --bg: #0a0d14;
  --panel: #12161f;
  --panel-2: #171c28;
  --border: #232a3a;
  --text: #e7ebf4;
  --muted: #8b93a7;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 14px;
}

html, body { height: 100%; }

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(236, 72, 153, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- header ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 13, 20, 0.85); backdrop-filter: blur(10px);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: 0.3px; }
.logo .dot {
  width: 12px; height: 12px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.8);
}
nav { display: flex; align-items: center; gap: 10px; font-size: 14px; }

.chip { display: flex; align-items: center; gap: 9px; }
.chip img { width: 28px; height: 28px; border-radius: 50%; }
.badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: 0.6px;
}

.btn {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 8px 15px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: #1e2535; border-color: #2e3a52; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; color: #fff;
}
.btn.primary:hover { filter: brightness(1.1); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.15); border-color: var(--red); color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 24px 22px 60px; display: grid; gap: 18px; }
.grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 14px; }

/* ---------- request box ---------- */
.request-row { display: flex; gap: 10px; }
.request-row input {
  flex: 1; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 10px; font-size: 14.5px; outline: none;
}
.request-row input:focus { border-color: var(--accent); }
.hint { margin-top: 9px; font-size: 12.5px; color: var(--muted); }
.msg { margin-top: 10px; font-size: 13.5px; border-radius: 10px; padding: 10px 12px; display: none; }
.msg.error { display: block; background: rgba(248, 113, 113, 0.12); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.msg.ok { display: block; background: rgba(52, 211, 153, 0.1); color: var(--green); border: 1px solid rgba(52,211,153,0.3); }

/* ---------- now playing ---------- */
.nowplaying { position: relative; overflow: hidden; padding: 0; min-height: 240px; }
.nowplaying video, .nowplaying img.art {
  width: 100%; height: 320px; object-fit: cover; display: block;
  background: linear-gradient(160deg, #1b2130, #10131c);
}
.nowplaying .overlay {
  position: absolute; inset: auto 0 0 0; padding: 46px 20px 16px;
  background: linear-gradient(transparent, rgba(8, 10, 16, 0.92));
}
.nowplaying .title { font-size: 22px; font-weight: 800; }
.nowplaying .req { color: var(--muted); font-size: 13px; margin-top: 4px; }
.nowplaying .req b { color: var(--text); font-weight: 600; }
.progress { margin-top: 12px; }
.progress .bar { height: 5px; background: rgba(255, 255, 255, 0.12); border-radius: 99px; overflow: hidden; }
.progress .fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width 0.5s linear; }
.progress .times { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.paused-badge {
  display: inline-block; margin-left: 8px; background: rgba(251, 191, 36, 0.15);
  color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  vertical-align: middle;
}
.idle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 70px 20px; text-align: center;
}
.idle .big { font-size: 44px; }
.idle h3 { font-size: 18px; }
.idle p { color: var(--muted); font-size: 13.5px; max-width: 380px; }

/* web audio */
.web-audio { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.web-audio .vol { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.web-audio input[type=range] { width: 130px; accent-color: var(--accent); }
.stream-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.stream-dot.live { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ---------- queue / log ---------- */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 9px 6px;
  border-bottom: 1px solid rgba(35, 42, 58, 0.6);
}
.item:last-child { border-bottom: none; }
.item img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.item .meta { flex: 1; min-width: 0; }
.item .t { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .num { color: var(--muted); font-size: 12px; width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.status.pending { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; }
.status.playing { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.status.played { background: rgba(139, 147, 167, 0.15); color: var(--muted); }
.status.skipped, .status.removed, .status.cleared { background: rgba(251, 191, 36, 0.12); color: var(--amber); }
.status.failed { background: rgba(248, 113, 113, 0.12); color: var(--red); }
.status.rejected { background: rgba(248, 113, 113, 0.18); color: #fda4af; }
.time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.reason { font-size: 11.5px; color: #fda4af; margin-top: 2px; }
.empty { color: var(--muted); font-size: 13.5px; padding: 14px 6px; text-align: center; }
.log-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .log-grid { grid-template-columns: 1fr; } }

/* ---------- tap-to-play overlay (autoplay-blocked browsers / iOS) ---------- */
.tap-play {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 50; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 15px;
  padding: 14px 28px; border-radius: 99px;
  box-shadow: 0 10px 34px rgba(139, 92, 246, 0.5);
  animation: tap-pulse 2.2s ease-in-out infinite;
}
.tap-play:hover { filter: brightness(1.12); }
@keyframes tap-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.05); }
}

/* ---------- player (screenshare) page ---------- */
body.screenshare { background: #000; overflow: hidden; }
.share-wrap { position: fixed; inset: 0; background: #05060a; }
.share-wrap video, .share-wrap img.art { width: 100%; height: 100%; object-fit: contain; background: #05060a; }
.share-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px; background: rgba(5, 6, 10, 0.82); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.35);
}
.share-banner .label { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.5px; }
.share-banner .url { color: #fff; font-weight: 700; font-size: 15px; }
.share-banner .btn { padding: 5px 12px; font-size: 12px; }
.share-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 34px 34px 22px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
}
.share-title { font-size: clamp(20px, 3.4vw, 34px); font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.share-req { color: var(--muted); font-size: clamp(12px, 1.5vw, 16px); margin-top: 5px; }
.share-req b { color: var(--text); }
.share-progress { margin-top: 14px; max-width: 1100px; }
.share-progress .bar { height: 6px; background: rgba(255,255,255,0.15); border-radius: 99px; overflow: hidden; }
.share-progress .fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width 0.5s linear; }
.share-times { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.share-side {
  position: fixed; right: 22px; bottom: 150px; width: 300px; z-index: 4;
  background: rgba(10, 13, 20, 0.78); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  max-height: 46vh; display: flex; flex-direction: column;
}
@media (max-width: 800px) { .share-side { display: none; } }
.share-side h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); margin-bottom: 8px; }
.share-side .item img { width: 34px; height: 34px; }
.share-idle {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; text-align: center; padding: 20px;
}
.share-idle .big { font-size: 60px; }
.share-idle h2 { font-size: clamp(18px, 3vw, 28px); }
.share-idle .url-big {
  font-size: clamp(14px, 2vw, 22px); font-weight: 800; color: #fff;
  background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.45);
  padding: 10px 22px; border-radius: 12px;
}
.share-idle p { color: var(--muted); }

.footer-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
