@font-face {
  font-family: "Radiance";
  src: url("fantasy-assets/radiance.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "Reaver";
  src: url("fantasy-assets/Reaver-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page-width: 1280px;
  --ivory: #f4ecd8;
  --ink: #17130d;
  --gold: #c9a457;
  --gold-bright: #efd58e;
  --gold-dark: #6f4b20;
  --red: #7d3034;
  --red-deep: #3c161b;
  --blue: #343d72;
  --blue-deep: #171b3e;
  --green: #286149;
  --green-deep: #113724;
  --page-font: "Radiance", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --display-font: "Radiance", "Microsoft YaHei", serif;
  --number-font: "Reaver", serif;
  --reaver-font: "Reaver", "Microsoft YaHei", serif;
  --kai-font: "Reaver", "KaiTi", "STKaiti", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 900px;
  font-size: 14px;
  scroll-behavior: smooth;
  background: #080604;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ivory);
  background: #080604;
  font-family: var(--page-font);
}

button,
select {
  font: inherit;
}

button,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.fantasy-app {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -12%, rgba(137, 91, 28, .26), transparent 36rem),
    linear-gradient(180deg, rgba(4, 3, 2, .26), rgba(4, 3, 2, .7)),
    url("fantasy-assets/ti2026_background_png.jpg") center top / cover fixed,
    #080604;
  position: relative;
}

.fantasy-app::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: .3;
  background:
    radial-gradient(circle at 8% 11%, rgba(228, 174, 67, .32) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 7%, rgba(228, 174, 67, .24) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 24%, rgba(228, 174, 67, .18) 0 1px, transparent 2px);
  background-size: 330px 280px, 430px 360px, 240px 220px;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: 18px;
}

.topbar {
  width: min(var(--page-width), calc(100% - 54px));
  min-height: 132px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(360px, 1fr) 400px;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(214, 178, 98, .24);
}

.brand {
  width: fit-content;
  display: grid;
  justify-items: start;
  color: var(--ivory);
  text-decoration: none;
  text-shadow: 0 0 20px rgba(229, 195, 118, .26);
}

.brand strong {
  font-family: var(--kai-font);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: .035em;
}

.stage-switcher-row {
  display: contents;
}

.stage-switcher {
  margin-top: 10px;
  display: flex;
  padding: 2px;
  border: 1px solid rgba(217, 182, 111, .34);
  background: rgba(14, 10, 6, .52);
  box-shadow: inset 0 0 9px rgba(0, 0, 0, .38);
}

.stage-switcher button {
  min-height: 27px;
  padding: 5px 8px 4px;
  color: rgba(218, 204, 177, .7);
  cursor: pointer;
  border: 0;
  background: transparent;
  font-family: 'Reaver';
  font-size: .61rem;
  line-height: 1;
  white-space: nowrap;
}

.stage-switcher button:hover {
  color: #f1dfb9;
  background: rgba(255, 248, 215, .08);
}

.stage-switcher button.is-active {
  color: #f6e8c9;
  background: linear-gradient(180deg, rgba(157, 107, 43, .92), rgba(92, 56, 23, .96));
  box-shadow: inset 0 0 10px rgba(238, 198, 104, .15);
}

.multiplier-switcher {
  margin-top: 5px;
}

.league-selector {
  width: 100%;
  margin-top: 10px;
  display: grid;
  gap: 3px;
  color: rgba(218, 204, 177, .72);
  font-family: 'Reaver';
  font-size: .61rem;
}

.league-selector select {
  width: 100%;
  min-height: 29px;
  padding: 4px 26px 4px 7px;
  color: #f6e8c9;
  border: 1px solid rgba(217, 182, 111, .34);
  border-radius: 0;
  background-color: rgba(14, 10, 6, .92);
  font-family: 'Reaver';
  font-size: .61rem;
}

.league-selector option {
  color: #f6e8c9;
  background-color: #18120c;
}

.league-selector select.is-the-international,
.league-selector option.league-option--the-international {
  color: #211609;
  background-color: #c49745;
}

