/* bw-nostr — dark "steel/cogs" theme. System fonts only, no external assets. */
:root {
  --bg:        #14171b;
  --bg-2:      #1b1f25;
  --panel:     #20262d;
  --panel-2:   #272e36;
  --border:    #353d47;
  --text:      #d7dde4;
  --text-dim:  #8b95a1;
  --accent:    #5a9fd4;   /* cold steel blue */
  --accent-2:  #c8862a;   /* cog brass */
  --danger:    #d4685a;
  --ok:        #6ab04c;
  --radius:    6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

/* --- top nav bar --- */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  height: 52px;
  background: linear-gradient(var(--bg-2), var(--bg));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav .brand {
  font-weight: 700;
  letter-spacing: .5px;
  margin-right: 18px;
  color: var(--text);
}
.nav .brand b { color: var(--accent); }
.nav a.navlink {
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
}
.nav a.navlink:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.navlink.active { color: var(--text); background: var(--panel-2); }
.nav .spacer { flex: 1; }

/* --- content area --- */
.content {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 16px 60px;
}

h1, h2, h3 { color: var(--text); font-weight: 600; line-height: 1.25; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 18px 0 10px; }
.muted { color: var(--text-dim); }
.small { font-size: 12px; }

/* --- cards --- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0;
}
.card.pad-lg { padding: 22px 20px; }

/* --- buttons --- */
.btn {
  display: inline-block;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  font: inherit;
  cursor: pointer;
}
.btn:hover { background: #2f3741; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0c1117; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- inputs --- */
input, select, textarea {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; margin: 10px 0 4px; color: var(--text-dim); font-size: 12px; }

/* --- spoiler blur utility --- */
.spoiler {
  filter: blur(6px);
  cursor: pointer;
  transition: filter .15s ease;
  user-select: none;
}
.spoiler.revealed { filter: none; cursor: auto; user-select: auto; }

/* --- toast --- */
.toast-host {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 9px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  animation: toast-in .15s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* --- misc --- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.empty-state { text-align: center; color: var(--text-dim); padding: 48px 12px; }

/* --- header sign-in menu --- */
.signin-menu {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 50;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.signin-menu .btn { width: 100%; text-align: center; }
.signin-menu .row .btn { width: auto; }

/* --- shared utility classes used across views (graceful, were undefined) --- */
.warn { color: var(--accent-2); }
.danger { color: var(--danger); }
.btn-primary {
  display: inline-block; background: var(--accent); border: 1px solid var(--accent);
  color: #0c1117; font-weight: 600; border-radius: var(--radius); padding: 7px 14px;
  font: inherit; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-sm, .btn.small {
  display: inline-block; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; width: auto;
}
.btn.btn-ghost { background: transparent; }
.pill.primary { color: var(--ok); border-color: var(--ok); }
.pill.danger { color: var(--danger); border-color: var(--danger); }
.card.success { border-left: 3px solid var(--ok); }
.spacer { flex: 1; }
.dropzone {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--text-dim); cursor: pointer;
  background: var(--bg-2);
}
.dropzone.drag-over { border-color: var(--accent); color: var(--text); }
.replay-grid, .home-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.replay-card, .home-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
}
.replay-card:hover, .home-card:hover { border-color: var(--accent); }
.bw-notice, .bw-fallback { color: var(--text-dim); padding: 8px 0; }
.bw-fallback-title { color: var(--text); font-weight: 600; }
.bw-build-cols { display: flex; gap: 18px; flex-wrap: wrap; }
.bw-openbw-canvas { border: 1px solid var(--border); border-radius: var(--radius); background: #000; }

/* live OpenBW game-data HUD */
.bw-stats-table{width:100%;border-collapse:collapse;font-size:13px;margin:6px 0}
.bw-stats-table th,.bw-stats-table td{text-align:right;padding:2px 8px;border-bottom:1px solid var(--color-border-tertiary,#2226)}
.bw-stats-table th:first-child,.bw-stats-table td:first-child{text-align:left}
.bw-spark-row{display:flex;align-items:center;gap:8px;margin:3px 0}
.bw-spark-label{min-width:120px}
.bw-spark{flex:1;height:36px;background:#0d0f13;border-radius:4px}

/* replay theater */
.theater{display:flex;flex-direction:column;gap:8px;width:100%}
.theater:fullscreen{background:#0b0d11;padding:12px;overflow:auto}
.theater-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.theater-title{font-weight:500}
.theater-main{display:grid;grid-template-columns:1fr 300px;gap:10px;min-height:440px}
.theater-canvas{background:#000;border-radius:6px;overflow:hidden;display:flex;min-height:440px}
.theater-canvas canvas{width:100%;height:100%;display:block;image-rendering:pixelated}
.theater-sidebar{background:#0e1116;border-radius:6px;padding:8px;overflow:auto;max-height:74vh}
.theater-sidebar h4{margin:10px 0 4px}
.theater-transport{display:flex;align-items:center;gap:10px}
.theater-tcontrols{display:flex;align-items:center;gap:6px}
.theater-track{position:relative;flex:1;height:14px;background:#1a1e26;border-radius:7px;cursor:pointer}
.theater-fill{position:absolute;left:0;top:0;height:100%;background:#2e9e6b;border-radius:7px;width:0}
.theater-markers{position:absolute;inset:0}
.theater-marker{position:absolute;top:-3px;width:3px;height:20px;background:#f6c453;border-radius:2px;cursor:pointer;transform:translateX(-1px)}
.theater-composer{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.theater-note{flex:1;min-width:160px}
.theater-annos{font-size:13px}
.theater-anno{display:flex;gap:6px;align-items:center;padding:2px 0;cursor:pointer;border-bottom:1px solid var(--color-border-tertiary,#2226)}
.theater-anno-text{color:var(--color-text-secondary,#aab)}
.theater-pdot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}
@media(max-width:720px){.theater-main{grid-template-columns:1fr}}
