:root {
  color-scheme: dark;
  --bg: #10100e;
  --panel: #1a1915;
  --panel2: #211f19;
  --border: #3a362a;
  --text: #eee8d7;
  --muted: #aaa38f;
  --gold: #d4a94b;
  --gold2: #f1cf77;
  --green: #79b66b;
  --danger: #d46d61;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(212,169,75,.08), transparent 26rem),
    linear-gradient(#11100e, #0b0b09);
  color: var(--text);
  min-height: 100vh;
}
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 34px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .18em; margin-bottom: 8px; }
h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(34px, 5vw, 58px); line-height: 1; color: var(--gold2); text-shadow: 0 2px 14px rgba(0,0,0,.5); }
.hero p { margin: 10px 0 0; color: var(--muted); }
.source-link { color: var(--gold2); text-decoration: none; padding: 10px 0; white-space: nowrap; }
.source-link:hover { text-decoration: underline; }
.card { background: linear-gradient(180deg, rgba(33,31,25,.97), rgba(25,24,20,.97)); border: 1px solid var(--border); box-shadow: 0 12px 35px rgba(0,0,0,.24); border-radius: 10px; }
.toolbar { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; padding: 16px; }
.guild-form { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.search-wrap { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
label { color: var(--muted); font-size: 13px; font-weight: 700; }
input, select { width: 100%; background: #0f0f0d; color: var(--text); border: 1px solid #484232; border-radius: 7px; padding: 11px 12px; outline: none; }
select { cursor: pointer; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,169,75,.09); }
button { border: 1px solid #b4872f; color: #17120a; background: linear-gradient(#efc867, #c79638); font-weight: 900; border-radius: 7px; padding: 11px 16px; cursor: pointer; }
button:hover { filter: brightness(1.06); }
button:disabled { opacity: .55; cursor: wait; }
.status { margin-top: 14px; padding: 13px 16px; }
.status-row { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }
.progress { height: 5px; background: #0f0f0d; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > div { width: 0; height: 100%; background: linear-gradient(90deg, #ad8030, #e7c161); transition: width .25s ease; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 14px 0; }
.hidden { display: none; }
.stat { padding: 15px 17px; }
.stat span { color: var(--muted); display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat strong { display: block; margin-top: 4px; font-family: Georgia, serif; font-size: 27px; color: var(--gold2); }
.table-card { margin-top: 14px; overflow: hidden; }
.table-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
h2 { margin: 0; font: 700 20px Georgia, serif; color: var(--gold2); }
#lastUpdated { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th, td { padding: 12px 18px; border-bottom: 1px solid #302d24; text-align: left; }
th { background: #171611; color: #bbb39e; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; cursor: pointer; user-select: none; }
th:hover { color: var(--gold2); }
th span { opacity: .45; margin-left: 3px; }
td { font-size: 14px; }
tbody tr:hover { background: rgba(212,169,75,.035); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.char-link { color: var(--gold2); font-weight: 800; text-decoration: none; }
.char-link:hover { text-decoration: underline; }
.level { color: #fff3c5; font-weight: 900; }
.online { color: var(--green); font-weight: 800; }
.muted { color: var(--muted); }
.error-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: 6px; vertical-align: middle; }
.empty { text-align: center; color: var(--muted); padding: 34px; }
footer { text-align: center; color: #6f6a5d; font-size: 12px; margin-top: 18px; }
@media (max-width: 800px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 26px; }
  .hero { display: block; }
  .source-link { display: inline-block; margin-top: 12px; }
  .toolbar { grid-template-columns: 1fr; }
  .guild-form { grid-template-columns: 1fr; }
  .search-wrap { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
