@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #1B1530;
  --ink-light: #2B2247;
  --paper: #F7F3EA;
  --gold: #E8A33D;
  --gold-dim: #C98A2E;
  --teal: #4FBDBA;
  --rose: #E8607A;
  --line: rgba(247, 243, 234, 0.14);
  --text-dim: rgba(247, 243, 234, 0.62);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(232, 163, 61, 0.12), transparent 45%),
    radial-gradient(circle at 100% 20%, rgba(79, 189, 186, 0.10), transparent 40%),
    var(--ink);
  color: var(--paper);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

header.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.01em;
  margin: 4px 0 6px;
}

.sub {
  color: var(--text-dim);
  font-size: 14.5px;
  margin: 0 0 28px;
}

.card {
  background: var(--ink-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 7px;
}

input[type="text"], textarea {
  width: 100%;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  color: var(--paper);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}

input[type="text"]:focus, textarea:focus {
  border-color: var(--gold);
}

textarea { resize: vertical; min-height: 78px; }

::placeholder { color: rgba(247,243,234,0.35); }

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input { flex: 1; }

button {
  font-family: inherit;
  font-weight: 600;
  font-size: 14.5px;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

button:active { transform: scale(0.97); }

.btn-gold {
  background: var(--gold);
  color: #1B1530;
}
.btn-gold:hover { background: var(--gold-dim); }

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--gold); }

.btn-danger {
  background: transparent;
  color: var(--rose);
  border: 1px solid rgba(232, 96, 122, 0.4);
  padding: 7px 12px;
  font-size: 13px;
}
.btn-danger:hover { background: rgba(232, 96, 122, 0.12); }

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.results { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.result-item:hover { background: rgba(255,255,255,0.04); border-color: var(--line); }

.result-item img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.result-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.result-channel {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.selected-track {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(232, 163, 61, 0.08);
  border: 1px solid rgba(232, 163, 61, 0.35);
  border-radius: 10px;
  padding: 10px;
}

.selected-track img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.selected-track .change {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.hint {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 6px;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gold);
  color: #1B1530;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  background: var(--rose);
  color: #1B1530;
}

/* --- Host / queue page --- */

.stub {
  display: flex;
  gap: 14px;
  background: var(--ink-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
}

.stub img {
  width: 84px;
  height: 63px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.stub-body { flex: 1; min-width: 0; }

.stub-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 2px;
}

.stub-channel {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.stub-dedication {
  font-family: 'Fraunces', serif;
  font-size: 14.5px;
  font-style: italic;
  color: var(--gold);
  line-height: 1.4;
  border-left: 2px solid var(--gold);
  padding-left: 10px;
  margin: 6px 0;
}

.stub-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 10px;
}

.stub-by {
  font-size: 12px;
  color: var(--text-dim);
}

.stub-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.count-badge {
  background: var(--teal);
  color: #1B1530;
  font-weight: 700;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state .big {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--paper);
  margin-bottom: 8px;
}

a.watch-link {
  color: var(--teal);
  font-size: 12.5px;
  text-decoration: none;
  font-weight: 600;
}
a.watch-link:hover { text-decoration: underline; }

.refresh-note {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 18px;
}

@media (max-width: 480px) {
  h1 { font-size: 27px; }
  .stub img { width: 68px; height: 51px; }
}
