/* GONG portal stylesheet.
 *
 * One pass, in dependency order: tokens, base, stadium backdrop, then the two
 * components everything is built from (.gbtn and .panel), then layout, then two
 * breakpoints. Nothing below overrides something above at higher specificity;
 * if a rule needs changing, change it where it is defined.
 *
 * The look comes from the 1.6.5.210 client: thick black outlines, vertical
 * gradients lit from the top, and hard unblurred drop shadows. There are no
 * webfonts and no build step, so display type uses a condensed system stack.
 */

/* ---------------------------------------------------------------- tokens -- */

:root {
  /* Surfaces */
  --ink: #1b2430;
  --muted: #5d6b7a;
  --paper: #ffffff;
  --wash: #eef2f6;
  --line: #c9d3dd;
  --outline: #000000;

  /* Stadium */
  --sky-high: #2b9fe6;
  --sky-low: #a9e2ff;
  --stand: #93a1b8;
  --stand-dark: #7f8da6;
  --grass: #4caa22;
  --grass-dark: #3f9019;

  /* Button ramps: top, mid, bottom, label */
  --yellow-top: #ffd23c;
  --yellow-mid: #ffc21a;
  --yellow-bottom: #f59300;
  --yellow-label: #3a2400;
  --red-top: #ff7a63;
  --red-mid: #ff4a34;
  --red-bottom: #dd1a0c;
  --blue-top: #7fd2ff;
  --blue-mid: #35a8f5;
  --blue-bottom: #1878e0;
  --green-top: #a6e46a;
  --green-mid: #7ac83c;
  --green-bottom: #4ca020;

  /* Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --border: 3px;
  --drop: 2px 2px 0 rgba(0, 0, 0, 0.35);
  --drop-lg: 4px 4px 0 rgba(0, 0, 0, 0.28);

  /* Impact is the client's face and exists on Windows and macOS. Everywhere
     else this lands on a heavy grotesque, so display type is set at 700: Impact
     has no bold face and picks up a light synthetic weight, while the fallbacks
     get the real bold they need to stay chunky. */
  --font-display: Impact, Haettenschweiler, "Arial Black", "Arial Narrow Bold",
    "Liberation Sans Narrow", "DejaVu Sans Condensed", sans-serif;
  --font-body: Tahoma, Verdana, Geneva, sans-serif;
}

/* ------------------------------------------------------------------ base -- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Grass, not sky: the stadium layer is viewport-fixed, so any document taller
     than it shows this underneath, and that area is always below the pitch. */
  background: var(--grass-dark);
  color: var(--ink);
  font: 15px/1.55 var(--font-body);
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-transform: uppercase;
}

h1 { font-size: clamp(26px, 5vw, 40px); }
h2 { font-size: clamp(20px, 3vw, 26px); }
h3 { font-size: 17px; }

p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

a {
  color: #12599c;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

a:hover { color: #0d4478; }

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--wash);
  font-size: 0.92em;
}

img { max-width: 100%; }

:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.55);
}

.shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* -------------------------------------------------------------- backdrop -- */

/* The stadium is deliberately confined to these four selectors: swapping in a
   real background image means replacing them, nothing else. */