.league-selector select.is-the-international {
  border-color: rgba(246, 209, 128, .82);
  background-image: linear-gradient(180deg, #d3aa5a, #a8752e);
  box-shadow: inset 0 0 9px rgba(255, 226, 158, .22);
}

.league-selector select:disabled {
  cursor: wait;
  opacity: .68;
}

.league-selector + .stage-switcher {
  margin-top: 5px;
}

.multiplier-switcher button {
  flex: 1 1 0;
}

.challenge-title {
  min-width: 0;
  display: grid;
  justify-items: center;
  text-align: center;
}

.event-script {
  width: min(100%, 330px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 13px rgba(214, 161, 55, .18));
}

.subtitle-row {
  min-width: 0;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px 10px;
}

.challenge-title h1 {
  margin: 0;
  color: #bfb29b;
  font-family: var(--display-font);
  font-size: 14px;
  font-weight: 400;
  text-shadow: 0 2px 18px rgba(234, 204, 135, .12);
}

.advisor-titles {
  width: min(100%, 560px);
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.advisor-titles label {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid rgba(217, 182, 111, .34);
  background: rgba(14, 10, 6, .58);
  box-shadow: inset 0 0 9px rgba(0, 0, 0, .38);
}

.advisor-titles span {
  padding: 0 7px;
  color: #c9b892;
  font-size: 10px;
  line-height: 28px;
  white-space: nowrap;
}

.advisor-titles select {
  min-width: 0;
  height: 28px;
  padding: 0 22px 0 7px;
  color: #f3e3c1;
  border: 0;
  border-left: 1px solid rgba(217, 182, 111, .22);
  border-radius: 0;
  outline: 0;
  background: rgba(92, 56, 23, .72);
  font-family: var(--display-font);
  font-size: 10px;
  text-overflow: ellipsis;
}

.advisor-titles select:hover,
.advisor-titles select:focus-visible {
  color: #fff2d2;
  background-color: rgba(126, 82, 31, .86);
}

.topbar-actions {
  justify-self: end;
  min-width: 380px;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar nav button,
.topbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 12px 11px;
  color: #dfd1b8;
  cursor: pointer;
  border: 0;
  border-bottom: 1px solid rgba(217, 182, 111, .18);
  background: transparent;
  font-family: var(--reaver-font);
  font-size: .76rem;
  letter-spacing: .09em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.topbar nav button:hover,
.topbar nav a:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

.total-score {
  min-width: 280px;
  padding-top: 6px;
  text-align: right;
}

.total-score small {
  display: block;
  color: #938875;
  font-size: .62rem;
}

.total-score strong {
  display: block;
  margin: 0 0 3px;
  color: var(--gold-bright);
  font-family: 'Reaver';
  font-size: 36px;
  line-height: 1;
}

.banner-grid {
  width: min(var(--page-width), calc(100% - 54px));
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  align-items: start;
  gap: 10px;
}

.loading-message {
  grid-column: 1 / -1;
  padding: 100px 20px;
  text-align: center;
  color: #b9aa91;
}

.banner-column {
  min-width: 0;
  height: auto;
}

.war-banner {
  min-width: 0;
  height: auto;
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding-bottom: 18px;
  overflow: hidden;
  color: var(--ink);
  border: 2px solid #c8a64f;
  background:
    linear-gradient(180deg, rgba(242, 235, 199, .74), rgba(183, 173, 131, .84)),
    #b8ae88;
  box-shadow:
    0 19px 45px rgba(0, 0, 0, .54),
    inset 0 0 50px rgba(83, 61, 25, .2);
}

.war-banner::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: .105;
  background: url("fantasy-assets/aegis_tile_texture_png.webp") 0 0 / 68px 68px repeat;
  filter: sepia(1) saturate(.55) brightness(.55);
}

.war-banner::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .13), transparent 18%, transparent 82%, rgba(77, 54, 18, .12)),
    linear-gradient(180deg, rgba(255, 255, 255, .09), transparent 25%, rgba(69, 48, 17, .14));
}

.banner-rope {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  height: 6px;
  background: url("fantasy-assets/rope_texture_png.webp") center / auto 6px repeat-x;
  filter: sepia(.38) saturate(1.22) brightness(.86);
}

.banner-rope.is-top {
  top: 1px;
}

.banner-rope.is-bottom {
  bottom: 1px;
  transform: rotate(180deg);
}

