/* 4everguilds — platform theme ("Nuit"), in the spirit of the official WoW site:
   charcoal, floating navigation bar, Montserrat titles, gold buttons.
   Guild themes override the variables. All text colours are AA on --bg,
   --surface and --surface-2 (checked). */
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-500-normal.f96e8aab37e8.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-600-normal.9e606da1cbeb.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-700-normal.1c0792ac34ef.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-400-normal.6ec1900716de.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-600-normal.ccd396b92abd.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-700-normal.456f29ac2c8a.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #141418;
  --surface: #1d1d23;
  --surface-2: #26262e;
  --text: #f2f1ee;
  --muted: #b4b2ad;
  --gold: #f8b700;
  --gold-line: #6e5a26;
  --ice: #6fc3ff;
  --link: #ffc72c;
  --danger: #ff8f8f;
  --success: #7fd9a4;
  --on-gold: #1a1300;
  --focus: #8fd3ff;
  --radius: 4px;
  --space: 1rem;
  --font-display: "Montserrat", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --shadow: 0 10px 30px rgb(0 0 0 / 35%);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgb(79 179 255 / 12%), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); letter-spacing: -0.01em; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
.lead { font-size: 1.125rem; }
.prose { max-width: 70ch; }
p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { color: var(--text); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }
/* QR codes (2FA) need a light quiet zone to be scanned on the dark theme. */
img.qr { display: block; width: 14rem; background: #fff; padding: 1rem; border-radius: 0.5rem; }

.icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  flex: none;
}

/* ---- Layout ------------------------------------------------------------ */
.container { width: min(72rem, 100% - 2rem); margin-inline: auto; }
.container-narrow { width: min(34rem, 100% - 2rem); margin-inline: auto; }

.site-header {
  border-bottom: 1px solid rgb(184 146 63 / 35%);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--space);
  min-height: 4.5rem;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { display: block; width: auto; height: 3rem; }
/* Guild brand on the left, then the nav, then the platform logo always top right. */
.site-header .site-nav { margin-left: auto; }
.brand-platform { display: inline-flex; }
.brand-platform img { display: block; width: auto; height: 3rem; }
@media (max-width: 40rem) { .brand-platform img, .brand img { height: 2.25rem; } }
.crest { border-radius: 50%; }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--gold); text-decoration: none; }