.stadium {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.stadium-sky,
.stadium-stands,
.stadium-pitch {
  position: absolute;
  left: 0;
  right: 0;
  display: block;
}

.stadium-sky {
  top: 0;
  bottom: 0;
  background:
    /* clouds */
    /* Kept to the outer margins so no cloud sits behind the header buttons. */
    radial-gradient(58px 34px at 8% 16%, #fff 0 96%, transparent 97%),
    radial-gradient(42px 26px at 14% 19%, #fff 0 96%, transparent 97%),
    radial-gradient(38px 24px at 3% 20%, #fff 0 96%, transparent 97%),
    radial-gradient(64px 36px at 94% 26%, #fff 0 96%, transparent 97%),
    radial-gradient(44px 28px at 88% 29%, #fff 0 96%, transparent 97%),
    radial-gradient(50px 30px at 5% 46%, #fff 0 96%, transparent 97%),
    radial-gradient(40px 26px at 96% 52%, #fff 0 96%, transparent 97%),
    linear-gradient(var(--sky-high) 0%, var(--sky-low) 62%);
}

.stadium-stands {
  bottom: 18vh;
  height: 30vh;
  border-top: var(--border) solid var(--outline);
  border-bottom: var(--border) solid var(--outline);
  /* Blocks of seating, not a wireframe: a soft vertical shade over wide
     alternating bands, with the seat rows kept faint. */
  background:
    linear-gradient(rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.14) 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.06) 0 3px,
      transparent 3px 14px
    ),
    repeating-linear-gradient(
      to right,
      var(--stand-dark) 0 72px,
      var(--stand) 72px 144px
    );
}

.stadium-pitch {
  bottom: 0;
  height: 18vh;
  border-top: var(--border) solid var(--outline);
  background:
    repeating-linear-gradient(
      to right,
      var(--grass-dark) 0 64px,
      var(--grass) 64px 128px
    );
}

/* ---------------------------------------------------------------- button -- */

/* One component for every action on the site, applied to <button> and <a>
   alike so a nav link and a form submit are visually identical. */
.gbtn {
  --btn-top: var(--yellow-top);
  --btn-mid: var(--yellow-mid);
  --btn-bottom: var(--yellow-bottom);
  --btn-label: var(--yellow-label);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px 11px;
  border: var(--border) solid var(--outline);
  border-radius: var(--radius-sm);
  background: linear-gradient(
    var(--btn-top) 0%,
    var(--btn-mid) 45%,
    var(--btn-bottom) 100%
  );
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.75),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18),
    var(--drop);
  color: var(--btn-label);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0.035em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.gbtn--red,
.gbtn--blue,
.gbtn--green {
  color: #fff;
  /* Light labels need the client's hard outline to stay legible on the ramp. */
  text-shadow:
    1px 1px 0 var(--outline),
    -1px 1px 0 var(--outline),
    1px -1px 0 var(--outline),
    -1px -1px 0 var(--outline);
}

.gbtn--red {
  --btn-top: var(--red-top);
  --btn-mid: var(--red-mid);
  --btn-bottom: var(--red-bottom);
}

.gbtn--blue {
  --btn-top: var(--blue-top);
  --btn-mid: var(--blue-mid);
  --btn-bottom: var(--blue-bottom);
}

.gbtn--green {
  --btn-top: var(--green-top);
  --btn-mid: var(--green-mid);
  --btn-bottom: var(--green-bottom);
}

.gbtn--sm {
  padding: 7px 14px 8px;
  font-size: 14px;
}

.gbtn--lg {
  padding: 13px 26px 14px;
  font-size: 20px;
}

.gbtn--hero {
  padding: 14px 30px 15px;
  border-radius: var(--radius);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.8),
    inset 0 -3px 0 rgba(0, 0, 0, 0.2),
    var(--drop-lg);
  font-size: 23px;
}

.gbtn:hover {
  filter: brightness(1.07);
}

.gbtn:active {
  transform: translate(2px, 2px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(0, 0, 0, 0.22);
}

.gbtn--hero:active {
  transform: translate(4px, 4px);
}

.gbtn[disabled],
.gbtn[aria-disabled="true"] {
  filter: saturate(0.35) brightness(0.95);
  cursor: not-allowed;
}

@media (prefers-reduced-motion: no-preference) {
  .gbtn {
    transition: filter 90ms linear, transform 90ms linear, box-shadow 90ms linear;
  }
}

/* ----------------------------------------------------------------- panel -- */

/* The client's dialog shape: white body, black outline, hard shadow, and a
   sky-blue title bar across the top edge. */
.panel {
  position: relative;
  border: var(--border) solid var(--outline);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--drop-lg);
  overflow: hidden;
}

.panel-title {
  margin: 0;
  padding: 11px var(--space-4) 12px;
  border-bottom: var(--border) solid var(--outline);
  background: linear-gradient(#a9e2ff 0%, #6ec2f2 100%);
  color: #10365f;
  font-size: 20px;
  text-align: center;
}

.panel-body {
  padding: var(--space-4);
}

.directory-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 28px;
  padding: 12px 14px;
  border: 3px solid var(--outline);
  border-radius: 6px;
  background: #d8d8d8;
  box-shadow:
    inset 0 0 0 3px #f4f4f4,
    4px 5px 0 rgb(54 45 38 / 48%);
}

.directory-filters label {
  display: grid;
  flex: 1 1 150px;
  gap: 3px;
  color: #4a4a4a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.directory-filters input,
.directory-filters select {
  width: 100%;
  min-height: 36px;
  padding: 6px 9px;
  border: 2px solid var(--outline);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-transform: none;
}

.member-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
}

.member-character-card {
  position: relative;
  margin-top: 10px;
  border: 4px solid #5b382c;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 24%) 0 2px, transparent 2px) 0 0 / 38px 100%,
    #d4d4d4;
  box-shadow:
    0 0 0 2px var(--outline),
    inset 0 0 0 3px #ececec,
    7px 8px 0 rgb(25 64 16 / 58%);
}

.member-character-card__header {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-width: min(310px, calc(100% - 20px));
  margin: -18px 0 0 12px;
  padding: 7px 18px 8px;
  border: 3px solid var(--outline);
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(#795342, #56382e);
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 24%),
    3px 3px 0 rgb(0 0 0 / 26%);
}

.member-character-card__header h2,
.member-character-card__header p {
  margin: 0;
}

.member-character-card__header h2 {
  font-size: 22px;
}

.member-character-card__header a {
  color: #fff;
  text-decoration: none;
  text-shadow:
    1px 1px 0 #000,
    -1px 1px 0 #000,
    1px -1px 0 #000,
    -1px -1px 0 #000;
}

.member-character-card__body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.member-character-card__loadout,
.profile-loadout,
.match-history {
  min-width: 0;
}

.member-character-card__record {
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 2px solid #858585;
  background: rgb(246 246 246 / 72%);
}

.member-character-card__record .gbtn {
  justify-self: end;
}

.loadout-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 4px solid #777;
}

.loadout-heading h3,
.loadout-heading span {
  margin: 0;
}

.loadout-heading h3 {
  color: #323232;
  font-size: 18px;
}

.loadout-heading span {
  color: #555;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.gear-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 0;
}

.gear-grid--compact {
  grid-template-columns: repeat(5, 52px);
  gap: 5px;
}

.gear-tile {
  --quality-fill: #ffffff;
  --quality-ink: #202020;

  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 88px;
  padding: 8px 2px;
  border-bottom: 2px dashed #8b8b8b;
  color: #202020;
}

.gear-grid--compact .gear-tile {
  display: grid;
  grid-template-columns: 52px;
  grid-template-rows: 52px auto;
  gap: 2px;
  width: 52px;
  min-height: 70px;
  padding: 0;
  border: 0;
}

.gear-tile__slot {
  display: block;
  color: #595959;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.gear-tile__icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 6px solid #898989;
  border-radius: 50%;
  background: var(--quality-fill);
  box-shadow:
    inset 0 0 0 2px #fff,
    0 0 0 2px rgb(255 255 255 / 62%);
}

.gear-grid--compact .gear-tile__icon {
  width: 52px;
  height: 52px;
  border-width: 5px;
}

.gear-tile__icon img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.gear-grid--compact .gear-tile__icon img {
  width: 38px;
  height: 38px;
}

.gear-tile__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-left: 10px;
}

.gear-tile__copy strong,
.gear-tile__attributes {
  overflow-wrap: anywhere;
}

.gear-tile__copy strong {
  color: #c7281d;
  font-size: 16px;
}

.gear-tile__rarity {
  color: var(--quality-ink);
  font-weight: 800;
}

.gear-tile__attributes {
  color: #303030;
  font-size: 12px;
}

.gear-quality--normal {
  --quality-fill: #ffffff;
  --quality-ink: #202020;
}

.gear-quality--rare {
  --quality-fill: #8bd51b;
  --quality-ink: #278200;
}

.gear-quality--very-rare {
  --quality-fill: #55d6f1;
  --quality-ink: #008eb5;
}

.gear-quality--extra-rare {
  --quality-fill: #ff9f20;
  --quality-ink: #e05b00;
}

.gear-grid--compact .gear-tile__slot {
  min-height: 20px;
  text-align: center;
  white-space: normal;
}

.gear-tooltip {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 8px);
  left: 50%;
  display: grid;
  width: min(240px, calc(100vw - 32px));
  gap: 3px;
  padding: 8px 10px;
  border: 2px solid #202020;
  border-radius: 2px;
  background: #f4f4f4;
  box-shadow: 3px 3px 0 rgb(0 0 0 / 32%);
  color: #202020;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0;
  overflow-wrap: anywhere;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 120ms ease;
  visibility: hidden;
}

.gear-tooltip strong {
  color: #c7281d;
  font-size: 14px;
}

.gear-tooltip__rarity {
  color: var(--quality-ink);
  font-weight: 800;
}

.gear-tooltip__attributes {
  color: #303030;
}

.gear-grid--compact .gear-tile:hover .gear-tooltip,
.gear-grid--compact .gear-tile:focus .gear-tooltip {
  opacity: 1;
  visibility: visible;
}

.gear-grid--compact .gear-tile:nth-child(5n + 1) .gear-tooltip,
.gear-grid--compact .gear-tile:nth-child(5n + 2) .gear-tooltip {
  left: 0;
  transform: none;
}

.gear-grid--compact .gear-tile:nth-child(5n + 4) .gear-tooltip,
.gear-grid--compact .gear-tile:nth-child(5n + 5) .gear-tooltip {
  right: 0;
  left: auto;
  transform: none;
}

.empty-gear {
  display: grid;
  grid-template-columns: repeat(5, 52px);
  gap: 5px;
  margin-bottom: 8px;
}

.empty-gear span {
  display: block;
  width: 52px;
  height: 52px;
  border: 6px solid #909090;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    inset 0 0 0 2px #f3f3f3,
    0 0 0 2px rgb(255 255 255 / 62%);
}

.record-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  gap: 2px;
  margin: 0;
  border: 3px solid #555;
  background: #555;
}

