/* ControlledChaos — site styles. Colors come from the guild crest. */
:root {
  --bg: #0D1220; --bg-deep: #0B101C; --panel: #151C2E; --panel-2: #1B2438; --line: #2A3550; --line-2: #3A4766; --row: #222B42;
  --text: #ECE6D8; --muted: #A9B2C6;
  --gold: #E3A93C; --gold-hi: #F4C46A; --gold-ink: #1A1206; --gold-soft: #2A2414; --gold-soft-text: #F0C467; --gold-line: #5A4520;
  --classic: #C98A4B; --classic-soft: #2A1E14; --classic-text: #E2AE7A;
  --forever: #9A7BF0; --forever-soft: #2B2150; --forever-text: #CDBBFF; --forever-bg: #17142A;
  --alliance: #2F6FC9; --alliance-soft: #142644; --alliance-text: #B9CDEE;
  --horde: #B8382A; --horde-soft: #3A1612; --horde-text: #EEC0B8;
  --discord: #4752C4; --ok: #3BA55C; --ok-text: #7FD6A0; --tank: #1F3D6E; --heal: #1E5A3A; --dps: #6E231B; --oce-soft: #142A2A; --oce-text: #9FE0D8;
  --radius: 14px;
  --display: 'Cinzel', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
main.wrap { width: 100%; }
a { color: var(--gold); } a:hover { color: var(--gold-hi); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.display { font-family: var(--display); font-weight: 700; }
.h1 { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 4.5vw, 44px); line-height: 1.1; margin: 8px 0 0; }
.h2 { font-family: var(--display); font-weight: 700; font-size: 26px; }
.h3 { font-family: var(--display); font-weight: 700; font-size: 20px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.section { padding-top: 64px; }
.hidden, [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 20px; border-radius: 10px; font: 600 15px var(--body); text-decoration: none; border: 1px solid transparent; cursor: pointer; background: var(--panel-2); color: var(--text); }
.btn:hover { filter: brightness(1.08); color: inherit; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--gold-ink); } .btn-gold:hover { color: var(--gold-ink); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-discord { background: var(--discord); color: #fff; } .btn-discord:hover { color: #fff; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 600 14px var(--body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill-retail { background: var(--gold-soft); color: var(--gold-soft-text); }
.pill-classic { background: var(--classic-soft); color: var(--classic-text); }
.pill-forever { background: var(--forever-soft); color: var(--forever-text); }
.pill-all { background: #1E2A40; color: #B9C6E0; }
.pill-alliance { background: var(--alliance-soft); color: var(--alliance-text); }
.pill-horde { background: var(--horde-soft); color: var(--horde-text); }
.pill-oceanic { background: var(--oce-soft); color: var(--oce-text); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg-deep); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.brand span { font-family: var(--display); font-weight: 800; font-size: 20px; }
.nav { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 15px; font-weight: 500; flex: 1 1 auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 10px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }
.userchip { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-height: 44px; font-weight: 600; }
.userchip img { width: 36px; height: 36px; border-radius: 50%; }
.rank-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
#hdr-user { margin-left: auto; }
@media (max-width: 760px) { .nav { order: 3; flex-basis: 100%; gap: 0 18px; } .brand span { font-size: 16px; } .brand img { width: 40px; height: 40px; } .site-header .btn-discord { padding: 0 12px; font-size: 13px; } }

.notice { padding: 14px 18px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 14px; }
.notice.warn { border-color: var(--gold-line); background: #1A1710; }
.notice.err { border-color: var(--horde); background: var(--horde-soft); }
.notice.ok { border-color: var(--ok); background: #12261B; }

/* Forms */
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea { min-height: 46px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-deep); color: var(--text); font: 15px var(--body); width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-size: 14px; }
.opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
.opt:has(input:checked) { border-color: var(--gold); }
.opt.alliance { background: var(--alliance-soft); } .opt.alliance:has(input:checked) { border-color: var(--alliance); }
.opt.horde { background: var(--horde-soft); } .opt.horde:has(input:checked) { border-color: var(--horde); }
.opt.forever:has(input:checked) { border-color: var(--forever); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }

/* Tables */
.table-box { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--row); font-size: 14px; vertical-align: middle; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 10px; background: var(--panel-2); }
.datebox { text-align: center; min-width: 48px; }
.datebox .d1 { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.datebox .d2 { font-size: 22px; font-weight: 700; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 12px; font-size: 14px; }

.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > div { height: 100%; background: var(--gold); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 10px; font-size: 14px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100% - 32px); }
#toast.err { border-color: var(--horde); }

/* Dialog */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0; width: min(640px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(5, 8, 15, .7); }
dialog .dlg-body { padding: 24px; display: grid; gap: 16px; }

.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: var(--bg-deep); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; padding-top: 24px; padding-bottom: 24px; font-size: 14px; }
.site-footer a { text-decoration: none; }
