/* forsgrimr — same tokens and auth-page styles as the asgardr dashboard
   (asgardr/server/web/style.css); keep the two visually in lockstep. */
:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1c2430;
  --border: #2a323d;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #4c8bf5;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #12171e, #0e1116);
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 10px #00000040;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: .3px;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .rune { color: var(--accent); font-size: 20px; }
.brand .sep { color: var(--border); }
.brand .band { font-family: var(--mono); color: var(--muted); font-weight: 500; }
.brand a { color: inherit; text-decoration: none; }
.topbar .actions { display: flex; align-items: center; gap: 8px; flex: none; }

.wrap { max-width: 860px; margin: 0 auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 0;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

.row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid #ffffff08; min-width: 0;
}
.row:last-child { border-bottom: 0; }
.row .k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .v { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right;
  white-space: nowrap; flex: none; display: flex; align-items: center; gap: 8px; }
.row.link { cursor: pointer; }
.row.link:hover .k { color: var(--accent); }
.row.dim .k { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.ok .dot { background: var(--ok); } .pill.ok { color: var(--ok); border-color: #3fb95040; }
.pill.warn .dot { background: var(--warn); } .pill.warn { color: var(--warn); border-color: #d2992240; }
.pill.bad .dot { background: var(--bad); } .pill.bad { color: var(--bad); border-color: #f8514940; }
.chip {
  font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--muted);
}
.chip.admin { color: var(--accent); border-color: #4c8bf555; }

/* ---- auth pages (verbatim from asgardr) ---- */
.center { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 34px; width: 100%; max-width: 380px; text-align: center;
}
.card .rune { font-size: 40px; color: var(--accent); }
.card h1 { font-size: 22px; margin: 12px 0 4px; }
.card p { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
button { font-family: inherit; }
button.primary {
  width: 100%; padding: 12px 16px; font-size: 15px; font-weight: 600;
  color: #fff; background: var(--accent); border: 0; border-radius: 9px; cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }
button.primary:disabled { opacity: .6; cursor: default; }
button.primary.slim { width: auto; padding: 8px 14px; font-size: 13px; }
.msg { margin-top: 16px; font-size: 13px; min-height: 18px; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; text-decoration: none;
  white-space: nowrap; }
.ghost:hover { color: var(--text); }
.ghost.on { color: var(--accent); border-color: var(--accent); background: #4c8bf51a; }
.ghost.danger:hover { color: var(--bad); border-color: #f8514955; }
.ghost.tiny { padding: 3px 8px; font-size: 11px; border-radius: 6px; }
.ghost:disabled { opacity: .4; cursor: default; }
.field { width: 100%; padding: 11px 13px; margin: 0 0 10px; font-size: 15px;
  color: var(--text); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 9px; font-family: inherit; }
.field:focus { outline: none; border-color: var(--accent); }
.field.slim { padding: 7px 10px; font-size: 13px; margin: 0; width: auto; min-width: 0; flex: 1; }
.form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* ---- player ---- */
body.player-open { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body.player-open #library { display: none; }
#player { display: none; flex: 1 1 auto; min-height: 0; flex-direction: column; }
body.player-open #player { display: flex; }

.songbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: var(--panel);
}
.songbar .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; font-size: 14px; }
.songbar .pos { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px;
  color: var(--muted); white-space: nowrap; }
.songbar .pos b { color: var(--text); font-weight: 650; }

/* The score is black-on-white by nature; keep it a bright sheet inside the
   dark chrome (like paper on a dark music stand) rather than inverting glyphs. */
#viewport { flex: 1 1 0; min-height: 0; overflow: auto; background: #f4f1ea; position: relative;
  -webkit-overflow-scrolling: touch; }
#score { min-height: 100%; }
#overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: #0e1116e6; color: var(--muted); font-size: 13px; z-index: 5; padding: 20px; }
#overlay .big { font-family: var(--mono); font-size: 22px; color: var(--text); }
.at-cursor-bar { background: #4c8bf526; }
.at-cursor-beat { background: var(--accent); width: 3px; }
.at-selection div { background: #d2992233; }
.at-highlight * { fill: #1d5fd6; stroke: #1d5fd6; }

.transport {
  border-top: 1px solid var(--border); background: var(--panel);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px;
}
.transport .line { display: flex; align-items: center; gap: 6px; }
.transport .line.scroll { overflow-x: auto; scrollbar-width: none; }
.transport .line.scroll::-webkit-scrollbar { display: none; }
.tbtn {
  flex: none; min-width: 44px; height: 40px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--mono); white-space: nowrap;
}
.tbtn.play { background: var(--accent); border-color: var(--accent); color: #fff; min-width: 56px; font-size: 16px; }
.tbtn.on { color: var(--accent); border-color: var(--accent); background: #4c8bf51a; }
.tbtn:disabled { opacity: .4; cursor: default; }
.tempo { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tempo input { flex: 1; min-width: 0; accent-color: var(--accent); }
.tempo .val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; width: 78px;
  text-align: right; white-space: nowrap; }
.tempo .val .unit { color: var(--muted); font-size: 11px; }

.songbar, .transport, .drawer, .banner, .roomstrip, .topbar { flex: none; }
.drawer { display: none; border-top: 1px solid var(--border); background: var(--panel);
  max-height: 40vh; overflow-y: auto; padding: 6px 12px; }
.drawer.open { display: block; }
.trk { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #ffffff08; }
.trk:last-child { border-bottom: 0; }
.trk .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.trk .name.shown { color: var(--accent); }
.trk .tbtn { height: 30px; min-width: 34px; font-size: 11px; padding: 0 8px; }
.trk .tbtn.mute.on { color: var(--bad); border-color: #f8514955; background: #f851491a; }
.trk .tbtn.solo.on { color: var(--warn); border-color: #d2992255; background: #d299221a; }

.banner { display: none; padding: 8px 12px; font-size: 13px; text-align: center; cursor: pointer;
  background: #d299221a; color: var(--warn); border-bottom: 1px solid #d2992240; }
.banner.show { display: block; }

table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th, table.list td { padding: 8px 8px; text-align: left; border-bottom: 1px solid #ffffff0d; vertical-align: middle; }
table.list th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
table.list td.mono, table.list td.num { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
table.list .num { text-align: right; }
table.list tbody tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }
.linkbox { font-family: var(--mono); font-size: 12px; word-break: break-all; padding: 10px;
  border: 1px solid #3fb95040; border-radius: 8px; background: #3fb9500d; margin-top: 10px; display: none; }
.linkbox.show { display: block; }
.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 6px 0 16px; }

.roomstrip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12px;
  border-bottom: 1px solid var(--border); background: var(--panel-2); }
.roomstrip .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* song rows: name on its own line on a phone, meta beneath */
.row.song { flex-wrap: wrap; row-gap: 2px; }
.row.song .k { flex: 1 1 100%; white-space: normal; font-weight: 600; font-size: 14px; }
.row.song .v { flex: 1; justify-content: flex-start; }
.row.song .v .ghost { margin-left: auto; }
@media (min-width: 700px) {
  .row.song { flex-wrap: nowrap; }
  .row.song .k { flex: 1 1 auto; }
  .row.song .v { flex: none; }
}
#inv-name { flex: 1 1 100%; order: -1; }
