/* Trax styles */
* { box-sizing: border-box; margin: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0f1115; color: #e6e6e6; min-height: 100vh;
}
a { color: #7dd3fc; text-decoration: none; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: #161a22; border-bottom: 1px solid #232a36; padding: 12px 16px; position: sticky; top: 0;
}
.brand { font-size: 1.3rem; font-weight: 700; color: #fbbf24; }
.nav a { margin-left: 14px; color: #aab3c5; }
.nav a:hover { color: #fff; }
.footer { text-align: center; color: #556; font-size: .8rem; padding: 24px; }

.flash { padding: 10px 16px; border-radius: 8px; margin: 10px auto; max-width: 1100px; }
.flash.ok { background: #12321e; color: #86efac; }
.flash.err { background: #3a1414; color: #fca5a5; }

.card {
  background: #161a22; border: 1px solid #232a36; border-radius: 12px; padding: 20px; margin: 16px 0;
}
.empty { text-align: center; padding: 40px; color: #aab3c5; }

h2 { margin-bottom: 10px; }
.count { color: #667; font-size: .8em; }

/* toolbar / search */
.toolbar { margin: 12px 0; }
.searchform { display: flex; gap: 8px; flex-wrap: wrap; }
.searchform input[type=text] { flex: 1; min-width: 200px; }

input, select, textarea, button {
  font: inherit; background: #0f1218; color: #e6e6e6;
  border: 1px solid #2a3242; border-radius: 8px; padding: 9px 12px;
}
input:focus, textarea:focus, select:focus { outline: 1px solid #7dd3fc; }

.btn {
  display: inline-block; background: #222a3a; border: 1px solid #2a3242;
  border-radius: 8px; padding: 9px 14px; color: #e6e6e6; cursor: pointer; font: inherit;
}
.btn:hover { background: #2a3448; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { background: #7f1d1d; border-color: #7f1d1d; color: #fecaca; }

/* tag cloud */
.tagcloud { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.tag {
  display: inline-block; background: #1d2430; border: 1px solid #2a3242; color: #9db3d8;
  border-radius: 999px; padding: 3px 10px; font-size: .8rem;
}
.tag.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* song grid */
.songgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-top: 14px;
}
.songcard {
  display: flex; flex-direction: column; background: #161a22; border: 1px solid #232a36;
  border-radius: 12px; overflow: hidden; color: #e6e6e6; transition: border-color .15s, transform .15s;
}
.songcard:hover { border-color: #3b82f6; transform: translateY(-2px); }
.thumbwrap { position: relative; aspect-ratio: 16/9; background: #0c0e12; }
.thumbwrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nothumb { display: flex; align-items: center; justify-content: center; height: 100%; color: #445; }
.jambadge {
  position: absolute; top: 8px; right: 8px; background: #b45309; color: #fff;
  font-weight: 700; font-size: .7rem; padding: 3px 8px; border-radius: 6px;
}
.songinfo { display: flex; flex-direction: column; gap: 3px; padding: 12px; }
.stlabel { color: var(--c, #666); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.songcard .title { font-weight: 600; font-size: 1.02rem; line-height: 1.25; }
.artist { color: #99a3b5; font-size: .88rem; }
.meta { color: #778; font-size: .78rem; }
.tagsline { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* song page */
.songpagehead { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.songpage .artist { font-size: 1.05rem; }
.songpage .meta { margin: 6px 0; }
.songactions { display: flex; gap: 8px; align-items: flex-start; }
.embed { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.notes { margin-top: 14px; background: #10141c; border: 1px solid #232a36; border-radius: 10px; padding: 14px; }
.notes h3 { margin-bottom: 6px; font-size: .95rem; color: #9db3d8; }
.dim { opacity: .55; }

/* files (v2) */
.files { margin-top: 14px; border-top: 1px solid #333; padding-top: 10px; }
.files h3 { margin: 0 0 8px; font-size: .95rem; color: #9db3d8; }
.filerow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; flex-wrap: wrap; }
.filerow:hover { background: #1c2024; }
.filerow form { margin-left: auto; }
.ficon { font-size: 1.1rem; }
.fname { font-weight: 600; }
.uploadform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.uploadform input[type=text] { flex: 0 1 120px; }
.uploadform .meta { width: 100%; }

/* forms */
label { display: block; margin: 12px 0; font-size: .85rem; color: #99a3b5; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 4px; }
.formcard form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.formcard form .row label { flex: 1; min-width: 120px; }
.login-card { max-width: 420px; margin: 60px auto; text-align: center; }
.login-card input { width: 100%; margin: 14px 0; }
.login-card button { width: 100%; }

@media (max-width: 640px) {
  .songgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .songactions { width: 100%; }
}
