:root {
  --bg: #14161b;
  --bg-card: #1e2129;
  --bg-elevated: #262a34;
  --text: #f0f1f3;
  --text-muted: #9aa0ac;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --border: #33384344;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.topbar h1 { font-size: 1.2rem; margin: 0; }

.link-muted { color: var(--text-muted); font-size: 0.9rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 44px;
}

.btn:hover { background: var(--accent-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-small { padding: 8px 14px; font-size: 0.85rem; min-height: 36px; }

.btn-google {
  background: #fff;
  color: #222;
  font-weight: 600;
}

/* login */

.login-body {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  text-align: center;
  max-width: 340px;
  padding: 32px;
  background: var(--bg-card);
  border-radius: var(--radius);
}

.login-card p { color: var(--text-muted); margin-bottom: 24px; }

/* upload */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  margin-bottom: 16px;
}

.drop-zone.dragover { border-color: var(--accent); background: var(--bg-elevated); }

.drop-zone .hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 10px; }

.upload-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.upload-row {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
}

.upload-row .name { display: flex; justify-content: space-between; margin-bottom: 6px; word-break: break-all; }

.upload-row .bar-track { background: var(--bg-elevated); border-radius: 6px; height: 6px; overflow: hidden; }

.upload-row .bar-fill { background: var(--accent); height: 100%; width: 0%; transition: width 0.15s; }

.upload-row.error .bar-fill { background: #e05555; }

.upload-row.done .bar-fill { background: #4caf7d; }

/* library grid */

h2 { margin-top: 8px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  font-size: 2rem;
  color: var(--text-muted);
}

.card-thumb--video { color: var(--accent); }
.card-thumb--audio { color: #d99a4e; }

.card-body { padding: 10px 12px; flex: 1; }

.card-title {
  margin: 0 0 4px;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta { margin: 0; font-size: 0.75rem; color: var(--text-muted); }

.card-actions { display: flex; gap: 8px; padding: 0 12px 12px; }

/* player */

.player-wrap { max-width: 900px; margin: 0 auto; padding: 12px 12px 40px; }

.player-title {
  font-size: 1rem;
  color: var(--text-muted);
  word-break: break-all;
  margin: 4px 0 12px;
}

.player { background: #000; border-radius: var(--radius); overflow: hidden; }

#media { width: 100%; display: block; max-height: 70vh; background: #000; }

.audio-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  font-size: 4rem;
  color: var(--text-muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--bg-card);
}

.ctrl-btn {
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.ctrl-btn:active { background: var(--accent); }

.ctrl-btn--main { min-width: 56px; min-height: 56px; font-size: 1.3rem; background: var(--accent); color: #fff; }

.ctrl-btn--small { min-width: 40px; min-height: 40px; border-radius: 8px; font-size: 0.85rem; }

.ctrl-btn--small.active { background: var(--accent); color: #fff; }

.seek-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 100%;
  order: 5;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.seek-row input[type="range"] {
  flex: 1;
  height: 32px;
  accent-color: var(--accent);
}

.side-controls { display: flex; gap: 8px; margin-left: auto; }

@media (min-width: 640px) {
  .seek-row { order: 0; flex: 1; }
  .side-controls { order: 6; margin-left: 0; }
}