.banner-heading {
  position: relative;
  z-index: 2;
  width: 55%;
  min-height: 170px;
  padding: 35px 10px 12px;
  text-align: center;
}

.banner-main,
.emblem-pennant {
  grid-area: 1 / 1;
}

.banner-main {
  min-width: 0;
  z-index: 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.banner-heading h2 {
  margin: 0;
  color: #16120d;
  font-family: "KaiTi", "STKaiti", var(--display-font);
  font-size: 1.85rem;
  font-weight: 700;
}

.selected-roster {
  display: block;
  max-width: 180px;
  margin: 5px auto 0;
  color: #2a2115;
  font-size: .86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Reaver';
}

.selected-roster small {
  display: block;
  margin-top: 1px;
  color: rgba(42, 33, 21, .6);
  font-size: 12px;
}

.score-method {
  width: fit-content;
  margin: 10px auto 0;
  padding: 0;
  color: #4b3921;
  border: 0;
}

.score-method legend {
  width: 100%;
  margin: 0 0 4px;
  padding: 0;
  text-align: center;
  font-family: var(--display-font);
  font-size: 12px;
}

.score-method div {
  display: flex;
  padding: 2px;
  border: 1px solid rgba(63, 43, 18, .72);
  background: rgba(235, 222, 179, .35);
  box-shadow: inset 0 0 9px rgba(78, 53, 19, .16);
}

.score-method button {
  min-width: 61px;
  padding: 5px 7px 4px;
  color: rgba(54, 41, 22, .72);
  cursor: pointer;
  border: 0;
  background: transparent;
  font-size: 10px;
}

.score-method button:hover {
  color: #2d2112;
  background: rgba(255, 248, 215, .34);
}

.score-method button.is-active {
  color: #f6e8c9;
  background:
    linear-gradient(180deg, rgba(157, 107, 43, .92), rgba(92, 56, 23, .96));
  box-shadow: inset 0 0 10px rgba(238, 198, 104, .15);
}

.banner-score {
  min-height: 31px;
  margin: 10px auto 0;
  display: block;
  color: rgba(124, 84, 38, 1);
  text-align: center;
  font-family: "Reaver";
  font-size: 1.36rem;
  letter-spacing: .04em;
  line-height: 1.2;
}

.emblem-pennant {
  --emblem-pennant-tip-depth: 28px;
  position: relative;
  z-index: 3;
  width: 43.5%;
  height: auto;
  margin: 32px 3.3% 0 0;
  padding: 10px 9px 45px;
  align-self: start;
  justify-self: end;
  background: rgba(238, 232, 199, .92);
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    50% calc(100% - var(--emblem-pennant-tip-depth)),
    0 100%
  );
  filter: drop-shadow(0 4px 4px rgba(55, 39, 18, .35));
}

.emblem-pennant::before {
  position: absolute;
  inset: 2px;
  z-index: 0;
  content: "";
  border: 1px solid rgba(255, 255, 255, .64);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .14), transparent 28%, rgba(91, 72, 39, .08)),
    rgba(165, 157, 123, .5);
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    50% calc(100% - var(--emblem-pennant-tip-depth) - 1px),
    0 100%
  );
}

.war-banner--five .emblem-pennant {
  height: auto;
}

.war-banner--five .emblem-card {
  height: 100px;
  min-height: 100px;
}

.emblem-stack {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  row-gap: 8px;
}

.emblem-card {
  --card-main: #653037;
  --card-dark: #32151a;
  height: 100px;
  min-height: 100px;
  color: #f9f1dd;
  border: 1px solid rgba(255, 255, 255, .08);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, .04), transparent 30%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 9px, rgba(0, 0, 0, .025) 9px 18px),
    linear-gradient(90deg, var(--card-main), var(--card-dark));
  box-shadow:
    0 5px 8px rgba(48, 34, 18, .38),
    inset 0 0 20px rgba(0, 0, 0, .25);
  overflow: hidden;
}

.emblem-card--red {
  --card-main: var(--red);
  --card-dark: var(--red-deep);
}

.emblem-card--blue {
  --card-main: var(--blue);
  --card-dark: var(--blue-deep);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, .04), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 12px, rgba(0, 0, 0, .07) 12px 23px),
    linear-gradient(90deg, var(--card-main), var(--card-dark));
}