.site-nav { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.site-nav a:not(.btn) { color: var(--text); text-decoration: none; padding: 0.4rem 0.2rem; }
.site-nav a:not(.btn):hover { color: var(--gold); }

main { flex: 1; padding-block: 2.5rem; }
main:focus { outline: none; }

.site-footer {
  border-top: 1px solid rgb(184 146 63 / 35%);
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.site-footer ul { list-style: none; display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; padding: 0; margin: 0 0 0.5rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  background: var(--gold);
  color: var(--on-gold);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- Menus (details/summary, no JavaScript) ----------------------------- */
.menu { position: relative; }
.menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgb(143 211 255 / 35%);
  border-radius: var(--radius);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { border-color: var(--ice); }
.menu > summary span { overflow-wrap: anywhere; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 20;
  min-width: 15rem;
  background: var(--surface-2);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.4rem;
}
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
@media (max-width: 40rem) {
  /* Narrow screens / 200 % zoom: the panel flows below its button, never off-screen. */
}
.menu-panel a, .menu-panel button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: rgb(143 211 255 / 12%); }
.menu-panel a[aria-current="page"] { color: var(--gold); }
.menu-label { display: block; padding: 0.4rem 0.7rem; color: var(--muted); font-size: 0.85rem; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 1rem var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: filter 150ms ease, background-color 150ms ease;
}
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 82%, #fff), var(--gold));
  color: var(--on-gold);
  border-color: color-mix(in srgb, var(--gold) 70%, #fff);
}
.btn-primary:hover { filter: brightness(1.08); color: var(--on-gold); }
.btn-secondary { background: rgb(143 211 255 / 8%); color: var(--ice); border-color: rgb(143 211 255 / 55%); }
.btn-secondary:hover { background: rgb(143 211 255 / 16%); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgb(255 143 143 / 60%); }
.btn-danger:hover { background: rgb(255 143 143 / 12%); color: var(--text); }
.btn-link { background: none; border: 0; color: var(--link); text-decoration: underline; padding-inline: 0; min-height: auto; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-top: 1.5rem; }

/* ---- Cards ------------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgb(243 217 139 / 12%);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
}
.card + .card { margin-top: 1.5rem; }
.card > :last-child { margin-bottom: 0; }
.card-title { display: flex; align-items: center; gap: 0.6rem; color: var(--gold); font-size: 1.375rem; }

.divider {
  height: 14px;
  margin: 2rem auto;
  max-width: 28rem;
  background: url("../img/divider.2e3b380b81a9.svg") center / contain no-repeat;
}

.page-head { margin-bottom: 1.5rem; }
.page-head p { color: var(--muted); }
.muted { color: var(--muted); }

/* ---- Forms -------------------------------------------------------------- */
.field { margin-bottom: 1.1rem; }
.field > label, .field legend, .field-label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.required { color: var(--gold); }
.required-note { font-size: 0.9rem; }
.field fieldset { border: 0; padding: 0; margin: 0; }
.field .help { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.field .errorlist, .errorlist { list-style: none; padding: 0; margin: 0.35rem 0 0; color: var(--danger); font-size: 0.95rem; }
.form-errors { border: 1px solid rgb(255 143 143 / 60%); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="url"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface-2);
  color: var(--text);
  /* Field border: the muted text colour, AA on the theme's surfaces (WCAG 1.4.11). */
  border: 1px solid var(--muted);
  border-radius: 6px;
  font: inherit;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ice); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
input[type="file"] { font: inherit; color: var(--muted); }

.check { display: flex; gap: 0.6rem; align-items: flex-start; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; accent-color: var(--gold); flex: none; }
.check label { font-weight: 400; margin: 0; }

.choices { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.choices label { display: inline-flex; gap: 0.4rem; align-items: center; font-weight: 400; }
.choices input { accent-color: var(--gold); width: 1.1rem; height: 1.1rem; }
/* Third-party sign-in buttons: brand colours, white text (AA on both). */
.btn-provider { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; border-color: transparent; }
.btn-provider .icon { width: 1.25rem; height: 1.25rem; }
.btn-discord { background: #4752c4; }
.btn-battlenet { background: #0b5ea8; }
.btn-provider:hover { filter: brightness(1.12); color: #fff; }
.char-tools:not([hidden]) { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.char-tools > :nth-child(n + 3) { grid-column: 1 / -1; }
.char-tools .actions { margin-top: 0.5rem; }

altcha-widget { display: block; margin: 0.5rem 0 1rem; }

/* ---- Messages ----------------------------------------------------------- */
.messages { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.6rem; }
.message {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgb(143 211 255 / 45%);
  background: rgb(143 211 255 / 8%);
}
.message.success { border-color: rgb(127 217 164 / 60%); background: rgb(127 217 164 / 8%); }
.message.error, .message.warning { border-color: rgb(255 143 143 / 60%); background: rgb(255 143 143 / 8%); }

/* ---- Tables and lists --------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid rgb(169 180 204 / 20%); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.table-wrap { overflow-x: auto; }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain > li + li { border-top: 1px solid rgb(169 180 204 / 20%); }
.list-plain > li { padding: 0.9rem 0; }

.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: 1px solid var(--gold-line); color: var(--gold); }

.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }

.avatar { width: 4rem; height: 4rem; border-radius: 50%; border: 2px solid var(--gold-line); object-fit: cover; background: var(--surface-2); }
.avatar-sm { width: 1.8rem; height: 1.8rem; border-width: 1px; }

/* ---- Account area ------------------------------------------------------- */
.account-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: start; }
.account-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem; }
.account-nav a { display: flex; gap: 0.6rem; align-items: center; padding: 0.55rem 0.75rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.account-nav a:hover { background: rgb(143 211 255 / 10%); }
.account-nav a[aria-current="page"] { background: rgb(224 187 104 / 12%); color: var(--gold); }
@media (max-width: 52rem) {
  .account-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}

/* ---- Platform home ------------------------------------------------------- */
.hero {
  display: grid;
  gap: 2.5rem 3rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  padding-block: 1.5rem 3rem;
}
.hero h1 { font-size: clamp(2.4rem, 1.5rem + 3.2vw, 3.9rem); line-height: 1.05; margin-bottom: 1rem; }
.hero .lead { max-width: 32rem; font-size: 1.2rem; color: var(--muted); }
@media (max-width: 52rem) { .hero { grid-template-columns: 1fr; } }

/* Static example of a guild home, built with the site's own components. */
.preview {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  font-size: 0.9rem;
}
.preview-top { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 1rem; }
.preview-crest {
  width: 3rem; height: 3rem; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 35%, #ecca7d, #7a5a1c);
  border: 2px solid var(--gold-line);
}
.preview-name { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--gold); line-height: 1.1; }
.preview-top .muted { font-size: 0.85rem; }
.preview h3 { font-size: 1rem; margin: 1rem 0 0.4rem; color: var(--gold); }
.preview .news-feed li { padding: 0.35rem 0; grid-template-columns: 4.5rem 1fr; }
.preview .composition-legend { font-size: 0.85rem; }
.preview-caption { margin: 1.25rem 0 0; text-align: right; font-size: 0.85rem; }

.section { margin-block: 3.5rem; }
.section > h2 { margin-bottom: 1.25rem; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.75rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.features h3 { display: flex; gap: 0.5rem; align-items: center; font-size: 1.2rem; margin-bottom: 0.35rem; }
.features .icon { color: var(--gold); }
.features p { color: var(--muted); margin: 0; }
/* The three steps are a real sequence: numbers carry meaning here. */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.steps li { counter-increment: step; position: relative; padding-left: 3.25rem; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.15rem;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1px solid var(--gold-line); color: var(--gold);
  display: grid; place-items: center;
  font: 700 1.1rem var(--font-display);
}
.steps h3 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.steps p { color: var(--muted); margin: 0; }

/* ---- Guild site ------------------------------------------------------------ */
.guild-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; padding: 0; margin: 0 0 2rem; border-bottom: 1px solid rgb(184 146 63 / 35%); }
.guild-nav a { display: inline-block; color: var(--text); text-decoration: none; padding: 0.5rem 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.guild-nav a:hover { color: var(--gold); }
.guild-nav a[aria-current="page"] { border-bottom-color: var(--gold); color: var(--gold); }

.guild-banner { display: block; width: 100%; height: auto; max-height: 18rem; object-fit: cover; border-radius: var(--radius); margin-bottom: 1.5rem; }
.guild-identity { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; margin: 0 0 2rem; }
.guild-identity .crest { width: 6.5rem; height: 6.5rem; border: 2px solid var(--gold-line); box-shadow: var(--shadow); }
.guild-identity h1 { margin: 0 0 0.3rem; }
.guild-identity p { margin: 0; color: var(--muted); max-width: 40rem; }
@media (max-width: 40rem) { .guild-identity { grid-template-columns: 1fr; } .guild-identity .crest { width: 5rem; height: 5rem; } }

/* Home blocks: the guild's own content is unboxed; outside links (Discord) and lists are boxed. */
.home-blocks { display: grid; gap: 2rem 2.5rem; grid-template-columns: minmax(0, 3fr) minmax(15rem, 2fr); align-items: start; }
.home-block-members { grid-column: 1 / -1; }
.home-block-news { grid-column: 1; }
.home-block-discord, .home-block-pages { grid-column: 2; }
.home-blocks .card + .card { margin-top: 0; }
.home-block > h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
@media (max-width: 52rem) { .home-blocks { grid-template-columns: 1fr; } .home-block { grid-column: auto !important; } }

/* Composition strip: one bar in class colours (inline SVG, attributes only, CSP-safe). */
.composition-bar { display: block; width: 100%; height: 1.4rem; border-radius: 999px; border: 1px solid var(--gold-line); background: var(--surface); }
.composition-legend { list-style: none; padding: 0; margin: 0.8rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; }
.composition-legend li::before { content: ""; display: inline-block; width: 0.7em; height: 0.7em; border-radius: 2px; background: var(--class-color, var(--muted)); margin-right: 0.45em; }
.composition-legend .muted { margin-left: 0.3em; }

.news-feed { list-style: none; padding: 0; margin: 0; }
.news-feed li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid rgb(169 180 204 / 20%); }
.news-feed li:first-child { border-top: 0; }
.news-feed time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.news-item + .news-item { margin-top: 1.5rem; }
.news-item h2 { margin-bottom: 0.2rem; }
.byline { color: var(--muted); font-size: 0.95rem; }
.markdown img { max-width: 100%; height: auto; border-radius: var(--radius); }
.markdown blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--gold-line); color: var(--muted); }
.markdown table { border-collapse: collapse; }
.markdown th, .markdown td { padding: 0.4rem 0.6rem; border-bottom: 1px solid rgb(169 180 204 / 20%); text-align: left; }

/* Roster: grouped by rank, one tile per character, class colour as an edge. */
.roster-group { margin-bottom: 2.25rem; }
.roster-group h2 { display: flex; align-items: baseline; gap: 0.75rem; font-size: 1.375rem; border-bottom: 1px solid var(--gold-line); padding-bottom: 0.4rem; margin-bottom: 0.9rem; }
.roster-group h2 .muted { font: 400 1rem var(--font-body); }
.roster-grid > li { display: flex; }
.roster-grid > li > .roster-tile { flex: 1; }
.roster-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); }
.roster-tile { display: flex; gap: 0.75rem; align-items: center; padding: 0.55rem 0.75rem; background: var(--surface); border-left: 3px solid var(--class-color, var(--muted)); border-radius: 0 var(--radius) var(--radius) 0; }
.roster-tile .avatar { width: 2.75rem; height: 2.75rem; border-width: 1px; border-color: var(--class-color, var(--gold-line)); flex: none; }
.roster-tile .name { font-weight: 600; }
.roster-tile .detail { display: block; color: var(--muted); font-size: 0.9rem; }
.roster-tile .badge { margin-left: 0.4rem; font-size: 0.7rem; }
.avatar-empty { display: inline-block; }

.roster-id { display: flex; align-items: center; gap: 0.75rem; }
.roster-id .avatar { width: 2.6rem; height: 2.6rem; border-width: 1px; border-color: var(--class-color, var(--gold-line)); }
.roster-table { width: 100%; border-collapse: collapse; }
.roster-table th, .roster-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid rgb(169 180 204 / 20%); vertical-align: middle; }
.roster-table th { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; }
.char-avatar { width: 2rem; height: 2rem; border-radius: 50%; vertical-align: middle; }
.char-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.char-row > .field { flex: 1; }
.char-row .char-avatar { margin-top: 0.3rem; }

