:root {
  --wg-bg: #0d0f12;
  --wg-ink: #f3f0e8;
  --wg-muted: #a9a49b;
  --wg-faint: #7f7970;
  --wg-panel: #171a1f;
  --wg-panel-2: #1d2127;
  --wg-line: rgba(255, 255, 255, 0.1);
  --wg-line-strong: rgba(231, 176, 75, 0.42);
  --wg-gold: #e7b04b;
  --wg-green: #49c178;
  --wg-red: #e26058;
  --wg-blue: #78a7e6;
  --wg-purple: #a28bea;
  --wg-shadow: 0 20px 70px rgba(0, 0, 0, 0.24);
}

body.wg-guild-minisite {
  margin: 0;
  color: var(--wg-ink);
  background:
    linear-gradient(180deg, rgba(231, 176, 75, 0.08), transparent 360px),
    linear-gradient(90deg, rgba(120, 167, 230, 0.06), transparent 38%, rgba(73, 193, 120, 0.04)),
    var(--wg-bg);
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
}

body.wg-guild-minisite *,
body.wg-guild-minisite *::before,
body.wg-guild-minisite *::after {
  box-sizing: border-box;
}

body.wg-guild-minisite a {
  color: inherit;
}

.wg-page {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.wg-nav {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.wg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--wg-ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
}

.wg-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}

.wg-nav-links {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--wg-line);
  border-radius: 8px;
  background: rgba(23, 26, 31, 0.72);
}

.wg-nav-links a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--wg-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.wg-nav-links a:hover,
.wg-nav-links a:focus-visible {
  color: var(--wg-ink);
  background: rgba(255, 255, 255, 0.07);
}

.wg-main {
  display: grid;
  gap: 14px;
}

.wg-hero {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.86fr) minmax(280px, 0.86fr);
  gap: 14px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid var(--wg-line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(29, 33, 39, 0.97), rgba(23, 26, 31, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 72px);
  box-shadow: var(--wg-shadow);
}

.wg-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.wg-crest {
  width: 132px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(231, 176, 75, 0.22), rgba(73, 193, 120, 0.12)),
    #22262d;
  color: #ffe7ac;
  font-size: 58px;
  font-weight: 900;
}

.wg-crest img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wg-title-group {
  min-width: 0;
}

.wg-eyebrow-row,
.wg-actions,
.wg-roster-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.wg-eyebrow,
.wg-mark {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(231, 176, 75, 0.34);
  border-radius: 8px;
  background: rgba(231, 176, 75, 0.1);
  color: #f3d08c;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.wg-mark {
  border-color: rgba(73, 193, 120, 0.34);
  background: rgba(73, 193, 120, 0.1);
  color: #bceccf;
}

.wg-mark-soft {
  border-color: rgba(120, 167, 230, 0.34);
  background: rgba(120, 167, 230, 0.1);
  color: #c4ddff;
}

.wg-title-group h1 {
  margin: 14px 0 0;
  color: var(--wg-ink);
  font-size: 52px;
  line-height: 1;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.wg-title-group p {
  margin: 10px 0 0;
  color: var(--wg-muted);
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
}

.wg-hero-side {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: start;
}

.wg-hero-actions {
  grid-column: 1 / -1;
  justify-content: center;
}

.wg-recruitment,
.wg-mini-meta,
.wg-panel,
.wg-score,
.wg-policy-item,
.wg-badge-line,
.wg-roster-summary div {
  border: 1px solid var(--wg-line);
  border-radius: 8px;
  background: rgba(23, 26, 31, 0.86);
}

.wg-recruitment {
  padding: 14px;
}

.wg-recruitment span,
.wg-mini-meta dt,
.wg-score span,
.wg-section-title span,
.wg-policy-item span,
.wg-roster-summary span {
  display: block;
  color: var(--wg-faint);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
}

.wg-recruitment strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.08;
  font-weight: 900;
}

.wg-recruitment.is-open strong {
  color: var(--wg-green);
}

.wg-recruitment.is-closed strong {
  color: var(--wg-red);
}

.wg-mini-meta {
  margin: 0;
  padding: 4px 16px;
}

.wg-mini-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--wg-line);
}

.wg-mini-meta div:last-child {
  border-bottom: 0;
}

.wg-mini-meta dt,
.wg-mini-meta dd {
  margin: 0;
}