.emblem-card--green {
  --card-main: var(--green);
  --card-dark: var(--green-deep);
  background:
    repeating-linear-gradient(45deg, transparent 0 13px, rgba(255, 255, 255, .025) 13px 15px),
    repeating-linear-gradient(-45deg, transparent 0 13px, rgba(255, 255, 255, .025) 13px 15px),
    linear-gradient(90deg, var(--card-main), var(--card-dark));
}

.emblem-head,
.emblem-detail,
.emblem-score-detail {
  display: grid;
  align-items: center;
}

.emblem-head {
  min-height: 32px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 3px;
  padding: 3px 5px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .14);
}

.emblem-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #f1d2c9;
  filter: drop-shadow(0 0 7px currentColor);
}

.emblem-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.emblem-card--blue .emblem-icon {
  color: #c6d1ff;
}

.emblem-card--green .emblem-icon {
  color: #b4e2ca;
}

.emblem-card select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  width: 100%;
  height: 18px;
  padding: 0 12px 0 1px;
  color: #f6eddb;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(247, 233, 202, .72) 50%),
    linear-gradient(135deg, rgba(247, 233, 202, .72) 50%, transparent 50%);
  background-position:
    calc(100% - 7px) 7px,
    calc(100% - 4px) 7px;
  background-repeat: no-repeat;
  background-size: 3px 3px;
  text-overflow: ellipsis;
}

.emblem-card select:hover {
  color: #fff7d7;
  background-color: rgba(255, 255, 255, .06);
}

.emblem-card select option {
  color: #f4ead6;
  background: #181513;
}



.stat-select {
  font-family: var(--reaver-font);
  font-size: 11px;
}

.emblem-multiplier {
  min-width: 37px;
  color: #fff8e9;
  text-align: right;
  font-family: "Reaver";
  font-size: 1.02rem;
  line-height: 1;
}

.manual-multiplier-control {
  min-width: 0;
  width: max-content;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-self: end;
  gap: 2px;
  color: #fff8e9;
  font-family: "Reaver";
  font-size: .78rem;
}

input.emblem-multiplier {
  appearance: textfield;
  box-sizing: content-box;
  width: 3ch;
  height: 23px;
  min-width: 0;
  padding: 1px 3px;
  color: #fff8e9;
  border: 1px solid rgba(255, 248, 233, .28);
  border-radius: 2px;
  outline: 0;
  background: rgba(0, 0, 0, .28);
  text-align: right;
}

input.emblem-multiplier:focus-visible {
  border-color: rgba(255, 223, 151, .84);
  box-shadow: 0 0 0 1px rgba(255, 223, 151, .28);
}

input.emblem-multiplier::-webkit-inner-spin-button,
input.emblem-multiplier::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.emblem-card--manual,
.war-banner--five .emblem-card--manual {
  height: 62px;
  min-height: 62px;
}

.emblem-detail {
  min-height: 22px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 1px 6px;
  border-top: 1px solid rgba(255, 255, 255, .035);
}

.emblem-detail select {
  font-family: var(--reaver-font);
  font-size: 10px;
}

.emblem-detail output {
  min-width: 32px;
  color: #dfd6c9;
  text-align: right;
  font-size: 10px;
  letter-spacing: .04em;
  font-family: 'Reaver';
}

.emblem-score-detail {
  min-height: 22px;
  grid-template-columns: minmax(0, 1fr);
  padding: 2px 6px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .12);
}

.emblem-score-detail output {
  color: #fff8e9;
  font-family: 'Reaver';
  font-size: 11px;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 7px rgba(255, 236, 191, .22);
  white-space: nowrap;
}

.leaderboard {
  position: relative;
  z-index: 3;
  width: 50%;
  height: 274px;
  min-height: 274px;
  margin: 0 0 0 2%;
  flex: 1 1 274px;
  overflow: hidden;
  color: #1e1912;
  border: 1px solid rgba(72, 51, 21, .42);
  background: rgba(229, 221, 185, .7);
  box-shadow:
    0 8px 20px rgba(72, 48, 15, .18),
    inset 0 0 22px rgba(255, 255, 255, .14);
  font-family: 'Reaver';
}