.record-strip > div {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 7px 8px;
  background: #f3f3f3;
  text-align: center;
}

.record-strip dt {
  color: #555;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.record-strip dd {
  margin: 0;
  color: #222;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
}

.record-strip--directory {
  grid-template-columns: repeat(2, minmax(68px, 1fr));
}

.character-profile-list {
  display: grid;
  gap: 34px;
}

.character-profile-board {
  position: relative;
  margin-top: 12px;
  border: 5px solid #5b382c;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 22%) 0 2px, transparent 2px) 0 0 / 42px 100%,
    #d3d3d3;
  box-shadow:
    0 0 0 2px #111,
    inset 0 0 0 3px #ededed,
    7px 8px 0 rgb(25 64 16 / 58%);
}

.character-profile-board__header {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: fit-content;
  min-width: min(340px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  margin: -20px 0 0 14px;
  padding: 8px 18px;
  border: 3px solid #111;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(#795342, #56382e);
  box-shadow: 3px 3px 0 rgb(0 0 0 / 25%);
  color: #fff;
}

.character-profile-board__header h2,
.character-profile-board__header p {
  margin: 0;
}

.character-profile-board__header h2 {
  font-size: 24px;
}

.character-profile-board__header a {
  color: #fff;
  text-decoration: none;
  text-shadow:
    1px 1px 0 #000,
    -1px 1px 0 #000,
    1px -1px 0 #000,
    -1px -1px 0 #000;
}

.character-profile-board__header p {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.character-profile-board__body {
  display: grid;
  gap: 22px;
  padding: 22px 20px 20px;
}

.character-profile-board .record-strip {
  grid-template-columns: repeat(2, minmax(68px, 1fr));
}

.character-profile-board .record-strip > div:last-child {
  grid-column: 1 / -1;
}

.profile-loadout,
.match-history {
  padding: 14px;
  border: 2px solid #888;
  background: rgb(244 244 244 / 62%);
}

.match-history .table-scroll {
  border-color: #666;
  border-radius: 0;
}

.match-history thead th {
  background: #666;
  color: #fff;
}

.match-result--win { color: #278200; }
.match-result--loss { color: #c7281d; }
.match-result--draw { color: #5a5a5a; }

.character-empty {
  padding: 24px;
  border: 4px solid #5b382c;
  background: #d4d4d4;
  box-shadow: 0 0 0 2px #111;
}

.member-card .panel-title a,
.member-character-list a,
.member-profile a {
  color: inherit;
}

.panel-body > h2,
.panel-body > h3 {
  margin-top: var(--space-5);
  color: #17337a;
}

.panel-body > h2:first-child,
.panel-body > h3:first-child {
  margin-top: 0;
}

.panel-action {
  display: flex;
  width: fit-content;
  margin: var(--space-4) auto 0;
}

.prose .panel-body {
  max-width: 68ch;
}

.steps {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
  list-style: decimal;
}

.steps li + li {
  margin-top: var(--space-3);
}

/* ---------------------------------------------------------------- header -- */

.site-header {
  position: relative;
  z-index: 2;
  padding: var(--space-4) 0;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.brand {
  display: block;
  flex: 0 0 auto;
  border: var(--border) solid var(--outline);
  border-radius: var(--radius);
  background: #ffd23c;
  box-shadow: var(--drop);
  line-height: 0;
  overflow: hidden;
}

.brand img {
  display: block;
  width: 170px;
  height: auto;
}

/* The checkbox stays in the accessibility tree and focusable; only its box is
   removed, so the label ring below shows where focus is. */
.nav-check {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.nav-toggle {
  margin-left: auto;
}

.nav-check:focus-visible + .nav-toggle {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.55);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px;
  height: 3px;
  background: currentColor;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

.site-nav {
  display: none;
  flex: 1 0 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.nav-check:checked ~ .site-nav {
  display: flex;
}

.nav-logout {
  margin: 0;
}

/* -------------------------------------------------------------- messages -- */

.messages {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border: var(--border) solid var(--outline);
  border-radius: var(--radius);
  background: #fff8d6;
  box-shadow: var(--drop);
  font-size: 14px;
}

.message-success { background: #d9f7c4; }
.message-error { background: #ffd9d3; }

.message button {
  padding: 0 var(--space-1);
  border: 0;
  background: none;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* ---------------------------------------------------------------- layout -- */

main {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  padding-bottom: var(--space-7);
}

/* Headings sit directly on the stadium, so they carry the client's hard outline
   rather than a soft shadow: white on white clouds needs a real edge. */
.page-heading {
  margin-bottom: var(--space-4);
  color: #fff;
  text-shadow:
    2px 2px 0 var(--outline),
    -2px 2px 0 var(--outline),
    2px -2px 0 var(--outline),
    -2px -2px 0 var(--outline),
    0 3px 0 rgba(0, 0, 0, 0.4);
}

.page-heading p {
  text-shadow:
    1px 1px 0 var(--outline),
    -1px 1px 0 var(--outline),
    1px -1px 0 var(--outline),
    -1px -1px 0 var(--outline);
}

.page-heading h1 {
  margin-bottom: var(--space-2);
}

.page-heading p {
  max-width: 62ch;
  font-size: 15px;
}

/* Single-column grids need an explicit zero-floor track. A grid item's automatic
   minimum size is min-content, so the 800px key art and nowrap tables would
   otherwise widen the page past the viewport instead of shrinking. */
.landing,
.hero,
.panel-row,
.character-layout {
  grid-template-columns: minmax(0, 1fr);
}

/* `main` is the grid on the landing page and is also the flex item that fills
   the viewport, so rows must be pinned to the top or every panel stretches. */
.landing {
  display: grid;
  align-content: start;
  gap: var(--space-5);
}

/* ------------------------------------------------------------------ hero -- */

.hero {
  display: grid;
}

.hero-art {
  display: block;
  width: 100%;
  height: 190px;
  border-bottom: var(--border) solid var(--outline);
  object-fit: cover;
  object-position: center 30%;
}

.hero-copy {
  padding: var(--space-4);
}

.hero-copy h1 {
  margin-bottom: var(--space-2);
  color: #17337a;
}

.hero-lede {
  max-width: 34ch;
  margin-bottom: var(--space-4);
  color: #3c4a59;
  font-size: 17px;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ------------------------------------------------------------ home panels -- */

.panel-row {
  display: grid;
  align-items: start;
  gap: var(--space-5);
}

.panel-row > .panel {
  display: flex;
  flex-direction: column;
}

.panel-row > .panel > .panel-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.news-item + .news-item {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 2px dashed var(--line);
}

.news-item h3 {
  margin-bottom: var(--space-1);
  color: #17337a;
}

.news-date {
  margin-bottom: var(--space-2);
  color: var(--muted);
  font-size: 13px;
}

.news-body {
  margin: 0;
}

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

.player-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.player-record {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.player-score {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.player-list li + li {
  border-top: 2px dashed var(--line);
}

.player-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--outline);
  border-radius: 50%;
  background: linear-gradient(#ffd23c, #f59300);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.player-name {
  color: #c8341c;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-card {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-2);
  border: 2px solid var(--outline);
  border-radius: var(--radius);
  background: var(--wash);
  text-align: center;
}

/* No item icons ship with the repo, so the tile is a drawn ball placeholder. */
.item-tile {
  width: 44px;
  height: 44px;
  border: 2px solid var(--outline);
  border-radius: 50%;
  background:
    radial-gradient(6px 6px at 50% 50%, var(--outline) 0 96%, transparent 97%),
    radial-gradient(4px 4px at 20% 28%, var(--outline) 0 96%, transparent 97%),
    radial-gradient(4px 4px at 80% 28%, var(--outline) 0 96%, transparent 97%),
    radial-gradient(4px 4px at 26% 79%, var(--outline) 0 96%, transparent 97%),
    radial-gradient(4px 4px at 74% 79%, var(--outline) 0 96%, transparent 97%),
    linear-gradient(#fff 0%, #d8e2ec 100%);
}

.item-name {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.item-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.star {
  width: 11px;
  height: 11px;
  background: var(--green-mid);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.item-note {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: 12px;
}

.event-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-card {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 2px solid var(--outline);
  border-radius: var(--radius);
  background: var(--wash);
}

.event-name {
  color: #17337a;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.event-date {
  color: #c8341c;
  font-size: 13px;
  font-weight: 700;
}

.event-description {
  margin: var(--space-1) 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.event-note {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* --------------------------------------------------------------- gallery -- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 2px solid var(--outline);
  border-radius: var(--radius);
  background: var(--wash);
}

.gallery-media {
  display: block;
  width: 100%;
  height: 160px;
  border: 2px solid var(--outline);
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--paper);
}

.gallery-detail-media {
  display: block;
  width: 100%;
  max-height: 680px;
  border: 2px solid var(--outline);
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--paper);
}

.gallery-rating-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-3) 0;
  padding: 0;
  border: 0;
}

.gallery-caption strong {
  display: block;
  color: #17337a;
  font-size: 15px;
}

.gallery-caption p {
  margin: var(--space-1) 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.gallery-kind {
  display: inline-block;
  margin-top: var(--space-2);
  padding: 2px 8px;
  border: 2px solid var(--outline);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.gallery-category {
  display: inline-block;
  margin-top: var(--space-2);
  margin-left: var(--space-1);
  padding: 2px 8px;
  border: 2px solid var(--outline);
  border-radius: var(--radius-sm);
  background: var(--yellow-top);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.gallery-votes {
  display: block;
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.gallery-vote-form {
  margin-top: var(--space-2);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.top-play-list {
  counter-reset: top-play;
}

.top-play-rank {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: var(--space-1);
  border: 2px solid var(--outline);
  border-radius: 50%;
  background: linear-gradient(#ffd23c, #f59300);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}

/* -------------------------------------------------------------- rankings -- */

.ranking-sections {
  display: grid;
  gap: var(--space-5);
}

.ranking-section {
  min-width: 0;
}

/* ------------------------------------------------------------------ auth -- */

.auth-layout {
  display: grid;
  justify-items: center;
  padding: var(--space-5) 0;
}

.auth-panel {
  width: 100%;
  max-width: 460px;
}

.auth-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
  padding-top: var(--space-4);
  border-top: 2px dashed var(--line);
  font-size: 14px;
}

/* ----------------------------------------------------------------- forms -- */

.field {
  margin-bottom: var(--space-3);
}

.field label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 2px solid var(--outline);
  border-radius: var(--radius-sm);
  background: #fff;
  color: inherit;
  font: inherit;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--blue-mid);
  outline-offset: 1px;
  box-shadow: none;
}

.field-error input {
  border-color: #c81f0d;
  background: #fff5f3;
}

.help-text {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: 12px;
}

.help-text ul {
  margin: var(--space-1) 0 0;
  padding-left: 18px;
}

.error-text,
.form-errors {
  color: #a5170a;
  font-size: 13px;
}

.form-errors {
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--outline);
  border-radius: var(--radius-sm);
  background: #ffd9d3;
}

.error-text ul,
.form-errors ul {
  margin: 0;
  padding-left: 18px;
}

.form-submit {
  width: 100%;
  margin-top: var(--space-2);
}

.amount-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

/* ------------------------------------------------------------ characters -- */

.character-layout {
  display: grid;
  gap: var(--space-4);
}

.character-list {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.character-tab {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border: var(--border) solid var(--outline);
  border-radius: var(--radius-sm);
  background: linear-gradient(#fff, #e4edf5);
  box-shadow: var(--drop);
  color: var(--ink);
  text-decoration: none;
}

.character-tab strong {
  font-size: 15px;
}

.character-tab span {
  color: var(--muted);
  font-size: 12px;
}

.character-tab[aria-current="page"] {
  background: linear-gradient(var(--blue-top), var(--blue-bottom));
  color: #fff;
}

.character-tab[aria-current="page"] span {
  color: #e8f6ff;
}

.character-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.character-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status-label {
  padding: 4px 10px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: linear-gradient(var(--green-top), var(--green-bottom));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.character-facts {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
}

.character-facts dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.character-facts dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.character-section + .character-section {
  margin-top: var(--space-5);
}

.character-section h3 {
  color: #17337a;
}

/* ---------------------------------------------------------------- tables -- */

.table-scroll {
  overflow-x: auto;
  border: 2px solid var(--outline);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 9px var(--space-3);
  text-align: left;
  white-space: nowrap;
}

thead th {
  background: linear-gradient(#a9e2ff, #6ec2f2);
  color: #10365f;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

tbody tr + tr td {
  border-top: 1px solid var(--line);
}

tbody tr:nth-child(even) td {
  background: var(--wash);
}

.medal-tag {
  padding: 2px 9px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.medal-tag--gold { background: var(--gold); }
.medal-tag--silver { background: var(--silver); }
.medal-tag--bronze { background: var(--bronze); color: #fff; }

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* --------------------------------------------------------------- forum -- */
.forum-list { display: grid; gap: var(--space-2); }
.forum-category,
.forum-topic-row {
  display: grid;
  gap: 2px;
  padding: var(--space-3);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.forum-category:hover,
.forum-topic-row:hover { border-color: var(--outline); background: var(--wash); }
.forum-category span,
.forum-category small,
.forum-topic-row span { color: var(--muted); }
.forum-compose { margin-top: var(--space-5); }
.forum-posts { display: grid; gap: var(--space-4); }
.forum-post .panel-body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.forum-link {
  margin: var(--space-2) var(--space-3) 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #12599c;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------------------------------------------------------------- footer -- */

.site-footer {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: var(--space-4) 0 var(--space-5);
  border-top: var(--border) solid var(--outline);
  background: rgba(24, 48, 20, 0.72);
  color: #fff;
}

.footer-inner {
  display: grid;
  gap: var(--space-2);
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

.footer-nav a {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-nav a:hover {
  color: var(--yellow-top);
  text-decoration: underline;
}

.footer-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

/* ------------------------------------------------------------ ≥ 720px -- */

@media (min-width: 720px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .brand img {
    width: 210px;
  }

  .hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: stretch;
  }

  /* A fixed art height sets the row: the key art is 4:3, so letting it size the
     row leaves the copy column with a screen of dead space. */
  .hero-art {
    height: 320px;
    border-right: var(--border) solid var(--outline);
    border-bottom: 0;
  }

  .hero-copy {
    align-self: center;
    padding: var(--space-6);
  }

  .panel-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .panel-body {
    padding: var(--space-5);
  }

  .member-character-card__body {
    grid-template-columns: minmax(0, 1fr) 250px;
    align-items: stretch;
  }

  .gear-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gear-grid--compact {
    grid-template-columns: repeat(5, 60px);
    gap: 7px;
  }

  .gear-grid--compact .gear-tile {
    grid-template-columns: 60px;
    grid-template-rows: 60px auto;
    width: 60px;
    min-height: 78px;
  }

  .gear-grid--compact .gear-tile__icon {
    width: 60px;
    height: 60px;
  }

  .gear-grid--compact .gear-tile__icon img {
    width: 44px;
    height: 44px;
  }

  .empty-gear {
    grid-template-columns: repeat(5, 60px);
    gap: 7px;
  }

  .empty-gear span {
    width: 60px;
    height: 60px;
  }

  .character-profile-board .record-strip {
    grid-template-columns: repeat(7, minmax(68px, 1fr));
  }

  .character-profile-board .record-strip > div:last-child {
    grid-column: auto;
  }

  .character-layout {
    grid-template-columns: minmax(190px, 240px) 1fr;
    align-items: start;
  }

  .character-list {
    flex-direction: column;
    overflow: visible;
  }

  .donation-layout {
    display: grid;
    grid-template-columns: minmax(0, 420px) 1fr;
    gap: var(--space-5);
    align-items: start;
  }

  .footer-inner {
    grid-template-columns: auto 1fr;
    align-items: center;
    text-align: left;
  }

  .footer-nav {
    justify-content: flex-start;
  }

  .footer-note {
    text-align: right;
  }
}

/* ----------------------------------------------------------- ≥ 1080px -- */

@media (min-width: 1080px) {
  body {
    font-size: 16px;
  }

  .site-header {
    padding: var(--space-5) 0;
  }

  .hero-copy {
    padding: var(--space-7);
  }

  .hero-art {
    height: 360px;
  }

  .ranking-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

}
