/* ============================================================================
 * Background Hero — visual identity
 * Palette : deep slate workshop, ember/forge progress, verdant "maxed",
 *           warm gold currency, parchment text.
 * Display : Cinzel (engraved, used with restraint).  Body : Inter.
 * Signature: the central completion ring.
 * ==========================================================================*/
:root {
  --bg:        #14161f;
  --bg-2:      #1a1d29;
  --panel:     #20242f; /* legacy use removed; kept for safety */
  --surface:   #1e2230;
  --surface-2: #262b3a;
  --line:      #2c3142;
  --line-soft: #242838;

  --ink:       #ece6d6; /* parchment */
  --ink-dim:   #9aa0b4;
  --ink-faint: #6b7185;

  --ember:     #e07b3c;
  --ember-hi:  #f2b45b;
  --verdant:   #5fae63;
  --gold:      #e6c35c;
  --danger:    #c8553d;

  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --tab: "Inter", system-ui, sans-serif;
  --display: "Cinzel", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--tab);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 12% -10%, #1d2231 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #211b1a 0%, transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ember-hi); outline-offset: 2px; border-radius: 4px; }

.app { display: flex; flex-direction: column; height: 100vh; }

/* ---- Top bar ----------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; height: 56px; flex: none;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
  -webkit-app-region: drag; /* let users drag the frameless-ish window */
}
.topbar button, .purse { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  font-size: 18px; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 8px; background: linear-gradient(135deg, var(--ember), #9c4d22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: .14em; font-size: 18px; }
.purse {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px; font-variant-numeric: tabular-nums;
  font-weight: 600; color: var(--gold);
}
.purse-ico { filter: saturate(1.2); }

/* ---- Body split -------------------------------------------------------- */
.body { display: flex; flex: 1; min-height: 0; }

/* ---- Sidebar ----------------------------------------------------------- */
.sidebar {
  width: 280px; flex: none; display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.015), transparent);
  padding: 16px 14px; gap: 14px; overflow-y: auto;
}

/* Completion ring — the signature */
.ring-card { position: relative; display: grid; place-items: center; padding: 6px 0 10px; }
.ring { width: 138px; height: 138px; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 9; }
.ring-fill {
  fill: none; stroke: var(--ember); stroke-width: 9;
  stroke-linecap: round; transition: stroke-dashoffset .5s ease;
  filter: drop-shadow(0 0 6px rgba(224,123,60,.45));
}
.ring-center { position: absolute; top: 6px; height: 138px; display: grid; place-content: center; text-align: center; }
.ring-pct { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; color: var(--ink); }
.ring-sub { font-size: 11px; color: var(--ink-dim); margin-top: 4px; letter-spacing: .03em; }
.ring-label { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }

/* Skills nav */
.skill-nav { display: flex; flex-direction: column; gap: 4px; }
.skill-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; color: var(--ink);
  padding: 9px 10px; border-radius: var(--r-sm); transition: background .15s, border-color .15s;
}
.skill-row:hover { background: var(--surface); }
.skill-row.selected { background: var(--surface-2); border-color: var(--line); }
.skill-row.is-active .skill-ico { animation: pulse 1.8s ease-in-out infinite; }
.skill-ico { font-size: 18px; width: 24px; text-align: center; flex: none; }
.skill-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.skill-name { font-size: 13.5px; font-weight: 500; }
.skill-bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.skill-bar-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ember), var(--ember-hi)); transition: width .25s ease; }
.skill-lvl { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--ink-dim); min-width: 22px; text-align: right; }