.wg-mini-meta dd {
  color: var(--wg-ink);
  text-align: right;
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.wg-actions {
  align-content: start;
  justify-content: center;
}

.wg-action,
.wg-empty-link,
.wg-roster-tabs button {
  min-height: 38px;
  border: 1px solid var(--wg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.wg-action {
  flex: 0 1 124px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--wg-ink);
  text-decoration: none;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.wg-action.wcl {
  flex-basis: 154px;
}

.wg-action span {
  white-space: nowrap;
}

.wg-action:hover,
.wg-action:focus-visible {
  border-color: rgba(231, 176, 75, 0.52);
  background: rgba(231, 176, 75, 0.1);
}

.wg-action img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.wg-empty-link {
  width: 100%;
  display: grid;
  place-items: center;
  color: var(--wg-muted);
  font-size: 13px;
  font-weight: 700;
}

.wg-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wg-score {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
}

.wg-score strong {
  color: var(--wg-ink);
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.wg-score.is-heroic strong { color: var(--wg-gold); }
.wg-score.is-mythic strong { color: #ff908b; }
.wg-score.is-normal strong { color: #a9cbfa; }

.wg-overview {
  display: grid;
  grid-template-columns: minmax(0, 65fr) minmax(280px, 35fr);
  gap: 14px;
  align-items: stretch;
}

.wg-panel {
  padding: 20px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.14);
}

.wg-section-title {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.wg-section-title h2 {
  margin: 0;
  color: var(--wg-ink);
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
}

.wg-prose {
  color: #d8d2c8;
  font-size: 16px;
  line-height: 1.72;
}

.wg-prose p {
  margin: 0 0 1em;
}

.wg-prose p:last-child {
  margin-bottom: 0;
}

.wg-prose a {
  color: #f0c05f;
}

.wg-posts-empty {
  min-height: 132px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--wg-line);
  border-radius: 8px;
  color: var(--wg-muted);
  font-size: 14px;
  text-align: center;
}

.wg-policy {
  display: grid;
  gap: 10px;
  align-content: start;
}

.wg-hero-policy {
  padding: 18px;
  box-shadow: none;
}

.wg-policy-item,
.wg-badge-line {
  padding: 14px;
}

.wg-policy-item strong {
  display: block;
  margin-top: 7px;
  color: var(--wg-ink);
  font-size: 20px;
  line-height: 1.15;
  font-weight: 900;
}

.wg-policy-item p {
  margin: 9px 0 0;
  color: var(--wg-muted);
  font-size: 14px;
  line-height: 1.45;
}

.wg-policy-item.is-warning {
  border-color: rgba(226, 96, 88, 0.4);
  background: rgba(226, 96, 88, 0.08);
}

.wg-policy-item.is-warning strong {
  color: #ff928e;
}

.wg-policy-item.is-ok {
  border-color: rgba(73, 193, 120, 0.42);
  background: rgba(73, 193, 120, 0.08);
}

.wg-policy-item.is-ok strong {
  color: #74e09f;
}

.wg-badge-line {
  color: #f3d08c;
  font-size: 14px;
  font-weight: 800;
  background: rgba(231, 176, 75, 0.08);
  border-color: rgba(231, 176, 75, 0.28);
}

.wg-raid-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wg-raid {
  min-height: 108px;
  display: grid;
  gap: 14px;
  align-content: space-between;
  padding: 14px;
  border: 1px solid var(--wg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.wg-raid h3 {
  margin: 0;
  color: var(--wg-ink);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.wg-raid p {
  margin: 6px 0 0;
  color: var(--wg-muted);
  font-size: 13px;
  font-weight: 700;
}

.wg-raid strong {
  color: var(--wg-ink);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.wg-raid-metrics {
  display: grid;
  gap: 5px;
}

.wg-raid-metrics span {
  color: var(--wg-muted);
  font-size: 12px;
  font-weight: 800;
}

.wg-progress {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.wg-progress span {
  display: block;
  width: var(--wg-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--wg-blue), #bad7ff);
}

.wg-raid.is-heroic .wg-progress span {
  background: linear-gradient(90deg, #c9902d, var(--wg-gold));
}

.wg-raid.is-mythic .wg-progress span {
  background: linear-gradient(90deg, #c84d55, #ff928e);
}

.wg-roster {
  padding: 20px;
}

.wg-roster-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.wg-roster-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.wg-roster-search {
  width: min(280px, 100%);
  height: 38px;
  border: 1px solid var(--wg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--wg-ink);
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.wg-roster-search::placeholder {
  color: var(--wg-faint);
}

.wg-roster-search:focus {
  border-color: rgba(231, 176, 75, 0.52);
}

.wg-roster-tabs {
  padding: 0;
}

.wg-roster-tabs button {
  padding: 0 12px;
  color: var(--wg-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.wg-roster-tabs button.is-active {
  color: #17130a;
  border-color: var(--wg-gold);
  background: var(--wg-gold);
}

.wg-roster-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.wg-roster-summary div {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
}

.wg-roster-summary strong {
  color: var(--wg-ink);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.wg-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--wg-line);
  border-radius: 8px;
}

.wg-roster-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
  background: rgba(13, 15, 18, 0.28);
}

.wg-roster-table tr[hidden] {
  display: none !important;
}

.wg-roster-table th,
.wg-roster-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--wg-line);
  text-align: left;
  vertical-align: middle;
}

.wg-roster-table th {
  color: var(--wg-faint);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.wg-roster-table th::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  color: var(--wg-gold);
}

.wg-roster-table th.is-asc::after {
  content: "↑";
}

.wg-roster-table th.is-desc::after {
  content: "↓";
}

.wg-roster-table tr:last-child td {
  border-bottom: 0;
}

.wg-roster-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.wg-roster-table td {
  color: #dcd6cb;
  font-size: 13px;
}

.wg-roster-table td > strong,
.wg-roster-table td strong {
  display: block;
  color: var(--wg-ink);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
}

.wg-roster-table td span {
  display: block;
  margin-top: 3px;
  color: var(--wg-muted);
  font-size: 11px;
  line-height: 1.25;
}

.wg-player {
  display: flex;
  align-items: center;
  gap: 0;
}

.wg-rank-link {
  width: max-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(231, 176, 75, 0.36);
  border-radius: 999px;
  background: rgba(231, 176, 75, 0.1);
  color: #f2c66d;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.wg-rank-link:hover,
.wg-rank-link:focus-visible {
  border-color: rgba(231, 176, 75, 0.72);
  background: rgba(231, 176, 75, 0.18);
}

.wg-pvp-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 280px;
}

.wg-roster-table td .wg-pvp-pill {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0 7px;
  border: 1px solid rgba(120, 167, 230, 0.28);
  border-radius: 999px;
  background: rgba(120, 167, 230, 0.08);
  color: #d8e8ff;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}

.wg-roster-table td .wg-pvp-pill b {
  color: #9fc7ff;
  font-size: 10px;
}

.wg-roster-table td .wg-pvp-pill small {
  color: var(--wg-muted);
  font-size: 10px;
}

.wg-empty-state,
.wg-roster-empty {
  min-height: 86px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--wg-line);
  border-radius: 8px;
  color: var(--wg-muted);
  font-size: 15px;
  text-align: center;
}

.wg-roster-empty[hidden],
.wg-roster-pager[hidden] {
  display: none !important;
}

.wg-roster-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.wg-roster-pager button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--wg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--wg-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.wg-roster-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.wg-roster-pager span {
  color: var(--wg-muted);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .wg-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  }

  .wg-hero-policy {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wg-hero-actions {
    grid-column: 1 / -1;
  }

  .wg-overview {
    grid-template-columns: minmax(0, 65fr) minmax(260px, 35fr);
  }

  .wg-raid-grid,
  .wg-roster-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .wg-page {
    width: min(calc(100% - 24px), 1320px);
    padding-top: 12px;
  }

  .wg-nav,
  .wg-roster-head {
    align-items: stretch;
    flex-direction: column;
  }

  .wg-nav-links,
  .wg-roster-tools,
  .wg-roster-search {
    width: 100%;
  }

  .wg-nav-links a,
  .wg-roster-tabs,
  .wg-roster-tabs button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .wg-hero {
    grid-template-columns: 1fr;
  }

  .wg-hero-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  }

  .wg-action {
    width: 100%;
  }

  .wg-identity,
  .wg-overview,
  .wg-hero-side,
  .wg-hero-policy {
    grid-template-columns: 1fr;
  }

  .wg-crest {
    width: 128px;
  }

  .wg-title-group h1 {
    font-size: 44px;
  }

  .wg-title-group p {
    font-size: 18px;
  }

  .wg-raid-grid,
  .wg-roster-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .wg-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .wg-roster-table {
    min-width: 0;
    display: block;
    background: transparent;
  }

  .wg-roster-table thead {
    display: none;
  }

  .wg-roster-table tbody {
    display: grid;
    gap: 10px;
  }

  .wg-roster-table tr {
    display: grid;
    padding: 10px;
    border: 1px solid var(--wg-line);
    border-radius: 8px;
    background: rgba(13, 15, 18, 0.32);
  }

  .wg-roster-table td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 1px solid var(--wg-line);
  }

  .wg-roster-table td::before {
    content: attr(data-label);
    color: var(--wg-faint);
    font-size: 11px;
    line-height: 1.25;
    font-weight: 800;
    text-transform: uppercase;
  }

  .wg-roster-table td:first-child {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .wg-roster-table td:first-child::before {
    display: none;
  }

  .wg-roster-table td:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .wg-pvp-stack {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .wg-page {
    width: 100%;
    padding: 10px 10px 28px;
  }

  .wg-hero,
  .wg-panel,
  .wg-roster {
    padding: 12px;
  }

  .wg-hero {
    gap: 12px;
  }

  .wg-nav {
    margin-bottom: 12px;
  }

  .wg-brand img {
    width: 30px;
    height: 30px;
  }

  .wg-nav-links a {
    min-height: 34px;
    padding: 0 10px;
  }

  .wg-identity {
    gap: 14px;
  }

  .wg-crest {
    width: 104px;
  }

  .wg-title-group h1 {
    font-size: 32px;
  }

  .wg-title-group p {
    font-size: 16px;
  }

  .wg-recruitment strong {
    font-size: 20px;
  }

  .wg-section-title h2 {
    font-size: 25px;
  }

  .wg-roster-summary {
    grid-template-columns: 1fr;
  }

  .wg-hero-actions {
    grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  }

  .wg-action {
    min-height: 36px;
  }

  .wg-raid-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .wg-hero-actions {
    grid-template-columns: 1fr;
  }

  .wg-roster-table td {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}
