/* RiftExile v2 design system: dark grimdark stone, aged gold accent, ember and blood for heat. Original palette
   (inspired by the mood of Wraeclast, not taken from the game). Uiverse.io-style touches live in theme.css. */
:root {
  color-scheme: dark;
  --bg: #0b0907;
  --bg2: #110d0a;
  --panel: #16120e;
  --panel2: #1e1813;
  --line: #2d241b;
  --line2: #3e3225;
  --text: #e9dfcb;
  --muted: #a99b88;
  --faint: #7a6d5e;
  --rift: #c9a35b;
  --rift-d: #8a6a32;
  --violet: #b08ad8;
  --ember: #e0823e;
  --good: #8fc06a;
  --bad: #d9583f;
  --warn: #d9a441;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --top-h: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--rift); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4.5vw, 38px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
::selection { background: rgba(201, 163, 91, .3); }
:focus-visible { outline: 2px solid var(--rift); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
.good { color: var(--good); } .bad { color: var(--bad); } .ember { color: var(--ember); } .rift { color: var(--rift); }

/* header */
.top { position: sticky; top: 0; z-index: 40; background: rgba(11, 9, 7, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; height: var(--top-h); padding: 0 16px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 650; font-size: 18px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--rift); font-weight: 650; }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav > a { color: var(--muted); padding: 8px 11px; border-radius: 8px; font-size: 14.5px; }
.nav > a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav > a.on { color: var(--text); background: var(--panel2); }
.nav-sep { flex: 1; }
.account-slot { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; padding: 10px; cursor: pointer; }
.menu-btn span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; transition: .2s; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--rift-d), var(--violet)); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 880px) {
  .menu-btn { display: block; }
  .nav { position: fixed; inset: var(--top-h) 0 auto 0; background: var(--bg2); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; gap: 2px; transform: translateY(-110%); transition: transform .2s ease; visibility: hidden; }
  .nav.open { transform: none; visibility: visible; box-shadow: var(--shadow); }
  .nav > a { padding: 12px; font-size: 16px; }
  .nav-sep { height: 8px; }
  .account-slot { padding: 6px 4px 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* layout */
main { flex: 1; width: 100%; outline: none; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 16px 56px; }
.page.narrow { max-width: 760px; }
.page.auth { max-width: 440px; padding-top: 48px; }
.page.full { max-width: none; padding: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--faint); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.f3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.f3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.f3 { grid-template-columns: 1fr; } }
.grid.c4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }
.foot { border-top: 1px solid var(--line); background: var(--bg2); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 22px 16px 30px; display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }
.noscript { padding: 40px; text-align: center; }

/* surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.tight { padding: 14px; }
.card.link { display: block; color: var(--text); transition: border-color .15s, transform .15s; }
.card.link:hover { border-color: var(--line2); text-decoration: none; transform: translateY(-1px); }
.card h3 { margin-bottom: 6px; }
.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 10px; font-weight: 600; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--radius); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; font-size: 16px; }
.note { background: rgba(201, 163, 91, .07); border: 1px solid rgba(201, 163, 91, .25); border-radius: var(--radius-s); padding: 10px 14px; font-size: 14px; }
.note.warn { background: rgba(240, 194, 79, .08); border-color: rgba(240, 194, 79, .3); }
.note.err { background: rgba(239, 107, 107, .08); border-color: rgba(239, 107, 107, .35); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.rift { color: var(--rift); border-color: rgba(201, 163, 91, .35); }
.pill.ember { color: var(--ember); border-color: rgba(240, 179, 90, .35); }
.pill.violet { color: var(--violet); border-color: rgba(154, 136, 255, .35); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font: 600 14.5px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; text-decoration: none !important; }
.btn:hover { background: #222838; border-color: #3d4659; }
.btn.primary { background: var(--rift); border-color: var(--rift); color: #1a1208; }
.btn.primary:hover { background: #e0bd76; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel); }
.btn.danger { color: var(--bad); border-color: rgba(239, 107, 107, .4); background: transparent; }
.btn.danger:hover { background: rgba(239, 107, 107, .1); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .ico { width: 18px; height: 18px; flex: none; }
.btn.provider { justify-content: flex-start; padding-left: 14px; }
.btn.provider .ico { margin-right: 4px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input, select, textarea { width: 100%; background: var(--bg2); border: 1px solid var(--line2); color: var(--text); border-radius: 10px; padding: 10px 12px; font: 15px var(--font); min-height: 42px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 90px; word-break: break-all; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rift-d); box-shadow: 0 0 0 3px rgba(201, 163, 91, .15); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--rift); flex: none; margin: 2px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-bottom: 14px; cursor: pointer; }
.form-err { color: var(--bad); font-size: 14px; min-height: 0; margin-bottom: 10px; }
.form-err:empty { display: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; color: var(--muted); font: 600 13.5px var(--font); padding: 7px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--panel2); color: var(--text); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; flex: 1 1 160px; }
.toolbar input[type="search"] { flex: 2 1 220px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; background: var(--bg2); position: sticky; top: 0; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--text); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
td a { color: var(--text); font-weight: 550; }
.item-cell { display: flex; align-items: center; gap: 10px; }
.item-cell img { width: 28px; height: 28px; object-fit: contain; }
.spark { width: 96px; height: 26px; display: block; }

/* home */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background:
  radial-gradient(700px 300px at 85% 0%, rgba(224, 130, 62, .12), transparent 70%),
  radial-gradient(600px 300px at 10% 100%, rgba(201, 163, 91, .12), transparent 70%), var(--bg); }
