/* Hazbin roster — Classic-era UI flavour, built from original CSS/SVG only. */

@font-face { font-family: "Cinzel"; src: url(fonts/cinzel.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url(fonts/crimson-pro.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url(fonts/crimson-pro-italic.woff2) format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --gold: #ffd100;          /* classic UI header yellow */
  --gold-soft: #e9c46a;
  --brass: #b08d3c;
  --brass-dark: #5a4416;
  --ink: #f1e6c8;
  --muted: #a99b7a;
  --stone: #1a1611;
  --horde: #b3261e;
  --alliance: #2f6fd6;
  --tt-bg-top: rgba(8, 12, 40, .97);
  --tt-bg-bot: rgba(2, 3, 14, .97);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Crimson Pro", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 18px/1.4 var(--body);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 190, 90, .14), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, .7), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55  0 0 0 0 .45  0 0 0 0 .32  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(#17120c, #0c0906);
  background-attachment: fixed;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Shared "carved frame": dark leather panel with a bevelled brass edge -- */
.panel, .banner-frame, .card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 220, 150, .06), transparent 40%),
    linear-gradient(#2a2117, #17110b);
  border: 2px solid var(--brass);
  border-radius: 6px;
  box-shadow:
    0 0 0 1px #000,
    0 0 0 3px var(--brass-dark),
    0 0 0 4px #000,
    inset 0 0 0 1px rgba(0, 0, 0, .8),
    inset 0 1px 0 2px rgba(255, 225, 160, .12),
    inset 0 0 24px rgba(0, 0, 0, .7),
    0 8px 24px rgba(0, 0, 0, .6);
}
/* corner rivets */
.panel::before, .panel::after, .banner-frame::before, .banner-frame::after {
  content: ""; position: absolute; top: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2b8, #b8902f 45%, #3b2a08 80%);
  box-shadow: 0 1px 1px #000;
}
.panel::before, .banner-frame::before { left: 6px; }
.panel::after, .banner-frame::after { right: 6px; }

/* ---- Banner --------------------------------------------------------------- */
.banner { padding: 28px 16px 8px; display: flex; justify-content: center; }
.banner-frame {
  text-align: center; padding: 18px 48px 16px; max-width: 640px; width: 100%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 200, 90, .16), transparent 70%),
    linear-gradient(#2c2015, #120c07);
}
.banner-kicker, .banner-sub {
  margin: 0; font: 600 13px/1 var(--display); letter-spacing: .32em; text-transform: uppercase; color: var(--muted);
}
.banner-title {
  margin: 8px 0 10px;
  font: 900 clamp(40px, 9vw, 72px)/1 var(--display);
  letter-spacing: .04em;
  color: var(--gold);
  background: linear-gradient(#fff4b0 10%, #ffd100 45%, #c78a12 75%, #fbe18a);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #2a1500) drop-shadow(0 0 14px rgba(255, 170, 40, .35));
}
.banner-title span { opacity: .7; font-weight: 400; }
.banner-sub { color: var(--gold-soft); letter-spacing: .22em; }

main { max-width: 1100px; margin: 0 auto; padding: 12px 16px 24px; }

/* ---- Stat bar -------------------------------------------------------------- */
.stats { margin: 14px 0; padding: 12px 22px; }
.stats dl { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 8px 18px; margin: 0; }
.stat { text-align: center; min-width: 96px; }
.stat dt { font: 600 12px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.stat dd { margin: 6px 0 0; font: 700 28px/1 var(--display); color: var(--gold); text-shadow: 0 2px 0 #000; }
.stat.horde dd { color: #ff5a4a; }
.stat.alliance dd { color: #6fa8ff; }

/* ---- Controls ------------------------------------------------------------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 14px 22px; align-items: end; }
.controls label {
  display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px;
  font: 600 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-soft);
}
.controls select {
  appearance: none; -webkit-appearance: none;
  font: 17px/1.2 var(--body); color: var(--ink);
  padding: 7px 30px 7px 10px; border-radius: 3px;
  border: 1px solid #000; box-shadow: 0 0 0 1px var(--brass-dark), inset 0 2px 6px rgba(0, 0, 0, .8);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23e9c46a'/%3E%3C/svg%3E") no-repeat right 10px center / 10px 6px,
    linear-gradient(#0f0b07, #1d160e);
}
.controls select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.view-opts { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 4px; border-top: 1px solid rgba(176, 141, 60, .25); }
.seg { display: inline-flex; border-radius: 4px; box-shadow: 0 0 0 1px var(--brass-dark); overflow: hidden; }
.seg button {
  font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding: 9px 14px 8px; border: 0; cursor: pointer; background: linear-gradient(#1d160e, #0f0b07);
}
.seg button + button { border-left: 1px solid #000; }
.seg button[aria-pressed="true"] { color: var(--gold); background: linear-gradient(#6b0f0a, #3a0705); box-shadow: inset 0 1px 0 rgba(255, 200, 150, .25); }
.seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.controls .check { flex: none; flex-direction: row; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: 600 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); }
.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 3px; border: 1px solid #000; box-shadow: 0 0 0 1px var(--brass-dark), inset 0 2px 4px #000; background: #0f0b07; display: grid; place-items: center; cursor: pointer; }
.check input:checked::after { content: "✔"; color: var(--gold); font-size: 13px; line-height: 1; }
.check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- Guild list view (classic guild window) ------------------------------ */
.guild-window { padding: 10px 10px 12px; overflow-x: auto; }
.guild-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.guild-table thead th {
  padding: 0; text-align: left; white-space: nowrap;
  background: linear-gradient(#3a2d1c, #1f170e); border-bottom: 2px solid var(--brass-dark);
}
.guild-table thead th > button, .guild-table thead th:not(:has(button)) {
  font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-soft);
}
.guild-table thead th > button { width: 100%; text-align: left; padding: 9px 10px 8px; border: 0; background: none; cursor: pointer; }
.guild-table thead th:not(:has(button)) { padding: 9px 10px 8px; }
.guild-table thead th > button:hover { color: var(--gold); }
.guild-table thead th > button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.guild-table td { padding: 5px 10px; border-bottom: 1px solid rgba(255, 220, 150, .06); white-space: nowrap; }
.guild-table tbody tr:not(.group-row):nth-child(even) { background: rgba(255, 220, 150, .03); }
.guild-table tbody tr:not(.group-row):hover { background: linear-gradient(90deg, rgba(255, 209, 0, .16), rgba(255, 209, 0, .04)); }
.guild-table tr.mine td.col-name { box-shadow: inset 3px 0 0 var(--gold); }
.group-row th { padding: 12px 10px 6px; border-bottom: 1px solid var(--brass-dark); }
.row-name {
  display: inline-flex; align-items: center; gap: 8px; padding: 2px 0; border: 0; background: none; cursor: pointer;
  font: 700 16px/1.2 var(--display); color: var(--cc); text-shadow: 0 1px 0 #000;
}
.row-name:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mini-crest { width: 16px; flex: none; display: inline-block; }
.mini-crest svg { display: block; width: 100%; height: auto; }
.mini-crest .faction-icon { width: 16px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px var(--brass-dark); }
.col-level { text-align: center; color: var(--gold); font: 700 15px/1 var(--display); }
.guild-table thead th.col-level > button { text-align: center; }
.col-class { color: var(--cc); }
.col-class .class-icon { display: inline-block; width: 20px; height: 20px; vertical-align: -5px; margin-right: 8px; border-radius: 2px; border: 1px solid #000; box-shadow: 0 0 0 1px var(--brass-dark); }
.col-class .portrait-initial { font-size: 14px; margin-right: 6px; }
.col-race .race-icon { display: inline-block; width: 20px; height: 20px; vertical-align: -5px; margin-right: 8px; border-radius: 2px; border: 1px solid #000; box-shadow: 0 0 0 1px var(--brass-dark); }
.race-icon-gap { display: inline-block; width: 22px; margin-right: 8px; }
.col-profs, .col-player { color: var(--ink); }
.col-player { font-style: italic; color: var(--muted); }
.col-edit { text-align: right; width: 1%; }
.guild-table .muted { color: var(--muted); }
.guild-table.grouped .col-player { display: none; }
.edit-icon { display: none; }

.count { margin: 18px 4px 10px; font: 600 14px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---- Roster cards (unit-frame style) -------------------------------------- */
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.card {
  --cc: #d8c9a3;
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; gap: 14px; align-items: center;
  padding: 14px 14px 14px 12px; text-align: left; color: inherit; font: inherit; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.card::after { /* faction-tinted glow along the bottom edge */
  content: ""; position: absolute; inset: auto 8px 0 8px; height: 2px; border-radius: 2px; opacity: .8;
  background: linear-gradient(90deg, transparent, var(--fc, var(--brass)), transparent);
}
.card.horde { --fc: var(--horde); }
.card.alliance { --fc: var(--alliance); }
.card:hover, .card[aria-expanded="true"] { transform: translateY(-2px); filter: brightness(1.12); }
.card:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.portrait {
  position: relative; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--cc) 45%, #000), #0b0805 75%);
  border: 3px solid #c9a24a;
  box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--brass-dark), inset 0 0 12px #000, 0 0 16px color-mix(in srgb, var(--cc) 35%, transparent);
}
.portrait .class-icon, .portrait .race-icon { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.class-badge { /* small class icon on the race portrait, opposite the level disc */
  position: absolute; right: -6px; top: -4px; z-index: 1; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #c9a24a; box-shadow: 0 0 0 1px #000, 0 2px 3px rgba(0, 0, 0, .8); overflow: hidden; background: #000;
}
.class-badge .class-icon { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait::after { /* soft inner rim over the icon, like the in-game portrait frame */
  content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 8px 2px rgba(0, 0, 0, .85); pointer-events: none;
}
.portrait-level { z-index: 1; }
.portrait-initial { font: 900 30px/1 var(--display); color: var(--cc); text-shadow: 0 2px 2px #000, 0 0 10px rgba(0, 0, 0, .9); }
.portrait-level { /* the little level disc on classic unit frames */
  position: absolute; left: -6px; bottom: -6px; min-width: 26px; height: 26px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 13px;
  font: 700 13px/1 var(--display); color: var(--gold);
  background: radial-gradient(circle at 40% 30%, #3a2c18, #0d0905);
  border: 2px solid #c9a24a; box-shadow: 0 0 0 1px #000;
}

.card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-name { font: 700 20px/1.15 var(--display); color: var(--cc); text-shadow: 0 1px 0 #000, 0 0 8px rgba(0, 0, 0, .8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-line { color: var(--ink); font-size: 17px; }
.card-line .cc { color: var(--cc); }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.card-player { color: var(--muted); font-style: italic; font-size: 16px; }
.card-player::before { content: "Player: "; font-style: normal; }

.badge { font: 700 11px/1 var(--display); letter-spacing: .12em; padding: 4px 7px 3px; border-radius: 3px; border: 1px solid; }
.badge.pvp { color: #ff8a7a; border-color: #7a2219; background: rgba(120, 20, 10, .35); }
.badge.pve { color: #9fe39a; border-color: #2c6a2a; background: rgba(20, 90, 20, .3); }
.badge.ruleset:not(.pvp):not(.pve) { color: var(--gold-soft); border-color: var(--brass-dark); }

.sockets { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; }
.mine .sockets { margin-right: 44px; }
.socket { /* gem-socket style profession slots */
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #050403 40%, #2a2216 100%);
  border: 2px solid #6b5527; box-shadow: inset 0 2px 4px #000, 0 0 0 1px #000;
}
.socket.filled {
  width: auto; border-radius: 11px; padding: 0 9px; display: grid; place-items: center;
  font: 600 12px/1 var(--display); color: #fff; letter-spacing: .04em;
  background: radial-gradient(circle at 50% 30%, #3a3020, #120e08);
  border-color: #c9a24a;
}

.crest { width: 34px; align-self: start; filter: drop-shadow(0 2px 2px #000); }

/* XP-bar style level progress (classic purple, gold at the cap) */
.xp {
  grid-column: 1 / -1; position: relative; display: block; height: 14px; margin-top: 2px; border-radius: 3px; overflow: hidden;
  background: linear-gradient(#0b0806, #1a140d); border: 1px solid #000; box-shadow: 0 0 0 1px var(--brass-dark), inset 0 2px 4px #000;
}
.xp > span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#b48cff, #6d3fc4 55%, #4a2390); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.xp.max > span { background: linear-gradient(#fff1a8, #e0a91f 55%, #9a6a0c); }
.xp::after { /* segment ticks, like the in-game bar */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(5% - 1px), rgba(0, 0, 0, .55) calc(5% - 1px) 5%);
}
.xp.max::after { opacity: .45; }
.xp.max em { color: #2a1700; text-shadow: 0 1px 0 rgba(255, 245, 200, .6); }
.xp em { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font: 600 10px/1 var(--display); font-style: normal; letter-spacing: .1em; color: #fff; text-shadow: 0 1px 1px #000, 0 0 3px #000; }

/* Group headings (group by player) */
.roster > li.group-head { grid-column: 1 / -1; margin: 10px 2px -6px; }
.group-head h3, .group-row th { margin: 0; font: 700 17px/1.2 var(--display); color: var(--gold); letter-spacing: .06em; text-align: left; }
.group-head h3 { padding-bottom: 6px; border-bottom: 1px solid var(--brass-dark); }
.group-count { margin-left: 8px; font: italic 400 15px/1 var(--body); color: var(--muted); letter-spacing: 0; }
.you { font: 400 14px/1 var(--body); color: var(--gold-soft); letter-spacing: 0; }
.crest svg { display: block; width: 100%; height: auto; }
/* In-game style icon slot: thin black edge inside a gold frame */
.faction-icon { display: block; border-radius: 3px; border: 1px solid #000; box-shadow: 0 0 0 1px var(--brass); }
.crest .faction-icon { width: 34px; height: 34px; }

.empty { text-align: center; padding: 40px 16px; font: 600 18px/1.3 var(--display); letter-spacing: .08em; color: var(--muted); }

/* ---- Tooltip (classic item tooltip: navy glass, grey-silver edge) --------- */
.tooltip {
  position: absolute; z-index: 10; width: 280px; padding: 10px 12px 12px;
  background: linear-gradient(var(--tt-bg-top), var(--tt-bg-bot));
  border: 1px solid #9aa3b5; border-radius: 5px;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 30px rgba(0, 0, 0, .8);
  font: 16px/1.35 var(--body); color: #fff; pointer-events: none;
}
.tooltip.sheet { /* mobile: dock to the bottom of the screen */
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); top: auto; width: auto; pointer-events: auto;
}
.tooltip p { margin: 0; }
.tt-name { font: 700 19px/1.2 var(--display); margin-bottom: 2px !important; }
.tt-guild { color: #40ff40; }
.tt-faction.horde { color: #ff5a4a; }
.tt-faction.alliance { color: #6fa8ff; }
.tt-ruleset { color: var(--muted); }
.tt-head { color: var(--gold); margin-top: 8px !important; }
.tt-profs { list-style: none; margin: 2px 0 0; padding: 0; color: #fff; }
.tt-profs .muted { color: #9d9d9d; }
.tt-player { color: var(--gold); margin-top: 8px !important; font-style: italic; }

/* ---- Account bar + buttons ---------------------------------------------- */
.account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 14px 0; padding: 12px 22px; }
.whoami { margin: 0; font-size: 18px; }
.whoami strong { font: 700 18px/1 var(--display); color: var(--gold); letter-spacing: .04em; }
.whoami .muted { color: var(--muted); font-style: italic; }
.whoami .notice { color: #ff8a7a; }
.whoami a { color: var(--gold); }
a.btn { display: inline-block; text-decoration: none; text-align: center; }
.account-actions { display: flex; gap: 10px; }

/* Classic red-and-gold UI button */
.btn {
  font: 700 13px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
  padding: 10px 16px 9px; border-radius: 4px; cursor: pointer;
  border: 1px solid #000;
  background: linear-gradient(#a3221a, #6b0f0a 55%, #4a0805);
  box-shadow: 0 0 0 1px var(--brass), inset 0 1px 0 rgba(255, 200, 150, .35), inset 0 -2px 4px rgba(0, 0, 0, .5), 0 2px 4px rgba(0, 0, 0, .6);
  text-shadow: 0 1px 0 #000;
}
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(1px); box-shadow: 0 0 0 1px var(--brass), inset 0 2px 4px rgba(0, 0, 0, .7); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn:disabled { filter: grayscale(1) brightness(.6); cursor: not-allowed; }
.btn[hidden] { display: none; }
.btn-secondary { background: linear-gradient(#3b3226, #211a11 60%, #15100a); color: var(--gold-soft); }
.btn-danger { background: linear-gradient(#5a1410, #2e0806); color: #ff9b8f; }
.btn-small { padding: 6px 10px 5px; font-size: 11px; }

.roster > li { position: relative; display: flex; }
.roster > li > .card { flex: 1; }
.roster > li.group-head { display: block; }
.edit-btn { position: absolute; right: 14px; bottom: 42px; }

/* ---- Dialogs (classic panel) ---------------------------------------------- */
.dlg {
  width: min(460px, calc(100vw - 24px)); padding: 0; color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 220, 150, .07), transparent 40%), linear-gradient(#2a2117, #120d08);
  border: 2px solid var(--brass); border-radius: 6px;
  box-shadow: 0 0 0 1px #000, 0 0 0 3px var(--brass-dark), 0 0 0 4px #000, inset 0 0 30px rgba(0, 0, 0, .7), 0 20px 60px rgba(0, 0, 0, .8);
}
.dlg::backdrop { background: rgba(0, 0, 0, .65); }
.dlg form { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; }
.dlg h2 { margin: 0 0 4px; text-align: center; font: 700 22px/1.2 var(--display); color: var(--gold); text-shadow: 0 2px 0 #000; letter-spacing: .04em; }
.dlg-note { margin: 0; color: var(--muted); font-size: 16px; }
.dlg-fixed { margin: 0; text-align: center; color: var(--ink); }
.dlg label { display: flex; flex-direction: column; gap: 4px; flex: 1; font: 600 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-soft); }
.dlg label[hidden] { display: none; }
.dlg .row { display: flex; gap: 12px; }
.dlg input, .dlg select {
  appearance: none; -webkit-appearance: none; width: 100%;
  font: 17px/1.2 var(--body); color: var(--ink); text-transform: none; letter-spacing: 0;
  padding: 8px 10px; border-radius: 3px; border: 1px solid #000;
  box-shadow: 0 0 0 1px var(--brass-dark), inset 0 2px 6px rgba(0, 0, 0, .8);
  background: linear-gradient(#0f0b07, #1d160e);
}
.dlg select {
  padding-right: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23e9c46a'/%3E%3C/svg%3E") no-repeat right 10px center / 10px 6px, linear-gradient(#0f0b07, #1d160e);
}
.dlg select:disabled { opacity: .7; }
.dlg input:focus-visible, .dlg select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.dlg-error { margin: 0; min-height: 1.3em; color: #ff6b5e; font-size: 16px; }
.dlg-error:empty { min-height: 0; }
.dlg-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.dlg-actions .spacer { flex: 1; }
.dlg .edit-only { display: none; }
.dlg.editing .edit-only { display: revert; }
.dlg.editing .new-only { display: none; }

/* ---- Footer ---------------------------------------------------------------- */
.foot { text-align: center; padding: 8px 16px 32px; color: var(--muted); font-size: 15px; }
.foot p { margin: 4px 0; }
.fineprint { font-size: 13px; opacity: .75; max-width: 46em; margin-left: auto !important; margin-right: auto !important; }

/* ---- Mobile -------------------------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .banner { padding-top: 18px; }
  .banner-frame { padding: 16px 24px 14px; }
  .roster { grid-template-columns: 1fr; }
  .stats { padding: 10px 14px; }
  .stats dl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .stat { min-width: 0; }
  .stat dt { font-size: 9px; letter-spacing: .08em; }
  .stat dd { font-size: 22px; }
  .controls { padding: 12px 14px; }
  .controls label { flex-basis: calc(50% - 8px); }
  .controls label:last-child { flex-basis: 100%; }
  .account { padding: 12px 14px; }
  .account-actions { width: 100%; }
  .account-actions .btn { flex: 1; white-space: nowrap; letter-spacing: .05em; padding-inline: 10px; }
  .dlg .row { flex-direction: column; }
  .guild-table .col-race, .guild-table .col-profs, .guild-table .col-ruleset { display: none; }
  .guild-table td, .guild-table thead th > button, .guild-table thead th:not(:has(button)) { padding-left: 5px; padding-right: 5px; }
  .guild-table .cls-name { display: none; }
  .guild-table .col-class .class-icon { width: 20px; height: 20px; margin: 0; }
  .row-name { font-size: 15px; gap: 6px; }
  .guild-window { padding: 6px; }
  .guild-table .edit-label { display: none; }
  .guild-table .edit-icon { display: inline; font-size: 13px; }
  .guild-table .col-edit .btn { padding: 5px 7px 4px; }
  .guild-table .col-player { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
  .guild-table thead th > button, .guild-table thead th:not(:has(button)) { letter-spacing: .06em; }
  .guild-table .mini-crest { width: 14px; }
}

@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

@media (max-width: 400px) { .banner-sub { letter-spacing: .12em; } }
