/* ====================================================================
   Domains Incorporated — companion app styles
   Sci-fi HUD aesthetic, dark, responsive (desktop + tablet).
   ==================================================================== */
:root {
  --bg: #070b12;
  --bg-2: #0c131f;
  --panel: #111b2b;
  --panel-2: #16243a;
  --line: #213450;
  --text: #dbe7f5;
  --muted: #7e93ad;
  --accent: #35e6c9;      /* cyan — primary */
  --accent-2: #5aa9ff;    /* blue */
  --hope: #ffcf4d;        /* hope gold */
  --fear: #b46cff;        /* fear violet */
  --hp: #ff5d6c;          /* vitals red */
  --stress: #ff9d4d;      /* stress amber */
  --armor: #6fe0ff;       /* armor cyan-blue */
  --evasion: #8affc1;     /* evasion green */
  --energy: #b46cff;      /* energy dmg */
  --kinetic: #ffb454;     /* kinetic dmg */
  --good: #49d987;
  --bad: #ff5d6c;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* inline entity icons (game-icons.net, recolor via currentColor) */
.entity-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--accent); }
.entity-icon svg { width: 18px; height: 18px; display: block; fill: currentColor; }
.entity-icon.lg svg { width: 28px; height: 28px; }
.entity-icon.sm svg { width: 14px; height: 14px; }
.entity-icon.xl svg { width: 40px; height: 40px; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(53,230,201,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(90,169,255,.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--accent-2); }
h1,h2,h3,h4 { margin: 0 0 .4em; font-weight: 650; letter-spacing: .2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---- top bar -------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: rgba(8,12,20,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; line-height: 1.05; }
.brand .b1 { font-family: var(--mono); font-size: 13px; letter-spacing: 3px; color: var(--accent); text-transform: uppercase; }
.brand .b2 { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; line-height: 1.1; }
.who .n { font-weight: 650; }
.who .c { font-size: 12px; color: var(--muted); }

.tabs { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tabs button {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 999px; cursor: pointer;
}
.tabs button.active { background: linear-gradient(180deg, var(--accent), #14b8a0); color: #04231f; }

.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: inherit; font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 9px; cursor: pointer;
  transition: border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--accent), #11a892); color: #042; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

/* ---- layout --------------------------------------------------------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 18px; }
.panel { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px 18px; }
.grid { display: grid; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.tag { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.kinetic { color: var(--kinetic); border-color: rgba(255,180,84,.4); }
.tag.energy { color: var(--energy); border-color: rgba(180,108,255,.4); }
.tag.lock { color: var(--bad); border-color: rgba(255,93,108,.4); }
.tag.on { color: var(--accent); border-color: rgba(53,230,201,.45); }

/* ---- roster --------------------------------------------------------- */
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.char-card { cursor: pointer; transition: border-color .15s, transform .08s; }
.char-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.char-card .cc-top { display: flex; align-items: center; justify-content: space-between; }
.char-card h3 { margin: 0; }
.char-card .corp { color: var(--accent); font-size: 13px; }
.char-card .meta { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.newcard { display: flex; align-items: center; justify-content: center; min-height: 150px; border-style: dashed; color: var(--muted); font-weight: 600; }
.newcard:hover { color: var(--accent); }

/* ---- creation wizard ------------------------------------------------ */
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.steps .step { font-size: 12px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.steps .step.done { color: var(--accent); border-color: rgba(53,230,201,.4); }
.steps .step.cur { background: var(--panel-2); color: var(--text); border-color: var(--accent); }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.ancestry-grid { grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); align-items: start; }
.pick {
  text-align: left; cursor: pointer; padding: 14px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel); transition: border-color .12s, background .12s;
}
.pick:hover { border-color: var(--accent-2); }
.pick.sel { border-color: var(--accent); background: var(--panel-2); box-shadow: inset 0 0 0 1px rgba(53,230,201,.35); }
.pick.disabled { opacity: .45; cursor: not-allowed; }
.pick h4 { margin: 0 0 4px; }
.pick .sub { color: var(--accent); font-size: 12px; margin-bottom: 6px; }
.pick .desc { color: var(--muted); font-size: 12.5px; }
.pick .stats { display: flex; gap: 12px; margin-top: 8px; font-family: var(--mono); font-size: 12px; }
.pick .stats span b { color: var(--text); }

/* job-title cards: full width so Foundation text is readable */
.pick.jobpick { grid-column: 1 / -1; }
.foundation { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.foundation .fhead { font-family: var(--mono); font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.ffeat { margin-bottom: 10px; }
.ffeat:last-child { margin-bottom: 0; }
.ffeat .fname { font-weight: 650; font-size: 13.5px; color: var(--text); margin-bottom: 2px; }
.ffeat .ftext { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ffeat .fbullets { margin: 6px 0 0; padding-left: 18px; }
.ffeat .fbullets li { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-bottom: 2px; }

.wizard-foot { display: flex; justify-content: space-between; margin-top: 18px; gap: 10px; }

/* corporation master/detail */
.corp-detail { margin-top: 16px; }
.cd-title { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; margin-bottom: 12px; }
.cd-stats { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-family: var(--mono); font-size: 13px; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.cd-stats b { color: var(--text); }

/* trait assigner */
.trait-array { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.trait-chip { font-family: var(--mono); font-size: 14px; padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); cursor: grab; }
.trait-chip.used { opacity: .3; }
.trait-rows { display: grid; gap: 8px; }
.trait-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.trait-row.essence { border-color: rgba(255,207,77,.5); }
.trait-row .tname { font-weight: 600; }
.trait-row .tname .ess { font-size: 10px; color: var(--hope); font-family: var(--mono); margin-left: 6px; }
.trait-slot { font-family: var(--mono); font-size: 16px; min-width: 44px; text-align: center; padding: 6px; border-radius: 8px; border: 1px dashed var(--line); color: var(--muted); }
.trait-slot.filled { border-style: solid; border-color: var(--accent); color: var(--accent); }

/* augment cards */
.aug-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 12px; }
.aug {
  border: 1px solid var(--line); border-radius: 11px; padding: 13px; background: var(--panel);
  display: flex; flex-direction: column; gap: 7px;
}
.aug.sel { border-color: var(--accent); background: var(--panel-2); }
.aug .ah { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aug h4 { margin: 0; font-size: 14.5px; }
.aug .affil { font-size: 11px; color: var(--accent-2); font-family: var(--mono); }
.aug .eff { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.aug .routine { font-size: 12px; border-left: 2px solid var(--line); padding-left: 8px; margin-top: 4px; }
.aug .routine b { color: var(--text); }
.aug-count { font-family: var(--mono); }
.aug-count.full { color: var(--hope); }

/* ===========================  PLAY HUD  ============================= */
.hud { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; align-items: start; }
.vitals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gauge { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; }
.gauge .glab { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.gauge .gval { font-family: var(--mono); font-size: 26px; font-weight: 700; margin: 2px 0 8px; }
.gauge.full2 { grid-column: 1 / -1; }

/* segmented pip rows (HP / Stress / Armor) */
.pips { display: flex; gap: 5px; flex-wrap: wrap; }
.pip { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: #0a1320; cursor: pointer; transition: transform .05s, background .12s, box-shadow .12s; }
.pip:active { transform: scale(.9); }
.pip.on { border-color: transparent; }
.pip.hp.on { background: var(--hp); box-shadow: 0 0 10px rgba(255,93,108,.5); }
.pip.stress.on { background: var(--stress); box-shadow: 0 0 10px rgba(255,157,77,.45); }
.pip.armor.on { background: var(--armor); box-shadow: 0 0 10px rgba(111,224,255,.45); }
.pip.disabled { opacity: .3; cursor: not-allowed; }

/* hope as gold diamonds */
.hope-row { display: flex; gap: 7px; }
.hope-dot { width: 20px; height: 20px; transform: rotate(45deg); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; background: #0a1320; }
.hope-dot.on { background: var(--hope); border-color: transparent; box-shadow: 0 0 12px rgba(255,207,77,.55); }

/* EKG stress trace */
.ekg { width: 100%; height: 46px; display: block; margin-top: 6px; }
.ekg path { fill: none; stroke: var(--stress); stroke-width: 2; filter: drop-shadow(0 0 4px rgba(255,157,77,.5)); }
.ekg .flat { stroke: #33425c; }

/* evasion ring + thresholds */
.defense { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.ring { position: relative; width: 104px; height: 104px; }
.ring svg { transform: rotate(-90deg); }
.ring .rc { font-family: var(--mono); position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .rc b { font-size: 26px; color: var(--evasion); }
.ring .rc span { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.thr { display: grid; gap: 8px; }
.thr .t { display: flex; align-items: center; justify-content: space-between; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; font-family: var(--mono); }
.thr .t .lab { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.thr .t.major .v { color: var(--stress); } .thr .t.severe .v { color: var(--hp); }
.thr .t .v { font-size: 18px; }

/* dice roller */
.roller .dice { display: flex; gap: 12px; justify-content: center; margin: 6px 0 10px; }
.die { width: 78px; height: 78px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px solid var(--line); background: #0a1320; }
.die .dl { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.die .dn { font-family: var(--mono); font-size: 32px; font-weight: 700; }
.die.hope { border-color: var(--hope); } .die.hope .dl, .die.hope .dn { color: var(--hope); }
.die.fear { border-color: var(--fear); } .die.fear .dl, .die.fear .dn { color: var(--fear); }
.die.win { box-shadow: 0 0 18px currentColor; }
.roll-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; font-family: var(--mono); letter-spacing: .5px; }
select optgroup { background: var(--bg-2); color: var(--accent); font-family: var(--mono); font-weight: 700; font-style: normal; letter-spacing: 1px; }
select option { background: #0a1320; color: var(--text); font-style: normal; }
select, input[type="number"], input[type="text"] {
  width: 100%; background: #0a1320; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-family: var(--mono);
}
.outcome { margin-top: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); text-align: center; min-height: 20px; }
.outcome.hope { border-color: var(--hope); background: rgba(255,207,77,.07); }
.outcome.fear { border-color: var(--fear); background: rgba(180,108,255,.07); }
.outcome.crit { border-color: var(--accent); background: rgba(53,230,201,.09); }
.outcome .big { font-size: 18px; font-weight: 700; }
.outcome .lil { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* weapon / armor cards */
.equip-cards { display: grid; gap: 10px; }
.ecard { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: var(--panel); }
.ecard .et { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ecard h4 { margin: 0; }
.ecard .ed { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.ecard .feat { font-size: 12px; color: var(--accent-2); margin-top: 6px; }
.ecard .actions { margin-top: 9px; display: flex; gap: 8px; flex-wrap: wrap; }
.empty-slot { border: 1px dashed var(--line); border-radius: 11px; padding: 14px; text-align: center; color: var(--muted); }

/* damage intake */
.intake .out { margin-top: 10px; padding: 10px; border-radius: 9px; border: 1px solid var(--line); font-family: var(--mono); }
.intake .out.minor { border-color: var(--accent); }
.intake .out.major { border-color: var(--stress); }
.intake .out.severe { border-color: var(--hp); }

.section-title { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; }

/* trait badges (tap to roll) */
.trait-badges { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.tbadge { cursor: pointer; text-align: center; padding: 12px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color .12s, transform .05s, box-shadow .12s; }
.tbadge:hover { border-color: var(--accent); box-shadow: 0 0 14px rgba(53,230,201,.18); }
.tbadge:active { transform: translateY(1px); }
.tbadge.essence { border-color: rgba(255,207,77,.5); }
.tb-name { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 5px; }
.tb-name .tb-ess { font-size: 8px; color: var(--hope); border: 1px solid rgba(255,207,77,.4); border-radius: 999px; padding: 1px 4px; }
.tb-mod { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--accent); margin: 3px 0; line-height: 1; }
.tbadge.essence .tb-mod { color: var(--hope); }
.tb-actions { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
@media (max-width: 880px) { .trait-badges { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .trait-badges { grid-template-columns: repeat(2, 1fr); } }

/* bonded unit */
.bonded-block { border-color: rgba(90,169,255,.4); box-shadow: inset 0 0 0 1px rgba(90,169,255,.1); }
.bu-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bu-title b { font-size: 15px; }
.bu-attack { font-family: var(--mono); font-size: 13px; color: var(--accent-2); border: 1px solid rgba(90,169,255,.4); border-radius: 999px; padding: 3px 10px; }
.bu-fields { display: grid; gap: 8px; max-width: 560px; }
.bu-stress { margin-top: 12px; }
.bu-stress .df-label { margin-bottom: 6px; }
.bu-ref { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.bu-ref .fhead { font-family: var(--mono); font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-2); margin-bottom: 6px; }
.bu-ref-line { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-bottom: 3px; }
.bu-upgrade { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; background: var(--panel); }
.bu-upgrade.on { border-color: rgba(90,169,255,.45); }
.bu-up-main { display: flex; align-items: flex-start; gap: 9px; flex: 1 1 260px; font-size: 12.5px; cursor: pointer; }
.bu-up-main b { color: var(--text); }
.bu-up-main input { width: auto; flex: none; margin-top: 2px; }
select.bu-param { width: auto; min-width: 150px; padding: 5px 8px; font-size: 12px; }

/* morphogenesis */
.morph-banner { border-color: rgba(138,255,193,.4); box-shadow: inset 0 0 0 1px rgba(138,255,193,.12); }
.mb-title { font-weight: 700; font-size: 15px; color: var(--evasion); }
.morph-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.morph-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); }
.morph-card.active { border-color: var(--evasion); box-shadow: inset 0 0 0 1px rgba(138,255,193,.18); }
.morph-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.morph-head h3 { margin: 0; font-size: 16px; }
.morph-stats { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.morph-stats b { color: var(--text); }
.morph-adv { font-size: 12px; color: var(--accent-2); margin-top: 6px; }
.morph-feats { margin-top: 8px; }
.morph-actions { margin-top: 10px; }
.morph-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.morph-status.active { color: var(--evasion); }

/* general dice tray */
.dice-tray .dice-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.die-btn { position: relative; width: 58px; height: 58px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: color .12s, border-color .12s, transform .05s, box-shadow .12s; }
.die-btn:hover { color: var(--accent); border-color: var(--accent); }
.die-btn:active { transform: translateY(1px); }
.die-btn.picked { color: var(--accent); border-color: rgba(53,230,201,.5); box-shadow: inset 0 0 0 1px rgba(53,230,201,.2); }
.die-svg { width: 46px; height: 46px; display: block; }
.die-svg polygon { fill: rgba(53,230,201,.06); stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.die-num { fill: currentColor; font-family: var(--mono); font-size: 12px; font-weight: 700; }
.die-count { position: absolute; top: -7px; right: -7px; background: var(--accent); color: #04231f; font-family: var(--mono); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }
.dice-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.dice-pool { color: var(--muted); font-size: 13px; }
.dice-out { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 10px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.do-total { font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1; }
.do-detail { color: var(--muted); font-size: 12.5px; }

/* equipped augments strip (Active tab) — ranked active > conditional > passive */
.aug-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-bottom: 4px; }
.aug-card { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: var(--panel); cursor: pointer; transition: border-color .12s; }
.aug-card:hover { border-color: var(--accent-2); }
.aug-card.expanded { border-color: var(--accent); }
.aug-card.active { border-color: rgba(53,230,201,.5); box-shadow: inset 0 0 0 1px rgba(53,230,201,.14); }
.aug-card.active:hover { border-color: var(--accent); }
.ac-exp { font-family: var(--mono); font-size: 15px; line-height: 1; color: var(--muted); width: 14px; text-align: center; }
.ac-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 7px; }
.ac-note { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 5px; }
.aug-card.cond { background: var(--bg-2); }
.aug-card .ac-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aug-card .ac-head h4 { margin: 0; font-size: 14px; }
.aug-card.cond .ac-head h4 { color: var(--text); opacity: .92; }
.aug-card .ac-eff { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.aug-card .ac-routine { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-family: var(--mono); }
.aug-card .ac-actions { margin-top: 9px; }
.aug-subhead { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.aug-passives { display: flex; flex-direction: column; }
.aug-pass { font-size: 12px; color: var(--muted); padding: 5px 2px; border-top: 1px solid var(--line); }
.aug-pass b { color: var(--text); }

/* corporation features on the HUD */
.cfeat { padding: 11px 0; border-top: 1px solid var(--line); }
.cfeat:first-of-type { border-top: 0; padding-top: 2px; }
.cf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.tag.hope-tag { color: var(--hope); border-color: rgba(255,207,77,.45); }

/* experiences in the roller */
.exp-list { display: grid; gap: 8px; }
.exp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.exp-row .exp-name { font-weight: 600; flex: 1 1 120px; min-width: 0; }
.exp-active { margin-top: 8px; font-size: 12.5px; color: var(--hope); }

/* weapon/armor trait glossary */
.trait-legend { display: grid; gap: 6px; }
.tl-item { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: baseline; font-size: 12.5px; }
.tl-item b { color: var(--accent-2); font-family: var(--mono); font-weight: 600; }
.tl-item span { color: var(--muted); line-height: 1.4; }
@media (max-width: 560px) { .tl-item { grid-template-columns: 1fr; gap: 1px; } }

/* dossier surface */
.dossier-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 18px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), var(--bg-2)); }
.dh-title { font-family: var(--mono); letter-spacing: 3px; text-transform: uppercase; color: var(--accent); font-size: 14px; }
.dh-id { color: var(--muted); font-size: 12px; }
.dossier-id { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: start; }
.dossier-photo { display: flex; flex-direction: column; align-items: center; }
.dossier-photo img { width: 180px; height: 180px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.dossier-photo-empty { width: 180px; height: 180px; border: 1px dashed var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.dossier-fields { display: grid; gap: 8px; }
.df-row { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; }
.df-label { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); }
.df-val { color: var(--text); }
.df-field { margin-top: 10px; }
.df-field label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
textarea { width: 100%; min-height: 72px; background: #0a1320; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
.reg-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 4px; }
.reg-card { border: 1px solid var(--line); border-radius: 11px; padding: 12px; text-align: center; background: var(--panel); }
.reg-card.dim { opacity: .42; }
.reg-card.lit { border-color: rgba(53,230,201,.4); box-shadow: inset 0 0 0 1px rgba(53,230,201,.12); }
.reg-icon { position: relative; display: inline-flex; }
.reg-tier { position: absolute; right: -8px; bottom: -4px; font-family: var(--mono); font-size: 10px; background: var(--panel-2); border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 1px 6px; }
.reg-name { font-weight: 600; margin-top: 8px; font-size: 13px; }
.reg-ctl { margin-top: 8px; display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }
select.reg-tier-sel { width: auto; padding: 5px 8px; font-size: 12px; }
@media (max-width: 560px) { .dossier-id { grid-template-columns: 1fr; justify-items: center; } }
.reg-card.jailbroken { border-color: rgba(255,93,108,.45); }
.reg-illicit { position: absolute; right: -8px; bottom: -4px; font-size: 13px; color: #ff7d8a; text-shadow: 0 0 6px rgba(255,93,108,.5); }
.reg-illicit-label { font-family: var(--mono); font-size: 11px; color: #ff8a93; }

/* jailbreak button + confirm modal (desaturated red for legibility on dark) */
.btn.jailbreak { border-color: rgba(255,93,108,.5); color: #ff8a93; }
.btn.jailbreak:hover { border-color: #ff5d6c; background: rgba(255,93,108,.08); color: #ff9aa3; }
.btn.danger-solid { background: #d6485a; border-color: transparent; color: #fff; }
.btn.danger-solid:hover { background: #e2566a; }
.modal-overlay { position: fixed; inset: 0; background: rgba(3,6,12,.72); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 18px; backdrop-filter: blur(2px); }
.modal { max-width: 460px; width: 100%; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid rgba(255,93,108,.4); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.modal-warn { color: #ff9aa3; font-size: 13.5px; line-height: 1.55; border: 1px solid rgba(255,93,108,.4); background: rgba(255,93,108,.07); border-radius: 9px; padding: 12px 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* inventory surface */
.inv-list { display: grid; gap: 8px; }
.inv-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.inv-item .inv-main { flex: 1 1 220px; min-width: 0; }
.inv-item .inv-main h4 { margin: 0; font-size: 14px; }
.inv-item .inv-eff { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.inv-qty { display: flex; align-items: center; gap: 8px; }
.inv-qty .qty { font-family: var(--mono); font-size: 16px; min-width: 20px; text-align: center; }
.inv-actions { display: flex; gap: 8px; }
.inv-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.inv-add input, .inv-add select { width: auto; flex: 1 1 150px; }
.inv-add select { flex: 0 0 auto; min-width: 130px; }
.inv-add button { flex: 0 0 auto; }

/* management surface */
select.add-aug { width: auto; min-width: 160px; padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--accent); border-color: var(--accent); background: #0a1320; cursor: pointer; }
.locked-slot { padding: 11px 12px; border: 1px dashed var(--line); border-radius: 9px; background: #0a1320; color: var(--muted); font-size: 12.5px; }
.item-detail { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #0a1320; }
.item-detail .id-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-detail .id-row b { font-size: 14px; }
.item-detail .id-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 4px; }
.item-detail .id-feat { font-size: 12px; color: var(--accent-2); margin-top: 6px; }
.aug-deltas { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.aug-deltas .delta { font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(53,230,201,.4); color: var(--accent); }
.aug-deltas .delta.derived { border-color: rgba(255,207,77,.45); color: var(--hope); }
.aug-note { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 2px; }
.aug.locked { opacity: .62; }
.aug-lock { font-family: var(--mono); font-size: 11.5px; color: var(--bad); margin-top: 6px; }
.aug-empty { border: 1px dashed var(--line); border-radius: 11px; padding: 20px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.swap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); margin-bottom: 8px; }
.list-item .li-main { min-width: 0; }
.list-item .li-main h4 { margin: 0; font-size: 14px; }
.list-item .li-main .li-sub { font-size: 12px; color: var(--muted); }

/* toast */
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--accent); color: var(--text); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; font-size: 13px; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.footer-note { color: var(--muted); font-size: 11.5px; text-align: center; padding: 22px 12px; line-height: 1.6; }

/* ---- responsive ----------------------------------------------------- */
@media (max-width: 880px) {
  .hud { grid-template-columns: 1fr; }
  .swap-grid { grid-template-columns: 1fr; }
  .roll-controls { grid-template-columns: 1fr; }
  .who { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .wrap { padding: 12px; }
  .vitals { grid-template-columns: 1fr; }
  .defense { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .topbar { gap: 8px; padding: 9px 12px; }
  .brand .b2 { display: none; }
  .pip, .hope-dot { width: 26px; height: 26px; } /* bigger tap targets */
}
