:root {
  --bg: #0f0d0b;
  --panel: #1a1612;
  --panel-2: #231e18;
  --line: #3a3127;
  --text: #e8dcc6;
  --muted: #a8977c;
  --gold: #f0c35a;
  --gold-dim: #b8913a;
  --alliance: #4a8cff;
  --horde: #e0453a;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: var(--gold); }

header.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(#1d1813, #120f0c);
}

header.top h1 {
  margin: 0;
  font: 600 20px/1 "Palatino Linotype", Georgia, serif;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-shadow: 0 1px 0 #000;
}

header.top nav { display: flex; gap: 4px; margin-left: auto; }

header.top nav a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}

header.top nav a.active, header.top nav a:hover { color: var(--gold); border-color: var(--gold-dim); }

main { max-width: 1240px; margin: 0 auto; padding: 18px 20px 40px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 10px;
  font: 600 13px/1.2 system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); }

input[type=text], input[type=search], input[type=number], select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 9px;
  font: inherit;
  min-width: 0;
}

input:focus, select:focus { outline: 1px solid var(--gold-dim); }

button {
  background: linear-gradient(#5a3d12, #3b270b);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 7px 14px;
  font: 600 13px/1.2 system-ui, sans-serif;
  cursor: pointer;
}

button:hover { filter: brightness(1.15); }
button:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
button.quiet { background: var(--panel-2); color: var(--text); border-color: var(--line); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented button { border: 0; border-radius: 0; background: var(--panel-2); color: var(--muted); }
.segmented button.on { background: linear-gradient(#5a3d12, #3b270b); color: var(--gold); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.legend .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.legend .swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.6); }

.tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }

.mapbox {
  position: relative;
  width: 100%;
  aspect-ratio: 1002 / 668;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(ellipse at center, #6b5636 0%, #3d3020 70%, #2a2117 100%);
}

.mapbox img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.mapbox svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mapbox path { stroke: rgba(0, 0, 0, 0.75); stroke-width: 0.12; vector-effect: non-scaling-stroke; cursor: pointer; }
.mapbox path:hover { filter: brightness(1.35); stroke: #fff; }

.tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(10, 12, 24, 0.94);
  border: 1px solid #6e7590;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 13px;
  z-index: 10;
  display: none;
  max-width: 380px;
  white-space: pre-line;
}

.tooltip b { color: var(--gold); font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
td .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

pre.snippet {
  margin: 0;
  background: #0b0a08;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  overflow-x: auto;
  color: #cfe3c0;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

.muted { color: var(--muted); }
.alliance { color: var(--alliance); }
.horde { color: var(--horde); }

/* Character roller */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }

.card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  min-height: 210px;
}

.card .label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.card img {
  width: 96px;
  height: 96px;
  margin: 12px auto 8px;
  display: block;
  border-radius: 8px;
  border: 2px solid var(--gold-dim);
  box-shadow: 0 0 0 3px #000;
}

.card .value { font: 600 18px/1.2 "Palatino Linotype", Georgia, serif; color: var(--gold); }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card.empty .value { color: var(--muted); font-weight: 400; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.locked { color: var(--horde); }

.allowed { display: grid; grid-template-columns: 160px 1fr 1fr; gap: 14px 24px; }
@media (max-width: 860px) { .allowed { grid-template-columns: 1fr; } }
.allowed .label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--gold-dim); }

/* Character roller: players (2 per row at most) */
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 980px) { .players { grid-template-columns: 1fr; } }

.player {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 0;
}
.player.locked-player { border-color: #6b2a24; }

.phead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.phead .spacer { flex: 1; }
.phead .pname { flex: 1; min-width: 90px; width: auto; font-weight: 600; color: var(--gold); padding: 5px 8px; }
.phead button { padding: 6px 9px; }
.phead .badge { white-space: nowrap; }

.ic { width: 56px; height: 56px; border-radius: 6px; border: 2px solid var(--gold-dim); box-shadow: 0 0 0 2px #000;
  display: block; background: #0b0a08; }
.ic.blank { border-color: var(--line); }
.ic.faction { width: 34px; height: 34px; border-width: 1px; }
span.ic.faction { display: inline-block; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.tile .label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tile .tname { font: 600 14px/1.15 "Palatino Linotype", Georgia, serif; color: var(--gold); hyphens: auto;
  max-width: 100%; }
.tile.empty .tname { color: var(--muted); font-weight: 400; }
.tile .sub { font-size: 11px; color: var(--muted); }
.tile .tile-foot { margin-top: auto; padding-top: 4px; min-height: 24px; }

button.reroll {
  padding: 2px 8px;
  font-size: 12px;
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}
button.reroll:hover { color: var(--gold); border-color: var(--gold-dim); }

.pstart { margin-top: 10px; font-size: 13px; }
.pstart select.zonepick { width: auto; padding: 2px 6px; font-size: 13px; font-weight: 600; }
.pnote { margin-top: 6px; font-size: 13px; }
.small { font-size: 12px; }
.small-btn { padding: 3px 9px; font-size: 12px; }
.msg .bad, .bad { color: #ff8a7a; }
.msg .good, .good { color: #9fdc7c; }
.grow { flex: 1; min-width: 260px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
textarea {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 9px;
  font: 12px/1.4 Consolas, monospace;
  resize: vertical;
  width: 100%;
}
.field input[type=text], .field input[type=search] { width: 100%; }
code { background: #0b0a08; padding: 0 4px; border-radius: 3px; }

/* Preferences */
.catrow { border-top: 1px solid var(--line); padding: 12px 0 4px; margin-top: 12px; }
.cathead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cathead b { min-width: 100px; color: var(--gold); }
.segmented button { padding: 5px 10px; font-size: 12px; }

.items { display: flex; flex-wrap: wrap; gap: 6px; }
.items.specs { gap: 8px 14px; }
.item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  min-width: 52px;
  user-select: none;
}
.item:hover { border-color: var(--line); background: var(--panel-2); }
.item img {
  width: 44px; height: 44px; border-radius: 5px; border: 2px solid var(--gold-dim); box-shadow: 0 0 0 1px #000;
}
.item .iname { font-size: 12px; text-align: center; max-width: 90px; }
.item.off img { filter: grayscale(1) brightness(0.45); border-color: var(--line); }
.item.off .iname { color: var(--muted); text-decoration: line-through; }
.item.era { opacity: 0.35; cursor: not-allowed; }
.item.picked img { border-color: #fff; box-shadow: 0 0 0 2px var(--gold), 0 0 10px var(--gold); }
.item.drawn img { opacity: 0.55; }
.item input.w { width: 56px; padding: 2px 4px; font-size: 12px; text-align: center; }
.item .pct { font-size: 11px; color: var(--muted); }

.specgroup {
  display: flex; align-items: flex-start; gap: 2px; padding: 2px 6px 2px 2px; border-left: 2px solid var(--line);
}
.specgroup .classmark { width: 22px; height: 22px; border-radius: 4px; margin: 4px 4px 0 2px; }
.specgroup .classname { font-size: 11px; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); }
.specgroup.class-off .classmark { filter: grayscale(1) brightness(0.5); }

.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 3px; border-radius: 50%;
  border: 1px solid var(--gold-dim); color: var(--gold); font: italic 600 10px/1 Georgia, serif;
  cursor: help; vertical-align: 1px;
}

/* Off / banned items: greyed with a red slash; blocked ones (banned, or their faction / class is off) can't be
   clicked */
.icw { position: relative; display: inline-block; line-height: 0; }
.item.slashed .icw::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 3px;
  background: #e03a2f; transform: rotate(-45deg); box-shadow: 0 0 2px #000; border-radius: 2px;
}
.item.slashed .iname::after { content: " \2715"; color: #e03a2f; text-decoration: none; display: inline-block; }
.item.blocked { cursor: not-allowed; }
.item.blocked:hover { background: none; border-color: transparent; }

.limits input { width: 54px; padding: 4px 6px; }
.banrow { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); }
.banlabel { min-width: 90px; color: var(--muted); font-size: 12px; padding-top: 14px; }
/* Bans: factions side by side with their races, classes with their specs 5 a row, professions gathering / crafting */
.items.bansides, .items.bangroups { gap: 12px; flex-wrap: nowrap; }
.banside { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 8px; }
.banside.alliance { background: linear-gradient(180deg, rgba(40, 70, 160, 0.28), transparent); }
.banside.horde { background: linear-gradient(180deg, rgba(150, 30, 30, 0.28), transparent); }
.banhead { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.banhead b { font-family: Georgia, serif; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.banraces { display: flex; gap: 6px; flex-wrap: wrap; }
.items.bangrid { display: grid; grid-template-columns: repeat(5, max-content); gap: 8px; }
.banclass { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px;
  padding: 3px 6px 3px 3px; background: rgba(255, 255, 255, 0.02); }
.banclass-cls { padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.banclass-specs { display: flex; gap: 2px; }
.banclass .item { min-width: 0; padding: 2px; }
.banclass-cls .item img { width: 40px; height: 40px; }
.banclass-specs .item img { width: 32px; height: 32px; }
.bangroup { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 8px; }
.bansub { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 4px; }
@media (max-width: 1150px) {
  .items.bangrid { grid-template-columns: repeat(3, max-content); }
}
@media (max-width: 900px) {
  .items.bangrid { grid-template-columns: repeat(2, max-content); }
  .items.bansides, .items.bangroups { flex-wrap: wrap; }
}

/* Character picker */
.wizard-back {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); display: none; z-index: 20;
  align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 16px;
}
.wizard {
  background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 10px; width: 100%; max-width: 960px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.whead { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-bottom: 1px solid var(--line); font: 600 17px/1.2 "Palatino Linotype", Georgia, serif; color: var(--gold); }
.wsteps { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 16px 0; }
.wstep {
  background: var(--panel-2); color: var(--muted); border-color: var(--line); padding: 5px 10px; font-size: 12px;
}
.wstep.on { color: var(--gold); border-color: var(--gold-dim); background: linear-gradient(#5a3d12, #3b270b); }
.wnote { margin: 10px 16px 0; padding: 8px 10px; border-left: 3px solid var(--gold-dim); background: var(--panel-2);
  font-size: 13px; }
.wbody { padding: 12px 16px; min-height: 240px; }
.wfoot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.wfoot .spacer { flex: 1; }
.wfoot a { font-size: 12px; }
.wsub { font: 600 13px/1.2 system-ui, sans-serif; color: var(--muted); letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 16px 0 8px; }
.wtoolbar { margin-bottom: 10px; font-size: 13px; color: var(--muted); }

.wcard {
  background: var(--panel-2); border: 2px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0;
}
.wcard:hover { border-color: var(--gold-dim); }
.wcard.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(240, 195, 90, 0.35); }
.wcard.no { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.9); }
.wcard.no:hover { border-color: var(--line); }
.wcard img { width: 48px; height: 48px; border-radius: 6px; border: 2px solid var(--gold-dim); }
.wcard b { color: var(--gold); font: 600 15px/1.2 "Palatino Linotype", Georgia, serif; }
.wcard .role { font-size: 12px; color: #9fdc7c; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wgrid.big { grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; }
.wgrid.big .wcard img { width: 96px; height: 96px; }
.wgrid.wzones { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-top: 8px; }

.wraces { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.wraces .wcard { flex-direction: row; align-items: flex-start; text-align: left; }
.wraces .face { width: 64px; height: 64px; }
.wrace-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wrow { display: flex; flex-wrap: wrap; gap: 4px; }
.wrow img { width: 26px; height: 26px; border-width: 1px; border-radius: 4px; }
.wrow img.gone { filter: grayscale(1) brightness(0.4); }

.wbanners { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.wbanners .wcard { width: 104px; min-height: 170px; justify-content: center;
  background: linear-gradient(180deg, #2c241b, #18130f); }
.wbanners .wcard img { width: 56px; height: 56px; }

.wprofs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .wprofs { grid-template-columns: 1fr; } }
.wlist { display: flex; flex-direction: column; gap: 6px; }
.wlist .wcard { flex-direction: row; text-align: left; padding: 6px 8px; }
.wlist .wcard img { width: 36px; height: 36px; }
.wlist .wcard span { display: flex; flex-direction: column; gap: 2px; }
.wlist .wcard b { font-size: 14px; }

.wsummary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.wsummary > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wsummary img { width: 56px; height: 56px; border-radius: 6px; border: 2px solid var(--gold-dim); }
.wsummary b { color: var(--gold); }
.wsummary span { font-size: 12px; color: var(--muted); }

.filebtn { display: inline-flex; align-items: center; cursor: pointer; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 14px;
  font: 600 13px/1.2 system-ui, sans-serif; }
.filebtn:hover { filter: brightness(1.15); }

button.danger { color: #ff8a7a; border-color: #6b2a24; }
.wizard.confirm { max-width: 460px; margin-top: 12vh; }

/* Picker: race and class screens like the game's character creation */
.wcreate { display: grid; grid-template-columns: 150px 150px minmax(0, 1fr); gap: 14px; align-items: start; }
.wcreate:has(.wclasses) { grid-template-columns: 230px minmax(0, 1fr); }
@media (max-width: 760px) { .wcreate, .wcreate:has(.wclasses) { grid-template-columns: 1fr 1fr; }
  .wdetail { grid-column: 1 / -1; } }
.wbanner { border-radius: 6px; padding: 10px 8px 14px; display: flex; flex-direction: column; align-items: center;
  gap: 8px; border: 2px solid #c9a227; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6); }
.wbanner.alliance { background: linear-gradient(180deg, #1d3a8a, #142a63 60%, #0f1f4a); }
.wbanner.horde { background: linear-gradient(180deg, #8a1d1d, #651414 60%, #4a0f0f); border-color: #a33; }
.wbanner h3 { margin: 0 0 4px; font: 600 17px/1 "Palatino Linotype", Georgia, serif; color: #f4e6c0;
  text-transform: uppercase; letter-spacing: 0.06em; text-shadow: 0 1px 2px #000; }
.wbanner.closed { filter: grayscale(0.8) brightness(0.7); }
.wclosed { font-size: 11px; color: #ffd0c8; text-align: center; }
.wrace { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; padding: 2px; }
.wrace img { width: 52px; height: 52px; border-radius: 6px; border: 2px solid #8a7a55; box-shadow: 0 0 0 2px #000; }
.wrace .wrace-name { font-size: 12px; color: #f4e6c0; text-shadow: 0 1px 2px #000; opacity: 0;
  transition: opacity .1s; }
.wrace:hover .wrace-name, .wrace.sel .wrace-name { opacity: 1; }
.wrace:hover img { border-color: #f4e6c0; }
.wrace.sel img { border-color: var(--gold); box-shadow: 0 0 0 2px #000, 0 0 12px var(--gold); }
.wrace.sel .wrace-name { color: var(--gold); font-weight: 600; }
.wrace.no { cursor: help; }
.wrace.no img { filter: grayscale(1) brightness(0.55); }
.wrace.no .icw::after, .wclass.no .icw::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 3px;
  background: #e03a2f; transform: rotate(-45deg);
  border-radius: 2px; }

.wdetail { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  min-height: 420px; }
.wdetail h3 { margin: 0; font: 600 20px/1.2 "Palatino Linotype", Georgia, serif; color: var(--gold); }
.wdetail h4 { margin: 14px 0 6px; font: 600 12px/1.2 system-ui, sans-serif; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); }
.wdetail p { margin: 8px 0 0; font-size: 13px; }
.wd-head { display: flex; gap: 12px; align-items: center; }
.wd-head img { width: 64px; height: 64px; border-radius: 8px; border: 2px solid var(--gold-dim); }
.wd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; }
.wd-list li { display: flex; gap: 8px; align-items: center; }
.wd-list img { width: 26px; height: 26px; border-radius: 4px; border: 1px solid var(--gold-dim); }
.wd-list .dot { width: 26px; text-align: center; color: var(--gold); }
.wd-list .dot::before { content: "\2022"; }
.wd-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.wd-class { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.wd-class > img { width: 32px; height: 32px; border-radius: 5px; border: 1px solid var(--gold-dim); }
.wd-class b { color: var(--gold); }
.wd-class.no { opacity: 0.45; filter: grayscale(0.8); }
.wd-specs { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.wd-specs span { display: inline-flex; align-items: center; gap: 4px; }
.wd-specs img { width: 18px; height: 18px; border-radius: 3px; }
.wd-spec-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.wd-spec-cards .wcard img { width: 64px; height: 64px; }

.wclasses { display: flex; flex-direction: column; gap: 6px; }
.wclass { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 2px solid var(--line);
  border-radius: 6px; cursor: pointer; background: linear-gradient(90deg, #2c241b, #18130f); }
.wclass img { width: 36px; height: 36px; border-radius: 5px; border: 1px solid var(--gold-dim); }
.wclass b { display: block; color: var(--gold); }
.wclass:hover { border-color: var(--gold-dim); }
.wclass.sel { border-color: var(--gold); box-shadow: 0 0 10px rgba(240, 195, 90, 0.35); }
.wclass.no { cursor: help; opacity: 0.5; }
.wclass.no img { filter: grayscale(1); }
.whead .spacer { flex: 1; }
.whead { gap: 8px; }

/* Config update page */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; text-align: center;
  border: 2px dashed var(--gold-dim); border-radius: 10px; background: var(--panel-2); cursor: pointer;
}
.dropzone b { font-size: 16px; color: var(--gold); }
.dropzone.over { border-color: var(--gold); background: rgba(255, 209, 0, 0.06); }
.filebtn.linkish { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; }
.confstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 14px 0; }
.confstats div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.confstats b { display: block; font-size: 22px; color: var(--gold); }
.confstats span { font-size: 12px; color: var(--muted); }
.conftable { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.conftable th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line);
  padding: 4px 8px; }
.conftable td { border-bottom: 1px solid var(--line); padding: 5px 8px; vertical-align: top; word-break: break-word; }
.confpre { max-height: 420px; overflow: auto; background: #0b0a08; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; font-size: 12px; white-space: pre; }

/* What you need page */
.needs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.need { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.need h3 { margin: 4px 0 6px; font-size: 16px; color: var(--gold); }
.need p { margin: 0 0 6px; font-size: 13px; }
.need ul { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.need li { margin: 3px 0; }
.need.req { border-color: var(--gold-dim); }
.needtag { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.need.req .needtag { color: var(--gold); }
.needs.wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tablewrap { overflow-x: auto; }
.conftable.compare td:first-child, .conftable.pages td:first-child { white-space: nowrap; width: 1%; }
@media (max-width: 700px) {
  .conftable.compare, .conftable.pages { min-width: 620px; }
  .needs.wide { grid-template-columns: 1fr; }
}
.conftable.compare td { line-height: 1.5; }

/* Phones: the menu wraps under the title, nothing wider than the screen */
header.top { flex-wrap: wrap; }
header.top nav { flex-wrap: wrap; }
@media (max-width: 600px) {
  header.top { padding: 10px 16px; gap: 8px; }
  header.top nav { margin-left: 0; }
  header.top nav a { padding: 5px 9px; font-size: 13px; }
  main { padding: 14px 16px 32px; }
  .controls > *, .field, .field select, .field input { max-width: 100%; min-width: 0; }
  label.check { white-space: normal; }
  .banrow { flex-direction: column; gap: 4px; }
  .banlabel { padding-top: 0; }
  .items.bangrid { grid-template-columns: 1fr; }
}

/* Achievements page */
.achlayout { display: grid; grid-template-columns: 230px 1fr; gap: 16px; align-items: start; }
.achcats { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.achcat { display: flex; justify-content: space-between; gap: 8px; text-align: left; background: none;
  border: 1px solid transparent; color: var(--text); padding: 5px 8px; border-radius: 6px; font-size: 13px; }
.achcat span { color: var(--muted); }
.achcat:hover { background: var(--panel-2); }
.achcat.on { border-color: var(--gold-dim); color: var(--gold); background: var(--panel-2); }
.achcat:disabled { opacity: 0.4; cursor: default; }
.achhead { margin: 18px 0 8px; font: 600 15px/1.2 Georgia, serif; color: var(--gold); }
.achhead:first-child { margin-top: 0; }
.achrow { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); margin-bottom: 8px; }
.achrow.off { opacity: 0.6; }
.achicon { width: 40px; height: 40px; border-radius: 6px; border: 2px solid var(--gold-dim); flex: none; }
.achbody { min-width: 0; }
.achname { font-weight: 600; }
.achexp { font-size: 11px; font-weight: 400; color: #9db3ff; margin-left: 4px; }
.achoff { font-size: 11px; font-weight: 400; color: #ff8a7a; margin-left: 4px; }
.achdesc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.achrewards { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: #9fdc7c; }
.achrewards li.textonly { color: var(--muted); }
.achother { font-size: 12px; color: var(--muted); margin-top: 6px; }
@media (max-width: 760px) {
  .achlayout { grid-template-columns: 1fr; }
  .achcats { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* Themed form controls (with controls.js): no white browser defaults */
:root { color-scheme: dark; }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); }
textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 7px 9px; font: inherit;
}
textarea:focus { outline: 1px solid var(--gold-dim); }
select {
  -webkit-appearance: none; appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0\
 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f0c35a' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select option { background: var(--panel); color: var(--text); }
input[type=search] {
  -webkit-appearance: none; appearance: none; padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='\
0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%23b8913a' stroke-width='2'/%3E%3Cpath d='M11 11l4 4' s\
troke='%23b8913a' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
input[type=search]::-webkit-search-cancel-button {
  -webkit-appearance: none; width: 14px; height: 14px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14\
 14'%3E%3Cpath d='M2 2l10 10M12 2L2 12' stroke='%23f0c35a' stroke-width='2'/%3E%3C/svg%3E") no-repeat center;
}
input[type=search]:focus, input[type=text]:focus, input[type=number]:focus, select:focus {
  outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 1px var(--gold-dim);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
.numstep { display: inline-flex; align-items: stretch; vertical-align: middle; }
.numstep input[type=number] { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.numstep-arrows { display: flex; flex-direction: column; border: 1px solid var(--line); border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0; overflow: hidden; background: var(--panel-2); }
.numstep-btn { flex: 1; width: 18px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none;
  color: var(--gold-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.numstep-btn + .numstep-btn { border-top: 1px solid var(--line); }
.numstep-btn::before { content: ""; border: 4px solid transparent; }
.numstep-btn.up::before { border-bottom: 5px solid currentColor; border-top-width: 0; }
.numstep-btn.down::before { border-top: 5px solid currentColor; border-bottom-width: 0; }
.numstep-btn:hover { color: var(--gold); background: var(--panel); }
.numstep:focus-within .numstep-arrows { border-color: var(--gold-dim); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

.sitefoot { max-width: 1240px; margin: 0 auto 28px; padding: 0 16px; font-size: 12px; line-height: 1.5;
  color: var(--muted); text-align: center; }

/* Live rooms (index.html) */
.live-code {
  font-size: 20px; letter-spacing: 0.18em; color: var(--gold); font-family: ui-monospace, Consolas, monospace;
}
.live-codebox { text-transform: uppercase; letter-spacing: 0.12em; width: 9em; }
.live-codebox::placeholder { text-transform: none; letter-spacing: normal; }
