/* M4 Eternal — the look of the MIR4 client: night-blue ink, bronze-gold hairlines, the MIR4 red for the one action
   that matters, a cold cyan for selection. Art, UI textures and fonts are the client's own (web/assets/official/,
   extracted by tools/extract_official_art.py); the site stays usable without them. The launcher uses the same
   tokens (launcher/M4Eternal.Launcher/Theme.xaml). */

/* ---------- fonts: the client's WN Sans family, each script only when a page needs it ---------- */
@font-face {
  font-family: "WN Sans"; src: url("/assets/official/fonts/wn-sans.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-024F, U+0300-036F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-218F, U+2190-21FF, U+2212, U+25A0-25FF;
}
@font-face {
  font-family: "WN Sans Thai"; src: url("/assets/official/fonts/wn-sans-thai.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; unicode-range: U+0E00-0E7F;
}
@font-face {
  font-family: "WN Sans KR"; src: url("/assets/official/fonts/wn-sans-kr.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; unicode-range: U+1100-11FF, U+3130-318F, U+AC00-D7AF;
}
@font-face {
  font-family: "WN Sans JP"; src: url("/assets/official/fonts/wn-sans-jp.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; unicode-range: U+3000-30FF, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF;
}
@font-face {
  font-family: "WN Sans SC"; src: url("/assets/official/fonts/wn-sans-sc.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF;
}
@font-face {
  font-family: "WN Sans TC"; src: url("/assets/official/fonts/wn-sans-tc.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF;
}

/* ---------- tokens ---------- */
:root {
  --ink: #05070b;
  --night: #0a0f17;
  --deep: #0e1520;
  --steel: #182231;
  --slate: #243246;
  --panel: rgba(11, 16, 25, 0.84);
  --panel-hi: rgba(20, 29, 43, 0.9);
  --text: #ebe5d6;
  --muted: #a4abb8;
  --faint: #6c7483;
  --gold: #d2ab67;
  --gold-hi: #f6e2ae;
  --gold-lo: #8a6a36;
  --gold-line: rgba(210, 171, 103, 0.32);
  --gold-hair: rgba(210, 171, 103, 0.16);
  --red: #c42a1c;
  --red-hi: #e8452f;
  --red-deep: #5b130d;
  --cyan: #74d4f2;
  --cyan-line: rgba(116, 212, 242, 0.35);
  --jade: #72c29d;
  --danger: #ef6a52;
  --radius: 2px;
  --wrap: 1240px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  --art: "/assets/official/";
  --font: "WN Sans", "WN Sans KR", "WN Sans JP", "WN Sans Thai", "Noto Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
:lang(zh-Hant) { --font: "WN Sans", "WN Sans TC", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif; }
:lang(zh-Hans) { --font: "WN Sans", "WN Sans SC", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif; }
:lang(ja) { --font: "WN Sans", "WN Sans JP", "Yu Gothic", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; }
:lang(ko) { --font: "WN Sans", "WN Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif; }
:lang(th) { --font: "WN Sans", "WN Sans Thai", "Leelawadee UI", "Thonburi", "Noto Sans Thai", system-ui, sans-serif; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--ink); }
html.i18n-pending body { opacity: 0; animation: i18n-reveal 0s 1.2s forwards; }
@keyframes i18n-reveal { to { opacity: 1; } }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(116, 212, 242, 0.06), transparent 60%),
    radial-gradient(900px 500px at 0% 30%, rgba(196, 42, 28, 0.05), transparent 60%),
    linear-gradient(180deg, var(--night), var(--ink) 60%);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: opacity 0.25s;
}
body * { font-family: inherit; }
main { flex: 1; }
img { max-width: 100%; display: block; }
img.art--missing { visibility: hidden; }
a { color: var(--gold-hi); text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
::selection { background: var(--red); color: #fff; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.2; letter-spacing: 0.01em; }
p { margin: 0 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--red); color: #fff; }
.skip:focus { top: 12px; }
.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.loading { color: var(--faint); letter-spacing: 0.08em; }
.loading::after { content: ""; display: inline-block; width: 18px; height: 18px; margin-left: 10px; vertical-align: -4px;
  background: url("/assets/official/ui/throbber.png") center / contain no-repeat; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* The kicker: small caps in gold between the client's title ornaments. */
.kicker {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 0 0 14px;
  font-size: 12.5px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold);
}
.kicker::before, .kicker::after {
  content: ""; width: 29px; height: 22px;
  background: url("/assets/official/ui/title-deco-02.png") center / contain no-repeat;
  opacity: 0.9;
}
.kicker::after { transform: scaleX(-1); }
:lang(ko) .kicker, :lang(ja) .kicker, :lang(zh-Hant) .kicker, :lang(zh-Hans) .kicker, :lang(th) .kicker { letter-spacing: 0.12em; }

/* Gold engraved titles. */
.title, .hero__title, .page-head h1 {
  background: linear-gradient(180deg, #fff6dc 0%, var(--gold-hi) 38%, var(--gold) 70%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 24px rgba(210, 171, 103, 0.18));
}
.title { font-size: clamp(28px, 3.4vw, 42px); text-transform: uppercase; letter-spacing: 0.08em; }
:lang(ko) .title, :lang(ja) .title, :lang(zh-Hant) .title, :lang(zh-Hans) .title { letter-spacing: 0.04em; }

/* ---------- buttons: the client's textures as nine-slice frames ---------- */
.btn {
  --h: 54px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h);
  padding: 0 38px;
  border: 0; cursor: pointer;
  color: var(--text); background: none;
  font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: filter 0.2s, transform 0.15s;
  white-space: nowrap;
}
:lang(ko) .btn, :lang(ja) .btn, :lang(zh-Hant) .btn, :lang(zh-Hans) .btn, :lang(th) .btn { letter-spacing: 0.06em; }
.btn:hover { color: #fff; filter: brightness(1.18); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { filter: grayscale(0.8) brightness(0.7); cursor: default; }
/* "Start game": Builtin_Btn_GameStart, red lacquer with ornate ends. */
.btn--start {
  --h: 66px;
  padding: 0 74px;
  font-size: 17px; letter-spacing: 0.2em;
  color: #fff4dc; text-shadow: 0 1px 0 #2a0503, 0 0 14px rgba(255, 140, 90, 0.35);
  border: solid transparent; border-width: 18px 46px;
  border-image: url("/assets/official/ui/btn-gamestart.png") 30 80 fill / 18px 46px stretch;
  background: linear-gradient(180deg, #8f2217, #4d0e09) padding-box; /* fallback without the texture */
  background-clip: padding-box;
  padding: 0 28px;
  min-height: 66px;
}
.btn--start::after {
  content: ""; position: absolute; inset: -6px -20px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(232, 69, 47, 0.35), transparent);
  opacity: 0; transition: opacity 0.3s; z-index: -1;
}
.btn--start:hover::after { opacity: 1; }
/* Btn_nor_01 (gold) and Btn_nor_02 (cyan): hexagonal frames with chevron tips. */
.btn--frame {
  --h: 50px;
  border: solid transparent; border-width: 15px 32px;
  border-image: url("/assets/official/ui/btn-nor-01.png") 20 44 fill / 15px 32px stretch;
  padding: 0 8px;
  color: var(--gold-hi);
}
.btn--blue { border-image-source: url("/assets/official/ui/btn-nor-02.png"); color: #d7f3ff; }
.btn--small { --h: 40px; min-height: 40px; border-width: 12px 26px; border-image-width: 12px 26px; font-size: 12.5px; padding: 0 4px; }
.btn--wide { width: 100%; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}
.link-arrow::after { content: ""; width: 26px; height: 1px; background: currentColor; transition: width 0.3s var(--ease); }
.link-arrow:hover::after { width: 42px; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  transition: background 0.35s, box-shadow 0.35s, backdrop-filter 0.35s;
}
.page-home .masthead { position: fixed; inset: 0 0 auto; }
.masthead--solid, .masthead:not(.page-home .masthead) {
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.94), rgba(8, 12, 19, 0.88));
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--gold-hair), 0 12px 30px -20px #000;
}
.masthead__inner {
  width: min(1400px, 100% - 72px); margin-inline: auto;
  display: flex; align-items: center; gap: 28px; min-height: 76px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__mark {
  width: 50px; height: 50px; flex: none;
  background: url("/assets/img/logo-badge.webp") center / contain no-repeat;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name {
  font-size: 19px; letter-spacing: 0.22em;
  background: linear-gradient(180deg, #fff6dc, var(--gold) 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__tag { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  position: relative; padding: 10px 14px; white-space: nowrap;
  font-size: 13.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.nav a::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  transition: width 0.3s var(--ease), left 0.3s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: #fff; }
.nav a[aria-current="page"]::after, .nav a:hover::after { left: 10%; width: 80%; }
.masthead__tools { display: flex; align-items: center; gap: 14px; }
.masthead__account { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 16px; }
.menu-toggle { display: none; }

/* language switcher */
.lang { position: relative; }
.lang__button {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  background: rgba(10, 15, 23, 0.6); color: var(--muted);
  border: 1px solid var(--gold-hair); border-radius: var(--radius); cursor: pointer;
  font-size: 13px;
}
.lang__button:hover, .lang__button[aria-expanded="true"] { color: var(--text); border-color: var(--gold-line); }
.lang__globe { width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; }
.lang__globe::before { content: ""; position: absolute; inset: -1.5px 3.5px; border: 1.5px solid currentColor; border-radius: 50%; }
.lang__globe::after { content: ""; position: absolute; left: -1px; right: -1px; top: 50%; border-top: 1.5px solid currentColor; }
.lang__list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 190px; margin: 0; padding: 8px; list-style: none;
  background: var(--panel-hi); border: 1px solid var(--gold-line); box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.lang__list li { padding: 8px 12px; cursor: pointer; color: var(--muted); font-size: 14.5px; border-left: 2px solid transparent; }
.lang__list li:hover, .lang__list li:focus { color: #fff; background: rgba(116, 212, 242, 0.08); outline: none; }
.lang__list li[aria-selected="true"] { color: var(--gold-hi); border-left-color: var(--cyan); }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* ---------- sections ---------- */
.band { position: relative; padding: clamp(72px, 9vw, 128px) 0; isolation: isolate; }
.band__art { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.band__art img { width: 100%; height: 100%; object-fit: cover; opacity: 0.4; }
.band__art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--ink), rgba(5, 7, 11, 0.55) 30%, rgba(5, 7, 11, 0.55) 70%, var(--ink));
}
.band__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 42px; flex-wrap: wrap; }
.band__head .kicker { margin-bottom: 8px; }

/* The popup panel of the client: dark glass, bronze hairline, an ornament in each top corner. */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(24, 34, 49, 0.78), rgba(10, 15, 23, 0.9));
  border: 1px solid var(--gold-hair);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--shadow);
  padding: 28px;
}
.panel::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-hi) 50%, var(--gold) 80%, transparent);
  opacity: 0.7;
}
.panel::after {
  content: ""; position: absolute; right: 0; top: 0; width: 113px; height: 54px; pointer-events: none;
  background: url("/assets/official/ui/pattern-popup.png") right top / contain no-repeat; opacity: 0.8;
}
.panel__title {
  display: flex; align-items: center; gap: 10px;
  margin: -28px -28px 22px; padding: 14px 28px;
  background: url("/assets/official/ui/frame-popup-02.png") center / 100% 100%;
  font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-hi);
  border-bottom: 1px solid var(--gold-hair);
}
.panel__title::before { content: ""; width: 20px; height: 20px; background: url("/assets/official/ui/title-deco.png") center / contain no-repeat; }

/* ---------- news ---------- */
.news { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; }
.news__lead { display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; color: var(--text); }
.news__lead:hover { color: var(--text); }
.news__lead figure { margin: 0; position: relative; aspect-ratio: 2040 / 720; overflow: hidden; background: var(--steel); }
.news__lead figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.news__lead:hover figure img { transform: scale(1.04); }
.news__lead figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 15, 23, 0.95), transparent 55%); }
.news__lead .news__body { padding: 0 30px 30px; margin-top: -54px; position: relative; }
.news__lead h3 { font-size: clamp(22px, 2.2vw, 30px); margin: 6px 0 12px; }
.news__list { display: grid; gap: 14px; align-content: start; }
.news__item {
  display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: start;
  padding: 18px 20px; color: var(--text);
  background: linear-gradient(90deg, rgba(24, 34, 49, 0.7), rgba(10, 15, 23, 0.5));
  border: 1px solid var(--gold-hair); border-left: 2px solid var(--gold-lo);
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s;
}
.news__item:hover { color: var(--text); border-left-color: var(--cyan); transform: translateX(4px); background: linear-gradient(90deg, rgba(36, 50, 70, 0.8), rgba(10, 15, 23, 0.5)); }
.news__item h3 { font-size: 17px; margin: 2px 0 6px; }
.news__item p, .news__lead p { color: var(--muted); font-size: 15px; margin: 0; }
.date { text-align: center; line-height: 1; color: var(--muted); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.date b { display: block; font-size: 30px; font-weight: 500; color: var(--gold-hi); margin-bottom: 6px; letter-spacing: 0; }
.tag {
  display: inline-block; padding: 3px 10px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid var(--cyan-line); background: rgba(116, 212, 242, 0.06);
}

/* ---------- class showcase: the class select screen ---------- */
.showcase { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 28px; align-items: stretch; }
.showcase__tabs { display: flex; flex-direction: column; gap: 6px; }
.class-tab {
  position: relative; width: 96px; height: 76px; padding: 0;
  border: 1px solid var(--gold-hair); background: rgba(10, 15, 23, 0.7);
  cursor: pointer; display: grid; place-items: center; color: var(--muted);
  transition: background 0.25s, border-color 0.25s;
}
.class-tab img { width: 44px; height: 44px; opacity: 0.55; transition: opacity 0.25s, transform 0.25s var(--ease); }
.class-tab:hover img { opacity: 0.9; }
.class-tab[aria-selected="true"] { border-color: var(--cyan-line); background: linear-gradient(90deg, rgba(116, 212, 242, 0.16), rgba(10, 15, 23, 0.7)); }
.class-tab[aria-selected="true"]::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.class-tab[aria-selected="true"] img { opacity: 1; transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(116, 212, 242, 0.6)); }
.showcase__stage {
  position: relative; min-height: 520px; overflow: hidden;
  display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); gap: 36px; align-items: end;
  padding: 0 40px 0 0;
  border: 1px solid var(--gold-hair);
  background: radial-gradient(600px 420px at 22% 70%, rgba(116, 212, 242, 0.14), transparent 70%), linear-gradient(180deg, rgba(14, 21, 32, 0.6), rgba(5, 7, 11, 0.92));
}
.showcase__stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("/assets/official/keyart/bg-mythicresult.jpg") 20% 60% / cover; opacity: 0.55;
}
.showcase__portrait { position: relative; align-self: end; }
.showcase__portrait img { width: 100%; height: auto; image-rendering: auto; -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent); mask-image: linear-gradient(180deg, #000 78%, transparent); }
.showcase__info { padding: 44px 0 44px; align-self: center; }
.showcase__emblem { width: 72px; height: 72px; margin-bottom: 14px; filter: drop-shadow(0 0 14px rgba(116, 212, 242, 0.45)); }
.showcase__name { font-size: clamp(34px, 4.4vw, 58px); margin-bottom: 10px; }
.showcase__role { color: var(--cyan); letter-spacing: 0.16em; text-transform: uppercase; font-size: 13px; margin-bottom: 18px; }
.showcase__desc { color: #d6d1c4; font-size: 16.5px; max-width: 560px; white-space: pre-line; }
.showcase__clip { margin-top: 24px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.showcase__clip video { width: 240px; aspect-ratio: 400 / 226; object-fit: cover; border: 1px solid var(--gold-line); background: #000; }
.fade-swap { animation: swap 0.6s var(--ease) both; }
@keyframes swap { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- rankings teaser (home) ---------- */
.podium { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: end; margin-bottom: 28px; }
.podium__slot { position: relative; text-align: center; padding: 20px 16px 22px; }
.podium__slot--1 { order: 2; } .podium__slot--2 { order: 1; } .podium__slot--3 { order: 3; }
.podium__flag { position: relative; margin: 0 auto -40px; width: min(200px, 100%); }
.podium__slot--1 .podium__flag { width: min(240px, 100%); }
.podium__flag > img:first-child { width: 100%; height: auto; opacity: 0.95; }
.podium__flag .podium__hero { position: absolute; left: 12%; right: 12%; bottom: 16%; width: 76%; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.podium__rank { width: 74px; margin: 0 auto 6px; position: relative; }
.podium__name { font-size: 20px; color: #fff; }
.podium__meta { color: var(--muted); font-size: 14px; }
.teaser { display: grid; gap: 8px; }
.teaser__row {
  display: grid; grid-template-columns: 48px 40px 1fr auto; gap: 16px; align-items: center;
  padding: 10px 18px; background: rgba(14, 21, 32, 0.7); border: 1px solid var(--gold-hair);
}
.teaser__row img.emblem { width: 30px; height: 30px; opacity: 0.85; }

/* rank badges */
.rank { display: inline-grid; place-items: center; width: 40px; height: 40px; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank img { width: 44px; height: 44px; }

/* ---------- page head (inner pages): a loading screen of the client ---------- */
.page-head { position: relative; isolation: isolate; padding: 110px 0 70px; overflow: hidden; min-height: 360px; display: grid; align-items: end; }
.page-head__art { position: absolute; inset: 0; z-index: -1; }
.page-head__art img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 60% 30%); animation: pan 22s ease-in-out infinite alternate; }
@keyframes pan { from { transform: scale(1.05) translateX(-1%); } to { transform: scale(1.1) translateX(1.5%); } }
.page-head__art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5, 7, 11, 0.95), rgba(5, 7, 11, 0.4) 60%, rgba(5, 7, 11, 0.2)), linear-gradient(0deg, var(--ink), transparent 50%);
}
.page-head h1 { font-size: clamp(36px, 5.6vw, 72px); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.page-head .lede { max-width: 620px; color: #cfcabd; font-size: 17px; margin: 0; }

.section { padding: 56px 0 96px; }

/* ---------- ledger (rankings) ---------- */
.tabs { display: inline-flex; gap: 0; margin-bottom: 26px; border: 1px solid var(--gold-hair); }
.tabs button {
  padding: 12px 26px; background: rgba(10, 15, 23, 0.7); color: var(--muted);
  border: 0; cursor: pointer; font-size: 13.5px; letter-spacing: 0.14em; text-transform: uppercase;
}
.tabs button + button { border-left: 1px solid var(--gold-hair); }
.tabs button[aria-selected="true"] { color: #fff; background: linear-gradient(180deg, rgba(116, 212, 242, 0.18), rgba(10, 15, 23, 0.7)); box-shadow: inset 0 -2px 0 var(--cyan); }
.ledger { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.ledger th { text-align: left; font-weight: 500; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding: 6px 16px; }
.ledger td { padding: 12px 16px; background: rgba(14, 21, 32, 0.72); border-top: 1px solid var(--gold-hair); border-bottom: 1px solid var(--gold-hair); vertical-align: middle; }
.ledger td:first-child { border-left: 1px solid var(--gold-hair); width: 70px; }
.ledger td:last-child { border-right: 1px solid var(--gold-hair); }
.ledger tbody tr { animation: rise 0.6s var(--ease) both; }
.ledger tbody tr.top td { background: rgba(34, 36, 38, 0.8); }
.ledger tbody tr.top td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.ledger .r { text-align: right; }
.hero-name { font-size: 16.5px; color: #fff; }
.bar { height: 2px; margin-top: 8px; background: rgba(255, 255, 255, 0.05); max-width: 260px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); transform-origin: left; transition: transform 0.8s var(--ease); }
.class-pill { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.class-pill img { width: 26px; height: 26px; }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 520px); min-height: calc(100vh - 76px); }
.auth__art { position: relative; overflow: hidden; }
.auth__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.auth__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 7, 11, 0.1), rgba(5, 7, 11, 0.4) 60%, var(--ink)), linear-gradient(0deg, rgba(5, 7, 11, 0.8), transparent 40%); }
.auth__quote { position: absolute; left: 48px; bottom: 44px; right: 30%; z-index: 1; font-size: clamp(20px, 2vw, 28px); color: #f2ecdd; text-shadow: 0 2px 16px #000; }
.auth__quote img { width: 64px; margin-bottom: 14px; }
.auth__side { display: grid; align-items: center; padding: 48px clamp(20px, 4vw, 56px); background: linear-gradient(180deg, rgba(10, 15, 23, 0.7), var(--ink)); }
.auth__side .panel { padding: 34px 32px; }
.auth__side .panel__title { margin: -34px -32px 26px; }
.auth h1 { font-size: 30px; margin-bottom: 6px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; margin-top: 22px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.field input {
  height: 48px; padding: 0 14px;
  color: var(--text); font-size: 16px;
  background: rgba(5, 7, 11, 0.7); border: 1px solid rgba(164, 171, 184, 0.2); border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:hover { border-color: rgba(164, 171, 184, 0.35); }
.field input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(116, 212, 242, 0.15); }
.field[data-invalid] input { border-color: var(--danger); }
.field__hint { font-size: 13px; color: var(--faint); min-height: 1em; }
.field[data-invalid] .field__hint { color: var(--danger); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength span { height: 3px; background: rgba(255, 255, 255, 0.08); transition: background 0.3s; }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] span:nth-child(-n+2) { background: #e0a24a; }
.strength[data-level="3"] span:nth-child(-n+3) { background: var(--gold); }
.strength[data-level="4"] span { background: var(--jade); }
.notice { margin: 0; padding: 12px 14px; font-size: 14.5px; border-left: 3px solid var(--danger); background: rgba(239, 106, 82, 0.1); }
.notice--ok { border-left-color: var(--jade); background: rgba(114, 194, 157, 0.1); }
.form__alt { margin: 22px 0 0; color: var(--muted); font-size: 14.5px; }
.form .btn { margin-top: 6px; }

/* ---------- empty states (the account page has its own sheet, account.css) ---------- */
.empty { padding: 30px; text-align: center; border: 1px dashed var(--gold-hair); color: var(--muted); }

/* ---------- guides, news, patch notes ---------- */
.guide-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 100px; }
.toc ol { list-style: none; margin: 12px 0 0; padding: 0; border-left: 1px solid var(--gold-hair); }
.toc a { display: flex; align-items: center; gap: 10px; padding: 7px 14px; color: var(--muted); font-size: 14.5px; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: #fff; border-left-color: var(--cyan); }
.toc img { width: 22px; height: 22px; opacity: 0.8; }
.entry { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 34px; padding: 36px 0; border-bottom: 1px solid var(--gold-hair); scroll-margin-top: 100px; }
.entry:last-child { border-bottom: 0; }
.entry__figure { position: relative; }
.entry__figure .portrait { width: 100%; height: auto; -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent); mask-image: linear-gradient(180deg, #000 80%, transparent); }
.entry__figure .emblem { position: absolute; right: -8px; top: 8px; width: 54px; height: 54px; filter: drop-shadow(0 0 10px rgba(116, 212, 242, 0.5)); }
.entry h2 { font-size: clamp(26px, 3vw, 36px); color: #fff; margin-bottom: 6px; }
.entry__role { color: var(--cyan); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 16px; }
.entry__official { position: relative; padding: 16px 20px 16px 22px; margin: 0 0 18px; color: #e3dccb; white-space: pre-line; background: rgba(210, 171, 103, 0.06); border-left: 2px solid var(--gold); }
.entry__official cite { display: block; margin-top: 8px; font-style: normal; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-lo); }
.entry p { color: #cfcabd; }
.entry video { width: min(100%, 400px); aspect-ratio: 400 / 226; margin-top: 8px; border: 1px solid var(--gold-line); background: #000; }
.entry__mark { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid var(--gold-line); background: rgba(10, 15, 23, 0.8); color: var(--gold-hi); font-size: 24px; }
.entry--system { grid-template-columns: 64px minmax(0, 1fr); }
.traits { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.traits li { padding: 5px 12px; font-size: 13px; color: var(--gold-hi); border: 1px solid var(--gold-hair); background: rgba(210, 171, 103, 0.06); }
.status { display: inline-block; padding: 3px 10px; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; border: 1px solid; }
.status--live { color: var(--jade); border-color: rgba(114, 194, 157, 0.4); }
.status--partial { color: #e0a24a; border-color: rgba(224, 162, 74, 0.4); }
.status--planned { color: var(--faint); border-color: rgba(108, 116, 131, 0.5); }
.article { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 28px; padding: 34px 0; border-bottom: 1px solid var(--gold-hair); scroll-margin-top: 100px; }
.article h2 { font-size: clamp(22px, 2.4vw, 30px); color: #fff; margin: 10px 0 10px; }
.article .lede { color: #e3dccb; font-size: 17px; }
.article p { color: #cfcabd; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 1px solid var(--gold-line); }
.release { position: relative; padding: 0 0 40px 20px; scroll-margin-top: 100px; }
.release::before { content: ""; position: absolute; left: -37px; top: 4px; width: 17px; height: 17px; background: url("/assets/official/ui/title-deco.png") center / contain no-repeat, var(--ink); }
.release__meta { display: flex; gap: 14px; align-items: baseline; color: var(--muted); font-size: 13.5px; letter-spacing: 0.08em; }
.release__meta b { font-weight: 500; color: var(--gold-hi); font-size: 18px; }
.release h2 { font-size: 24px; color: #fff; margin: 6px 0 12px; }
.release ul { margin: 0; padding-left: 18px; color: #cfcabd; }
.release li { margin: 5px 0; }
.release li::marker { color: var(--gold); }
.entry-pic { display: block; width: 100%; max-width: 760px; aspect-ratio: 3 / 1; object-fit: cover; margin: 14px 0 18px; border: 1px solid var(--gold-hair); }
.entry-pic.art--missing { display: none; }

/* ---------- footer ---------- */
.footer { margin-top: auto; padding: 64px 0 30px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6)); border-top: 1px solid var(--gold-hair); position: relative; }
.footer::before { content: ""; position: absolute; left: 50%; top: -1px; width: 320px; height: 1px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer__about p { color: var(--faint); font-size: 14px; margin-top: 16px; max-width: 420px; }
.footer h4 { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer ul a { color: var(--muted); font-size: 14.5px; }
.footer ul a:hover { color: #fff; }
.footer__legal { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--gold-hair); color: var(--faint); font-size: 12.5px; }

/* ---------- reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal].is-quiet { transition: none; }

/* ---------- responsive ---------- */
/* The masthead: eight links, the language and the account in one row down to 1281px (the longest labels are Spanish and
   Portuguese), tightening as it narrows; below that the links fold into the menu button. */
@media (max-width: 1600px) {
  .masthead__inner { gap: 20px; }
  .nav { gap: 0; }
  .nav a { padding: 10px 9px; letter-spacing: 0.07em; }
}
@media (max-width: 1440px) {
  .brand__tag { display: none; }
  .nav a { padding: 10px 7px; font-size: 12.5px; letter-spacing: 0.05em; }
  .masthead__tools { gap: 10px; }
  .masthead__account { max-width: 190px; letter-spacing: 0.08em; }
  .lang__button > span:last-child { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 1280px) {
  .masthead__inner { gap: 14px; min-height: 64px; }
  .menu-toggle {
    display: grid; place-items: center; width: 44px; height: 44px; margin-left: 4px; flex: none;
    background: none; border: 1px solid var(--gold-hair); cursor: pointer;
  }
  .menu-toggle span[aria-hidden] { width: 20px; height: 2px; background: var(--gold-hi); box-shadow: 0 -6px 0 var(--gold-hi), 0 6px 0 var(--gold-hi); }
  .nav {
    position: fixed; inset: 64px 0 auto; flex-direction: column; gap: 0; padding: 12px 20px 22px;
    max-height: calc(100vh - 64px); overflow-y: auto;
    background: rgba(5, 7, 11, 0.97); border-bottom: 1px solid var(--gold-line);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  }
  .menu-open .nav { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 14px 4px; font-size: 15px; letter-spacing: 0.12em; border-bottom: 1px solid var(--gold-hair); }
  .masthead__tools { margin-left: auto; min-width: 0; }
  .masthead__account { max-width: 190px; }
}
@media (max-width: 960px) {
  .page-home .masthead { background: linear-gradient(180deg, rgba(5, 7, 11, 0.85), transparent); }
  .news, .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__art { min-height: 260px; }
  .auth__quote { left: 20px; right: 20px; bottom: 22px; }
  .showcase { grid-template-columns: 1fr; }
  .showcase__tabs { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .class-tab { flex: none; width: 64px; height: 60px; }
  .class-tab[aria-selected="true"]::before { left: 10px; right: 10px; top: auto; bottom: -1px; width: auto; height: 3px; }
  .showcase__stage { grid-template-columns: 1fr; padding: 0 22px 26px; }
  .showcase__portrait { max-width: 280px; margin: 0 auto; }
  .showcase__info { padding: 0; }
  .guide-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; border-left: 0; gap: 4px; }
  .toc a { border: 1px solid var(--gold-hair); margin: 0; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__about { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .wrap { width: calc(100% - 32px); }
  .masthead__inner { width: calc(100% - 24px); }
  .brand__mark { width: 38px; height: 38px; }
  .brand__name { font-size: 15px; letter-spacing: 0.16em; }
  .masthead__account { display: none; }
  .lang__button { padding: 0 9px; }
  .btn--start { padding: 0 12px; font-size: 15px; letter-spacing: 0.14em; }
  .podium { gap: 6px; }
  .podium__slot { padding: 10px 2px 12px; }
  .podium__flag, .podium__slot--1 .podium__flag { width: 100%; margin-bottom: -24px; }
  .podium__rank { width: 48px; }
  .podium__name { font-size: 14.5px; overflow-wrap: anywhere; }
  .podium__meta { font-size: 11.5px; }
  .teaser__row { grid-template-columns: 40px 30px 1fr; }
  .teaser__row > :last-child { grid-column: 3; font-size: 13px; color: var(--muted); }
  .entry, .article { grid-template-columns: 1fr; gap: 16px; }
  .entry__figure { max-width: 200px; }
  .entry--system { grid-template-columns: 48px 1fr; }
  .entry__mark { width: 48px; height: 48px; font-size: 18px; }
  .hide-sm { display: none; }
  .ledger td, .ledger th { padding: 10px 10px; }
  .footer__grid { grid-template-columns: 1fr; }
  .page-head { min-height: 300px; padding: 96px 0 44px; }
  .auth__side { padding: 28px 16px 48px; }
  .auth__side .panel { padding: 26px 20px; }
  .auth__side .panel__title { margin: -26px -20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
