/* The Railway system: a neutral violet-black surface, hairline inset rings,
   one violet call to action, IBM Plex Serif headings over Inter. A hazed
   mountain vista (bg-sky/range/ridge.svg) parallaxes behind everything. */
:root {
  color-scheme: dark;

  --bg: #13111c;
  --bg-2: #1c1a28;
  --bg-3: #232131;
  --bg-4: #2b2839;
  --black: #0c0a12;

  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --line-3: rgba(255, 255, 255, 0.28);

  --text: #f7f7f8;
  --text-2: rgba(255, 255, 255, 0.72);
  --text-3: rgba(255, 255, 255, 0.46);

  --violet: #553f83;
  --violet-2: #664c9c;
  --violet-soft: #a893d8;
  --violet-ring: rgba(133, 104, 199, 0.45);
  --violet-wash: rgba(133, 104, 199, 0.16);

  --link: #b6a3e4;
  --forever: #5ec8a8;
  --red: #ff8f8f;
  --pvp: #e8c05a;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --pill: 999px;

  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;

  --horde: #c8413a;
  --alliance: #4d7ec8;

  --k-druid: #ff7d0a;
  --k-hunter: #abd473;
  --k-mage: #69ccf0;
  --k-paladin: #f58cba;
  --k-priest: #ffffff;
  --k-rogue: #fff569;
  --k-shaman: #0070de;
  --k-warlock: #9482c9;
  --k-warrior: #c79c6e;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* The vista, in three layers behind the page. Each drifts up at its own rate
   as you scroll (`--scroll`, set in app.js), so the moon barely moves while
   the near ridge slides — and each drift stops at a cap, so the art never
   walks far from its framing. The layers reach 140px past the foot of the
   viewport to cover the strip a drift would otherwise expose. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(19, 17, 28, 0.1) 0%,
    rgba(19, 17, 28, 0.55) 52%,
    rgba(19, 17, 28, 0.92) 100%
  );
}

.backdrop-layer {
  position: absolute;
  inset: 0 0 -140px;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  transform: translate3d(0, var(--drift, 0px), 0);
  will-change: transform;
}

.backdrop-sky {
  --drift: max(-30px, var(--scroll, 0px) * -0.04);
  background-image: url('bg-sky.svg');
}

.backdrop-range {
  --drift: max(-70px, var(--scroll, 0px) * -0.09);
  background-image: url('bg-range.svg');
}

.backdrop-ridge {
  --drift: max(-120px, var(--scroll, 0px) * -0.16);
  background-image: url('bg-ridge.svg');
}

button,
select,
input {
  font: inherit;
}

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

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

  .backdrop-layer {
    transform: none !important;
  }
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* The site bar: clear glass over the art, on a hairline. */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(19, 17, 28, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand b {
  color: var(--violet-soft);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.badge-build {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  font-size: 12px;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--pill);
}

.badge-build .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--forever);
  box-shadow: 0 0 8px rgba(94, 200, 168, 0.8);
}

.sheet {
  padding: 8px 0 40px;
}

/* The hero is open sky: no box, the art carries it. */
.hero {
  padding: 68px 0 56px;
  text-align: center;
}

/* With the hero gone the panel would sit flush under the header. */
.hero[hidden] ~ .panel {
  margin-top: 34px;
}

