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

:root {
  --bg: #14121a;
  --panel: #1e1b26;
  --text: #e8e4ef;
  --muted: #9a93a8;
  --accent: #b0578d;
  --accent-soft: #b0578d33;
  --error: #e06c75;
  --radius: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hidden { display: none !important; }

.panel {
  margin-top: 18vh;
  width: 100%;
  max-width: 22rem;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
}
.panel h1 { font-size: 1.4rem; margin-bottom: 1.2rem; color: var(--accent); }

main {
  width: 100%;
  max-width: 56rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

form { display: flex; gap: 0.5rem; }
.panel form { flex-direction: column; }

input {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  color: var(--text);
  border: 1px solid #35303f;
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
}
input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 0.65rem 1.3rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: wait; }

#status { min-height: 1.5rem; color: var(--muted); }
#status.error, .error { color: var(--error); }
.error { min-height: 1.2rem; margin-top: 0.6rem; font-size: 0.9rem; }

#player-box { display: flex; flex-direction: column; gap: 0.6rem; }
#title { font-size: 1.05rem; font-weight: 600; }

video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
}

#player-meta { display: flex; align-items: center; gap: 0.8rem; }
select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid #35303f;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}
#mode-badge {
  font-size: 0.78rem;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}
#mode-badge.proxy { background: #d19a6633; color: #d19a66; }

#history-box h3 { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.4rem; }
#history { list-style: none; display: flex; flex-direction: column; gap: 0.2rem; }
#history a {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#history a:hover { background: var(--panel); }
#history .h-title { color: var(--accent); margin-right: 0.5rem; }
#history .h-url { color: var(--muted); font-size: 0.82rem; }