/* Class colours (apps/guilds/wow.py) are accents only, never text colour. */
.class-1 { --class-color: #c69b6d; }
.class-2 { --class-color: #f48cba; }
.class-3 { --class-color: #aad372; }
.class-4 { --class-color: #fff468; }
.class-5 { --class-color: #ffffff; }
.class-6 { --class-color: #c41e3a; }
.class-7 { --class-color: #0070dd; }
.class-8 { --class-color: #3fc7eb; }
.class-9 { --class-color: #8788ee; }
.class-10 { --class-color: #00ff98; }
.class-11 { --class-color: #ff7c0a; }
.class-12 { --class-color: #a330c9; }
.class-13 { --class-color: #33937f; }

/* ---- Appearance editor --------------------------------------------------- */
.appearance { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); align-items: start; margin-bottom: 1.5rem; }
.appearance .card + .card { margin-top: 0; }
.preview-canvas { background: var(--p-bg); color: var(--p-text); padding: 1rem; border-radius: var(--radius); border: 1px solid var(--gold-line); }
.preview-heading { color: var(--p-primary); font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin: 0 0 0.75rem; }
.preview-surface { background: var(--p-surface); padding: 1rem; border-radius: var(--radius); }
.preview-surface a { color: var(--p-accent); }
.preview-muted { opacity: 0.8; }
.preview-button { display: inline-block; background: var(--p-primary); color: var(--p-on-primary); padding: 0.4rem 0.9rem; border-radius: var(--radius); font-weight: 600; }
.preview-images { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
input[type="color"] { width: 4rem; height: 2.5rem; padding: 0.2rem; }
.block-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid rgb(169 180 204 / 20%); }
.block-row .check { flex: 1 1 12rem; }
.block-row select { width: auto; }
.block-moves { display: inline-flex; gap: 0.5rem; }
.markdown-help { margin-bottom: 1rem; }

/* htmx indicators (includeIndicatorStyles is off to keep the CSP strict). */
.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; transition: opacity 200ms ease-in; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Character sheet ------------------------------------------------------ */
.character-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center; margin-bottom: 1.5rem; }
.character-head .avatar { width: 4.5rem; height: 4.5rem; border-color: var(--class-color, var(--gold-line)); }
.character-head h1 { margin: 0 0 0.2rem; }
.character-head p { margin: 0; color: var(--muted); }
.ilvl { text-align: right; line-height: 1.1; }
.ilvl-value { display: block; font: 700 2.5rem var(--font-display); color: var(--gold); font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) { .character-head { grid-template-columns: auto 1fr; } .ilvl { grid-column: 1 / -1; text-align: left; } }

.sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, 22rem) minmax(0, 1fr); gap: 1rem 1.5rem; align-items: start; margin-bottom: 2.5rem; }
.sheet-render { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.sheet-render-img { width: 100%; height: auto; max-height: 34rem; object-fit: contain; filter: drop-shadow(0 12px 24px rgb(0 0 0 / 55%)); }
.sheet-render-empty { width: 100%; aspect-ratio: 3 / 4; border-radius: var(--radius); background: radial-gradient(ellipse at 50% 40%, var(--surface-2), transparent 70%); }
.sheet-slots { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.sheet-right .slot-button { flex-direction: row-reverse; text-align: right; }
/* Weapons: a row under the sheet, centred, as in the game. */
.sheet-weapons { grid-column: 1 / -1; width: min(44rem, 100%); justify-self: center; grid-template-columns: 1fr 1fr; }
.sheet-weapons .slot:last-child .slot-button { flex-direction: row-reverse; text-align: right; }
@media (max-width: 56rem) {
  .sheet { grid-template-columns: 1fr; }
  .sheet-render { order: -1; }
  .sheet-render-img { max-height: 22rem; }
  .sheet-right .slot-button { flex-direction: row; text-align: left; }
}

.slot { position: relative; }
.slot-button {
  display: flex; gap: 0.65rem; align-items: center; width: 100%;
  padding: 0.35rem; background: var(--surface); color: var(--text);
  border: 1px solid transparent; border-radius: var(--radius); font: inherit; text-align: left; cursor: default;
}
button.slot-button:hover, button.slot-button:focus-visible { border-color: var(--q, var(--gold-line)); }
.slot-icon { width: 2.5rem; height: 2.5rem; flex: none; border-radius: 4px; border: 2px solid var(--q, #555); background: var(--surface-2); }
.slot-text { min-width: 0; }
.slot-name { display: block; color: var(--q, var(--text)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-meta { display: block; color: var(--muted); font-size: 0.85rem; }
.slot-empty .slot-icon { border-style: dashed; border-color: var(--gold-line); }
.slot-flag { color: var(--danger); font-weight: 600; }
.slot-missing .slot-icon { box-shadow: 0 0 0 2px var(--danger); }

/* Item quality colours, lightened where needed for 4.5:1 on dark surfaces. */
.quality-poor { --q: #a8a8a8; }
.quality-common { --q: #f2f2f2; }
.quality-uncommon { --q: #3ee640; }
.quality-rare { --q: #4ea5ff; }
.quality-epic { --q: #c57cff; }
.quality-legendary { --q: #ff9a2e; }
.quality-artifact { --q: #e6cc80; }
.quality-heirloom { --q: #3fd6ff; }

/* Tooltip: hover or keyboard focus, hoverable, dismissed with Escape (item-tooltips.js). */
.item-tip {
  display: none; position: absolute; z-index: 30; top: 0; left: calc(100% + 0.5rem);
  width: 19rem; padding: 0.75rem 0.9rem; font-size: 0.9rem; line-height: 1.45;
  background: #0a0f1e; color: #f2f2f2; border: 1px solid var(--q, var(--gold-line)); border-radius: 6px; box-shadow: var(--shadow);
}
.sheet-right .item-tip { left: auto; right: calc(100% + 0.5rem); }
.sheet-weapons .item-tip { left: 0; top: calc(100% + 0.4rem); }
.slot:hover .item-tip, .slot:focus-within .item-tip { display: block; }
.slot.tip-dismissed .item-tip { display: none; }
.item-tip p { margin: 0 0 0.2rem; }
.tip-name { color: var(--q, #fff); font-weight: 700; font-size: 1rem; }
.tip-sub { color: #3ee640; }
.tip-ilvl { color: #ffd84a; }
.tip-stats { list-style: none; padding: 0; margin: 0.3rem 0; }
.tip-enchant, .tip-spell { color: #3ee640; }
.tip-socket { color: #c9d1e6; }
.tip-set { color: #ffd84a; margin-top: 0.3rem; }
.tip-missing { color: #ff9b9b; font-weight: 600; }
@media (max-width: 56rem) { .item-tip, .sheet-right .item-tip { left: 0; right: auto; top: calc(100% + 0.4rem); width: min(19rem, 100%); } }

.audit-list { padding-left: 1.2rem; }
.audit-list li { margin-bottom: 0.3rem; }
.talent-columns { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin-top: 0.75rem; }
.talent-columns h3 { font-size: 1.05rem; }
.talent-columns ul { padding-left: 1.1rem; margin: 0; }
.sheet-extra { margin-bottom: 2rem; }
a.roster-tile { color: var(--text); text-decoration: none; }
a.roster-tile:hover { background: var(--surface-2); }
.roster-tile .ilvl-small { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---- Wishlist ------------------------------------------------------------- */
.wish-switch { margin-bottom: 0.75rem; }
.wish-sheet { margin-top: 1.5rem; }
.wish-sheet .sheet-render { justify-content: flex-start; padding-top: 1rem; }
.wish-portrait { width: 7.5rem; height: 7.5rem; border-radius: 50%; border: 2px solid var(--gold-line); }
.wish-name { font: 700 1.5rem var(--font-display); color: var(--gold); margin: 0; }
a.slot-button { text-decoration: none; cursor: pointer; }
a.slot-button:hover, a.slot-button:focus-visible { border-color: var(--gold-line); }
.wish-slot .slot-name { white-space: normal; }
.wish-remove { margin: 0.1rem 0 0 3.2rem; font-size: 0.85rem; }
.sheet-right .wish-remove { margin: 0.1rem 3.2rem 0 0; text-align: right; }
.wish-search input[type="search"] { flex: 1 1 14rem; width: auto; }
.wish-results { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.5rem; }
.wish-result { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 0.55rem 0.75rem; background: var(--surface); border-left: 3px solid var(--q, var(--gold-line)); border-radius: 0 var(--radius) var(--radius) 0; }
.wish-result-text { min-width: 0; }
.wish-result .slot-name { white-space: normal; }
.wish-best { margin-bottom: 2rem; }

/* ---- Phones ---------------------------------------------------------------- */
@media (max-width: 40rem) {
  main { padding-block: 1.25rem 2rem; }
  .site-header .container { gap: 0.5rem; min-height: 3.5rem; padding-block: 0.4rem; }
  .brand-text { font-size: 1.15rem; }
  .brand-guild .crest { width: 2.25rem; height: 2.25rem; }
  .brand-platform img { height: 1.75rem; }
  /* Menus: icon and avatar only, the full labels stay for screen readers. */
  .menu > summary > span:not(.visually-hidden) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .menu > summary { min-height: 2.75rem; min-width: 2.75rem; justify-content: center; }
  .site-nav > a:not(.btn) { padding: 0.6rem 0.2rem; }
  .site-nav .btn { min-height: 2.5rem; padding: 0.4rem 0.8rem; }

  /* Guild and account navigation: one scrollable row instead of a wall of links. */
  .guild-nav ul { flex-wrap: nowrap; overflow-x: auto; gap: 1.25rem; scrollbar-width: thin; }
  .guild-nav li { flex: none; }
  .guild-nav a { padding-block: 0.75rem; }
  .account-nav { padding: 0.5rem; }
  .account-nav ul { display: flex; overflow-x: auto; gap: 0.25rem; scrollbar-width: thin; }
  .account-nav li { flex: none; }
  .account-nav a { white-space: nowrap; min-height: 2.75rem; }

  .card { padding: 1rem; }
  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2.2rem; }
  .actions .btn { flex: 1 1 auto; }
  .inline-form > * { flex: 1 1 100%; }
  .inline-form select, .inline-form .btn { width: 100%; }
  .choices { flex-direction: column; gap: 0.35rem; }
  .choices label { min-height: 2.25rem; }
  .news-feed li { grid-template-columns: 1fr; gap: 0.1rem; }
  .roster-grid { grid-template-columns: 1fr; }
  .class-bars li, .composition-legend { font-size: 0.9rem; }
  .sheet-weapons { grid-template-columns: 1fr; }
  .item-tip, .sheet-right .item-tip, .sheet-weapons .item-tip { position: static; width: auto; margin-top: 0.35rem; }
  .wish-remove, .sheet-right .wish-remove { margin: 0.1rem 0 0; text-align: left; }
  .wish-result { flex-direction: column; align-items: stretch; }
  .wish-result .btn { width: 100%; }
  .block-row .block-moves { width: 100%; }
  .block-row .block-moves .btn { flex: 1; }
  .table-wrap { margin-inline: -0.5rem; }
}

/* ---- Progression, Mythic+, planner, help ---------------------------------- */
.raid { margin-bottom: 2rem; }
.raid-modes { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.raid-mode { background: var(--surface); border-radius: var(--radius); padding: 0.85rem 1rem; border-top: 3px solid var(--d, var(--gold-line)); }
.raid-mode-head { margin: 0 0 0.4rem; }
.raid-count { font: 700 1.6rem var(--font-display); color: var(--gold); margin-right: 0.3rem; font-variant-numeric: tabular-nums; }
.raid-mode meter { width: 100%; height: 0.6rem; accent-color: var(--d, var(--gold)); }
.difficulty-lfr { --d: #7fd9a4; }
.difficulty-normal { --d: #8fd3ff; }
.difficulty-heroic { --d: #c57cff; }
.difficulty-mythic { --d: #ff9a2e; }
.num { font-variant-numeric: tabular-nums; }
.profession-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.profession-grid .card + .card { margin-top: 0; }
.subnav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.subnav a { color: var(--text); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.subnav a[aria-current="page"] { border-bottom-color: var(--gold); color: var(--gold); }
.help-item h2, .event-list h2 { font-size: 1.25rem; margin-bottom: 0.2rem; }
.comp-counts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.comp-counts span { background: var(--surface); border: 1px solid var(--gold-line); border-radius: 999px; padding: 0.2rem 0.8rem; font-weight: 600; }
.signup-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.signup-list li { padding: 0.3rem 0 0.3rem 0.6rem; border-left: 3px solid var(--class-color, var(--gold-line)); margin-bottom: 0.25rem; }
.event-grid { margin-top: 1.5rem; }
.home-block-progression { grid-column: 1 / -1; }
.home-block-mythic, .home-block-events { grid-column: 2; }
.progress-line { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.progress-chip { border: 1px solid var(--d, var(--gold-line)); border-radius: 999px; padding: 0.1rem 0.7rem; font-variant-numeric: tabular-nums; }

/* ---- Raid banners: journal artwork, veil, gilded frame, skinned bars -------- */
.raid-banners { display: grid; gap: 1.25rem; }
.raid-banner {
  position: relative; isolation: isolate; overflow: hidden; min-height: 13rem;
  border-radius: var(--radius); border: 1px solid #b8923f;
  box-shadow: var(--shadow), inset 0 0 0 1px rgb(0 0 0 / 60%), inset 0 0 0 4px rgb(224 187 104 / 22%);
  background: #0b0f1c;
}
/* Corner ornaments of the frame. */
.raid-banner::before, .raid-banner::after {
  content: ""; position: absolute; z-index: 2; width: 2.2rem; height: 2.2rem; pointer-events: none;
  border: 2px solid #e0bb68;
}
.raid-banner::before { top: 0.45rem; left: 0.45rem; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.raid-banner::after { bottom: 0.45rem; right: 0.45rem; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.raid-art { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.raid-veil {
  position: relative; min-height: 13rem; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.8rem;
  padding: 1.5rem 1.75rem 1.4rem;
  background: linear-gradient(90deg, rgb(6 9 18 / 94%) 0%, rgb(6 9 18 / 80%) 45%, rgb(6 9 18 / 35%) 100%),
              linear-gradient(0deg, rgb(6 9 18 / 85%) 0%, transparent 60%);
  color: #f2ede0;
}
.raid-title {
  margin: 0; font: 700 clamp(1.4rem, 1rem + 1.6vw, 2.1rem) var(--font-display); color: #f3d98b;
  text-shadow: 0 2px 10px rgb(0 0 0 / 80%);
}
.raid-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; max-width: 34rem; }
.raid-bar { display: grid; grid-template-columns: 7.5rem 1fr 3.2rem; gap: 0.75rem; align-items: center; font-size: 0.95rem; }
.raid-bar-label { color: #f2ede0; font-weight: 600; text-shadow: 0 1px 4px rgb(0 0 0 / 90%); }
.raid-bar-count { font: 700 1.05rem var(--font-display); color: #f3d98b; text-align: right; font-variant-numeric: tabular-nums; }
.raid-bar-track {
  position: relative; display: block; height: 0.85rem; border-radius: 999px; overflow: hidden;
  background: linear-gradient(180deg, #05070d, #151a28);
  border: 1px solid rgb(224 187 104 / 55%);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 80%);
}
.raid-bar-fill {
  position: absolute; inset: 0 auto 0 0; display: block; border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--d) 70%, #fff) 0%, var(--d) 45%, color-mix(in srgb, var(--d) 70%, #000) 100%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--d) 60%, transparent);
}
/* Shine on the fill. */
.raid-bar-fill::after { content: ""; position: absolute; inset: 1px 4px auto 4px; height: 35%; border-radius: 999px; background: rgb(255 255 255 / 35%); }
.raid-block .raid-kills { margin: 0.5rem 0 0 0.25rem; }
@media (max-width: 40rem) {
  .raid-veil { padding: 1.25rem 1rem 1rem; }
  .raid-bar { grid-template-columns: 5.5rem 1fr 2.8rem; gap: 0.5rem; font-size: 0.85rem; }
}
.wow-icon { display: inline-block; width: 1.35em; height: 1.35em; border-radius: 4px; vertical-align: -0.3em; border: 1px solid rgb(0 0 0 / 60%); }
.roster-tile .wow-icon { margin-right: 0.3rem; }
.pct-0 { width: 0%; }
.pct-1 { width: 1%; }
.pct-2 { width: 2%; }
.pct-3 { width: 3%; }
.pct-4 { width: 4%; }
.pct-5 { width: 5%; }
.pct-6 { width: 6%; }
.pct-7 { width: 7%; }
.pct-8 { width: 8%; }
.pct-9 { width: 9%; }
.pct-10 { width: 10%; }
.pct-11 { width: 11%; }
.pct-12 { width: 12%; }
.pct-13 { width: 13%; }
.pct-14 { width: 14%; }
.pct-15 { width: 15%; }
.pct-16 { width: 16%; }
.pct-17 { width: 17%; }
.pct-18 { width: 18%; }
.pct-19 { width: 19%; }
.pct-20 { width: 20%; }
.pct-21 { width: 21%; }
.pct-22 { width: 22%; }
.pct-23 { width: 23%; }
.pct-24 { width: 24%; }
.pct-25 { width: 25%; }
.pct-26 { width: 26%; }
.pct-27 { width: 27%; }
.pct-28 { width: 28%; }
.pct-29 { width: 29%; }
.pct-30 { width: 30%; }
.pct-31 { width: 31%; }
.pct-32 { width: 32%; }
.pct-33 { width: 33%; }
.pct-34 { width: 34%; }
.pct-35 { width: 35%; }
.pct-36 { width: 36%; }
.pct-37 { width: 37%; }
.pct-38 { width: 38%; }
.pct-39 { width: 39%; }
.pct-40 { width: 40%; }
.pct-41 { width: 41%; }
.pct-42 { width: 42%; }
.pct-43 { width: 43%; }
.pct-44 { width: 44%; }
.pct-45 { width: 45%; }
.pct-46 { width: 46%; }
.pct-47 { width: 47%; }
.pct-48 { width: 48%; }
.pct-49 { width: 49%; }
.pct-50 { width: 50%; }
.pct-51 { width: 51%; }
.pct-52 { width: 52%; }
.pct-53 { width: 53%; }
.pct-54 { width: 54%; }
.pct-55 { width: 55%; }
.pct-56 { width: 56%; }
.pct-57 { width: 57%; }
.pct-58 { width: 58%; }
.pct-59 { width: 59%; }
.pct-60 { width: 60%; }
.pct-61 { width: 61%; }
.pct-62 { width: 62%; }
.pct-63 { width: 63%; }
.pct-64 { width: 64%; }
.pct-65 { width: 65%; }
.pct-66 { width: 66%; }
.pct-67 { width: 67%; }
.pct-68 { width: 68%; }
.pct-69 { width: 69%; }
.pct-70 { width: 70%; }
.pct-71 { width: 71%; }
.pct-72 { width: 72%; }
.pct-73 { width: 73%; }
.pct-74 { width: 74%; }
.pct-75 { width: 75%; }
.pct-76 { width: 76%; }
.pct-77 { width: 77%; }
.pct-78 { width: 78%; }
.pct-79 { width: 79%; }
.pct-80 { width: 80%; }
.pct-81 { width: 81%; }
.pct-82 { width: 82%; }
.pct-83 { width: 83%; }
.pct-84 { width: 84%; }
.pct-85 { width: 85%; }
.pct-86 { width: 86%; }
.pct-87 { width: 87%; }
.pct-88 { width: 88%; }
.pct-89 { width: 89%; }
.pct-90 { width: 90%; }
.pct-91 { width: 91%; }
.pct-92 { width: 92%; }
.pct-93 { width: 93%; }
.pct-94 { width: 94%; }
.pct-95 { width: 95%; }
.pct-96 { width: 96%; }
.pct-97 { width: 97%; }
.pct-98 { width: 98%; }
.pct-99 { width: 99%; }
.pct-100 { width: 100%; }

/* ---- Platform backdrop: the 4everguilds clock as a watermark, a starfield ---- */
.on-platform { position: relative; }
.on-platform::before {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  top: 50%; left: 50%; width: min(70rem, 140vw); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: url("../img/clock-decor-1024.d15a45ed2bd9.webp") center / contain no-repeat;
  /* White surround of the artwork cut out, dial edges feathered into the dark. */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 18%, rgb(0 0 0 / 55%) 32%, transparent 46%);
  mask-image: radial-gradient(circle at 50% 50%, #000 18%, rgb(0 0 0 / 55%) 32%, transparent 46%);
  opacity: 0.06;
  filter: saturate(0.6) blur(1px);
}
.on-platform {
  background:
    radial-gradient(1.5px 1.5px at 96.3% 99.3%, rgb(255 210 90 / 65%), transparent 70%),
    radial-gradient(2px 2px at 99.3% 100.0%, rgb(255 210 90 / 53%), transparent 70%),
    radial-gradient(1.5px 1.5px at 96.7% 87.0%, rgb(255 210 90 / 84%), transparent 70%),
    radial-gradient(1px 1px at 64.5% 96.4%, rgb(255 232 160 / 88%), transparent 70%),
    radial-gradient(1px 1px at 66.0% 73.2%, rgb(248 183 0 / 45%), transparent 70%),
    radial-gradient(3px 3px at 94.6% 69.0%, rgb(248 183 0 / 89%), transparent 70%),
    radial-gradient(2.5px 2.5px at 99.4% 83.8%, rgb(255 232 160 / 59%), transparent 70%),
    radial-gradient(1.5px 1.5px at 95.9% 96.8%, rgb(255 232 160 / 40%), transparent 70%),
    radial-gradient(1.5px 1.5px at 63.4% 100.0%, rgb(255 232 160 / 71%), transparent 70%),
    radial-gradient(2px 2px at 60.1% 70.3%, rgb(248 183 0 / 47%), transparent 70%),
    radial-gradient(1.5px 1.5px at 89.3% 95.7%, rgb(255 210 90 / 45%), transparent 70%),
    radial-gradient(1px 1px at 94.1% 72.5%, rgb(255 210 90 / 40%), transparent 70%),
    radial-gradient(2px 2px at 87.5% 60.2%, rgb(255 232 160 / 69%), transparent 70%),
    radial-gradient(2.5px 2.5px at 87.1% 94.2%, rgb(255 210 90 / 47%), transparent 70%),
    radial-gradient(2.5px 2.5px at 89.8% 97.7%, rgb(248 183 0 / 63%), transparent 70%),
    radial-gradient(2px 2px at 97.6% 91.0%, rgb(255 232 160 / 55%), transparent 70%),
    radial-gradient(1px 1px at 82.5% 66.6%, rgb(255 210 90 / 88%), transparent 70%),
    radial-gradient(2px 2px at 73.1% 96.0%, rgb(255 210 90 / 74%), transparent 70%),
    radial-gradient(1.5px 1.5px at 98.9% 64.6%, rgb(255 210 90 / 64%), transparent 70%),
    radial-gradient(1.5px 1.5px at 99.8% 79.1%, rgb(255 232 160 / 82%), transparent 70%),
    radial-gradient(1.5px 1.5px at 53.6% 100.0%, rgb(255 210 90 / 55%), transparent 70%),
    radial-gradient(3px 3px at 68.4% 91.9%, rgb(255 232 160 / 74%), transparent 70%),
    radial-gradient(1px 1px at 65.2% 95.6%, rgb(248 183 0 / 63%), transparent 70%),
    radial-gradient(1px 1px at 98.6% 92.9%, rgb(255 232 160 / 56%), transparent 70%),
    radial-gradient(1px 1px at 100.0% 99.9%, rgb(248 183 0 / 58%), transparent 70%),
    radial-gradient(1.5px 1.5px at 50.3% 85.4%, rgb(248 183 0 / 48%), transparent 70%),
    radial-gradient(1px 1px at 57.3% 99.2%, rgb(255 232 160 / 38%), transparent 70%),
    radial-gradient(1px 1px at 98.0% 80.2%, rgb(255 210 90 / 73%), transparent 70%),
    radial-gradient(1.5px 1.5px at 83.2% 84.9%, rgb(255 210 90 / 37%), transparent 70%),
    radial-gradient(1.5px 1.5px at 63.9% 95.6%, rgb(255 210 90 / 76%), transparent 70%),
    radial-gradient(1px 1px at 12.5% 6.8%, rgb(255 232 160 / 46%), transparent 70%),
    radial-gradient(2px 2px at 0.0% 11.6%, rgb(248 183 0 / 40%), transparent 70%),
    radial-gradient(1px 1px at 17.3% 16.8%, rgb(248 183 0 / 81%), transparent 70%),
    radial-gradient(2.5px 2.5px at 2.0% 36.2%, rgb(255 210 90 / 62%), transparent 70%),
    radial-gradient(1px 1px at 2.0% 0.2%, rgb(255 232 160 / 67%), transparent 70%),
    radial-gradient(3px 3px at 0.3% 20.4%, rgb(255 210 90 / 82%), transparent 70%),
    radial-gradient(1px 1px at 42.9% 2.3%, rgb(248 183 0 / 81%), transparent 70%),
    radial-gradient(1px 1px at 40.5% 25.1%, rgb(248 183 0 / 60%), transparent 70%),
    radial-gradient(2.5px 2.5px at 7.2% 0.1%, rgb(248 183 0 / 35%), transparent 70%),
    radial-gradient(1.5px 1.5px at 0.3% 7.0%, rgb(255 210 90 / 43%), transparent 70%),
    radial-gradient(3px 3px at 3.7% 23.1%, rgb(255 232 160 / 42%), transparent 70%),
    radial-gradient(1px 1px at 0.0% 24.7%, rgb(255 210 90 / 89%), transparent 70%),
    radial-gradient(1px 1px at 6.8% 32.6%, rgb(255 210 90 / 69%), transparent 70%),
    radial-gradient(2px 2px at 14.4% 14.7%, rgb(248 183 0 / 47%), transparent 70%),
    radial-gradient(3px 3px at 0.4% 2.1%, rgb(255 232 160 / 40%), transparent 70%),
    radial-gradient(2px 2px at 18.7% 1.7%, rgb(255 210 90 / 81%), transparent 70%),
    radial-gradient(2px 2px at 0.3% 13.9%, rgb(255 210 90 / 89%), transparent 70%),
    radial-gradient(2px 2px at 29.4% 23.1%, rgb(255 210 90 / 37%), transparent 70%),
    radial-gradient(1px 1px at 38.8% 7.8%, rgb(255 232 160 / 45%), transparent 70%),
    radial-gradient(3px 3px at 14.6% 23.0%, rgb(255 232 160 / 78%), transparent 70%),
    radial-gradient(1px 1px at 19.4% 25.3%, rgb(248 183 0 / 90%), transparent 70%),
    radial-gradient(1.5px 1.5px at 0.9% 31.9%, rgb(255 210 90 / 63%), transparent 70%),
    radial-gradient(2px 2px at 9.7% 39.0%, rgb(255 210 90 / 82%), transparent 70%),
    radial-gradient(1px 1px at 8.7% 16.3%, rgb(255 210 90 / 62%), transparent 70%),
    radial-gradient(1.5px 1.5px at 3.1% 9.3%, rgb(255 210 90 / 87%), transparent 70%),
    radial-gradient(2px 2px at 6.0% 4.2%, rgb(255 210 90 / 85%), transparent 70%),
    radial-gradient(3px 3px at 0.1% 25.6%, rgb(248 183 0 / 62%), transparent 70%),
    radial-gradient(2px 2px at 7.4% 25.4%, rgb(255 210 90 / 82%), transparent 70%),
    radial-gradient(3px 3px at 10.7% 2.9%, rgb(255 232 160 / 60%), transparent 70%),
    radial-gradient(1.5px 1.5px at 8.5% 30.5%, rgb(255 232 160 / 43%), transparent 70%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgb(248 183 0 / 16%), transparent 70%),
    radial-gradient(ellipse 30% 25% at 96% 96%, rgb(255 210 90 / 12%), transparent 70%),
    radial-gradient(ellipse 50% 42% at 0% 0%, rgb(248 183 0 / 13%), transparent 70%),
    radial-gradient(ellipse 26% 22% at 4% 4%, rgb(255 210 90 / 10%), transparent 70%),
    radial-gradient(ellipse 55% 45% at 100% 0%, rgb(63 140 255 / 16%), transparent 70%),
    radial-gradient(ellipse 55% 45% at 0% 100%, rgb(63 140 255 / 14%), transparent 70%),
    linear-gradient(160deg, #1b1b20 0%, #141417 55%, #0f0f11 100%);
  background-attachment: fixed;
}

/* ---- Official-site inspired components ------------------------------------ */
/* Charcoal with a faint stone grain. */
body {
  background:
    radial-gradient(ellipse 90% 60% at 50% -15%, rgb(111 195 255 / 10%), transparent 70%),
    repeating-radial-gradient(circle at 30% 20%, rgb(255 255 255 / 1.2%) 0 1px, transparent 1px 3px),
    var(--bg);
}
/* Floating, translucent navigation bar. */
.site-header { background: transparent; border-bottom: 0; padding: 0.75rem 1rem 0; }
.site-header .container {
  width: min(84rem, 100%);
  background: color-mix(in srgb, #3a3a46 78%, transparent);
  backdrop-filter: blur(6px);
  border-radius: 4px;
  padding: 0.35rem 0.9rem;
  box-shadow: 0 6px 24px rgb(0 0 0 / 35%);
}
.site-nav a:not(.btn) { font-weight: 600; }
/* Buttons: gold slab and gold outline, capitals. */
.btn { border-radius: 2px; text-transform: uppercase; letter-spacing: 0.02em; font: 700 0.95rem var(--font-display); }
.btn-primary {
  background: linear-gradient(180deg, #ffd23f 0%, var(--gold) 55%, #e39c00 100%);
  border-color: #ffdc6a;
  color: var(--on-gold);
  box-shadow: 0 2px 0 rgb(0 0 0 / 35%);
}
.btn-secondary { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-secondary:hover { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--text); }
.btn-provider { text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
/* Panels: flat, dark, hairline edge (no gilded gradient). */
.card {
  background: var(--surface);
  border: 1px solid rgb(255 255 255 / 7%);
  box-shadow: 0 10px 30px rgb(0 0 0 / 30%);
}
.card-title { color: var(--text); }
/* Gold capitals above a title (used where the official site does). */
.eyebrow { display: block; margin: 0 0 0.4rem; color: var(--gold); font: 700 0.95rem var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; }
.guild-nav a[aria-current="page"], .subnav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
.badge { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
/* Platform hero: painted-sky gradient (no Blizzard artwork on the showcase). */
.on-platform .hero {
  margin: -1rem 0 0; padding: 3rem clamp(1rem, 4vw, 3rem);
  border-radius: 4px;
  background:
    linear-gradient(115deg, rgb(20 20 24 / 0%) 35%, rgb(20 20 24 / 55%) 100%),
    linear-gradient(160deg, #4b3b77 0%, #2c4f93 45%, #1a2c57 100%);
  box-shadow: inset 0 -80px 80px -60px rgb(20 20 24 / 90%);
}
.on-platform .hero h1 { color: #fff; text-shadow: 0 2px 16px rgb(0 0 0 / 45%); }
.on-platform .hero .lead { color: #e7e4ff; }
@media (max-width: 40rem) {
  .site-header { padding: 0.5rem 0.5rem 0; }
  .on-platform .hero { padding: 2rem 1rem; }
}
.block-grip { cursor: grab; color: var(--muted); letter-spacing: -0.2em; user-select: none; }
.block-row.is-dragging { opacity: 0.5; }
.discord-chat { margin-top: 1rem; }
.discord-frame { display: block; width: 100%; height: 26rem; border: 0; border-radius: var(--radius); background: #313338; }
.home-block-rss { grid-column: 2; }

/* Platform logo: large, top left (guild sites keep the small one on the right). */
.brand-platform-lg img { height: 4.5rem; }
.on-platform .site-header .site-nav { margin-left: auto; }
@media (max-width: 40rem) { .brand-platform-lg img { height: 3rem; } }
.avatar-header { width: 2.5rem; height: 2.5rem; border: 2px solid var(--gold); box-shadow: 0 0 0 2px rgb(0 0 0 / 50%); }
.menu > summary:has(.avatar-header) { padding-block: 0.2rem; }

/* ---- Account menu: WoW character first, pseudo underneath (official-site style) ---- */
.account-menu > summary { gap: 0.6rem; border-color: transparent; }
.me-names { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.me-name { font: 700 0.95rem var(--font-display); color: var(--gold); }
.me-pseudo { font-size: 0.8rem; color: var(--muted); }
.avatar-xs { width: 1.5rem; height: 1.5rem; border-width: 1px; }
.char-switch { max-height: 16rem; overflow-y: auto; margin-bottom: 0.4rem !important; border-bottom: 1px solid rgb(255 255 255 / 8%); }
.char-switch button[aria-current="true"] { color: var(--gold); background: rgb(248 183 0 / 10%); }
@media (max-width: 40rem) { .me-pseudo { display: none; } }
.character-head h1 .wow-icon { width: 0.75em; height: 0.75em; vertical-align: -0.05em; border-radius: 6px; }

/* Character render: large, may pass slightly behind the slot columns. */
.sheet { position: relative; }
.sheet-render { align-self: stretch; z-index: 0; }
.sheet-render-img {
  width: 150%; max-width: none; max-height: 40rem; margin-inline: -25%;
  object-fit: contain; object-position: center top; pointer-events: none;
}
.sheet-left, .sheet-right { position: relative; z-index: 1; }
@media (max-width: 56rem) { .sheet-render-img { width: 100%; margin-inline: 0; max-height: 26rem; } }
.pvp { margin-bottom: 2rem; }
.pvp-rating { font: 700 1.1rem var(--font-display); color: var(--gold); }
.pvp-titles { columns: 2 16rem; padding-left: 1.1rem; }

/* ---- PvP card (check-pvp style) --------------------------------------------- */
.pvp-honor { font: 400 1rem var(--font-body); margin-left: 0.5rem; }
.pvp-cards { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin-bottom: 1.25rem; }
.pvp-card { background: rgb(0 0 0 / 35%); border: 1px solid rgb(255 255 255 / 7%); border-radius: var(--radius); padding: 1rem; text-align: center; }
.pvp-card-title { margin: 0; color: var(--muted); }
.pvp-card-rating { margin: 0.2rem 0 0.6rem; font: 700 2rem var(--font-display); color: #4ea5ff; font-variant-numeric: tabular-nums; }
.pvp-card-stats { margin: 0; display: grid; gap: 0.2rem; border-top: 1px solid rgb(255 255 255 / 8%); padding-top: 0.6rem; }
.pvp-card-stats div { display: flex; justify-content: space-between; gap: 1rem; }
.pvp-card-stats dt { color: var(--muted); }
.pvp-card-stats dd { margin: 0; font-variant-numeric: tabular-nums; }
.pvp-achievements { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.6rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.pvp-achievements li { display: flex; gap: 0.75rem; align-items: center; }
.pvp-achievements img { width: 2.75rem; height: 2.75rem; border-radius: 4px; border: 1px solid #3b6bd6; flex: none; }
.pvp-achievements strong { display: block; }
.pvp-achievements .muted { display: block; font-size: 0.9rem; }
.pvp-season { background: rgb(0 0 0 / 25%); border-radius: var(--radius); padding: 0.4rem 1rem; margin-bottom: 0.75rem; }
.pvp-season > summary { font: 600 1.1rem var(--font-display); padding: 0.4rem 0; cursor: pointer; }

/* ---- Stats and professions on the sheet ---------------------------------------- */
.stats-card { margin-bottom: 2rem; }
.stat-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.stat { display: flex; gap: 0.9rem; align-items: center; }
.stat > .icon { width: 2.6rem; height: 2.6rem; padding: 0.45rem; border: 2px solid currentColor; border-radius: 50%; color: var(--s); flex: none; }
.stat-name { display: block; color: var(--s); font-weight: 600; }
.stat-value { font: 700 1.3rem var(--font-body); font-variant-numeric: tabular-nums; }
.stat-rating { margin-left: 0.6rem; font: 400 0.85rem var(--font-body); color: var(--muted); }
.stat-rating::before { content: "› "; }
.stat-health { --s: #3ee640; }
.stat-primary { --s: #ffd23f; }
.stat-crit { --s: #ff6b6b; }
.stat-mastery { --s: #b98cff; }
.stat-haste { --s: #3fd6a5; }
.stat-versa { --s: #c9ccd6; }
.sheet-professions { margin-bottom: 2rem; }
.prof-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; max-width: 40rem; }
.prof-list li { display: grid; grid-template-columns: 9rem 1fr 8rem 4.5rem; gap: 0.75rem; align-items: center; }
.prof-list meter { width: 100%; accent-color: var(--gold); }
.prof-name { font-weight: 600; }
@media (max-width: 40rem) { .prof-list li { grid-template-columns: 1fr 4.5rem; } .prof-list meter, .prof-list .muted { grid-column: 1 / -1; } }

/* The header and its menus always stay above the page (raid banners, sheets…). */
.site-header { position: relative; z-index: 100; }
.menu-panel { z-index: 110; }

/* ---- Guild home tiles --------------------------------------------------------- */
.tiles-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-bottom: 1rem; }
.tiles-toolbar .tiles-help { flex-basis: 100%; margin: 0; }
.tiles-edit-actions:not([hidden]) { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.tiles { display: grid; gap: 1.25rem; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; align-items: start; }
.tile {
  position: relative; min-width: 0;
  background: var(--surface); border: 1px solid rgb(255 255 255 / 8%); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgb(0 0 0 / 25%); padding: 1.1rem 1.2rem 1rem;
}
.tile > :last-child { margin-bottom: 0; }
.tile-title { font-size: 1.15rem; margin: 0 0 0.8rem; padding-bottom: 0.5rem; border-bottom: 1px solid rgb(255 255 255 / 8%); }
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
@media (max-width: 64rem) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-3, .span-4 { grid-column: span 2; } }
@media (max-width: 40rem) { .tiles { grid-template-columns: 1fr; } .tile[class*="span-"] { grid-column: 1 / -1; } }
/* Editing */
.tiles.is-editing .tile { outline: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 3px; cursor: grab; }
.tile.is-dragging { opacity: 0.5; }
.tile.is-hidden { opacity: 0.35; }
.tile.is-hidden .tile-title::after { content: " (masquée)"; font-weight: 400; color: var(--muted); }
.tile-controls { position: absolute; top: 0.5rem; right: 0.5rem; display: flex; gap: 0.25rem; z-index: 3; }
.tile-controls button { min-width: 2.2rem; min-height: 2.2rem; border-radius: 3px; border: 1px solid var(--gold-line); background: var(--surface-2); color: var(--text); cursor: pointer; font: 600 0.8rem var(--font-body); }
.tile-controls button:hover { border-color: var(--gold); color: var(--gold); }
/* Compact raid banners inside a tile */
.raid-banners-compact { gap: 0.75rem; }
.raid-banners-compact .raid-banner, .raid-banners-compact .raid-veil { min-height: 8.5rem; }
.raid-banners-compact .raid-veil { padding: 1rem 1.1rem 0.9rem; gap: 0.5rem; }
.raid-banners-compact .raid-title { font-size: 1.2rem; }
.raid-banners-compact .raid-bar { grid-template-columns: 5.5rem 1fr 2.6rem; font-size: 0.85rem; }
.raid-banners-compact .raid-banner::before, .raid-banners-compact .raid-banner::after { width: 1.4rem; height: 1.4rem; }
/* News carousel: content shown directly, images fitted to the tile */
.carousel-track { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
.carousel-slide h3 { margin: 0 0 0.2rem; font-size: 1.15rem; }
.carousel-body { max-height: 16rem; overflow: hidden; position: relative; mask-image: linear-gradient(180deg, #000 80%, transparent); }
.carousel-body img { display: block; width: 100%; height: 10rem; object-fit: cover; border-radius: var(--radius); margin: 0.5rem 0; }
.carousel-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.75rem; }
.carousel-nav .btn { min-height: 2.25rem; padding: 0.3rem 0.8rem; font-size: 0.8rem; }

/* ---- Agenda: month calendar ------------------------------------------------------ */
.cal-head { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin-bottom: 0.75rem; }
.cal-title { margin: 0 0.5rem; font-size: 1.5rem; min-width: 12rem; text-align: center; }
.cal-new { margin-left: auto; }
.cal-legend { list-style: none; padding: 0; margin: 0 0 0.75rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.85rem; color: var(--muted); }
.cal-legend li::before { content: ""; display: inline-block; width: 0.75em; height: 0.75em; border-radius: 2px; margin-right: 0.4em; background: var(--k, var(--muted)); vertical-align: -0.05em; }
.cal-legend-reset { --k: #4ea5ff; }
.cal-legend-faire { --k: #c57cff; }
.kind-raid { --k: #ff9a2e; }
.kind-mythic { --k: #3fd6a5; }
.kind-pvp { --k: #ff6b6b; }
.kind-other { --k: #c9ccd6; }
.calendar { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.calendar th { font: 700 0.85rem var(--font-display); color: var(--muted); padding: 0.3rem 0; }
.calendar td { vertical-align: top; height: 7.5rem; padding: 0.35rem; background: var(--surface); border: 1px solid rgb(255 255 255 / 6%); border-radius: 3px; }
.calendar td.is-out { opacity: 0.45; }
.calendar td.is-today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.calendar td.is-faire { background: linear-gradient(180deg, rgb(197 124 255 / 10%), var(--surface) 60%); }
.cal-day { display: flex; justify-content: space-between; align-items: center; }
.cal-num { font: 700 0.95rem var(--font-display); }
.is-today .cal-num { color: var(--gold); }
.cal-add { width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 3px; text-decoration: none; color: var(--muted); border: 1px solid transparent; }
.cal-add:hover, .cal-add:focus-visible { color: var(--gold); border-color: var(--gold-line); }
.cal-flag { display: inline-block; font-size: 0.7rem; padding: 0 0.35rem; border-radius: 2px; color: #cfe4ff; background: rgb(78 165 255 / 18%); margin: 0.15rem 0.15rem 0 0; }
.cal-flag-faire { color: #ecdcff; background: rgb(197 124 255 / 20%); }
.cal-event { display: block; margin-top: 0.25rem; padding: 0.15rem 0.35rem; font-size: 0.78rem; line-height: 1.25; text-decoration: none; color: var(--text); border-left: 3px solid var(--k); background: color-mix(in srgb, var(--k) 14%, transparent); border-radius: 0 2px 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event:hover { background: color-mix(in srgb, var(--k) 26%, transparent); }
.cal-event time { font-weight: 700; }
.cal-list-title { margin-top: 2rem; }
@media (max-width: 40rem) {
  .calendar td { height: 4.5rem; padding: 0.2rem; }
  .cal-event { font-size: 0; height: 0.45rem; padding: 0; margin-top: 0.2rem; background: var(--k); }
  .cal-flag { font-size: 0; width: 0.45rem; height: 0.45rem; padding: 0; border-radius: 50%; }
  .cal-add { display: none; }
  .cal-title { min-width: 0; font-size: 1.2rem; }
}
.ilvl-group { display: flex; gap: 1.5rem; align-items: flex-end; }
.ilvl-pvp .ilvl-value { color: #ff6b6b; }
@media (max-width: 40rem) { .ilvl-group { grid-column: 1 / -1; } }

/* Tiles arranged directly: grip in the title, controls on hover or keyboard focus. */
.tile-grip { cursor: grab; color: var(--muted); margin-right: 0.45rem; letter-spacing: -0.2em; user-select: none; }
.tile-grip:hover { color: var(--gold); }
.tile-controls { opacity: 0; transition: opacity 120ms ease; }
.tile:hover .tile-controls, .tile:focus-within .tile-controls { opacity: 1; }
@media (hover: none) { .tile-controls { opacity: 1; } }
.tiles-actions { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.tiles-status { flex-basis: 100%; margin: 0; min-height: 1.2em; color: var(--gold); font-size: 0.9rem; }
.tile.is-hidden { opacity: 0.25; transition: opacity 400ms ease; }
.tile-resize {
  position: absolute; right: 2px; bottom: 2px; width: 1.1rem; height: 1.1rem; cursor: ew-resize; z-index: 3;
  background: linear-gradient(135deg, transparent 50%, var(--gold-line) 50%, var(--gold-line) 60%, transparent 60%, transparent 70%, var(--gold-line) 70%, var(--gold-line) 80%, transparent 80%);
  opacity: 0; transition: opacity 120ms ease; touch-action: none;
}
.tile:hover .tile-resize, .tile.is-resizing .tile-resize { opacity: 1; }
.tile.is-resizing { outline: 2px dashed color-mix(in srgb, var(--gold) 60%, transparent); outline-offset: 3px; }
@media (hover: none) { .tile-resize { display: none; } }

/* ==== Smartphones: nothing may be wider than the screen ======================= */
html, body { max-width: 100%; }
main { overflow-x: clip; }
h1, h2, h3, .card-title, .brand-text { overflow-wrap: anywhere; hyphens: auto; }
/* Grid and flex children may shrink below their content width. */
.account-layout > *, .tiles > *, .grid-2 > *, .sheet > *, .home-blocks > *, .appearance > *,
.event-grid > *, .profession-grid > *, .pvp-cards > *, .stat-list > *, .raid-modes > * { min-width: 0; }
img, svg, video, iframe { max-width: 100%; }
@media (max-width: 40rem) {
  body { font-size: 0.97rem; }
  h1 { font-size: 1.6rem; }
  h2, .card-title { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
  .container { width: calc(100% - 1.25rem); }
  /* Header: one row — guild (or logo) on the left, the two menus on the right. */
  .site-header { padding: 0.4rem 0.4rem 0; }
  .site-header .container { flex-wrap: nowrap; gap: 0.4rem; padding: 0.3rem 0.5rem; width: 100%; }
  .brand-guild { flex: 1 1 auto; min-width: 0; gap: 0.4rem; }
  .brand-guild .brand-text { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-guild .crest { width: 2rem; height: 2rem; flex: none; }
  .on-guild .brand-platform { display: none; }
  .brand-platform-lg img { height: 2.4rem; }
  .site-header .site-nav { flex-wrap: nowrap; gap: 0.3rem; margin-left: auto; flex: none; }
  .menu > summary { padding: 0.3rem 0.4rem; min-height: 2.75rem; }
  .menu > summary .icon:last-child { display: none; }
  .avatar-header { width: 2.1rem; height: 2.1rem; }
  /* Dropdowns open over the page, full width, instead of pushing it. */
  .menu { position: static; }
  .menu-panel { position: fixed; top: 4.2rem; left: 0.5rem; right: 0.5rem; min-width: 0; max-height: calc(100vh - 5rem); overflow-y: auto; }
  .site-nav > a:not(.btn) { padding: 0.5rem 0.2rem; font-size: 0.9rem; }
  .site-nav .btn { padding: 0.35rem 0.6rem; font-size: 0.75rem; min-height: 2.4rem; }
  /* Management and account sidebars: a scrolling row of links. */
  .account-nav { padding: 0.35rem; }
  .account-nav a { padding: 0.45rem 0.6rem; font-size: 0.9rem; }
  .card { padding: 0.9rem; }
  .card .card { padding: 0.8rem; }
  .btn { white-space: normal; text-align: center; }
  .actions { gap: 0.5rem; }
  .guild-nav ul { margin-bottom: 1.25rem; }
  .tiles-toolbar .tiles-help { font-size: 0.85rem; }
  .character-head { gap: 0.75rem; }
  .character-head .avatar { width: 3.5rem; height: 3.5rem; }
  .ilvl-value { font-size: 1.8rem; }
  .ilvl-group { gap: 1rem; }
  .calendar { border-spacing: 2px; }
  .cal-head .btn { padding: 0.35rem 0.6rem; font-size: 0.75rem; }
  .cal-new { margin-left: 0; }
  .pvp-cards { grid-template-columns: 1fr 1fr; }
  .pvp-card-rating { font-size: 1.5rem; }
  .stat-list { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .stat > .icon { width: 2rem; height: 2rem; padding: 0.3rem; }
  .stat-value { font-size: 1.05rem; }
  .stat-rating { display: block; margin-left: 0; }
  .raid-bar { grid-template-columns: 4.8rem 1fr 2.6rem; }
}
.sheet-slots { grid-template-columns: minmax(0, 1fr); }
.sheet-weapons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.slot, .wish-slot, .wish-result, .roster-tile { min-width: 0; }
@media (max-width: 40rem) { .sheet-weapons { grid-template-columns: minmax(0, 1fr); } }

/* Language menu with flags */
.flag { width: 1.5rem; height: 1rem; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / 40%); vertical-align: middle; }
.lang-menu > summary { gap: 0.35rem; }
.lang-code { font: 700 0.8rem var(--font-body); }
.lang-menu button[aria-current="true"] { color: var(--gold); }
@media (max-width: 40rem) { .lang-code { display: none; } }

/* Phones: tile controls on their own row under the title (never over it); a tile is
   always full width there, so no width button nor resize handle. */
@media (max-width: 40rem) {
  .tile-controls { position: static; opacity: 1; justify-content: flex-end; margin: -0.35rem 0 0.5rem; }
  .tile-controls [data-tile-size], .tile-resize { display: none; }
  .tile-controls button { min-width: 2.75rem; min-height: 2.75rem; }
  .tile { display: flex; flex-direction: column; }
  .tile > .tile-controls { order: 1; }
  .tile > .tile-title { order: 0; }
  .tile > :not(.tile-controls):not(.tile-title) { order: 2; }
}

/* ---- Wishlist: PvE / PvP switch, fill dialog, ranked choices ----------------------- */
.mode-switch { display: inline-flex; border: 1px solid var(--gold-line); border-radius: 999px; padding: 0.2rem; gap: 0.2rem; margin: 0.5rem 0 1rem; flex-wrap: wrap; }
.mode-switch a { padding: 0.4rem 0.9rem; border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.9rem; }
.mode-switch a[aria-current="page"] { background: var(--gold); color: var(--on-gold); }
.wish-fill { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-bottom: 1rem; }
.fill-dialog { max-width: min(32rem, calc(100vw - 2rem)); background: var(--surface); color: var(--text); border: 1px solid var(--gold-line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.fill-dialog::backdrop { background: rgb(0 0 0 / 60%); }
.fill-dialog h2 { margin-top: 0; }
.wish-ranks { margin: 0.1rem 0 0; padding-left: 1.1rem; }
.wish-ranks li { white-space: normal; }
.wish-count { color: var(--gold); font-weight: 600; margin-left: 0.3rem; }
.wish-source { display: block; color: var(--muted); font-size: 0.85rem; }
