/* Armory look: dark leather/stone background, bronze frames, gold accents */
:root {
  --bg: #0e0a07;
  --panel: #1a130e;
  --panel-2: #231a12;
  --panel-3: #2c2016;
  --bronze: #a8743a;
  --bronze-dark: #5e3f1d;
  --bronze-light: #e2b46c;
  --gold: #f0c96a;
  --text: #ece0c8;
  --muted: #a8977c;
  --q-poor: #9d9d9d; --q-common: #ffffff; --q-uncommon: #1eff00; --q-rare: #0070dd;
  --q-epic: #a335ee; --q-legendary: #ff8000; --q-artifact: #e6cc80;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; min-height: 100vh;
  background:
    radial-gradient(900px 500px at 50% -5%, rgba(168,116,58,.22), transparent 65%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px),
    var(--bg);
}
.hidden { display: none !important; }

/* Bronze frame: outer bronze line + inner dark line + soft glow */
.frame {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--bronze);
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(226,180,108,.15), inset 0 0 40px rgba(0,0,0,.55), 0 10px 30px rgba(0,0,0,.5);
  border-radius: 6px;
  position: relative;
}
.frame::before, .frame::after {   /* corner rivets */
  content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--bronze-light), var(--bronze-dark));
  top: 6px; left: 6px; box-shadow: 0 0 0 1px #000;
}
.frame::after { left: auto; right: 6px; }

/* Logo centred; tagline on the left, languages and account on the right */
.topbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; padding: 14px 24px;
  border-bottom: 1px solid var(--bronze-dark); background: linear-gradient(180deg, #1c140d, #120d09);
  box-shadow: 0 1px 0 rgba(226,180,108,.12);
}
.brand { font-family: Cinzel, serif; font-size: 30px; letter-spacing: 1px; color: var(--bronze-light); text-shadow: 0 2px 0 #000;
  text-decoration: none; text-align: center; white-space: nowrap; }