.hero-in { max-width: 1240px; margin: 0 auto; padding: 56px 16px 48px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); letter-spacing: -.025em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--rift), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.hero-art { aspect-ratio: 1; max-width: 420px; justify-self: end; width: 100%; }
@media (max-width: 820px) { .hero-in { grid-template-columns: 1fr; padding-top: 36px; } .hero-art { display: none; } }
.feature .ico-tile { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--panel2); border: 1px solid var(--line2); margin-bottom: 12px; color: var(--rift); }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }
.section { margin-top: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 10px; }
.section-head h2 { margin: 0; }

/* lists */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.list > * { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
a.li { display: block; color: var(--text); }
a.li:hover { background: var(--panel2); text-decoration: none; }
.li-title { font-weight: 600; }
.li-meta { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* builds */
.build-card { display: flex; flex-direction: column; gap: 10px; }
.build-card .asc { font-size: 12px; color: var(--ember); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.build-card h3 { font-size: 16px; margin: 0; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.stat-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.gear-item { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.gear-item .slot { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.gear-item .nm { font-weight: 650; font-size: 14px; }
.gear-item.r3 .nm { color: #d98a3a; } .gear-item.r2 .nm { color: #e8d36a; } .gear-item.r1 .nm { color: #8ea8ff; }
.gear-item ul { margin: 6px 0 0; padding: 0; list-style: none; color: #d2c19a; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.4em; } .prose h3 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid var(--line2); color: var(--muted); }
.notes { white-space: pre-wrap; font-size: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 480px; overflow: auto; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* calendar */
.cal-item { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; }
.cal-date { text-align: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 0; }
.cal-date .m { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ember); font-weight: 700; }
.cal-date .d { font-size: 22px; font-weight: 700; line-height: 1.1; }
.countdown { font-variant-numeric: tabular-nums; color: var(--rift); font-weight: 600; }

/* account */
.acct { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.acct-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--top-h) + 16px); }
.acct-nav a { color: var(--muted); padding: 9px 12px; border-radius: 8px; font-size: 14.5px; }
.acct-nav a.on, .acct-nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
@media (max-width: 760px) { .acct { grid-template-columns: 1fr; } .acct-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; } .acct-nav a { white-space: nowrap; } }
.ident { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ident:last-child { border-bottom: 0; }
.ident .ico { width: 28px; height: 28px; flex: none; }

/* toasts */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 11px 14px; font-size: 14px; box-shadow: var(--shadow); animation: tin .2s ease; pointer-events: auto; }
.toast.err { border-color: rgba(239, 107, 107, .5); }
.toast.ok { border-color: rgba(105, 211, 138, .45); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* dialogs */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: var(--radius); padding: 22px; width: min(92vw, 460px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }

/* passive tree */
.tree-app { position: relative; height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); display: grid; grid-template-columns: minmax(0, 1fr) 340px; background: #07080b; }
.tree-stage { position: relative; overflow: hidden; touch-action: none; cursor: grab; }
.tree-stage.dragging { cursor: grabbing; }
.tree-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tree-side { background: var(--bg2); border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.tree-hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; flex-wrap: wrap; }
.tree-hud > * { pointer-events: auto; }
.tree-hud .search { flex: 1 1 220px; max-width: 360px; position: relative; }
.tree-hud .search input { background: rgba(20, 16, 12, .92); padding-right: 70px; }
.tree-hud .search .hits { position: absolute; right: 10px; top: 11px; font-size: 12px; color: var(--muted); }
.hud-chip { background: rgba(20, 16, 12, .92); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.hud-chip b { color: var(--ember); }
.tree-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.tree-zoom button { width: 40px; height: 40px; border-radius: 10px; background: rgba(20, 16, 12, .92); border: 1px solid var(--line2); color: var(--text); font-size: 18px; cursor: pointer; }
.tree-tip { position: absolute; z-index: 5; pointer-events: none; background: rgba(17, 13, 10, .97); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; max-width: 320px; font-size: 13.5px; box-shadow: var(--shadow); }
.tree-tip .tn { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.tree-tip .tn.keystone { color: var(--violet); } .tree-tip .tn.notable { color: var(--ember); }
.tree-tip ul { margin: 0; padding: 0; list-style: none; color: #d2c19a; }
.tree-tip .flav { color: #a88c5b; font-style: italic; margin-top: 6px; }
.tree-tip .cost { margin-top: 6px; color: var(--rift); font-size: 12.5px; }
.node-card { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 6; background: rgba(17, 13, 10, .98); border: 1px solid var(--line2); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); max-height: 46%; overflow: auto; }
.class-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.class-grid button { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 8px 10px; font: 600 13.5px var(--font); cursor: pointer; text-align: left; }
.class-grid button.on { border-color: var(--rift); background: rgba(201, 163, 91, .08); }
.class-grid button small { display: block; font-weight: 400; color: var(--faint); font-size: 11.5px; }
.attr-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.attr-row > div { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 6px; }
.attr-row .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.attr-row .v { font-weight: 700; font-size: 18px; }
.attr-row .str .v { color: #ec7a6a; } .attr-row .dex .v { color: #77d28f; } .attr-row .int .v { color: #7fa8ff; }
.sum-list { font-size: 13px; color: #d2c19a; margin: 0; padding: 0; list-style: none; max-height: 300px; overflow: auto; }
.sum-list li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.sum-list li b { color: var(--text); font-variant-numeric: tabular-nums; }
.tree-tabs { position: absolute; left: 12px; bottom: 12px; }
@media (max-width: 900px) {
  .tree-app { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
  .tree-side { position: fixed; inset: auto 0 0 0; max-height: 72vh; border-left: 0; border-top: 1px solid var(--line2); border-radius: 16px 16px 0 0; transform: translateY(100%); transition: transform .22s ease; z-index: 30; box-shadow: var(--shadow); }
  .tree-side.open { transform: none; }
  .tree-zoom { bottom: 64px; }
}
.side-toggle { display: none; }
@media (max-width: 900px) { .side-toggle { display: inline-flex; } }
.mini-tree { position: relative; height: 420px; border-radius: var(--radius); overflow: hidden; background: #07080b; border: 1px solid var(--line); touch-action: none; }
.mini-tree canvas { width: 100%; height: 100%; display: block; }
/* Patch Day */
.pd-line mark { background: rgba(240, 179, 90, .22); color: var(--text); border-radius: 3px; padding: 0 2px; }
.pd-build > summary::-webkit-details-marker, .pd-sec > summary::-webkit-details-marker { color: var(--faint); }
.pd-sum { border-left: 2px solid rgba(201, 163, 91, .35); padding-left: 8px; }

/* ---- Touches inspired by Uiverse.io (MIT community elements), written fresh for RiftExile ------------------------- */
/* PoE 1 / PoE 2 switch: angled "cyber" tabs with a glowing underline on the active game */
.game-switch { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); margin-right: 6px; }
.game-switch button { position: relative; border: 0; background: transparent; color: var(--muted); font: 700 12.5px var(--font); letter-spacing: .06em;
  padding: 6px 12px; cursor: pointer; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); transition: color .15s, background .15s; }
.game-switch button:hover { color: var(--text); background: var(--panel2); }
.game-switch button.on { color: #1a1208; background: linear-gradient(180deg, #e0bd76, var(--rift)); text-shadow: none; }
.game-switch button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -3px; height: 2px; border-radius: 2px;
  background: var(--rift); box-shadow: 0 0 10px var(--rift), 0 0 20px rgba(201, 163, 91, .5); }

/* Shimmer placeholder while a page loads */
.skel { display: grid; gap: 14px; }
.skel i { display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--panel) 0%, var(--panel2) 40%, var(--panel) 80%);
  background-size: 300% 100%; animation: rx-skel 1.3s ease-in-out infinite; }
.skel .h { height: 32px; width: 45%; } .skel .b { height: 90px; } .skel .w7 { width: 70%; } .skel .w5 { width: 50%; }
@keyframes rx-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Patch Day: builds the patch touched get a glowing, turning edge; untouched ones get a calm "safe" badge */
@property --rx-spin { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.pd-build { position: relative; }
.pd-build.hit::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--rx-spin), transparent 0 50%, var(--ember) 72%, #ffe2ad 78%, var(--ember) 84%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: rx-spin 3.5s linear infinite; }
@keyframes rx-spin { to { --rx-spin: 360deg; } }
.pill.safe { color: var(--good); border-color: rgba(105, 211, 138, .45); background: rgba(105, 211, 138, .08);
  animation: rx-safe .9s cubic-bezier(.2, 1.6, .4, 1) both; box-shadow: 0 0 14px rgba(105, 211, 138, .25); }
@keyframes rx-safe { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .skel i, .pd-build.hit::before, .pill.safe { animation: none; } }
/* New-password checklist */
.pw-rules { list-style: none; padding: 0; margin: -6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--faint); }
.pw-rules li::before { content: "○ "; } .pw-rules li.ok { color: var(--good); } .pw-rules li.ok::before { content: "✓ "; }