.ranking-list {
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  scrollbar-color: #806539 rgba(60, 43, 22, .15);
  scrollbar-width: thin;
}

.ranking-list li + li {
  border-top: 1px solid rgba(68, 48, 22, .17);
}

.ranking-row {
  width: 100%;
  min-height: 49px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: #2c2418;
  text-align: left;
  cursor: pointer;
  border: 0;
  background: rgba(248, 241, 211, .13);
}

.ranking-row:hover {
  background: rgba(255, 250, 221, .42);
}

.ranking-row.is-selected {
  color: #f8edd2;
  background:
    linear-gradient(90deg, rgba(125, 83, 34, .96), rgba(72, 47, 22, .94));
  box-shadow: inset 3px 0 #e2bf70;
}

.ranking-identity {
  min-width: 0;
}

.ranking-identity strong,
.ranking-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-identity strong {
  font-size: 12px;
  font-weight: 600;
}

.ranking-identity small {
  margin-top: 2px;
  color: rgba(58, 46, 30, .57);
  font-size: 12px;
}

.ranking-row.is-selected .ranking-identity small {
  color: #bcaa89;
}

.ranking-value {
  color: #60471f;
  text-align: right;
  font-size: 12px;
}

.ranking-row.is-selected .ranking-value {
  color: #f2d99e;
}

.ranking-value.is-missing {
  color: #866a68;
  font-family: var(--page-font);
  font-size: .68rem;
}

.load-error,
.noscript-message {
  width: min(720px, calc(100% - 40px));
  margin: 50px auto;
  padding: 22px;
  color: #ecd8bd;
  border: 1px solid #92564d;
  background: rgba(60, 21, 19, .8);
  text-align: center;
}

.load-error p,
.noscript-message {
  margin-bottom: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(2, 2, 1, .82);
  backdrop-filter: blur(11px);
}

.modal {
  width: min(1040px, 100%);
  max-height: 88vh;
  overflow: hidden;
  color: #eadfc9;
  border: 1px solid rgba(212, 174, 96, .48);
  background:
    linear-gradient(145deg, rgba(106, 70, 27, .23), transparent 34%),
    #12100d;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .74);
}

.modal-header {
  min-height: 84px;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(208, 169, 88, .25);
}

.modal-header h2 {
  margin: 2px 0 0;
  font-family: var(--display-font);
  font-size: 1.65rem;
}

.modal-header button {
  padding: 8px 0;
  color: #cbbfa9;
  font-size: .92rem;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.modal-header button:hover {
  color: var(--gold-bright);
}

.modal-body {
  max-height: calc(88vh - 84px);
  padding: 24px;
  overflow-y: auto;
}

.modal-lead {
  margin: 0 0 20px;
  color: #c6b9a4;
  font-size: .95rem;
  line-height: 1.65;
}

.emblem-ranking-toolbar {
  position: sticky;
  top: -24px;
  z-index: 5;
  margin: -24px -24px 18px;
  padding: 14px 24px 12px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(208, 169, 88, .2);
  background:
    linear-gradient(180deg, rgba(31, 24, 15, .99), rgba(18, 16, 13, .98));
  box-shadow: 0 10px 18px rgba(0, 0, 0, .24);
}

.emblem-ranking-switcher {
  padding: 2px;
  display: inline-flex;
  border: 1px solid rgba(217, 182, 111, .34);
  background: rgba(14, 10, 6, .72);
  box-shadow: inset 0 0 9px rgba(0, 0, 0, .38);
}

.emblem-ranking-switcher button {
  min-height: 34px;
  padding: 8px 14px;
  color: rgba(218, 204, 177, .7);
  cursor: pointer;
  border: 0;
  background: transparent;
  font-family: var(--reaver-font);
  font-size: .7rem;
  line-height: 1;
  white-space: nowrap;
}

.emblem-ranking-switcher button:hover {
  color: #f1dfb9;
  background: rgba(255, 248, 215, .08);
}

.emblem-ranking-switcher button.is-active {
  color: #f6e8c9;
  background: linear-gradient(180deg, rgba(157, 107, 43, .92), rgba(92, 56, 23, .96));
  box-shadow: inset 0 0 10px rgba(238, 198, 104, .15);
}

.emblem-ranking-method {
  margin-top: -8px;
  padding: 10px 12px;
  color: #a99f90;
  border-left: 2px solid rgba(212, 174, 96, .55);
  background: rgba(212, 174, 96, .055);
  font-size: .8rem;
}

.emblem-rankings {
  display: grid;
  gap: 24px;
}

.emblem-ranking-role > header {
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(212, 174, 96, .22);
}

.emblem-ranking-role > header h3 {
  margin: 0;
  padding-bottom: 7px;
  color: #ead5a5;
  font-family: var(--display-font);
  font-size: 1.08rem;
}

.emblem-ranking-role > header p {
  margin: 0 0 7px;
  color: #8f8678;
  font-size: .7rem;
}

.emblem-ranking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.emblem-ranking-card {
  --ranking-color: var(--gold-dark);
  --ranking-deep: #241b0f;
  position: relative;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--ranking-color) 68%, transparent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--ranking-color) 18%, transparent), transparent 42%),
    color-mix(in srgb, var(--ranking-deep) 62%, #12100d);
}

