:root {
  --bg: #0f0f10; --panel: #1b1b1e; --panel2: #26262b;
  --text: #f1f1f3; --muted: #9b9ba3; --accent: #ff3b30; --line: #2c2c33;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
button { cursor: pointer; font: inherit; }
img { display: block; }

#login {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-box {
  max-width: 360px; text-align: center; background: var(--panel);
  padding: 32px 24px; border-radius: 18px; border: 1px solid var(--line);
}
.login-box .logo { font-size: 40px; color: var(--accent); }
.login-box h1 { margin: 8px 0 4px; font-size: 22px; }
.login-box p { color: var(--muted); font-size: 14px; }
.hint { color: var(--accent); min-height: 1em; }
#tg-login { display: flex; justify-content: center; margin: 16px 0; }

#app { max-width: 760px; margin: 0 auto; padding: 0 16px env(safe-area-inset-bottom); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 2px; position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand { font-weight: 700; color: var(--accent); }
.user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.user img { width: 26px; height: 26px; border-radius: 50%; }
#logout { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 4px 10px; }

.player-wrap { background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
#player { width: 100%; max-height: 60vh; background: #000; display: block; }
.now { padding: 10px 12px; background: var(--panel); }
.now-title { font-weight: 600; }
.now-author { color: var(--muted); font-size: 13px; }

.input-row { display: flex; gap: 8px; margin: 14px 0; }
#url {
  flex: 1; background: var(--panel2); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 11px 12px;
}
#playBtn { background: var(--accent); border: none; color: #fff; border-radius: 10px; padding: 0 18px; font-weight: 600; }

.hist-h { font-size: 13px; color: var(--muted); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.item {
  display: flex; gap: 12px; padding: 10px; align-items: center;
  border: 1px solid var(--line); background: var(--panel); border-radius: 12px; margin-bottom: 10px;
}
.item .thumb { width: 120px; height: 68px; object-fit: cover; border-radius: 8px; background: #000; flex: none; cursor: pointer; }
.item .meta { flex: 1; min-width: 0; cursor: pointer; }
.item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .a { color: var(--muted); font-size: 13px; }
.item .bar { height: 4px; background: var(--panel2); border-radius: 2px; margin: 6px 0 4px; overflow: hidden; }
.item .bar span { display: block; height: 100%; background: var(--accent); }
.item .sub { font-size: 12px; color: var(--muted); }
.item .del { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; flex: none; width: 32px; }
@media (max-width: 520px) {
  .item .thumb { width: 92px; height: 52px; }
}