.brand span { color: var(--gold); }
.tagline { color: var(--muted); }
.topbar-end { display: flex; align-items: center; justify-content: flex-end; gap: 18px; flex-wrap: wrap; }
.langs { display: flex; gap: 6px; }
.lang {
  width: 34px; height: 26px; border-radius: 4px; border: 1px solid var(--bronze-dark); background: var(--panel) center/cover;
  cursor: pointer; padding: 0; opacity: .6; transition: opacity .15s, border-color .15s; overflow: hidden;
}
.lang .fi { width: 100%; height: 100%; display: block; background-size: cover; }
.lang:hover { opacity: .9; }
.lang.active { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 1px #000, 0 0 8px rgba(240,201,106,.35); }

.wrap { max-width: 1140px; margin: 0 auto; padding: 20px 16px 40px; }

/* pickers */
.picker { display: grid; gap: 12px; margin-bottom: 18px; padding: 16px 18px; }
.picker-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.label { color: var(--bronze-light); font-family: Cinzel, serif; margin-right: 4px; }
.chip {
  background: linear-gradient(180deg, var(--panel-3), var(--panel)); border: 1px solid var(--bronze-dark); color: var(--text);
  padding: 7px 12px; border-radius: 4px; cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s;
}
.chip:hover { border-color: var(--bronze); }
.chip.active { border-color: var(--gold); box-shadow: inset 0 0 12px color-mix(in srgb, var(--c, var(--gold)) 30%, transparent), 0 0 0 1px #000; }
.chip.class { color: var(--c); font-weight: 600; }
.chip .role { color: var(--muted); font-size: 12px; margin-left: 6px; }
.level-row { gap: 12px; }
.level-buttons { display: flex; gap: 6px; }
.slider-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.slider-wrap input { flex: 1; accent-color: var(--bronze); }
.slider-wrap output { min-width: 28px; font-weight: 600; text-align: right; color: var(--gold); }

/* faction toggle */
.faction { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 4px; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--text); background: linear-gradient(180deg, var(--panel-3), var(--panel));
  border: 1px solid var(--bronze-dark); opacity: .6; transition: opacity .15s, border-color .15s, box-shadow .15s; }
.faction:hover { opacity: .9; }
.faction-icon { width: 28px; height: 28px; border-radius: 3px; background: center/cover; box-shadow: 0 0 0 1px #000; }
.faction.alliance.active { opacity: 1; border-color: #4a7fd4; color: #9cc0ff; box-shadow: inset 0 0 12px rgba(74,127,212,.35), 0 0 0 1px #000; }
.faction.horde.active { opacity: 1; border-color: #c0392b; color: #ff9c8f; box-shadow: inset 0 0 12px rgba(192,57,43,.35), 0 0 0 1px #000; }
.data-versions { color: var(--muted); font-size: 11px; opacity: .8; }

/* armory */
.armory {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) minmax(0, 1fr);
  grid-template-areas: "left center right" "bottom bottom bottom"; gap: 14px; padding: 22px 18px 18px;
}
.col { display: flex; flex-direction: column; gap: 8px; }
.left { grid-area: left; } .right { grid-area: right; }
.center { grid-area: center; position: relative; }
.bottom { grid-area: bottom; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  border-top: 1px solid var(--bronze-dark); padding-top: 14px; }

.slot {
  display: flex; align-items: center; gap: 10px; padding: 5px; border-radius: 4px; width: 100%; min-height: 58px;
  background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,.1)); border: 1px solid rgba(94,63,29,.6);
  cursor: pointer; text-align: left; color: inherit; font: inherit;
}
.slot:hover, .slot.selected { border-color: var(--bronze); background: linear-gradient(90deg, rgba(168,116,58,.16), rgba(0,0,0,.1)); }
.right .slot { flex-direction: row-reverse; text-align: right; background: linear-gradient(270deg, rgba(0,0,0,.35), rgba(0,0,0,.1)); }
.icon {
  width: 46px; height: 46px; border-radius: 4px; flex: none; background: #0b0806 center/cover no-repeat;
  border: 2px solid var(--qc, var(--bronze-dark)); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(0,0,0,.6), 0 0 8px color-mix(in srgb, var(--qc, transparent) 35%, transparent);
}
.icon.empty { border-color: var(--bronze-dark); border-style: dashed; opacity: .55; box-shadow: none; }
.slot-text { min-width: 0; }
.slot-name { font-weight: 600; color: var(--qc, var(--muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 #000; }
.slot-meta { color: var(--muted); font-size: 12px; }

.hero {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px;
  border-radius: 4px; padding: 24px 12px; border: 1px solid var(--bronze-dark);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c, var(--gold)) 20%, transparent), transparent 70%), rgba(0,0,0,.25);
}
.crest { width: 70px; height: 70px; border-radius: 50%; margin-bottom: 8px;
  background: radial-gradient(circle, color-mix(in srgb, var(--c, var(--gold)) 55%, #000) 0 45%, transparent 46%),
              radial-gradient(circle at 35% 30%, var(--bronze-light), var(--bronze-dark) 70%);
  box-shadow: 0 0 0 2px #000, 0 0 18px rgba(226,180,108,.25); }
.hero-class { font-family: Cinzel, serif; font-size: 30px; color: var(--c, var(--gold)); text-shadow: 0 2px 0 #000; }
.hero-spec { font-size: 16px; }
.hero-level { color: var(--muted); }
.hero-score { margin-top: 16px; display: flex; flex-direction: column; }
.hero-score span { font-family: Cinzel, serif; font-size: 34px; color: var(--gold); text-shadow: 0 2px 0 #000; }
.hero-score small { color: var(--muted); }

.paywall { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 20px; border-radius: 4px; background: rgba(14,10,7,.94); border: 1px solid var(--gold); box-shadow: 0 0 24px rgba(240,201,106,.15); }
.paywall .lock { font-size: 34px; }
.paywall h3 { font-family: Cinzel, serif; color: var(--gold); margin: 6px 0; }
.paywall p { color: var(--muted); }
.btn-premium { background: linear-gradient(180deg, var(--bronze-light), var(--bronze)); color: #1a1006; border: 1px solid #000;
  padding: 9px 18px; border-radius: 4px; font-family: Cinzel, serif; font-weight: 700; opacity: .75; }
.armory.locked .slot { filter: blur(3px) grayscale(.6); pointer-events: none; }

/* tooltip (WoW style) — used on hover and in the detail panel */
.tt { background: rgba(6,8,16,.96); border: 1px solid #5b6578; border-radius: 4px; padding: 10px 12px;
  box-shadow: 0 0 0 1px #000, 0 6px 24px rgba(0,0,0,.7); max-width: 320px; }
.tt h4 { margin: 0 0 2px; color: var(--qc); font-size: 15px; }
.tt .row { color: #fff; font-size: 13px; }
.tt .muted { color: var(--muted); font-size: 12px; }
.tt .gold { color: #ffd100; }
.tt .stat { color: #fff; font-size: 13px; }
.tt .req { color: #fff; font-size: 13px; }
.tt .est { color: #ff9a3c; font-size: 13px; }
.tt a { color: var(--gold); font-size: 12px; }
.tt.floating { position: fixed; z-index: 50; pointer-events: none; }

/* detail */
.detail { margin-top: 14px; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.detail .tt { max-width: none; }
.alts h5 { margin: 0 0 8px; color: var(--bronze-light); font-family: Cinzel, serif; font-weight: 600; }
.alt { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--bronze-dark); }
.alt .icon { width: 34px; height: 34px; }
.score { color: var(--gold); font-weight: 600; margin-left: auto; }

/* item sources + hide controls */
.sources { margin-top: 8px; padding-top: 6px; border-top: 1px solid #2a3042; }
.src { display: flex; gap: 6px; font-size: 12.5px; color: #fff; margin-top: 4px; line-height: 1.35; }
.src-ico { width: 16px; flex: none; text-align: center; }
.tag { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; padding: 0 5px; border-radius: 3px;
  border: 1px solid var(--bronze-dark); color: var(--bronze-light); margin-left: 4px; }
.rate { color: var(--gold); font-weight: 600; margin-left: 2px; }
.tag.raid { border-color: #a335ee; color: #c58cf5; }
.btn-hide { margin-top: 10px; background: linear-gradient(180deg, #3a1d14, #24120c); color: #f3c7b8; border: 1px solid #7a3420;
  padding: 6px 12px; border-radius: 4px; cursor: pointer; font: inherit; font-size: 13px; }
.btn-hide:hover { border-color: #c25a3a; }
.hint { margin-top: 4px; }
.alt-text { min-width: 0; flex: 1; }
.alt .x { background: none; border: 1px solid transparent; border-radius: 4px; cursor: pointer; padding: 2px 4px; opacity: .55; }
.alt .x:hover { opacity: 1; border-color: #7a3420; }
.hidden-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 8px 14px; border: 1px solid var(--bronze-dark);
  border-radius: 4px; background: rgba(0,0,0,.3); color: var(--muted); font-size: 13px; }
.link { background: none; border: 0; color: var(--gold); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

/* account (login) */
.account { display: flex; align-items: center; gap: 8px; position: relative; }
.account .who { color: var(--bronze-light); font-weight: 600; }
.login-menu { position: absolute; right: 0; top: 110%; z-index: 40; display: flex; flex-direction: column; gap: 6px;
  padding: 10px; min-width: 210px; background: var(--panel); border: 1px solid var(--bronze); border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.btn-provider { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 4px; text-decoration: none;
  font-weight: 600; color: #fff; border: 1px solid #000; }
.btn-provider.battlenet { background: #148eff; }
.btn-provider.google { background: #fff; color: #222; }
.btn-provider:hover { filter: brightness(1.08); }

/* report dialog + toast */
.btn-report { background: none; border: 1px solid var(--bronze-dark); color: var(--muted); padding: 9px 14px; border-radius: 4px;
  cursor: pointer; font: inherit; }
.btn-report.small { margin-top: 10px; margin-left: 6px; padding: 6px 10px; font-size: 13px; }
.btn-report:hover { color: var(--text); border-color: var(--bronze); }
.about-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.modal { padding: 22px; width: min(520px, calc(100vw - 32px)); color: var(--text); }
.modal::backdrop { background: rgba(0,0,0,.65); }
.modal h3 { margin: 0 0 12px; font-family: Cinzel, serif; color: var(--bronze-light); }
.modal label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.modal select, .modal textarea, .modal input { font: inherit; color: var(--text); background: #0b0806; border: 1px solid var(--bronze-dark);
  border-radius: 4px; padding: 8px; }
.modal textarea { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.report-status { min-height: 1.2em; margin: 0 0 8px; font-size: 13px; }
.report-status.error { color: #ff8f7a; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 4px;
  background: var(--panel); border: 1px solid var(--bronze); box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.footer-links { font-size: 12px; }
.footer-links a { color: var(--muted); }
.ad ins { width: 100%; height: 100%; }
.ad.live { border: 0; background: none; }

/* about me + donation */
.about { display: flex; align-items: center; gap: 18px; margin-top: 22px; padding: 18px 22px; flex-wrap: wrap; }
.about-text { flex: 1; min-width: 240px; }
.about h3 { margin: 0 0 6px; font-family: Cinzel, serif; color: var(--bronze-light); }
.about p { margin: 0; color: var(--text); }
.btn-donate { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 4px; text-decoration: none;
  font-family: Cinzel, serif; font-weight: 700; color: #1a1006; border: 1px solid #000;
  background: linear-gradient(180deg, var(--gold), var(--bronze)); box-shadow: 0 0 0 1px rgba(240,201,106,.3), 0 4px 14px rgba(0,0,0,.4); }
.btn-donate:hover { filter: brightness(1.08); }
.donate-icon { font-size: 18px; }

.disclaimer { color: var(--muted); font-size: 12px; margin-top: 22px; }

/* ad slots (placeholders). body.ads-off hides them; sizes follow standard IAB units */
.ad { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; border: 1px dashed var(--bronze-dark); background: rgba(0,0,0,.25); border-radius: 4px; }
.ad-leaderboard { width: min(728px, calc(100% - 32px)); height: 90px; margin: 14px auto 0; }
.ad-incontent { width: 100%; max-width: 728px; height: 90px; margin: 18px auto 0; }
.ad-footer { width: 100%; max-width: 970px; height: 90px; margin: 18px auto 0; }
.ad-rail { position: fixed; top: 140px; width: 160px; height: 600px; display: none; }
.ad-rail-left { left: calc(50% - 570px - 16px - 160px - 16px); }
.ad-rail-right { right: calc(50% - 570px - 16px - 160px - 16px); }
@media (min-width: 1560px) { .ad-rail { display: flex; } }
@media (max-width: 760px) { .ad-leaderboard, .ad-incontent { height: 100px; max-width: 320px; } }
body.ads-off .ad { display: none !important; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 10px; }
  .topbar .brand { order: -1; }
  .topbar-end { justify-content: center; }
}
@media (max-width: 820px) {
  .armory { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "center center" "left right" "bottom bottom"; }
  .hero { padding: 14px; }
  .right .slot { flex-direction: row; text-align: left; background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,.1)); }
  .bottom { grid-template-columns: minmax(0, 1fr); }
  .detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .armory { grid-template-columns: minmax(0, 1fr); grid-template-areas: "center" "left" "right" "bottom"; padding: 18px 12px 12px; }
  .topbar { padding: 12px 16px; }
}
@media (hover: none) { .tt.floating { display: none !important; } }

/* Reference talents + stat priority (own weights, ADR-0025) */
.talents { margin-top: 14px; padding: 18px; }
.talents h3 { font-family: Cinzel, serif; color: var(--bronze-light); font-size: 15px; margin: 0 0 10px; }
.talents h3:not(:first-child) { margin-top: 16px; }
.talent-trees { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.talent-tree { background: var(--panel-3); border: 1px solid var(--bronze-dark); border-radius: 6px; padding: 10px 12px; }
.talent-tree h4 { margin: 0 0 6px; font-size: 13px; color: var(--bronze-light); display: flex; justify-content: space-between; }
.talent-tree h4 small { color: var(--gold); }
.talent-tree ul { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.talent-tree li { padding: 2px 0; }
.talent-tree .rank { display: inline-block; min-width: 18px; color: var(--gold); font-weight: 700; }
.stat-prio { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-chip { background: var(--panel-3); border: 1px solid var(--bronze-dark); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.stat-chip b { color: var(--gold); margin-left: 4px; }
.talents .muted { color: var(--muted); }
.talents .small { font-size: 12px; margin-top: 12px; }

/* Talent trees like the in-game calculator: icons on a 4x7 grid (cell 52px = TCELL in app.js) */
.ttrees { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 10px; }
.ttree { background: radial-gradient(ellipse at top, #241a10, #0d0a07 75%); border: 1px solid var(--bronze-dark);
  border-radius: 6px; padding: 8px 10px 10px; }
.ttree h4 { margin: 0 0 6px; font-size: 13px; color: var(--bronze-light); display: flex; justify-content: space-between; }
.ttree h4 small { color: var(--gold); font-size: 13px; }
.ttree.empty h4 { color: var(--muted); }
.tboard { position: relative; width: 208px; height: 364px; }
.tarrows { position: absolute; inset: 0; pointer-events: none; }
.tarrows path { stroke: #7a6136; stroke-width: 3; fill: none; }
.tgrid { position: relative; display: grid; grid-template-columns: repeat(4, 52px); grid-template-rows: repeat(7, 52px);
  place-items: center; }
.tnode { position: relative; width: 40px; height: 40px; border: 2px solid #3d3d3d; border-radius: 5px; background: #000;
  cursor: help; }
.tnode img { width: 100%; height: 100%; border-radius: 3px; display: block; filter: grayscale(1) brightness(.45); }
.tnode.on { border-color: #1eff00; }
.tnode.max { border-color: #ffd100; }
.tnode.on img, .tnode.max img { filter: none; }
.trank { position: absolute; right: -8px; bottom: -8px; background: #000; border: 1px solid #555; border-radius: 4px;
  padding: 0 3px; font-size: 10px; font-weight: 700; line-height: 14px; color: #1eff00; }
.tnode.max .trank { color: #ffd100; }