.emblem-ranking-card--red {
  --ranking-color: var(--red);
  --ranking-deep: var(--red-deep);
}

.emblem-ranking-card--blue {
  --ranking-color: var(--blue);
  --ranking-deep: var(--blue-deep);
}

.emblem-ranking-card--green {
  --ranking-color: var(--green);
  --ranking-deep: var(--green-deep);
}

.emblem-ranking-card--unavailable {
  --ranking-color: #b9bbb6;
  --ranking-deep: #41423f;
}

.emblem-ranking-card h4 {
  margin: 0;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e9ddc8;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: color-mix(in srgb, var(--ranking-color) 24%, transparent);
  font-family: var(--display-font);
  font-size: .78rem;
}

.emblem-ranking-card h4 > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ranking-color) 70%, #fff);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ranking-color) 74%, transparent);
}

.emblem-ranking-card ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.emblem-ranking-row {
  position: relative;
  min-height: 52px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-top: 1px solid rgba(255, 255, 255, .055);
}

.emblem-ranking-row:first-child {
  border-top: 0;
  background: linear-gradient(90deg, rgba(239, 213, 142, .09), transparent);
}

.emblem-ranking-place {
  color: #81786a;
  font-family: var(--number-font);
  font-size: .65rem;
  text-align: center;
}

.emblem-ranking-row:first-child .emblem-ranking-place {
  color: var(--gold-bright);
}

.emblem-ranking-stat {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.emblem-ranking-stat-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ded1bc;
  font-size: .7rem;
  line-height: 1.15;
}

.emblem-ranking-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--ranking-color) 58%, #fff);
}

.emblem-ranking-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.emblem-ranking-stat small {
  overflow: hidden;
  color: #898174;
  font-size: .61rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emblem-ranking-score {
  min-width: 38px;
  display: grid;
  justify-items: end;
  color: #f1dfb9;
  font-family: var(--number-font);
  font-size: 1rem;
  line-height: 1;
}

.emblem-ranking-score small {
  margin-top: 3px;
  color: #746d62;
  font-family: var(--page-font);
  font-size: .53rem;
  font-weight: 400;
  white-space: nowrap;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.data-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .035);
}

.data-card h3 {
  margin: 0 0 8px;
  color: #ead5a5;
  font-family: var(--display-font);
  font-size: 1rem;
}

.data-card p,
.data-card li {
  color: #a99f90;
  font-size: .82rem;
  line-height: 1.55;
}

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

