:root {
  --bg: #070a14;
  --stone: #15110c;
  --stone-2: #1d1811;
  --stone-3: #0d0b08;
  --frame: #6b5426;
  --frame-hi: #c9a24a;
  --line: #2e2618;
  --text: #f1e7d0;
  --muted: #a3967c;
  --gold: #ffd100;
  --gold-soft: #f8d877;
  --good: #1eff00;
  --warn: #ffb02e;
  --danger: #ff5a4f;
  --legendary: #ff8000;
  --xp: #8b3fd1;
  --font: 'Alegreya Sans', system-ui, sans-serif;
  --display: 'Cinzel', Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.35;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.warn { color: var(--warn); }

/* Night sky over the Skyborne isles: stars, aurora and low clouds. */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 8%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 22%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 12%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 26%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 6%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 40%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 35%, #fff5 50%, transparent 51%),
    radial-gradient(900px 380px at 75% -5%, rgba(64, 196, 210, .22), transparent 70%),
    radial-gradient(800px 360px at 15% 0%, rgba(120, 90, 220, .18), transparent 70%),
    radial-gradient(1400px 420px at 50% 115%, rgba(150, 175, 210, .14), transparent 70%),
    linear-gradient(180deg, #0a1124 0%, #0b0f1d 45%, #08090f 100%);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 8px 28px;
  background: linear-gradient(180deg, rgba(26, 20, 12, .97), rgba(12, 9, 6, .97));
  border-bottom: 1px solid #000;
  box-shadow: 0 1px 0 var(--frame), 0 3px 0 #000, 0 4px 0 rgba(201,162,74,.35), 0 10px 30px rgba(0,0,0,.5);
}
.brand { display: flex; align-items: center; gap: 4px; text-decoration: none; }
.crest { width: 58px; height: 58px; filter: drop-shadow(0 0 10px rgba(255, 209, 0, .35)); }
.wordmark { display: flex; flex-direction: column; line-height: .9; }
.wm-top {
  font-family: var(--display); font-weight: 900; font-size: 25px; letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(180deg, #fff3b0, #ffd100 50%, #a8730f); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #000);
}
.wm-bottom { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 7px; text-transform: uppercase; color: #9fd8e3; padding-left: 2px; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; background: none; border: 0; padding: 12px 16px;
  font-family: var(--display); font-weight: 700; font-size: 13.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.tab:hover { color: var(--gold-soft); }
.tab.active { color: var(--gold); text-shadow: 0 0 12px rgba(255, 209, 0, .5); }
.tab.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.topbar-actions { display: flex; gap: 8px; }
.roster-switch { display: flex; border-radius: 5px; border: 1px solid #000; box-shadow: 0 0 0 1px var(--frame); overflow: hidden; }
.roster-switch button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 0; background: rgba(0,0,0,.35); color: var(--muted); font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.roster-switch button + button { border-left: 1px solid var(--frame); }
.roster-switch button:hover { color: var(--gold-soft); }
.roster-switch button.active { color: var(--gold); background: linear-gradient(180deg, #2b2213, #15100a); }
.roster-switch small { font-size: 12px; font-weight: 800; padding: 0 6px; border-radius: 8px; background: rgba(0,0,0,.5); color: var(--muted); }

main { max-width: 1680px; margin: 0 auto; padding: 26px 28px 40px; }
.site-foot { max-width: 1680px; margin: 0 auto; padding: 0 28px 40px; color: #6f6656; font-size: 12.5px; text-align: center; }

/* ---------- WoW icons ---------- */
.wicon {
  --s: 36px;
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: var(--s); height: var(--s); border-radius: 4px; overflow: hidden;
  background: #111; border: 1px solid #000;
  box-shadow: 0 0 0 1px #5a4a2c, 0 2px 4px rgba(0,0,0,.6);
  font-size: calc(var(--s) * .5);
}
.wicon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.wicon::after { content: ''; position: absolute; inset: 0; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), inset 0 0 6px rgba(0,0,0,.7); pointer-events: none; }
.wicon b { font-weight: 400; line-height: 1; }
.wicon.sm { --s: 30px; }
.wicon.xs { --s: 20px; border-radius: 3px; box-shadow: 0 0 0 1px #4a3d25; }
.wicon.md { --s: 38px; }
.wicon.lg { --s: 52px; }
.wicon.empty { background: transparent; border: 1px dashed #5a4a2c; box-shadow: none; color: var(--muted); }
.wicon[data-tip] { cursor: help; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 5px; font-weight: 700; font-size: 15px; white-space: nowrap;
  border: 1px solid #000; box-shadow: 0 0 0 1px var(--frame), inset 0 1px 0 rgba(255,255,255,.08);
  background: linear-gradient(180deg, #2b241a, #17120c); color: var(--gold-soft);
}
.btn:hover { box-shadow: 0 0 0 1px var(--frame-hi), 0 0 12px rgba(255,209,0,.2); color: var(--gold); }
.btn.primary {
  color: var(--gold); text-shadow: 0 1px 0 #000;
  background: linear-gradient(180deg, #b3170f 0%, #7d0b07 55%, #520503 100%);
  box-shadow: 0 0 0 1px var(--frame-hi), inset 0 1px 0 rgba(255,180,150,.35), 0 4px 14px rgba(120, 10, 5, .4);
}
.btn.primary:hover { filter: brightness(1.15); }
.btn.ghost { background: rgba(0,0,0,.3); }
.btn.danger { background: linear-gradient(180deg, #7d0b07, #3d0302); color: #ffd0c8; box-shadow: 0 0 0 1px #8a2a20; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 4px;
  border: 0; background: transparent; color: var(--muted); text-decoration: none; font-size: 15px;
}
.icon-btn:hover { background: rgba(255,209,0,.08); color: var(--gold); }
.link { background: none; border: 0; color: var(--muted); font-size: 14px; font-weight: 500; padding: 4px 8px; border-radius: 4px; }
.link:hover { color: var(--gold); background: rgba(255,209,0,.06); }
.link.danger:hover { color: var(--danger); }

/* ---------- framed panels (cards, stats, toolbar, panels, dialog) ---------- */
.card, .stat, .toolbar, .panel, .launch, dialog {
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 40%),
    linear-gradient(180deg, var(--stone-2), var(--stone));
  border: 1px solid #000;
  box-shadow: 0 0 0 1px var(--frame), 0 0 0 2px #000, inset 0 0 0 1px rgba(201,162,74,.12), 0 12px 30px rgba(0,0,0,.45);
  border-radius: 6px;
}

/* ---------- stats & toolbar ---------- */
.stats { display: grid; grid-template-columns: minmax(300px, 2fr) repeat(3, minmax(110px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat { padding: 6px 16px; display: flex; align-items: baseline; gap: 10px; }
.stat b { font-family: var(--display); font-size: 22px; color: var(--gold); line-height: 1.1; text-shadow: 0 2px 0 #000; }
.stat > span { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.launch {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 14px; padding: 6px 16px;
  background:
    radial-gradient(400px 140px at 100% 0%, rgba(64,196,210,.25), transparent 70%),
    linear-gradient(180deg, #13202a, #0d1218);
  box-shadow: 0 0 0 1px #3f7f8a, 0 0 0 2px #000, inset 0 0 0 1px rgba(159,216,227,.15), 0 12px 30px rgba(0,0,0,.45);
}
.launch-count { font-family: var(--display); font-size: 16px; font-weight: 700; }
.launch-count b { color: var(--gold); font-size: 22px; text-shadow: 0 0 14px rgba(255,209,0,.4), 0 2px 0 #000; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px; margin-bottom: 18px; }
.toolbar input[type=search] { flex: 1 1 260px; }
.toolbar input, .toolbar select, .form input, .form select, .form textarea {
  background: #0a0806; border: 1px solid #3a301f; border-radius: 4px; padding: 8px 12px; outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.6);
}
.toolbar input:focus, .toolbar select:focus, .form input:focus, .form select:focus, .form textarea:focus { border-color: var(--frame-hi); box-shadow: 0 0 0 2px rgba(255,209,0,.15), inset 0 1px 3px rgba(0,0,0,.6); }
select option, select optgroup { background: #17120c; color: var(--text); }
.saved { color: var(--muted); font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); display: inline-block; }
.dot.off { background: var(--muted); box-shadow: none; }

/* ---------- card grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr)); gap: 22px; }
.card {
  --cc: #888;
  position: relative; min-width: 0;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px;
  background:
    radial-gradient(420px 180px at 0% 0%, color-mix(in srgb, var(--cc) 14%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 40%),
    linear-gradient(180deg, var(--stone-2), var(--stone));
  transition: transform .15s ease;
}
.card::before {
  content: ''; position: absolute; left: 16px; right: 16px; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cc), transparent); opacity: .8;
}
/* No hover glow on cards: restyling each card as it scrolls under the pointer re-rasterised its big shadows every frame. */
.card.main {
  box-shadow: 0 0 0 1px var(--legendary), 0 0 0 2px #000, 0 0 24px rgba(255,128,0,.25), inset 0 0 0 1px rgba(255,128,0,.2), 0 12px 30px rgba(0,0,0,.45);
}
.card.main::after { content: 'Main'; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); padding: 1px 12px; font-family: var(--display); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; color: var(--legendary); background: #120c06; border: 1px solid var(--legendary); border-radius: 3px; }
.card.dragging { opacity: .4; }
.card.drop-target { transform: scale(1.015); box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(255,209,0,.3); }

.corner { position: absolute; width: 8px; height: 8px; background: linear-gradient(135deg, #fff0a8, var(--frame-hi) 50%, #6b5426); transform: rotate(45deg); border: 1px solid #000; z-index: 1; }
.corner.tl { top: -5px; left: -5px; }
.corner.tr { top: -5px; right: -5px; }
.corner.bl { bottom: -5px; left: -5px; }
.corner.br { bottom: -5px; right: -5px; }

.card-head { display: flex; gap: 14px; align-items: flex-start; }
.ident { flex: 1; min-width: 0; }
.ident h3 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 700; color: #fff; text-shadow: 0 2px 0 #000; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-weight: 700; font-size: 14.5px; margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-shadow: 0 1px 0 #000; }
.meta { margin-top: 5px; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.head-actions { display: flex; flex-direction: column; }
.head-actions .icon-btn { width: 28px; height: 26px; }
.crown { font-size: 17px; }
.crown.on { color: var(--legendary); text-shadow: 0 0 10px rgba(255,128,0,.7); }
.handle { cursor: grab; }

.portrait { position: relative; flex: none; width: 66px; height: 66px; }
.portrait .portrait-race {
  --s: 66px; border-radius: 6px;
  box-shadow: 0 0 0 1px #000, 0 0 0 3px color-mix(in srgb, var(--cc) 70%, #000), 0 0 18px color-mix(in srgb, var(--cc) 35%, transparent);
}
.portrait .portrait-class { --s: 28px; position: absolute; right: -9px; bottom: -9px; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--cc); }
.portrait.sm { width: 52px; height: 52px; }
.portrait.sm .portrait-race { --s: 52px; }
.portrait.sm .portrait-class { --s: 22px; right: -7px; bottom: -7px; }
.modal-portrait .portrait { width: 52px; height: 52px; }
.portrait.unknown { border-radius: 6px; border: 1px dashed #5a4a2c; }
.modal-portrait .portrait-race { --s: 52px; }
.modal-portrait .portrait-class { --s: 22px; right: -7px; bottom: -7px; }

.faction { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; letter-spacing: .3px;
  padding: 2px 10px; border-radius: 3px; white-space: nowrap; text-shadow: 0 1px 0 #000;
  color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, #000); border: 1px solid color-mix(in srgb, var(--pc) 40%, #000);
}
.tag { flex: none; white-space: nowrap; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; padding: 1px 6px; border-radius: 3px; text-shadow: none; }
.tag.warn { color: var(--warn); background: rgba(255,176,46,.1); border: 1px solid rgba(255,176,46,.3); }

.xpbar {
  width: 70px; height: 8px; border-radius: 2px; overflow: hidden; border: 1px solid #000;
  background: repeating-linear-gradient(90deg, #1a1222 0 9%, #000 9% 10%);
}
.xpbar.wide { width: auto; }
.xpbar i { display: block; height: 100%; background: linear-gradient(180deg, #b77aff, var(--xp) 50%, #4b1a7a); box-shadow: 0 0 6px rgba(139,63,209,.7); }

.card h4, .panel h4 {
  margin: 0 0 8px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); font-weight: 800;
  display: flex; align-items: center; gap: 8px; text-shadow: 0 1px 0 #000;
}
.profs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.prof { display: flex; align-items: center; gap: 8px; min-width: 0; }
.prof .wicon { --s: 34px; }
.prof select {
  flex: 1; min-width: 0; padding: 7px 8px; font-size: 15px; border-radius: 4px; font-weight: 600;
  background: #0a0806; border: 1px solid #3a301f; box-shadow: inset 0 1px 3px rgba(0,0,0,.6);
}
.prof select:hover { border-color: var(--frame); }
.prof.locked strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 4px;
  background: #0d0a07; border: 1px solid #2e2618; color: var(--muted); font-size: 14px; font-weight: 600;
}
.chip em { font-style: normal; font-weight: 800; font-size: 12px; }
.chip:not(.on) .wicon { filter: grayscale(1) brightness(.55); }
.chip.on { color: var(--text); border-color: var(--frame); background: linear-gradient(180deg, #241c10, #120d07); }
.chip.on em { color: var(--good); }
.chip:hover { border-color: var(--frame-hi); }

.card-row { display: flex; align-items: center; gap: 10px; }
.card-row .pill { font-size: 12.5px; padding: 2px 8px; }
.sec-toggles { display: flex; gap: 7px; }
.sec-toggle { position: relative; display: inline-flex; padding: 0; border: 0; background: none; }
.sec-toggle .wicon { --s: 30px; }
.sec-toggle:not(.on) .wicon { filter: grayscale(1) brightness(.45); }
.sec-toggle.on .wicon { box-shadow: 0 0 0 1px var(--frame-hi), 0 0 8px rgba(255,209,0,.25); }
.sec-toggle .skill { font-size: 11px; right: -4px; bottom: -5px; }
span.sec-toggle { cursor: help; }
.builds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.build {
  display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 0; min-height: 44px; text-align: left;
  padding: 7px 10px; border-radius: 4px; background: rgba(0,0,0,.35); border: 1px solid #2a2216; box-shadow: inset 0 1px 4px rgba(0,0,0,.5);
}
.build:hover { border-color: var(--frame); background: rgba(255,209,0,.03); }
.build.empty { color: var(--muted); font-size: 14px; font-weight: 600; }
.build-kind { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.build-kind em { font-style: normal; letter-spacing: .5px; color: var(--gold-soft); }
.build.viewable { border-color: var(--frame); }
.build.viewable:hover { border-color: var(--frame-hi); background: rgba(255,209,0,.07); }
.build:hover .build-kind em { color: var(--gold); text-decoration: underline; }
.build-line { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 14.5px; }
.build-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.build-line span { font-size: 13px; white-space: nowrap; }
.treebar { display: flex; gap: 2px; height: 3px; border-radius: 2px; overflow: hidden; }
.tree { background: var(--cc); opacity: .9; }
.treebar:not(.legacy) .tree:nth-child(2) { opacity: .6; }
.treebar:not(.legacy) .tree:nth-child(3) { opacity: .35; }
.ruleset-pick {
  padding: 2px 8px; border-radius: 4px; font-weight: 800; font-size: 13.5px; color: var(--rc); cursor: pointer; outline: none; text-shadow: 0 1px 0 #000;
  background: color-mix(in srgb, var(--rc) 10%, #0a0806); border: 1px solid color-mix(in srgb, var(--rc) 45%, #000);
}
.ruleset-pick:hover { border-color: var(--rc); }
.clamp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes { margin: 0; font-size: 14px; color: #d8c9a3; font-style: italic; border-left: 2px solid var(--frame); padding-left: 10px; }


.add-card {
  align-items: center; justify-content: center; min-height: 150px; color: var(--muted); font-weight: 700; font-size: 15px;
  background: rgba(0,0,0,.25); border: 2px dashed #3a301f; box-shadow: none;
}
.add-card span { font-size: 32px; color: var(--gold); line-height: 1; text-shadow: 0 0 14px rgba(255,209,0,.4); }
.add-card:hover { color: var(--gold-soft); border-color: var(--frame-hi); box-shadow: none; }
.add-card::before { display: none; }
.empty-note { text-align: center; color: var(--muted); }

/* ---------- pages ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-family: var(--display); margin: 0 0 4px; font-size: 30px; color: var(--gold); text-shadow: 0 2px 0 #000, 0 0 18px rgba(255,209,0,.25); }
.page-head p { margin: 0; }
.panel { padding: 18px; margin-bottom: 22px; }

/* professions page */
.class-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.class-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 4px; background: rgba(0,0,0,.3); border: 1px solid color-mix(in srgb, var(--cc) 35%, #000); }
.class-tile b { font-family: var(--display); font-size: 22px; color: var(--cc); text-shadow: 0 2px 0 #000; }
.class-tile small { color: var(--muted); font-weight: 600; }
.class-tile.none { opacity: .35; filter: grayscale(.8); }
.ptable { display: flex; flex-direction: column; }
.prow { display: grid; grid-template-columns: 230px 50px 1fr; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #2a2216; }
.prow:first-child { border-top: 0; }
.prow-name { display: flex; align-items: center; gap: 12px; }
.prow-name div { display: flex; flex-direction: column; }
.prow-count { font-family: var(--display); font-size: 22px; color: var(--gold); text-align: center; }
.prow.missing .prow-count { color: var(--danger); }
.prow-who { display: flex; flex-wrap: wrap; gap: 6px; }
.mini { display: inline-flex; align-items: center; gap: 6px; border: 1px solid color-mix(in srgb, var(--cc) 40%, #000); background: rgba(0,0,0,.35); color: var(--cc); border-radius: 4px; padding: 3px 10px 3px 3px; font-size: 14px; font-weight: 700; }
.mini:hover { border-color: var(--cc); }
.sec { display: grid; grid-template-columns: 160px 1fr 50px; gap: 12px; align-items: center; padding: 7px 0; }
.sec span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sec .xpbar { height: 12px; }

.settings { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.settings select { background: #0a0806; border: 1px solid #3a301f; border-radius: 4px; padding: 4px 8px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: -8px; }
.empty-note .link { text-decoration: underline; padding: 0 2px; font-size: inherit; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); }

/* ---------- modal & forms ---------- */
dialog { padding: 0; color: var(--text); width: min(780px, calc(100vw - 32px)); box-shadow: 0 0 0 1px var(--frame-hi), 0 0 0 2px #000, 0 30px 80px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(3, 4, 8, .8); }
.form { padding: 22px; }
.modal-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #2a2216; }
.modal-head h2 { margin: 0; flex: 1; font-family: var(--display); font-size: 23px; color: var(--gold); text-shadow: 0 2px 0 #000; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-grid label:not(.check) { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 700; }
.form-grid label input, .form-grid label select, .form-grid label textarea { color: var(--text); font-weight: 500; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
fieldset { border: 1px solid #3a301f; border-radius: 4px; padding: 12px 14px; margin: 0; background: rgba(0,0,0,.2); }
legend { padding: 0 6px; font-size: 13px; color: var(--gold); font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; }
legend .muted { text-transform: none; letter-spacing: 0; }
/* Dropdowns with icons: Chrome's customisable <select>. Other browsers skip this block and show a plain list. */
.opt-icon { flex: none; width: 22px; height: 22px; border-radius: 3px; border: 1px solid #000; box-shadow: 0 0 0 1px #5a4a2c; }
@supports (appearance: base-select) {
  select.rich, select.rich::picker(select) { appearance: base-select; }
  select.rich { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
  select.rich > button { all: unset; flex: 1; min-width: 0; }
  select.rich selectedcontent { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
  select.rich::picker-icon { color: var(--muted); }
  select.rich::picker(select) { margin-top: 4px; padding: 4px; border-radius: 4px; border: 1px solid var(--frame); background: #17120c; box-shadow: 0 12px 30px rgba(0,0,0,.6); }
  select.rich option { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 3px; background: none; font-size: 15.5px; font-weight: 500; }
  select.rich option:hover, select.rich option:focus-visible { background: rgba(255,209,0,.1); outline: none; }
  select.rich option:checked { color: var(--gold); font-weight: 700; }
  select.rich option::checkmark { display: none; }
  select.rich option:disabled { opacity: .35; }
  select.rich option[style] { color: var(--rc); }
  select.rich.ruleset-pick { padding: 2px 8px 2px 3px; gap: 6px; }
  select.rich.ruleset-pick .opt-icon { width: 18px; height: 18px; }
  select.rich.ruleset-pick option .opt-icon { width: 22px; height: 22px; }
  select.rich.ruleset-pick::picker(select) { min-width: 150px; }
  .prof select.rich { padding: 5px 8px; }
  .prof select.rich selectedcontent img { display: none; } /* the slot's own icon sits right beside it */
  .prof select.rich::picker(select) { min-width: 190px; }
  select.rich optgroup { background: none; font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 800; padding-top: 4px; }
  select.rich optgroup option { font-size: 15.5px; letter-spacing: 0; text-transform: none; color: var(--text); }
}
.build-fields { display: grid; grid-template-columns: 1fr 2fr; gap: 8px 12px; }
.build-read { grid-column: 1 / -1; margin: 0; font-size: 13.5px; color: var(--muted); }
.tb-row { display: grid; grid-template-columns: 1fr 2fr auto auto; gap: 6px 10px; align-items: end; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed #2a2216; }
.tb-row .icon-btn { margin-bottom: 4px; }
.tb-row:first-child .tb-first { visibility: hidden; }
.tb-row:only-child .tb-remove { visibility: hidden; }
.add-build { margin-left: -8px; }
.build-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.build-tabs button { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 12px; border-radius: 4px; border: 1px solid #3a301f; background: #0a0806; color: var(--muted); font-weight: 700; }
.build-tabs button:hover { border-color: var(--frame); color: var(--gold-soft); }
.build-tabs button.active { color: var(--gold); border-color: var(--frame-hi); background: linear-gradient(180deg, #2b2213, #15100a); }
.build-tabs small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.calc-missing { margin: 0; padding: 30px 0; text-align: center; }
.build-read b { color: var(--text); }
.build-read a { color: var(--gold-soft); }
.from-game { margin: 0; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 4px; font-size: 14px; color: #b9f5a8; background: rgba(30,255,0,.05); border: 1px solid rgba(30,255,0,.2); }
.form-warn { color: var(--warn); font-size: 14px; min-height: 1em; margin: 12px 0 0; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; }
.modal-foot .remove { margin-right: auto; }
.modal-foot a.btn { text-decoration: none; }
dialog:has(.calc-frame) { width: min(1280px, calc(100vw - 32px)); }
/* The frame is exactly as tall as Wowhead's embedded calculator (plus its own 1px border each side): 512px, or
   566px when the link records the order talents were taken in, which adds a closed "Talent Order" bar. Anything
   taller shows the embed's own black page underneath. Opening Talent Order scrolls inside the frame. */
.calc-frame { display: block; width: 100%; height: min(514px, calc(100vh - 230px)); min-height: 320px; border: 1px solid #000; border-radius: 4px; background: #181818; box-shadow: 0 0 0 1px var(--frame); }
.calc-frame.ordered { height: min(568px, calc(100vh - 230px)); }
.legacy-view { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.legacy-view h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--lc); }
.legacy-view h4 b { margin-left: auto; font-size: 16px; }
.lnode { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 14.5px; font-weight: 600; }
.lnode span:not(.wicon) { flex: 1; min-width: 0; }
.lnode b { color: var(--lc); }
.lnode.zero { opacity: .4; }
.lnode.zero b { color: var(--muted); }
.confirm p { margin: 0 0 8px; font-size: 17px; }


/* WoW-style tooltip */
#tooltip {
  position: fixed; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .1s;
  max-width: 280px; padding: 8px 11px; border-radius: 5px;
  background: rgba(8, 9, 28, .94); border: 1px solid #000; box-shadow: 0 0 0 1px #8b8b9e, 0 8px 22px rgba(0,0,0,.6);
  display: flex; flex-direction: column; gap: 2px; font-size: 14px;
}
#tooltip.show { opacity: 1; }
#tooltip strong { font-size: 15.5px; color: #fff; }
#tooltip span { color: var(--gold); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, #241c10, #120d07); color: var(--gold); font-weight: 700;
  border: 1px solid #000; box-shadow: 0 0 0 1px var(--frame-hi); padding: 10px 18px; border-radius: 5px; transition: .2s; z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .launch { grid-column: span 3; }
}
@media (max-width: 900px) {
  .prow { grid-template-columns: 1fr 40px; }
  .prow-who { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 6px 10px; padding: 8px 16px; }
  .crest { width: 46px; height: 46px; }
  .tabs { order: 3; flex-basis: 100%; justify-content: space-between; gap: 0; }
  .tab { padding: 10px 3px; font-size: 11px; letter-spacing: .2px; }
  .tab.active::after { left: 4px; right: 4px; }
  .topbar-actions { margin-left: auto; }
  .roster-switch { order: 2; flex-basis: 100%; }
  .roster-switch button { flex: 1; justify-content: center; padding: 6px 8px; }
  .topbar-actions .btn { padding: 6px 10px; font-size: 13px; }
  .wm-top { font-size: 20px; }
  .wm-bottom { font-size: 10px; letter-spacing: 5px; }
  .toolbar input[type=search] { flex-basis: 100%; }
  .toolbar select { flex: 1 1 0; min-width: 0; padding: 6px; }
  main { padding: 18px 16px 40px; }
  .site-foot { padding: 0 16px 30px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat { padding: 6px 10px; gap: 6px; }
  .stat > span { font-size: 11px; letter-spacing: .5px; }
  .grid { grid-template-columns: 1fr; }
  .form-grid, .build-fields, .legacy-view { grid-template-columns: 1fr; }
  .tb-row { grid-template-columns: 1fr auto auto; }
  .tb-row label { grid-column: 1 / -1; }
  .span2 { grid-column: auto; }
  .saved { margin-left: 0; }
}

/* ---------- live game data ---------- */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); display: inline-block; flex: none; }
.live-dot.err { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
/* Nothing on the page animates forever: an endless animation keeps the browser drawing 60+ frames a second even when idle. */
.live-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 4px; font-size: 13.5px; font-weight: 700; color: #b9f5a8; background: rgba(30,255,0,.06); border: 1px solid rgba(30,255,0,.25); }
.live-badge:hover { background: rgba(30,255,0,.12); }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -12px 0 24px; padding: 10px 14px; border-radius: 5px; background: rgba(30,255,0,.05); border: 1px solid rgba(30,255,0,.25); }

.ingame { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border-radius: 4px; font-size: 14px; font-weight: 600; background: linear-gradient(180deg, rgba(30,255,0,.05), rgba(0,0,0,.25)); border: 1px solid rgba(30,255,0,.2); }
.ig-top { display: flex; align-items: center; gap: 8px; color: #b9f5a8; cursor: help; white-space: nowrap; }
.ig-stats { display: flex; align-items: center; gap: 12px; }
.ig-stats > span { display: inline-flex; align-items: center; gap: 4px; cursor: help; white-space: nowrap; }
.ig-map { margin-left: auto; padding: 0 2px; }
.xpbar.big { position: relative; flex: 1; min-width: 40px; width: auto; height: 8px; }
.xpbar.big s { position: absolute; top: 0; bottom: 0; background: rgba(0,112,221,.55); text-decoration: none; }
.coin { display: inline-flex; align-items: center; gap: 2px; margin-right: 4px; }
.coin::after { content: ''; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 -2px 2px rgba(0,0,0,.4); }
.coin.gold::after { background: radial-gradient(circle at 35% 35%, #fff3a0, #e0a800); }
.coin.silver::after { background: radial-gradient(circle at 35% 35%, #fff, #9aa3ad); }
.coin.copper::after { background: radial-gradient(circle at 35% 35%, #ffc59a, #b0602c); }

.prof-icon { position: relative; flex: none; display: inline-flex; }
.skill {
  position: absolute; right: -3px; bottom: -5px; z-index: 1; font-size: 13px; font-weight: 800; cursor: help; color: #fff;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 4px #000;
}
.skill.none { color: #8a8a8a; }

/* ---------- journeys ---------- */
.char-pick { display: flex; align-items: center; gap: 10px; }
.char-pick select { background: #0a0806; border: 1px solid #3a301f; border-radius: 4px; padding: 9px 12px; font-weight: 700; }
.journey { display: grid; grid-template-columns: 290px 1fr; gap: 22px; align-items: start; }
.journey-side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow: auto; }
.journey-side h4:not(:first-child) { margin-top: 12px; }
.zone { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 8px 12px; border-radius: 4px; background: rgba(0,0,0,.3); border: 1px solid #2a2216; }
.zone strong { display: flex; align-items: center; gap: 8px; }
.zone:hover { border-color: var(--frame); }
.zone.active { border-color: var(--frame-hi); background: linear-gradient(90deg, rgba(255,209,0,.1), rgba(0,0,0,.3)); }
.zone .dead { color: var(--danger); }
.swatch-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.journey-main { min-width: 0; }
.map-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.map-head h3 { margin: 0; font-family: var(--display); color: var(--gold); font-size: 22px; text-shadow: 0 2px 0 #000; }
.map-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); flex: 1; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { width: 22px; height: 0; border-top: 3px solid var(--gold); }
.lg-line.ghost { border-top: 3px dashed #9ec9ff; }
.lg-line.flight { border-top: 3px dotted #ffb347; }
.lg-death { color: #ff6b6b; } .lg-level { color: var(--gold); } .lg-quest { color: #ffe066; }
.map-wrap { position: relative; border-radius: 4px; overflow: hidden; border: 1px solid #000; box-shadow: 0 0 0 1px var(--frame), inset 0 0 40px rgba(0,0,0,.6); background: #1b160e; }
#map-svg { display: block; width: 100%; aspect-ratio: 1002 / 668; }
.map-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: rgba(0,0,0,.4); }
.map-paper { fill: #2a2114; }
.map-image { opacity: .8; }
.map-grid { stroke: rgba(255,220,150,.08); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-coord { fill: rgba(255,220,150,.25); font-size: 11px; font-family: var(--font); }
.route { fill: none; stroke: var(--rc); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 2px rgba(0,0,0,.9)); }
.route.ghost { stroke: #9ec9ff; stroke-dasharray: 6 5; opacity: .85; }
.route.flight { stroke: #ffb347; stroke-dasharray: 1 6; stroke-width: 3.5; }
.mk { cursor: help; }
.mk circle { fill: #120d07; stroke-width: 2; vector-effect: non-scaling-stroke; }
.mk text { font-size: 13px; font-weight: 800; text-anchor: middle; pointer-events: none; }
.mk.death circle { stroke: #ff5a4f; } .mk.death text { fill: #ff6b6b; }
.mk.level circle { stroke: var(--gold); } .mk.level text { fill: var(--gold); }
.mk.quest circle { stroke: #ffe066; } .mk.quest text { fill: #ffe066; }
.mk-start { fill: var(--good); stroke: #000; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: help; }
.mk-here circle { fill: var(--cc); stroke: #000; stroke-width: 2; vector-effect: non-scaling-stroke; }
.mk-here .pulse { fill: none; stroke: var(--cc); stroke-width: 2; opacity: .5; vector-effect: non-scaling-stroke; }
.scrub { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.scrub input { flex: 1; accent-color: var(--gold); }
.scrub span { min-width: 120px; text-align: right; }
.map-hint { margin: 10px 0 0; }
code { background: rgba(0,0,0,.4); border: 1px solid #2a2216; padding: 1px 5px; border-radius: 3px; font-size: .9em; color: var(--gold-soft); }
.event-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.event-log li { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-bottom: 1px solid #221b12; }
.event-log li div { display: flex; flex-direction: column; }
.ev-icon { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #120d07; border: 1px solid #3a301f; font-weight: 800; }
.event-log .death .ev-icon { color: #ff6b6b; border-color: #8a2a20; }
.event-log .level .ev-icon { color: var(--gold); border-color: var(--frame-hi); }
.event-log .quest .ev-icon { color: #ffe066; }
.setup ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 900px) {
  .journey { grid-template-columns: 1fr; }
  .journey-side { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .char-pick { width: 100%; }
  .char-pick select { flex: 1; min-width: 0; }
  .scrub span { min-width: 0; }
  .map-panel { padding: 12px; }
}

/* ---------- bank alts ---------- */
.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 24px 0 12px; }
.section-head h3 { margin: 0; font-family: var(--display); color: var(--gold); font-size: 22px; text-shadow: 0 2px 0 #000; }
.bank-grid { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.bank-card { gap: 10px; }
.bank-card .ident h3 { white-space: normal; overflow: visible; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.tag.bank { color: #ffe9a8; background: rgba(255,209,0,.12); border: 1px solid rgba(255,209,0,.35); font-family: var(--font); }
.bank-gold { margin-left: auto; font-weight: 700; white-space: nowrap; cursor: help; }
.chip.purpose { cursor: default; padding-right: 10px; }
.slot-meters { display: flex; flex-direction: column; gap: 6px; }
.slots { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; font-weight: 600; }
.slots .meter { height: 8px; border-radius: 2px; background: #1a150e; border: 1px solid #000; overflow: hidden; }
.slots .meter i { display: block; height: 100%; background: linear-gradient(180deg, #ffe066, #c99400); }
.slots.full .meter i { background: linear-gradient(180deg, #ff7a6e, #a3170f); }
.slots.full b { color: var(--danger); }
.add-card.small { min-height: 120px; }
.contents h4 { margin-bottom: 6px; }
.item-list { display: grid; grid-template-columns: 1fr; gap: 2px; }
.item-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 2px 0; border-bottom: 1px dashed #2a2216; }
.item { text-decoration: none; font-weight: 600; text-shadow: 0 1px 0 #000; }
.item:hover { text-decoration: underline; }
.stat em { font-style: normal; text-transform: none; letter-spacing: 0; }
.bank-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.gold-total { font-family: var(--font) !important; font-size: 22px !important; color: var(--text) !important; }
.hints ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.hints li::marker { color: var(--warn); }
.find { margin-top: 24px; }
.bank-search { width: 100%; background: #0a0806; border: 1px solid #3a301f; border-radius: 4px; padding: 10px 14px; margin-bottom: 14px; outline: none; }
.bank-search:focus { border-color: var(--frame-hi); }
.results { display: flex; flex-direction: column; }
.result { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 12px; padding: 9px 0; border-top: 1px solid #2a2216; align-items: center; }
.result:first-child { border-top: 0; }
.result-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.result-name b { color: var(--gold); }
.holders { display: flex; flex-wrap: wrap; gap: 6px; }
.holder { font-size: 13.5px; padding: 2px 9px; border-radius: 4px; background: rgba(0,0,0,.35); border: 1px solid #2a2216; }
.holder.is-bank { border-color: rgba(255,209,0,.35); }
.role-toggle { display: flex; gap: 8px; }
.role-toggle label { flex: 1; cursor: pointer; }
.role-toggle input { position: absolute; opacity: 0; }
.role-toggle span { display: block; text-align: center; padding: 9px; border-radius: 4px; border: 1px solid #3a301f; background: #0a0806; color: var(--muted); font-weight: 700; }
.role-toggle input:checked + span { color: var(--gold); border-color: var(--frame-hi); background: linear-gradient(180deg, #2b2213, #15100a); }
.role-toggle input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.purposes { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.form-grid[data-role="bank"] .char-only, .form-grid:not([data-role="bank"]) .bank-only { display: none; }
@media (max-width: 640px) {
  .result { grid-template-columns: 1fr; }
}