.nav-extra { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.nav-btn {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: transparent; border: 1px solid transparent; color: var(--ink-dim);
  padding: 9px 10px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500;
}
.nav-btn:hover { background: var(--surface); color: var(--ink); }
.nav-btn.selected { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

/* ---- Content ----------------------------------------------------------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 16px 20px; gap: 14px; overflow: hidden; position: relative; }

/* Active banner */
.active-banner {
  flex: none; min-height: 60px; display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface);
}
.active-banner.on { border-color: rgba(224,123,60,.4); background: linear-gradient(90deg, rgba(224,123,60,.10), var(--surface) 60%); }
.banner-idle { color: var(--ink-faint); font-size: 14px; }
.banner-ico { font-size: 24px; flex: none; }
.banner-info { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.banner-title { font-weight: 600; font-size: 14px; }
.banner-sub { font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.banner-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.banner-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ember), var(--ember-hi)); box-shadow: 0 0 12px rgba(242,180,91,.5); }
.btn-stop { flex: none; background: transparent; border: 1px solid var(--line); color: var(--ink-dim); padding: 7px 14px; border-radius: var(--r-sm); font-weight: 600; font-size: 13px; }
.btn-stop:hover { border-color: var(--danger); color: var(--danger); }

/* Main scroller */
.main { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }

/* Panel head */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head-left { display: flex; align-items: center; gap: 14px; }
.panel-ico { font-size: 30px; }
.panel-title { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0; letter-spacing: .04em; }
.panel-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-faint); }
.panel-head-right { display: flex; align-items: center; gap: 14px; min-width: 240px; }
.lvl-big { font-family: var(--display); font-weight: 700; font-size: 20px; min-width: 56px; text-align: right; }
.maxed-tag { color: var(--verdant); font-family: var(--display); letter-spacing: .1em; }
.xp-line { flex: 1; }
.xp-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.xp-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--ember-hi)); transition: width .25s ease; }
.xp-text { font-size: 11.5px; color: var(--ink-dim); margin-top: 5px; font-variant-numeric: tabular-nums; text-align: right; }