@media (max-width: 1380px) {
  :root {
    --page-width: 1280px;
  }

  .topbar,
  .banner-grid {
    width: min(var(--page-width), calc(100% - 40px));
  }

  .topbar {
    grid-template-columns: 190px minmax(320px, 1fr) 380px;
    gap: 18px;
  }

  .brand strong {
    font-size: 1.9rem;
  }

  .war-banner {
    height: auto;
    min-height: 0;
  }

  .emblem-pennant {
    width: 44%;
    margin-right: 2.6%;
  }

  .banner-heading,
  .leaderboard {
    width: 50%;
  }

  .banner-heading h2 {
    font-size: 1.72rem;
  }

  .emblem-head {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .emblem-icon {
    width: 22px;
    height: 22px;
  }

  .emblem-icon svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 180px 1fr 320px;
  }

  .topbar,
  .banner-grid {
    width: 1110px;
  }

  .banner-grid {
    grid-template-columns: repeat(3, 362px);
  }

  .challenge-title h1 {
    font-size: 15px;
  }

  .total-score {
    min-width: 260px;
  }

  .war-banner {
    height: auto;
    min-height: 0;
  }

  .banner-heading h2 {
    font-size: 1.7rem;
  }

  .selected-roster {
    max-width: 175px;
    font-size: 16px;
  }

  .emblem-pennant {
    width: 45%;
    padding-left: 7px;
    padding-right: 7px;
  }

  .emblem-multiplier {
    min-width: 34px;
    font-size: .93rem;
  }

  .stat-select,
  .emblem-detail select {
    font-size: .59rem;
  }

  .leaderboard {
    width: 50%;
    margin-left: 2.6%;
  }
}



/* Tablet and small-laptop layout: avoid the former fixed 1110px canvas. */
@media (min-width: 901px) and (max-width: 1180px) {
  html,
  body {
    min-width: 0;
  }

  .topbar,
  .banner-grid {
    width: calc(100% - 32px);
  }

  .topbar {
    min-height: 150px;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 12px 20px;
  }

  .challenge-title {
    justify-items: start;
    text-align: left;
  }

  .subtitle-row {
    justify-content: flex-start;
  }

  .event-script {
    width: min(100%, 300px);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    justify-items: stretch;
  }

  .topbar nav {
    justify-self: start;
  }

  .total-score {
    justify-self: end;
  }

  .banner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }

  .banner-column:last-child {
    width: calc((100% - 12px) / 2);
    grid-column: 1 / -1;
    justify-self: center;
  }
}