h1 {
  margin: 0 0 14px;
  color: #fff;
  font-family: var(--serif);
  font-size: 50px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.subtitle {
  margin: 0 auto;
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
}

/* A panel is a smoked-glass card held by an inset hairline ring. */
.panel {
  background: rgba(28, 26, 40, 0.74);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 18px 44px rgba(0, 0, 0, 0.36);
  overflow: hidden;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  color: #fff;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.panel-body {
  padding: 18px;
}

/* Sub-headings inside a panel: a quiet tracked label. */
.rule {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 22px 0 10px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.rule:first-child {
  margin-top: 0;
}

.count {
  margin-left: auto;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

/* The roster saves itself; this is the only report of that. */
.save-state {
  margin-left: auto;
  color: var(--text-3);
  font-size: 13px;
}

.save-state.saved {
  color: var(--forever);
}

.row:last-child {
  margin-bottom: 0;
}

.grow {
  flex: 1 1 16rem;
  min-width: 0;
}

input {
  height: 40px;
  padding: 8px 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
}

input::placeholder {
  color: var(--text-3);
}

input:hover {
  border-color: var(--line-2);
}

input:focus {
  border-color: var(--violet-ring);
  outline: none;
  box-shadow: 0 0 0 3px var(--violet-wash);
}

.btn {
  min-height: 40px;
  padding: 8px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--line-3);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* The one violet call to action per view. */
.btn.primary {
  color: #fff;
  background: var(--violet);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn.primary:hover:not(:disabled) {
  background: var(--violet-2);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn.ghost {
  background: rgba(0, 0, 0, 0.28);
}

.btn.text {
  background: none;
  border-color: transparent;
  color: var(--text-2);
}

.btn.text:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border-color: transparent;
}

.btn.small {
  min-height: 32px;
  padding: 4px 11px;
  font-size: 13px;
}

.btn.danger {
  color: var(--red);
  background: rgba(255, 90, 90, 0.08);
  border-color: rgba(255, 120, 120, 0.28);
}

.btn.danger:hover:not(:disabled) {
  background: rgba(255, 90, 90, 0.16);
  border-color: rgba(255, 120, 120, 0.45);
}

.admin-bar {
  margin: 18px -18px -18px;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.24);
  border-top: 1px solid var(--line);
}

.roll .btn {
  margin-left: auto;
}

/* No footer bar — just the admin line, kept quiet at the foot of the page. */
.admin-foot {
  padding: 8px 0 28px;
  color: var(--text-3);
  font-size: 13px;
}

.admin-foot .container {
  display: flex;
  justify-content: flex-end;
}

.admin-foot .row {
  margin: 0;
}

.linkish {
  padding: 4px;
  color: var(--text-3);
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.linkish:hover {
  color: var(--link);
  text-decoration: underline;
}

/* The name is taken: its roster is loaded, and editing replaces it. Violet
   rather than red — this is a statement of where you are, not a fault. */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 0;
  padding: 10px 14px;
  color: var(--text-2);
  background: var(--violet-wash);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--violet-ring);
  font-size: 13px;
}

.error {
  margin: 12px 0 0;
  padding: 10px 14px;
  color: #ffd4d4;
  background: rgba(255, 90, 90, 0.1);
  border: 1px solid rgba(255, 120, 120, 0.3);
  border-radius: var(--radius);
  font-size: 13px;
}

/* One character: a card on the panel's own surface. */
.nameplate {
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.035);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.nameplate-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
}

.slot-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nameplate-title {
  margin-right: auto;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nameplate-title.horde {
  color: #e2756d;
}

.nameplate-title.alliance {
  color: #85aae0;
}

.pick {
  padding: 14px;
}

.pick + .pick {
  border-top: 1px solid var(--line);
}

.pick-label {
  display: block;
  margin-bottom: 9px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.banner-slot,
.glyph-slot,
.race-slot,
.chip {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.banner-slot:hover,
.glyph-slot:hover,
.chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-2);
}

/* Picked is a violet ring and a lit face, not a coloured edge. */
.banner-slot.picked,
.glyph-slot.picked,
.race-slot.picked,
.chip.picked {
  color: #fff;
  background: rgba(133, 104, 199, 0.18);
  border-color: var(--violet-ring);
  box-shadow: 0 0 0 3px var(--violet-wash);
}

.banners {
  display: flex;
  gap: 10px;
}

.banner-slot {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
}

/* The crests are alpha masks, so currentColor tints them like the old inline
   SVGs did; the picked rules below only have to set `color`. */
.banner-slot .banner-mark {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--text-3);
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.banner-slot.horde .banner-mark {
  -webkit-mask-image: url('icons/faction/horde.png');
  mask-image: url('icons/faction/horde.png');
}

.banner-slot.alliance .banner-mark {
  -webkit-mask-image: url('icons/faction/alliance.png');
  mask-image: url('icons/faction/alliance.png');
}

.banner-slot.horde.picked {
  color: #f0938c;
  background: rgba(200, 65, 58, 0.16);
  border-color: rgba(200, 65, 58, 0.55);
  box-shadow: 0 0 0 3px rgba(200, 65, 58, 0.14);
}

.banner-slot.horde.picked .banner-mark {
  color: #e2756d;
}

.banner-slot.alliance.picked {
  color: #9dbdf0;
  background: rgba(77, 126, 200, 0.16);
  border-color: rgba(77, 126, 200, 0.55);
  box-shadow: 0 0 0 3px rgba(77, 126, 200, 0.14);
}

.banner-slot.alliance.picked .banner-mark {
  color: #85aae0;
}

/* The nine classes, a 3x3 block across the full width of the panel. */
.glyphs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.glyph-slot {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 6px 9px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.glyph-slot img {
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: var(--radius-sm);
  opacity: 0.68;
  transition: opacity 0.15s ease;
}

.glyph-slot:hover img,
.glyph-slot.picked img {
  opacity: 1;
}

.glyph-slot.k-druid.picked { color: var(--k-druid); }
.glyph-slot.k-hunter.picked { color: var(--k-hunter); }
.glyph-slot.k-mage.picked { color: var(--k-mage); }
.glyph-slot.k-paladin.picked { color: var(--k-paladin); }
.glyph-slot.k-priest.picked { color: var(--k-priest); }
.glyph-slot.k-rogue.picked { color: var(--k-rogue); }
.glyph-slot.k-shaman.picked { color: #5a9df0; }
.glyph-slot.k-warlock.picked { color: var(--k-warlock); }
.glyph-slot.k-warrior.picked { color: var(--k-warrior); }

/* Those rules set only `color`, so the edge, wash and ring can all be drawn
   off currentColor and the picked class carries its own colour throughout. */
.glyph-slot.picked {
  background: color-mix(in srgb, currentColor 13%, transparent);
  border-color: color-mix(in srgb, currentColor 62%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 11%, transparent);
}

/* The five races of the side on show, in a fixed row. A race the class
   cannot take keeps its place, unlit and dead, so the matrix reads as one
   shape instead of a list that reshuffles under the hand. */
.races {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.race-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.race-slot:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-2);
}

.race-slot:disabled {
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.015);
  border-color: rgba(255, 255, 255, 0.05);
  opacity: 0.5;
  cursor: not-allowed;
}

/* Playstyle is the faction bar again: two slots, one row, full width. */
.chips {
  display: flex;
  gap: 10px;
}

.chip {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
}

/* A shield against the world, crossed swords against each other. Alpha masks
   tinted by currentColor, the same trick the faction crests use. */
.chip-mark {
  width: 21px;
  height: 21px;
  flex: none;
  color: var(--text-3);
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: color 0.15s ease;
}

.chip.pve .chip-mark {
  -webkit-mask-image: url('icons/style/pve.svg');
  mask-image: url('icons/style/pve.svg');
}

.chip.pvp .chip-mark {
  -webkit-mask-image: url('icons/style/pvp.svg');
  mask-image: url('icons/style/pvp.svg');
}

/* Picked takes the colour the tally already gives it: PvE teal, PvP red. */
.chip.pve.picked {
  color: #8fdcc4;
  background: rgba(94, 200, 168, 0.15);
  border-color: rgba(94, 200, 168, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 200, 168, 0.13);
}

.chip.pve.picked .chip-mark {
  color: var(--forever);
}

.chip.pvp.picked {
  color: #f2d183;
  background: rgba(232, 192, 90, 0.14);
  border-color: rgba(232, 192, 90, 0.52);
  box-shadow: 0 0 0 3px rgba(232, 192, 90, 0.12);
}

.chip.pvp.picked .chip-mark {
  color: var(--pvp);
}

.chip:hover .chip-mark {
  color: var(--text-2);
}

/* The tally: one compact donut per category, slices in the official
   colours. Hover, focus or tap a slice to name who is in it. */
.pies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: start;
  gap: 12px;
  margin-bottom: 20px;
}

.pie {
  margin: 0;
  padding: 12px;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pie-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}

.pie-svg {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
}

.slice-track {
  fill: none;
  stroke: var(--bg-3);
  stroke-width: 16;
}

.slice {
  fill: none;
  stroke-width: 16;
  cursor: pointer;
  transition: stroke-dasharray 0.3s ease, stroke-dashoffset 0.3s ease,
    opacity 0.15s ease;
}

.pie:has(.lit) .slice {
  opacity: 0.4;
}

.pie .slice.lit {
  opacity: 1;
  stroke-width: 19;
}

.pie-total {
  fill: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.legend {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 2px;
  cursor: pointer;
}

.legend li.lit,
.legend li:focus {
  outline: none;
  background: var(--bg-3);
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-label {
  color: var(--text-2);
}

.legend-count,
.legend-pct {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.legend-pct {
  min-width: 2.5rem;
  text-align: right;
}

.pie-detail {
  margin: 8px 0 0;
  min-height: 2.6em;
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-3);
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.pie-detail b {
  color: var(--gold);
  font-weight: 600;
}

.roll {
  list-style: none;
  padding: 0;
  margin: 0;
}

.roll li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.roll li:last-child {
  border-bottom: 0;
}

.roll-name {
  flex: 0 0 auto;
  color: #fff;
  font-weight: 600;
}

.roll-chars {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.roll-char {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 3px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--pill);
  font-size: 12px;
}

.roll-char img {
  width: 16px;
  height: 16px;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: var(--radius-sm);
}

/* The chip reads as its class, edge and all: no fill, border takes the
   class colour through currentColor. */
.roll-char.k-druid { color: var(--k-druid); }
.roll-char.k-hunter { color: var(--k-hunter); }
.roll-char.k-mage { color: var(--k-mage); }
.roll-char.k-paladin { color: var(--k-paladin); }
.roll-char.k-priest { color: var(--k-priest); }
.roll-char.k-rogue { color: var(--k-rogue); }
.roll-char.k-shaman { color: #3a8ae8; }
.roll-char.k-warlock { color: var(--k-warlock); }
.roll-char.k-warrior { color: var(--k-warrior); }

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 4px 10px;
    height: auto;
    padding: 10px 0;
  }

  .header-right {
    flex-basis: 100%;
    margin-left: 0;
  }

  .hero {
    padding: 40px 0 32px;
  }

  h1 {
    font-size: 32px;
  }

  .subtitle {
    font-size: 16px;
  }

  .panel-body,
  .panel-head {
    padding: 14px;
  }

  .admin-bar {
    margin: 14px -14px -14px;
    padding: 12px 14px;
  }

  .pies {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Narrow screens: donut beside its legend so all three stay in view. */
  .pie {
    display: grid;
    grid-template-columns: 84px 1fr;
    grid-template-areas: 'title title' 'svg legend' 'detail detail';
    align-items: center;
    column-gap: 12px;
  }

  .pie-title {
    grid-area: title;
  }

  .pie-svg {
    grid-area: svg;
    width: 84px;
    height: 84px;
    margin: 0;
  }

  .legend {
    grid-area: legend;
  }

  .pie-detail {
    grid-area: detail;
  }

  .glyph-slot {
    gap: 7px;
    padding: 6px;
    font-size: 12px;
  }

  .glyph-slot img {
    width: 24px;
    height: 24px;
  }

  /* Five across is too narrow for 'Night Elf' on a phone: go three up. */
  .races {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .race-slot {
    min-height: 40px;
    padding: 6px 4px;
    font-size: 12px;
  }
}