/* Action grid */
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 13px; }
.action-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .1s;
}
.action-card:hover { border-color: #38405a; }
.action-card.active { border-color: rgba(224,123,60,.55); background: linear-gradient(180deg, rgba(224,123,60,.08), var(--surface)); }
.action-card.locked { opacity: .55; }
.act-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.act-name { font-weight: 600; font-size: 14.5px; }
.act-xp { color: var(--ember-hi); font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.act-lock { color: var(--ink-faint); font-size: 12px; }
.act-yield { font-size: 12px; color: var(--ink-dim); min-height: 16px; }
.act-req { font-size: 11.5px; color: var(--ink-faint); }
.act-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.act-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ember), var(--ember-hi)); }
.act-foot { display: flex; align-items: center; justify-content: space-between; }
.act-dur { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.btn-act {
  background: linear-gradient(180deg, var(--ember), #b9602b); color: #1a120c; border: none;
  padding: 7px 18px; border-radius: var(--r-sm); font-weight: 700; font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-act:hover:not(:disabled) { filter: brightness(1.08); }
.btn-act:disabled { background: var(--surface-2); color: var(--ink-faint); box-shadow: none; cursor: not-allowed; }
.action-card.active .btn-act { background: var(--surface-2); color: var(--ember-hi); box-shadow: none; }

/* Inventory */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.inv-cell {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.inv-cell.currency { border-color: rgba(230,195,92,.35); }
.inv-ico { font-size: 26px; }
.inv-qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-name { font-size: 11.5px; color: var(--ink-dim); }
.empty { color: var(--ink-faint); padding: 30px; font-size: 14px; }

/* Account button (in the left menu) + login modal */
.account-nav-btn { min-width: 0; }
.account-nav-btn .account-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Dashboard / home ---------------------------------------------------- */
.nav-top { margin-bottom: 8px; }

.dash-banner { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(135deg, var(--surface-2), var(--surface)); padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.dash-banner-glow { position: absolute; inset: 0; background: radial-gradient(420px 170px at 88% -20%, rgba(224,123,60,.30), transparent 70%); pointer-events: none; }
.dash-banner-main { position: relative; z-index: 1; min-width: 0; }
.dash-eyebrow { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ember-hi); font-weight: 700; }
.dash-title { font-family: var(--display); font-size: 30px; line-height: 1.12; margin: 6px 0 8px; color: var(--ink); word-break: break-word; }
.dash-tagline { margin: 0; color: var(--ink-dim); max-width: 58ch; font-size: 14px; line-height: 1.5; }
.dash-banner-ring { position: relative; z-index: 1; flex: 0 0 auto; text-align: center; padding-left: 20px; border-left: 1px solid var(--line); }
.dash-ring-pct { display: block; font-family: var(--display); font-size: 27px; color: var(--ember-hi); }
.dash-ring-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }

.dash-status { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px 16px; margin-bottom: 16px; }
.dash-status.on { border-color: rgba(224,123,60,.5); }
.dash-status-ico { font-size: 26px; }
.dash-status-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dash-status-title { font-weight: 700; color: var(--ink); }
.dash-status-sub { font-size: 13px; color: var(--ink-dim); }

.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.stat-ico { font-size: 18px; opacity: .9; }
.stat-val { font-family: var(--display); font-size: 22px; color: var(--ink); margin-top: 4px; display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.stat-num { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-sub { font-family: var(--tab); font-size: 12px; color: var(--ink-faint); }
.stat-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }

.dash-sync { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 18px 20px; }
.dash-sync.cta { border-color: rgba(224,123,60,.45); background: linear-gradient(135deg, rgba(224,123,60,.08), var(--surface)); }
.dash-sync.subtle, .dash-sync.synced { padding: 12px 16px; }
.dash-sync-ico { font-size: 22px; flex: 0 0 auto; }
.dash-sync-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.dash-sync-title { font-weight: 700; color: var(--ink); }
.dash-sync-sub { font-size: 13px; color: var(--ink-dim); }
.dash-sync-actions { display: flex; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-dim); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; }
.btn-ghost:hover { border-color: var(--ember); color: var(--ink); }
.dash-link { background: none; border: none; color: var(--ember-hi); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }

@media (max-width: 720px) {
  .dash-banner { flex-direction: column; align-items: flex-start; }
  .dash-banner-ring { padding-left: 0; border-left: none; padding-top: 12px; border-top: 1px solid var(--line); width: 100%; text-align: left; }
  .dash-sync { flex-direction: column; align-items: flex-start; }
}

/* ---- Profile ------------------------------------------------------------- */
.prof-section { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); margin: 18px 0 8px; }
.prof-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 16px 18px; }
.prof-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.prof-row:last-child { border-bottom: none; }
.prof-k { color: var(--ink-dim); font-size: 14px; }
.prof-v { color: var(--ink); font-size: 14px; text-align: right; word-break: break-word; }
.prof-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.prof-badge.ok { background: rgba(95,174,99,.18); color: var(--verdant); }
.prof-badge.warn { background: rgba(224,123,60,.18); color: var(--ember-hi); }
.prof-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.prof-actions .btn-primary, .prof-actions .btn-ghost { width: auto; }
.prof-note { color: var(--ink-faint); font-size: 12px; margin: 10px 0 0; }
.prof-table { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.prof-trow { display: grid; grid-template-columns: 2fr 1fr 1.2fr 2fr; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.prof-trow:last-child { border-bottom: none; }
.prof-thead { color: var(--ink-faint); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--bg-2); }
.prof-skill { color: var(--ink); }
.prof-prog-bar { display: block; height: 7px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.prof-prog-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--ember-hi)); }
@media (max-width: 560px) {
  .prof-trow { grid-template-columns: 1.6fr 0.8fr 1fr; }
  .prof-trow > .prof-prog { display: none; }
}
.acc-input { width: 100%; box-sizing: border-box; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); padding: 11px 13px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 10px; }
.acc-input:focus { outline: none; border-color: var(--ember); }
.acc-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.acc-link { width: 100%; background: transparent; border: none; color: var(--ink-dim); font-size: 13px; padding: 8px; margin-top: 6px; }
.acc-link:hover { color: var(--ink); }
/* Inline "resend verification" link shown within an .acc-error message. */
.acc-resend-link { display: inline; width: auto; color: var(--ember-hi); font: inherit; padding: 0; margin: 0; cursor: pointer; text-decoration: underline; }
.acc-resend-link:hover { color: var(--ember-hi); }
.acc-resend-link:disabled { opacity: .6; cursor: default; text-decoration: none; }