/* Mobile layout: stack the three war banners and let each banner flow vertically. */
@media (max-width: 900px) {
  html {
    min-width: 0;
    font-size: 14px;
  }

  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .fantasy-app {
    overflow: clip;
    background:
      radial-gradient(circle at 50% -8%, rgba(137, 91, 28, .24), transparent 28rem),
      linear-gradient(180deg, rgba(4, 3, 2, .28), rgba(4, 3, 2, .74)),
      url("fantasy-assets/ti2026_background_png.jpg") center top / auto 100vh scroll,
      #080604;
  }

  .page-shell {
    padding-bottom: 28px;
  }

  .topbar,
  .banner-grid {
    width: min(100% - 24px, 560px);
  }

  .topbar {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    justify-items: center;
    gap: 6px;
    padding: 18px 0 16px;
    text-align: center;
  }

  /* Flatten the desktop groups so mobile can follow one visual reading order. */
  .topbar > .brand,
  .topbar > .challenge-title,
  .topbar > .topbar-actions {
    display: contents;
  }

  .topbar > .brand > strong {
    order: 2;
    justify-self: center;
  }

  .brand strong {
    font-size: clamp(1.65rem, 7vw, 2rem);
  }

  .topbar > .challenge-title > .event-script {
    order: 1;
    justify-self: center;
  }

  .topbar > .challenge-title > .subtitle-row {
    order: 3;
  }

  .topbar > .brand > .stage-switcher-row {
    order: 5;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .topbar > .brand > .stage-switcher-row > .stage-switcher {
    margin-top: 0;
  }

  .topbar > .topbar-actions > nav {
    order: 4;
  }

  .topbar > .challenge-title > .advisor-titles {
    order: 7;
    margin-top: 0;
  }

  .topbar > .topbar-actions > .total-score {
    order: 8;
  }

  .stage-switcher button {
    min-height: 38px;
    padding: 8px 11px;
    font-size: .68rem;
  }

  .challenge-title {
    width: 100%;
  }

  .advisor-titles {
    width: min(100%, 520px);
  }

  .event-script {
    width: min(82vw, 310px);
  }

  .subtitle-row {
    margin-top: 6px;
    justify-content: center;
    gap: 4px;
  }

  .challenge-title h1 {
    max-width: 32rem;
    padding: 0 8px;
    font-size: .78rem;
    letter-spacing: .1em;
    line-height: 1.45;
  }

  .topbar-actions {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    justify-items: center;
    gap: 10px;
  }

  .topbar nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .topbar nav button,
  .topbar nav a {
    min-height: 44px;
    padding: 12px 10px;
  }

  .total-score {
    width: min(100%, 320px);
    min-width: 0;
    text-align: center;
  }

  .total-score strong {
    font-size: 1.75rem;
  }

  .banner-grid {
    margin-top: 16px;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .banner-column {
    width: 100%;
  }

  .war-banner {
    width: 100%;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .banner-main {
    display: contents;
  }

  .banner-heading {
    order: 1;
    width: 100%;
    min-height: 0;
    padding: 34px 18px 16px;
  }

  .banner-heading h2 {
    font-size: clamp(1.65rem, 8vw, 2rem);
  }

  .selected-roster {
    max-width: min(100%, 330px);
    font-size: .9rem;
  }

  .score-method {
    margin-top: 12px;
  }

  .score-method button {
    min-width: 112px;
    min-height: 40px;
    padding: 8px 10px;
    font-size: .72rem;
  }

  .emblem-pennant {
    order: 2;
    width: calc(100% - 24px);
    height: auto;
    margin: 0 auto;
    padding: 10px 10px 42px;
  }

  .war-banner--five .emblem-pennant {
    height: auto;
  }

  .war-banner--five .emblem-card {
    height: auto;
    min-height: 108px;
  }

  .emblem-stack {
    align-content: start;
    row-gap: 8px;
  }

  .emblem-card {
    height: auto;
    min-height: 108px;
  }

  .emblem-card--manual,
  .war-banner--five .emblem-card--manual {
    height: auto;
    min-height: 60px;
  }

  .emblem-head {
    min-height: 36px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 5px 8px 3px;
  }

  .emblem-icon,
  .emblem-icon svg {
    width: 25px;
    height: 25px;
  }

  .emblem-card select {
    height: 24px;
    font-size: .74rem;
  }

  .emblem-detail {
    min-height: 24px;
    padding: 2px 8px;
  }

  .emblem-score-detail {
    min-height: 24px;
    padding: 2px 8px;
  }

  .emblem-detail select,
  .emblem-detail output {
    font-size: .7rem;
  }

  .emblem-multiplier {
    min-width: 44px;
    font-size: 1.08rem;
  }

  .leaderboard {
    order: 3;
    width: calc(100% - 24px);
    height: min(300px, 48vh);
    min-height: 238px;
    margin: 16px auto 22px;
  }

  .ranking-row {
    min-height: 54px;
    padding: 8px 10px;
  }

  .ranking-identity strong {
    font-size: 15px;
  }

  .ranking-value {
    font-size: .92rem;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: end;
  }

  .modal {
    max-height: calc(100dvh - 24px);
    border-radius: 10px 10px 0 0;
  }

  .modal-header {
    min-height: 72px;
    padding: 14px 16px;
    gap: 12px;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }

  .modal-header button {
    min-height: 44px;
    flex: 0 0 auto;
  }

  .modal-body {
    max-height: calc(100dvh - 96px);
    padding: 16px;
  }

  .emblem-ranking-toolbar {
    top: -16px;
    margin: -16px -16px 16px;
    padding: 12px 16px 10px;
  }

  .data-grid,
  .emblem-ranking-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .emblem-ranking-role > header {
    align-items: flex-start;
  }

  .emblem-ranking-switcher {
    width: 100%;
  }

  .emblem-ranking-switcher button {
    min-width: 0;
    flex: 1 1 0;
    padding-inline: 8px;
    white-space: normal;
  }

  .data-card {
    padding: 14px;
  }

  .load-error,
  .noscript-message {
    width: calc(100% - 24px);
    margin: 32px auto;
    padding: 18px;
  }
}

@media (max-width: 380px) {
  .topbar,
  .banner-grid {
    width: calc(100% - 16px);
  }

  .topbar nav {
    gap: 2px;
  }

  .topbar nav button,
  .topbar nav a {
    padding-inline: 8px;
    font-size: .7rem;
  }

  .score-method button {
    min-width: 98px;
  }

  .emblem-pennant,
  .leaderboard {
    width: calc(100% - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

html[lang="en"] .is-uppercase-title {
  font-family: "Reaver", serif;
  font-weight: 700;
}
