/* HUM Credits — game-style HUD. One deliberate dark theme. */
:root {
  --bg: #0b1029;
  --panel: #131a3d;
  --panel-2: #1a2350;
  --line: #2b3a7a;
  --text: #e9edff;
  --muted: #9aa6d6;
  --cyan: #2ee6d6;
  --gold: #ffc145;
  --good: #3ddc84;
  --warn: #ffb020;
  --bad: #ff5c7a;
  --display: 'Orbitron', Verdana, sans-serif;
  --body: 'Rubik', 'Segoe UI', Arial, sans-serif;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(ellipse at 20% -10%, #1c2766 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text); font: 15px/1.5 var(--body); min-height: 100vh;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: .5px; margin: 0; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; color: var(--text); }
h3 { font-size: 14px; font-weight: 700; }
.num, td.num, .kpi .v { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--display); font-size: 11px; letter-spacing: 3px; color: var(--cyan); text-transform: uppercase; font-weight: 700; }

/* Shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, #0f1638, #0b1029); border-right: 1px solid var(--line);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 44px; height: 44px; }
.brand b { font-family: var(--display); font-weight: 900; font-size: 26px; color: var(--gold); letter-spacing: 4px; text-shadow: 0 0 18px rgba(255,193,69,.4); }
.brand small { display: block; font-family: var(--display); font-size: 9px; letter-spacing: 3px; color: var(--cyan); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 9px 12px; border-radius: 10px;
  font-weight: 500; border: 1px solid transparent;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a.on { color: var(--text); background: var(--panel-2); border-color: var(--line); box-shadow: inset 3px 0 0 var(--cyan); }
.nav .sep { font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: #5f6aa0; margin: 12px 12px 2px; }
.side .who { margin-top: auto; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.side .who b { color: var(--text); display: block; }
.main { padding: 28px max(20px, env(safe-area-inset-right, 0px)) 48px max(28px, env(safe-area-inset-left, 0px)); min-width: 0; }
.top { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.top .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Panels */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: 2fr 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card > h2 { margin-bottom: 12px; }
.card .sub { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.kpi .l { font-family: var(--display); font-size: 10px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.kpi .v { font-family: var(--display); font-size: 28px; font-weight: 800; margin-top: 6px; }
.kpi .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi.gold { border-color: rgba(255,193,69,.6); box-shadow: 0 0 28px rgba(255,193,69,.12); }
.kpi.gold .v { color: var(--gold); }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* XP bars */
.xp { height: 10px; background: #0a0f28; border-radius: 99px; overflow: hidden; border: 1px solid #22306a; }
.xp > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--gold)); border-radius: 99px; }
.xp.done > i { background: linear-gradient(90deg, var(--good), var(--gold)); }
.xp.short > i { background: linear-gradient(90deg, #5a6aa8, var(--warn)); }
.xprow { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 4px 14px; align-items: center; }
.xprow + .xprow { margin-top: 12px; }
.xprow .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xprow .v { text-align: right; color: var(--gold); font-family: var(--display); font-size: 13px; font-weight: 700; }
.xprow .xp, .xprow .m { grid-column: 1 / -1; }
.xprow .m { font-size: 12px; color: var(--muted); }

/* Pills & badges */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.pill.good { color: var(--good); border-color: rgba(61,220,132,.5); background: rgba(61,220,132,.08); }
.pill.warn { color: var(--warn); border-color: rgba(255,176,32,.5); background: rgba(255,176,32,.08); }
.pill.bad { color: var(--bad); border-color: rgba(255,92,122,.5); background: rgba(255,92,122,.08); }
.pill.info { color: var(--cyan); border-color: rgba(46,230,214,.5); background: rgba(46,230,214,.08); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.badge { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #0f1538; display: flex; gap: 10px; align-items: center; }
.badge svg { width: 30px; height: 30px; flex: none; }
.badge b { display: block; font-size: 13px; }
.badge span { font-size: 12px; color: var(--muted); }
.badge.locked { opacity: .45; filter: grayscale(1); }

/* Tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--display); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
     padding: 12px 12px; border-bottom: 1px solid var(--line); background: #10173a; position: sticky; top: 0; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #1f2a5e; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(46,230,214,.04); }
td.num, th.num { text-align: right; }
.checks { display: flex; gap: 4px; }
.chk { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.chk.y { background: rgba(61,220,132,.15); color: var(--good); }
.chk.n { background: rgba(255,92,122,.15); color: var(--bad); }

/* Forms */
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.cb { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select, textarea {
  background: #0a0f28; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font: inherit; min-width: 0;
}
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--cyan); padding: 0; }
input[type=file] { padding: 8px; }
textarea { min-height: 120px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--cyan); color: var(--bg); background: var(--cyan);
  cursor: pointer; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn { white-space: nowrap; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--cyan); }
.btn.gold { background: var(--gold); border-color: var(--gold); }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(255,92,122,.6); }
.btn.sm { padding: 6px 10px; font-size: 10px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* Flash */
.flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { border-color: rgba(61,220,132,.5); background: rgba(61,220,132,.08); }
.flash.bad { border-color: rgba(255,92,122,.5); background: rgba(255,92,122,.08); }

/* Unlock card */
.unlock { border: 2px solid var(--gold); border-radius: 18px; padding: 22px; background: linear-gradient(160deg, #1a2252, #121a40);
          box-shadow: 0 0 46px rgba(255,193,69,.22); }
.unlock.miss { border-color: var(--line); box-shadow: none; }
.unlock .big { font-family: var(--display); font-size: 38px; font-weight: 900; color: var(--gold); margin: 6px 0; }
.unlock.miss .big { color: var(--muted); }
.rulelist { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.rulelist li { display: flex; gap: 10px; align-items: center; }

/* Chart */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--body); font-size: 12px; fill: var(--muted); }
.chart .val { fill: var(--text); font-weight: 600; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(440px, 100%); padding: 28px; }
.auth .brand { margin-bottom: 18px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g21, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav .sep { display: none; }
  .side .who { margin-top: 0; border-top: 0; padding-top: 0; width: 100%; font-size: 12px; }
  .side .who b { display: inline; }
  .nav a { padding: 6px 10px; }
  .g4, .g2 { grid-template-columns: 1fr; }
  .main { padding: 18px 16px 40px; }
}
@media (prefers-reduced-motion: no-preference) {
  .xp > i { animation: fill 900ms ease-out both; transform-origin: left; }
  @keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* Build 2: role home and address lookup */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.role { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 22px; border-radius: 18px; border: 2px solid var(--line);
  background: linear-gradient(160deg, #18205a, #10173d); color: var(--text); text-decoration: none; min-height: 290px; transition: transform .15s, border-color .15s, box-shadow .15s; }
a.role:hover { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 0 34px rgba(46,230,214,.18); text-decoration: none; }
.role .ri { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: rgba(46,230,214,.1); color: var(--cyan); border: 1px solid rgba(46,230,214,.4); }
.role .ri svg { width: 30px; height: 30px; }
.role .rn { font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.role .rb { color: var(--muted); font-size: 14px; flex: 1; }
.role .rs { font-family: var(--display); font-size: 11px; letter-spacing: 1.5px; color: var(--gold); text-transform: uppercase; }
.role .btn { align-self: flex-start; }
.role.locked { opacity: .5; filter: grayscale(.8); }
.role.locked .ri { color: var(--muted); border-color: var(--line); background: transparent; }
.role.locked .rs { color: var(--muted); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; text-decoration: none; }
.tabs a.on { color: var(--text); border-color: var(--cyan); background: rgba(46,230,214,.08); }
.scan { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scanhead { display: flex; gap: 14px; align-items: center; }
.radar { width: 54px; height: 54px; flex: none; border-radius: 50%; border: 1px solid rgba(46,230,214,.5); position: relative; overflow: hidden;
  background: repeating-radial-gradient(circle, transparent 0 8px, rgba(46,230,214,.18) 8px 9px); }
.radar::after { content: ""; position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(46,230,214,.55), transparent 25%); animation: sweep 2.4s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .radar::after { animation: none; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 10px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.prog { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.prog + .prog { margin-top: 10px; }
.prog.best { border-color: var(--gold); box-shadow: 0 0 22px rgba(255,193,69,.14); }
.prog .pa { font-family: var(--display); font-weight: 800; color: var(--gold); font-size: 20px; }
.prog .pm { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.mapframe { width: 100%; height: 240px; border: 1px solid var(--line); border-radius: 12px; margin-top: 14px; background: #0f1538; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
@media (max-width: 900px) { .roles, .scan { grid-template-columns: 1fr; } .role { min-height: 0; } }