/* Geared indicator (gear-reduced action time) */
.geared { color: var(--verdant); font-weight: 600; }
.act-dur.geared { color: var(--verdant); }

/* Gear panel */
.gear-group { margin-bottom: 22px; }
.gear-group-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.gear-group-title { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .06em; color: var(--ink); }
.gear-unequip { background: transparent; border: 1px solid var(--line); color: var(--ink-dim); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.gear-unequip:hover { border-color: var(--danger); color: var(--danger); }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gear-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.gear-card.equipped { border-color: var(--verdant); background: linear-gradient(180deg, rgba(95,174,99,.10), var(--surface)); }
.gear-top { display: flex; align-items: center; gap: 9px; }
.gear-ico { font-size: 20px; }
.gear-name { font-weight: 600; font-size: 14px; }
.gear-meta { display: flex; align-items: center; justify-content: space-between; }
.gear-bonus { color: var(--verdant); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.gear-target { font-size: 11.5px; color: var(--ink-faint); }
.gear-foot .btn-act { width: 100%; }
.btn-act.buy { background: var(--surface-2); color: var(--gold); box-shadow: none; border: 1px solid rgba(230,195,92,.3); }
.btn-act.buy:hover:not(:disabled) { border-color: var(--gold); }
.btn-act.equipped { background: transparent; color: var(--verdant); border: 1px solid rgba(95,174,99,.4); box-shadow: none; }

/* Nav category subheaders */
.nav-cat { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); padding: 10px 10px 4px; }
.skill-nav .nav-cat:first-child { padding-top: 2px; }

/* Equip screen */
.equip-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; color: var(--ink-dim); font-size: 13.5px; }
.equip-summary strong { color: var(--verdant); }
.equip-slot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; margin-bottom: 12px; }
.equip-slot-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.equip-slot-title { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .06em; }
.equip-bonus { color: var(--verdant); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.equip-current { display: flex; align-items: center; gap: 10px; padding: 8px 0; min-height: 22px; }
.equip-current.filled { border-bottom: 1px solid var(--line-soft); padding-bottom: 12px; margin-bottom: 4px; }
.equip-cur-ico { font-size: 20px; }
.equip-cur-name { font-weight: 600; font-size: 14px; flex: 1; }
.equip-empty { color: var(--ink-faint); font-size: 13px; }
.equip-cands { display: flex; flex-wrap: wrap; gap: 8px; }
.equip-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.equip-chip:hover { border-color: var(--ember); }
.equip-chip-ico { font-size: 14px; }
.equip-chip-bonus { color: var(--verdant); font-weight: 700; }
.equip-chip-qty { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.equip-hint { color: var(--ink-faint); font-size: 12.5px; }

/* Sell section (Shop) */
.sell-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.sell-row { display: grid; grid-template-columns: 24px 1fr auto auto auto; align-items: center; gap: 12px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.sell-ico { font-size: 18px; text-align: center; }
.sell-name { font-size: 13.5px; font-weight: 500; }
.sell-eq { font-size: 10.5px; color: var(--verdant); border: 1px solid rgba(95,174,99,.4); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.sell-have { font-variant-numeric: tabular-nums; color: var(--ink-dim); font-size: 13px; min-width: 44px; text-align: right; }
.sell-unit { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sell-btns { display: flex; gap: 6px; }
.sell-btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); padding: 6px 12px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.sell-btn:hover { border-color: #38405a; }
.sell-btn.primary { color: var(--gold); border-color: rgba(230,195,92,.3); }
.sell-btn.primary:hover { border-color: var(--gold); }
.buy-head { margin-top: 4px; }
.gear-group-title.sub { font-size: 13.5px; color: var(--ink-dim); }

/* Completion view */
.comp-wrap { display: flex; flex-direction: column; gap: 20px; }
.comp-headline { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 4px; }
.comp-big { font-family: var(--display); font-weight: 700; font-size: 46px; color: var(--ember-hi); }
.comp-small { color: var(--ink-dim); font-size: 13px; }
.comp-list { display: flex; flex-direction: column; gap: 8px; }
.comp-row { display: grid; grid-template-columns: 26px 130px 1fr 64px; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.comp-ico { font-size: 18px; text-align: center; }
.comp-name { font-size: 13.5px; font-weight: 500; }
.comp-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.comp-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--verdant), #7fce82); }
.comp-val { text-align: right; font-weight: 600; font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(8,9,13,.66); display: none; place-items: center; z-index: 50; backdrop-filter: blur(3px); }
.modal.show { display: grid; }
.modal-card { width: min(440px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.modal-title { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0 0 14px; letter-spacing: .05em; }
.off-line { color: var(--ink-dim); font-size: 14px; margin: 0 0 10px; }
.off-line strong { color: var(--ink); }
.off-cap { color: var(--ember-hi); font-size: 12px; }
.off-list { list-style: none; padding: 0; margin: 10px 0 20px; display: flex; flex-direction: column; gap: 6px; }
.off-list li { font-size: 13.5px; color: var(--ink); }
.btn-primary { width: 100%; background: linear-gradient(180deg, var(--ember), #b9602b); color: #1a120c; border: none; padding: 12px; border-radius: 10px; font-weight: 700; font-size: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { filter: brightness(1.08); }

/* Toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); padding: 11px 18px; border-radius: 999px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* Scrollbars */
.sidebar::-webkit-scrollbar, .main::-webkit-scrollbar { width: 9px; }
.sidebar::-webkit-scrollbar-thumb, .main::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 820px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100vh; }
  .body { flex-direction: column; }
  .sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--line); flex-direction: column; }
  .skill-nav { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; align-items: start; }
  .skill-nav .nav-cat { grid-column: 1 / -1; }
  .skill-nav .nav-dungeon-row { grid-column: 1 / -1; }
  .nav-extra { flex-direction: row; }
  .nav-extra .nav-btn { flex: 1; justify-content: center; }
  .content { height: auto; overflow: visible; }
  .main { overflow: visible; }
  .comp-row { grid-template-columns: 24px 1fr 50px; }
  .comp-bar { display: none; }
  .sell-row { grid-template-columns: 24px 1fr auto; row-gap: 8px; }
  .sell-unit { grid-column: 2 / -1; text-align: right; }
  .sell-btns { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- Profile: expansion library ----------------------------------------- */
.prof-expansions { display: flex; flex-wrap: wrap; gap: 16px; }
.exp-card { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.exp-art { width: 192px; height: 96px; border-radius: var(--r-sm); border: 1px solid var(--line); background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; }
.exp-art-name { font-family: var(--display); font-size: 16px; color: var(--ink); }
.exp-card.locked .exp-art { opacity: .4; filter: grayscale(1); }
.exp-card.locked { cursor: pointer; }
.exp-card.locked:hover .exp-art { opacity: .6; border-color: var(--ember, #e07b3c); }
.exp-card.locked:focus-visible { outline: 2px solid var(--ember, #e07b3c); outline-offset: 3px; border-radius: var(--r-sm); }
.exp-status { font-size: 12px; font-weight: 700; }
.exp-card.owned .exp-status { color: var(--verdant); }
.exp-card.locked .exp-status { color: var(--ink-faint); }

/* ---- Floating yield text (resource collected) --------------------------- */
.float-yield { position: fixed; z-index: 60; pointer-events: none; color: var(--verdant); font-weight: 700; font-size: 14px; text-shadow: 0 1px 4px rgba(0,0,0,.55); white-space: nowrap; animation: floatUp 1.1s ease-out forwards; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(10px); }
  14% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-22px); }
}

/* ---- Dungeons ----------------------------------------------------------- */
.nav-dungeon-row { padding-left: 30px; opacity: .92; }
.nav-dungeon-row .skill-name { font-size: 13px; }
.dng-stats { font-size: 13px; color: var(--ink-dim); white-space: nowrap; }

.dng-list { display: flex; flex-direction: column; gap: 12px; }
.dng-card { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px 16px; }
.dng-card.locked { opacity: .55; }
.dng-card-ico { font-size: 32px; flex: 0 0 auto; width: 44px; text-align: center; }
.dng-card-main { flex: 1; min-width: 0; }
.dng-card-top { display: flex; align-items: center; gap: 10px; }
.dng-card-name { font-family: var(--display); font-size: 17px; color: var(--ink); }
.dng-card-sub { color: var(--ink-dim); font-size: 13px; margin-top: 2px; }
.dng-card-boss { color: var(--ink-faint); font-size: 12px; margin-top: 4px; }
.dng-card-act { flex: 0 0 auto; }
.dng-card-act .btn-primary { width: auto; }
.dng-lock { color: var(--ink-faint); font-size: 13px; font-weight: 600; }

.dng-run { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 20px; max-width: 560px; }
.dng-run-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dng-run-name { font-family: var(--display); font-size: 20px; color: var(--ink); }
.dng-bar-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-dim); margin-bottom: 5px; }
.dng-hp, .dng-enemy, .dng-prog-text { margin-bottom: 16px; }
.hpbar, .enemybar, .dng-prog { height: 16px; border-radius: 999px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); }
.hpbar-fill { height: 100%; background: linear-gradient(90deg, #3f9a4a, var(--verdant)); transition: width .15s linear; }
.enemybar-fill { height: 100%; background: linear-gradient(90deg, #9a3f3f, var(--danger)); transition: width .15s linear; }
.enemybar.boss .enemybar-fill { background: linear-gradient(90deg, var(--danger), var(--ember-hi)); }
.dng-phase { color: var(--ink-dim); font-size: 14px; margin-bottom: 8px; }
.dng-prog-fill { height: 100%; background: linear-gradient(90deg, var(--ember), var(--ember-hi)); transition: width .15s linear; }
.dng-prog-text { font-size: 12px; color: var(--ink-faint); margin-top: 5px; }
.dng-result { font-size: 15px; font-weight: 600; padding: 12px 0; }
.dng-result.ok { color: var(--verdant); }
.dng-result.bad { color: var(--danger); }
.dng-run-actions { display: flex; gap: 10px; margin-top: 8px; }
.dng-run-actions .btn-primary, .dng-run-actions .btn-ghost { width: auto; }

/* ---- Free edition: locked skills + upsell ------------------------------- */
.skill-row.locked-skill { opacity: .5; }
.skill-row.locked-skill:hover { opacity: .8; background: var(--surface-2); }
.skill-lock { margin-left: auto; font-size: 13px; opacity: .85; }

#upsell-modal .modal-card { max-width: 380px; }
.upsell-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.upsell-ico { font-size: 36px; line-height: 1; }
.upsell-tag { display: block; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ember); font-weight: 700; }
.upsell-note { color: var(--ink-faint); font-size: 12.5px; margin: 10px 0 0; }
.upsell-img { display: block; width: 100%; max-height: 150px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); margin: 0 0 12px; }
.upsell-includes { margin: 12px 0 0; }
.upsell-includes-h { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; margin-bottom: 6px; }
.upsell-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.upsell-list li { position: relative; padding-left: 20px; font-size: 13.5px; line-height: 1.35; }
.upsell-list li::before { content: '✓'; position: absolute; left: 0; color: var(--verdant); font-weight: 700; }
.upsell-price { margin: 14px 0 0; font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--ink); }
.upsell-price:empty { display: none; }
.upsell-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.upsell-actions .btn-primary { width: 100%; }
.upsell-actions .acc-link { text-align: center; }

.ver-link { display: block; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); text-align: center; font-size: 11px; color: var(--ink-faint); text-decoration: none; }
.ver-link[href]:hover { color: var(--ember); text-decoration: underline; cursor: pointer; }
