/* Demolition of Prelims — game stylesheet.
 * Mobile-first. Palette: warm amber on dark graphite. */

* { box-sizing: border-box; min-width: 0; }
html, body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #151515;
  color: #e8e8e8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#root { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ---------- picker (entry screen) ---------- */

.picker { max-width: 480px; margin: 8vh auto 4vh; padding: 0 1.5rem; }
.picker h1 {
  font-size: 20px;
  color: #d4a373;
  letter-spacing: 0.6px;
  margin: 0 0 4px;
  font-weight: 600;
}
.picker .tagline { color: #777; font-size: 12px; letter-spacing: 0.4px; margin-bottom: 1rem; }
.picker-hint {
  color: #b0a088; font-size: 12.5px; line-height: 1.45; letter-spacing: 0.2px;
  margin: 0 0 14px; padding: 8px 10px;
  background: #1a1614; border: 1px solid #2a241c; border-radius: 3px;
}
.picker-hint.err { color: #d8b0b0; background: #201616; border-color: #6b3a3a; }
.user-list { display: flex; flex-direction: column; gap: 6px; }
.user-btn[disabled] { opacity: 0.5; cursor: default; }
.user-btn {
  background: #1c1c1c; color: #e8e8e8; border: 1px solid #2e2e2e; border-left: 3px solid #444;
  padding: 14px 16px; font: inherit; font-size: 14px; text-align: left; cursor: pointer; border-radius: 3px;
  transition: border-color 0.15s, background 0.15s;
  min-height: 52px;
}
.user-btn:active { border-color: #d4a373; border-left-color: #d4a373; background: #1f1a14; }

/* ---------- topbar + nav ---------- */

header.topbar {
  background: #1a1a1a;
  border-bottom: 1px solid #262626;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 12px;
}
.topbar .brand {
  color: #d4a373;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: 13px;
  white-space: nowrap;
}
.topbar .meta {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #888;
  font-size: 11.5px;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.topbar .meta > span:first-child {
  display: inline-flex; align-items: center;
  min-width: 0;
}
.topbar .who {
  color: #d4a373;
  max-width: 9ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}
@media (max-width: 430px) {
  .topbar .sync-text { display: none; }
  .topbar .who { max-width: 7ch; }
  .topbar .brand { font-size: 12px; letter-spacing: 0.3px; }
}
.topbar .sync-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #666; display: inline-block;
  margin-right: 4px; vertical-align: middle;
  flex-shrink: 0;
}
.topbar .sync-dot.synced { background: #5fa04f; }
.topbar .sync-dot.offline { background: #c05858; }
.topbar .sync-text { white-space: nowrap; }

/* Sticky warning banner shown when the server has rejected our writes for
   lack of a biometric session. Tappable anywhere to trigger re-auth. */
.auth-banner {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: #2a2016; color: #e0c690; border-bottom: 1px solid #6b4a1a;
  font-size: 12.5px; line-height: 1.3; letter-spacing: 0.3px;
  cursor: pointer;
}
.auth-banner-text { flex: 1; }
.auth-banner-btn {
  background: #6b4a1a; color: #fff; border: 1px solid #8a5a2b;
  padding: 6px 14px; border-radius: 3px; font: inherit; font-size: 12px;
  cursor: pointer; letter-spacing: 0.4px; min-height: 32px;
}
.auth-banner-btn:hover { background: #8a5a2b; }
.auth-banner-btn[disabled] { opacity: 0.5; cursor: default; }

.topbar details.menu { position: relative; }
.topbar details.menu {
  flex-shrink: 0;
  margin-left: 4px;
}
.topbar details.menu summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 3px;
  color: #888;
  font-size: 18px;
  line-height: 1;
  user-select: none;
  min-width: 28px;
  text-align: center;
}
.topbar details.menu summary::-webkit-details-marker { display: none; }
.topbar details.menu[open] summary { color: #d4a373; background: #2a2016; }
.topbar .menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 4px;
  min-width: 140px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  z-index: 50;
}
.topbar .menu-panel a,
.topbar .menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: none;
  color: #e8e8e8;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 3px;
  text-decoration: none;
}
.topbar .menu-panel a:hover,
.topbar .menu-panel button:hover {
  background: #2a2016; color: #d4a373;
}
.topbar .menu-panel hr {
  border: none; border-top: 1px solid #262626; margin: 4px 0;
}

.topbar nav {
  display: flex;
  gap: 2px;
  padding: 4px 10px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid #242424;
}
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  color: #888;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 3px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar nav a:active { background: #222; }
.topbar nav a.active {
  color: #d4a373; background: #2a2016; border-color: #5a4228;
}

/* ---------- view container ---------- */

main.view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px 24px;
  -webkit-overflow-scrolling: touch;
}
main.view.view-study, main.view.view-test { padding: 0; }

.view-wrap { max-width: 720px; margin: 0 auto; min-width: 0; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
}

/* ---------- home view ---------- */

.home-wrap { max-width: 720px; margin: 0 auto; padding: 14px 14px 40px; }
.home-wrap h2 {
  color: #d4a373; font-size: 12px; letter-spacing: 0.6px; font-weight: 700;
  margin: 22px 0 8px; text-transform: uppercase;
}
.home-wrap h2:first-child { margin-top: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
}
@media (min-width: 600px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
}
.stat {
  background: #1c1c1c; border: 1px solid #2e2e2e; border-left: 3px solid #444;
  border-radius: 3px; padding: 10px 12px;
  min-width: 0;
}
.stat .label { font-size: 10px; color: #888; letter-spacing: 0.5px; text-transform: uppercase; }
.stat .value { font-size: 20px; color: #e8e8e8; font-weight: 600; margin-top: 4px; line-height: 1.1; }
.stat .delta { font-size: 10.5px; color: #5fa04f; margin-top: 3px; }
.stat.accent { border-left-color: #d4a373; }
.stat.accent .value { color: #d4a373; }

.cta-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cta {
  background: #2a2016; color: #d4a373; border: 1px solid #8a5a2b;
  padding: 10px 18px; border-radius: 3px; font: inherit; font-size: 13px;
  cursor: pointer; letter-spacing: 0.4px; text-decoration: none; display: inline-block;
  min-height: 40px;   /* comfortable tap target */
}
.cta:active { background: #3a2c18; }
.cta.secondary { background: #1c1c1c; color: #bbb; border-color: #333; }
.cta.secondary:active { background: #242424; color: #e8e8e8; }

/* ---------- study surface (ported from pyq_interface.html) ---------- */

.study-header {
  background: #1a1a1a;
  border-bottom: 1px solid #262626;
  padding: 8px 12px;
  flex-shrink: 0;
}
#counts {
  display: flex;
  gap: 6px;
  font-size: 10.5px;
  color: #bbb;
  margin-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#counts::-webkit-scrollbar { display: none; }
#counts .c {
  display: inline-flex; padding: 3px 8px; border-radius: 3px;
  background: #222; border: 1px solid #333; white-space: nowrap; flex-shrink: 0;
}
#counts .c.covered   { color: #9bd68a; border-color: #3e5c35; }
#counts .c.partial   { color: #e8c46a; border-color: #5c4d2b; }
#counts .c.uncovered { color: #e37676; border-color: #5c3030; }
#counts .c.claimed   { color: #d4a373; border-color: #5a4228; background: #2a2016; }
#counts .c .n { font-weight: 600; color: inherit; margin-left: 3px; }

#filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; align-items: stretch; }
@media (min-width: 640px) {
  #filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
}
#filters label {
  font-size: 10.5px; color: #888; letter-spacing: 0.4px; text-transform: uppercase;
  display: flex; flex-direction: column; gap: 3px;
}
#filters select, #filters input {
  background: #222; color: #e8e8e8; border: 1px solid #333;
  padding: 8px 8px; border-radius: 3px; font-size: 13px; font-family: inherit;
  min-height: 36px;
  width: 100%;
}
@media (min-width: 640px) {
  #filters label { flex-direction: row; align-items: center; gap: 6px; }
  #filters select, #filters input { width: auto; min-width: 120px; }
  #filters input { min-width: 180px; }
}
#filters select:focus, #filters input:focus { outline: none; border-color: #8a5a2b; }
#filters button {
  background: #2a2016; color: #d4a373; border: 1px solid #8a5a2b;
  padding: 8px 12px; border-radius: 3px; font-size: 12px; cursor: pointer;
  letter-spacing: 0.4px; font-family: inherit;
  min-height: 36px;
  grid-column: span 2;
}
@media (min-width: 640px) { #filters button { grid-column: auto; } }
#filters button:active { background: #3a2c18; }

#list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 40px;
  -webkit-overflow-scrolling: touch;
}
#list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }

.pyq-card {
  background: #1c1c1c;
  border: 1px solid #2e2e2e;
  border-left: 3px solid #444;
  border-radius: 4px;
  padding: 10px 12px;
  transition: border-color 0.15s;
}
.pyq-card.status-covered   { border-left-color: #5fa04f; }
.pyq-card.status-partial   { border-left-color: #c49a3c; }
.pyq-card.status-uncovered { border-left-color: #c05858; }
.pyq-card.status-uncurated { border-left-color: #444; }
.pyq-card.claimed { background: #1a1f18; border-color: #3a4d32; border-left-color: #d4a373; }
.pyq-card.highlight { border-color: #d4a373; box-shadow: 0 0 18px rgba(212,163,115,0.25); }

.pyq-header {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-bottom: 6px; font-size: 11px;
}
.badge {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  background: #2a2a2a; color: #bbb; border: 1px solid #333; letter-spacing: 0.3px;
}
.badge.year { color: #d4a373; border-color: #5a4228; background: #2a2016; font-weight: 600; }
.badge.subject { color: #9bb0c7; }
.badge.era { background: #2a2216; color: #c9a27a; border-color: #4a3a22; }
.badge.era .triage { color: #888; font-weight: 400; margin-left: 3px; font-size: 10px; }
.badge.pyqid { color: #666; font-family: ui-monospace, monospace; margin-left: auto; }
.badge.staged { color: #c9a6db; background: #2a1f33; border-color: #4a3a5c; }

.status-pill {
  font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 2px; font-weight: 600;
}
.status-pill.covered   { background: #1f3019; color: #9bd68a; }
.status-pill.partial   { background: #2f2611; color: #e8c46a; }
.status-pill.uncovered { background: #2f1818; color: #e37676; }
.status-pill.uncurated { background: #262626; color: #888; }

.pyq-question {
  font-size: 13.5px; line-height: 1.55; color: #e8e8e8;
  margin: 4px 0 8px; white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pyq-options {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 12.5px; color: #bbb;
  margin-bottom: 6px; padding: 4px 0;
}
.pyq-options .opt {
  padding: 3px 8px; border-radius: 2px; display: flex; gap: 8px;
  overflow-wrap: anywhere;
}
.pyq-options .opt > span:last-child { min-width: 0; }
.pyq-options .opt .key {
  font-weight: 600; color: #888; flex-shrink: 0; width: 18px;
}
.pyq-options .opt.correct {
  background: rgba(95,160,79,0.1); color: #c8e8b8;
  border-left: 2px solid #5fa04f; padding-left: 6px;
}
.pyq-options .opt.correct .key { color: #9bd68a; }

.pyq-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #2a2a2a;
}
.uncurated-note { font-size: 12px; color: #777; font-style: italic; letter-spacing: 0.3px; }
.status-note { font-size: 12px; color: #c49a3c; margin-bottom: 6px; font-style: italic; }
.status-note.uncovered { color: #c05858; }

.pyq-actions { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.mark-btn {
  background: #2a2016; color: #d4a373; border: 1px solid #5a4228;
  padding: 8px 14px; font: inherit; font-size: 11px; border-radius: 3px;
  cursor: pointer; letter-spacing: 0.4px; text-transform: uppercase;
  min-height: 36px;
}
.mark-btn:active { background: #3a2c18; border-color: #8a5a2b; }
.mark-btn.claimed {
  background: #1a2618; color: #9bd68a; border-color: #3a5c2b;
  cursor: default;
}
.claim-note { font-size: 11px; color: #666; letter-spacing: 0.3px; }

.node-cards { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.node-card {
  background: #222; border: 1px solid #2e2e2e; border-left: 3px solid #555;
  border-radius: 3px; padding: 7px 11px;
}
.node-card .nc-head {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-bottom: 3px; font-size: 11px;
}
.node-card .nc-label { font-weight: 600; color: #e8e8e8; font-size: 13px; margin-right: 8px; overflow-wrap: anywhere; }
.node-card .nc-detail { font-size: 12.5px; color: #c0c0c0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.node-card.staged { border-left-style: dashed; border-left-color: #a87cc0; background: #201a26; }
.node-card.staged .nc-label::before { content: "◆ "; color: #a87cc0; font-size: 11px; }

#empty {
  text-align: center; color: #666; padding: 40px; font-size: 13px; font-style: italic;
}

/* ---------- placeholders ---------- */

.placeholder {
  max-width: 600px; margin: 10vh auto; text-align: center;
  color: #888; font-size: 13px; padding: 20px;
}
.placeholder h2 { color: #d4a373; letter-spacing: 0.6px; font-size: 14px; text-transform: uppercase; }
.placeholder p { max-width: 50ch; margin: 1rem auto; line-height: 1.6; }

/* ---------- throne / badge pills ---------- */

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.throne-pill {
  background: #2a2016; color: #d4a373; border: 1px solid #5a4228;
  padding: 3px 10px; border-radius: 12px; font-size: 11px;
  letter-spacing: 0.3px; text-transform: lowercase;
}
.badge-pill {
  background: #1a2618; color: #9bd68a; border: 1px solid #3a5c2b;
  padding: 3px 10px; border-radius: 12px; font-size: 11px;
  letter-spacing: 0.3px;
}

/* ---------- test runner ---------- */

.test-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; font-size: 12px;
}
.test-area { color: #d4a373; font-weight: 600; letter-spacing: 0.4px; }
.test-progress { color: #888; font-variant-numeric: tabular-nums; }
.test-bar {
  height: 3px; background: #262626; border-radius: 2px; overflow: hidden;
  margin-bottom: 14px;
}
.test-bar-fill {
  height: 100%; background: linear-gradient(90deg, #8a5a2b 0%, #d4a373 100%);
  transition: width 0.3s;
}
.test-card {
  background: #1c1c1c; border: 1px solid #2e2e2e; border-left: 3px solid #d4a373;
  border-radius: 4px; padding: 14px 16px;
}
.test-opts {
  display: flex; flex-direction: column; gap: 4px;
  margin: 10px 0 16px;
}
.test-opt {
  padding: 12px 14px; border-radius: 3px; font-size: 14px;
  background: #222; border: 1px solid #2e2e2e; color: #c8c8c8;
  display: flex; gap: 10px;
  min-height: 48px;
  align-items: center;
}
.test-opt .key { color: #888; font-weight: 600; width: 24px; flex-shrink: 0; }
.test-opt.pickable { cursor: pointer; transition: border-color 0.1s, background 0.1s; }
.test-opt.pickable:active { border-color: #8a5a2b; background: #2a2016; }
.test-opt.picked { border-color: #d4a373; background: #2a2016; color: #e8e8e8; }
.test-opt.picked .key { color: #d4a373; }
.test-opt.correct {
  background: rgba(95,160,79,0.15); color: #c8e8b8;
  border-color: #5fa04f;
}
.test-opt.correct .key { color: #9bd68a; }
.test-opt.correct::after { content: "✓"; color: #9bd68a; font-weight: 600; margin-left: auto; }
.test-opt.wrong {
  background: rgba(192,88,88,0.1); color: #e6b4b4;
  border-color: #c05858;
}
.test-opt.wrong .key { color: #e37676; }
.test-opt.wrong::after { content: "✗"; color: #e37676; font-weight: 600; margin-left: auto; }

.reveal { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #333; }
.reveal-heading {
  font-size: 11px; letter-spacing: 0.5px; color: #888;
  text-transform: uppercase; margin-bottom: 8px;
}

.test-actions { margin-top: 14px; display: flex; gap: 10px; }
.test-actions .cta:disabled {
  opacity: 0.4; cursor: not-allowed; background: #1c1c1c; color: #666; border-color: #333;
}

/* ---------- test summary ---------- */

.summary-wrap { max-width: 640px; margin: 24px auto; padding: 0 16px; }
.summary-wrap h2 {
  color: #d4a373; font-size: 16px; letter-spacing: 0.6px;
  text-transform: uppercase; margin: 0 0 18px;
}
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px;
}
.badge-pop {
  background: #1a2618; color: #9bd68a; border: 1px solid #3a5c2b;
  padding: 12px 16px; border-radius: 4px;
  margin-top: 16px; text-align: center; font-size: 13px;
  letter-spacing: 0.3px;
}
.badge-pop.hof {
  background: #2a2016; color: #d4a373; border-color: #8a5a2b;
  font-size: 14px; font-weight: 600; letter-spacing: 0.6px;
}

/* ---------- test picker disabled row ---------- */

.lb-table tr.disabled td { color: #555; }
.lb-table .area-name { color: inherit; }
.lb-table button[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- teams ---------- */

.team-list { display: flex; flex-direction: column; gap: 10px; }
.team-card {
  background: #1c1c1c; border: 1px solid #2e2e2e; border-left: 3px solid #d4a373;
  border-radius: 4px; padding: 12px 16px;
}
.team-card.dissolved {
  border-left-color: #555; opacity: 0.65;
}
.team-card.muted-card { border-left-color: #444; background: #181818; }
.team-card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 8px;
  flex-wrap: wrap;
}
.team-name {
  font-size: 13px; color: #e8e8e8; font-weight: 600; letter-spacing: 0.2px;
  overflow-wrap: anywhere;
  min-width: 0;
}
.team-stats {
  display: flex; gap: 10px; font-size: 11px; color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}
.team-stats > span:first-child { color: #d4a373; font-weight: 600; }
.team-age { font-variant-numeric: tabular-nums; }
.team-members {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
  border-top: 1px dashed #2a2a2a; padding-top: 8px;
}
.team-member {
  display: flex; justify-content: space-between; font-size: 12px;
  padding: 2px 0;
}
.team-member .name { color: #c8c8c8; }
.team-member .pts { color: #888; font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; }
.team-member.crossed .name { color: #e8c46a; }
.team-member.crossed .pts { color: #e8c46a; }
.team-member.crossed .name::after { content: " ◈"; color: #e8c46a; }
.team-dissolved-note {
  margin-top: 10px; padding: 6px 10px; border-radius: 3px;
  background: #242020; color: #c49a3c; font-size: 11px;
  border: 1px solid #4a3a2b; letter-spacing: 0.3px;
}

.team-form {
  background: #1c1c1c; border: 1px solid #2e2e2e; border-radius: 4px;
  padding: 14px 16px;
}
.team-checks {
  display: grid; grid-template-columns: 1fr;
  gap: 6px; margin-bottom: 14px;
}
@media (min-width: 600px) {
  .team-checks { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
}
.team-check {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #222; border: 1px solid #2e2e2e; border-radius: 3px;
  cursor: pointer; font-size: 13px; user-select: none;
  min-height: 44px;
}
.team-check input[type=checkbox] { width: 18px; height: 18px; }
.team-check:hover { border-color: #5a4228; }
.team-check input[type=checkbox] { margin: 0; accent-color: #d4a373; }
.team-check input[type=checkbox]:checked + span { color: #d4a373; font-weight: 600; }
.team-check-pts { margin-left: auto; color: #666; font-variant-numeric: tabular-nums; font-size: 11px; }

.team-pill {
  background: #1f2a2a; color: #7fc8c0; border: 1px solid #2e4e4e;
  padding: 3px 10px; border-radius: 12px; font-size: 11px;
  letter-spacing: 0.3px;
}

/* ---------- leaderboard + data tables ---------- */

.lb-table {
  margin: 0 auto;
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;  /* forces horizontal scroll on small viewports via .table-scroll */
  font-size: 13px;
}
.lb-table th, .lb-table td {
  text-align: left; padding: 10px 10px;
  border-bottom: 1px solid #242424;
  white-space: nowrap;
}
.lb-table th { color: #888; font-size: 10.5px; letter-spacing: 0.5px; text-transform: uppercase; font-weight: 500; }
.lb-table td { color: #e8e8e8; }
.lb-table tr.me td { color: #d4a373; background: #1a1612; }
.lb-table td.num { font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; }
.lb-table .area-name { white-space: normal; }

/* ---------- misc ---------- */

.muted { color: #777; }
.loading { color: #888; padding: 2rem; text-align: center; font-style: italic; }

/* ---------- debug / diagnostic panel ---------- */

.dbg-block {
  background: #1c1c1c; border: 1px solid #2e2e2e; border-left: 3px solid #555;
  border-radius: 3px; padding: 10px 12px; margin-bottom: 10px;
  font-size: 12.5px; line-height: 1.6; color: #c8c8c8;
}
.dbg-block h3 {
  color: #d4a373; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase;
  margin: 0 0 6px; font-weight: 700;
}
.dbg-block code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11.5px;
  background: #111;
  padding: 1px 5px;
  border-radius: 2px;
  color: #e8c46a;
}
.dbg-block div { margin: 2px 0; overflow-wrap: anywhere; }
.dbg-block table { margin-top: 4px; font-size: 11.5px; }
.dbg-block b { color: #e8e8e8; }
