:root {
  color-scheme: dark;
  --ink: #151617;
  --ash: #202123;
  --ivory: #e9dfcf;
  --ember: #d37d55;
  --line: #e9dfcf34;
  --margin: clamp(18px, 4.3vw, 84px);
  --support-size: clamp(62px, 5.5vw, 76px);
  --support-right: max(12px, calc(env(safe-area-inset-right, 0px) + 8px));
  --duration: .32s;
  background: var(--ink);
  color: var(--ivory);
  font-family: system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
:root:not(.motion-off) { scroll-behavior: smooth; }
.motion-off { --duration: 0s; }
img { display: block; }
img:not([src]) { visibility: hidden; }
.artwork { display: block; }
button { color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #f4a579; outline-offset: 4px; }
[hidden] { display: none !important; }
.content-width { width: min(calc(100% - var(--margin) * 2), 1760px); margin-inline: auto; }

.masthead {
  position: absolute;
  z-index: 5;
  inset: 0 0 auto;
  height: 77px;
  padding: 0 var(--margin);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid #e9dfcf1e;
  background: linear-gradient(#101112d9, #10111215);
}
.brand { justify-self: start; }
.brand img { width: clamp(119px, 11.15vw, 180px); height: auto; max-height: 47px; object-fit: contain; object-position: left center; }
.masthead nav { display: flex; align-items: stretch; height: 100%; gap: clamp(22px, 3.45vw, 66px); }
.masthead nav :is(a, button) { position: relative; display: grid; place-items: center; }
.masthead nav img { height: 16px; width: auto; opacity: .82; transition: opacity var(--duration); }
.masthead nav :is(:hover, [aria-current]) img { opacity: 1; }
.masthead nav [aria-current]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--ember);
  box-shadow: 0 0 14px #e7814a91;
}

.download {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--ivory);
  color: #292420;
  transition: background var(--duration);
}
.download:hover { background: #fff5e4; }
.download img { width: auto; height: 18px; }
.masthead-download { justify-self: end; min-width: 120px; min-height: 38px; padding: 0 18px; }
.masthead-download img { height: 15px; }

.hero { position: relative; min-height: max(555px, 46.5vw); display: grid; isolation: isolate; background: var(--ink); }
.hero-scenes, .hero-art, .hero-effects { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-scenes { overflow: hidden; z-index: -2; }
.hero-effects { z-index: -2; pointer-events: none; mix-blend-mode: screen; }
.effects-off .hero-effects { visibility: hidden; }
.hero-art {
  opacity: 0;
  object-fit: cover;
  object-position: right 24%;
}
.hero-art.is-active { opacity: 1; }
.hero::before, .hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero::before { background: linear-gradient(90deg, #101112d9 1%, #111213a8 24%, #11121336 49%, transparent 70%); }
.hero::after { background: linear-gradient(0deg, #151617 0%, #15161740 10%, transparent 26%, transparent 88%, #12131444); }
.hero-inner { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 112px 0 108px; }
.hero-copy { width: min(48.5%, 680px); position: relative; }
.hero-role { display: flex; align-items: center; gap: 12px; min-height: 19px; margin-bottom: 18px; }
.hero-role::before { content: ""; width: 21px; height: 1px; background: var(--ember); }
.hero-role img { height: 16px; width: auto; }
.hero h1 { margin: 0; width: 100%; }
.hero-lettering {
  --title-height: clamp(125px, 15.5vw, 238px);
  --title-ratio: 4;
  display: block;
  position: relative;
  width: min(100%, 680px, calc(var(--title-height) * var(--title-ratio)));
  aspect-ratio: var(--title-ratio);
  isolation: isolate;
}
.hero:is([data-role="warrior"], [data-role="lancer"], [data-role="archer"]) .hero-lettering {
  --title-height: clamp(163px, 17.5vw, 288px);
}
.title-ink { display: block; position: relative; }
.hero-lettering img { width: 100%; height: auto; }

@supports (mask-image: linear-gradient(black, black)) {
  .hero-lettering {
    filter: drop-shadow(0 2px 3px #170d0890);
  }
  .hero[data-role] .title-ink::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    mask: var(--title-mask, none) center / 100% 100% no-repeat;
    background: linear-gradient(112deg, transparent 38%, #ffde8229 46%, #fff9dcb8 50%, #ffe09629 54%, transparent 62%) 125% 0 / 258% 100% no-repeat;
    mix-blend-mode: screen;
    opacity: 0;
  }
  .effects-off .hero[data-role] .title-ink::after { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  :root:not(.effects-off, .motion-off) .title-ink::after { animation: title-gold-sweep 5.6s linear infinite; }
}
@keyframes title-gold-sweep {
  0% { background-position: 125% 0; opacity: 0; }
  7% { opacity: .9; }
  32%, 100% { background-position: -25% 0; opacity: 0; }
}
.hero-subtitle { margin: 21px 0 31px; }
.hero-subtitle img { width: auto; height: 19px; max-width: 100%; object-fit: contain; object-position: left; }
.hero-download { gap: 15px; padding: 0 24px; min-width: 176px; min-height: 48px; }
.hero-download i {
  width: 14px;
  height: 13px;
  border-bottom: 1px solid;
  position: relative;
}
.hero-download i::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  height: 8px;
  border-left: 1px solid;
}
.hero-download i::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border: solid;
  border-width: 0 1px 1px 0;
  left: 3.5px;
  top: 2px;
  transform: rotate(45deg);
}

.hero-controls {
  position: absolute;
  inset: auto 0 21px;
  inset-inline-end: max(0px, calc(var(--support-right) + var(--support-size) + 6px - var(--margin)));
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 18px;
}
.step { width: 44px; height: 42px; display: grid; place-items: center; border: 1px solid #e9dfcf57; transition: background var(--duration), border-color var(--duration); }
.step:hover { background: #f1e8d322; border-color: var(--ivory); }
.step i { width: 9px; height: 9px; border: solid var(--ivory); border-width: 1px 1px 0 0; rotate: 45deg; }
.step.previous i { rotate: -135deg; }
.hero-progress { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.hero-progress button { position: relative; height: 33px; }
.hero-progress button::after { content: ""; position: absolute; inset: calc(50% - 1px) 0 auto; height: 2px; background: #e9dfcf48; transition: background var(--duration); }
.hero-progress button:hover::after { background: #f4ecdd9e; }
.hero-progress button[aria-pressed="true"]::after { background: var(--ember); box-shadow: 0 0 11px #d37d5566; }

.classes { padding: 17px 0 45px; }
.section-heading { display: flex; align-items: center; gap: clamp(16px, 2vw, 32px); margin-bottom: 22px; }
.section-heading h2 { margin: 0; display: flex; align-items: center; gap: 14px; }
.section-heading h2::before { content: ""; width: 2px; height: 24px; background: var(--ember); transform: skewX(-19deg); }
.section-heading img { height: clamp(23px, 2vw, 34px); width: auto; }
.section-heading::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.class-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.class-card {
  --portrait-light: 227 161 110;
  --portrait-rim: .34;
  position: relative;
  isolation: isolate;
  display: block;
  overflow: hidden;
  text-align: left;
  background: var(--ash);
  border-bottom: 2px solid transparent;
  transition: border-color var(--duration);
}
.class-card[data-role="warrior"] { --portrait-light: 238 128 89; }
.class-card[data-role="mage"] { --portrait-light: 135 185 251; }
.class-card[data-role="taoist"] { --portrait-light: 240 190 116; }
.class-card[data-role="assassin"] { --portrait-light: 199 145 205; }
.class-card[data-role="lancer"] { --portrait-light: 159 204 235; }
.class-card[data-role="spirit"] { --portrait-light: 190 161 253; }
.class-card[data-role="archer"] { --portrait-light: 145 201 176; }
.class-card .portrait { display: block; width: 100%; height: auto; aspect-ratio: 9 / 8; object-fit: cover; background: var(--ink); }
.class-card::before, .class-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}
.class-card::before {
  background: radial-gradient(ellipse at 95% 2%, rgb(var(--portrait-light) / .27), transparent 46%);
  box-shadow: inset 0 0 0 1px rgb(var(--portrait-light) / .55);
  opacity: var(--portrait-rim);
  transition: opacity var(--duration);
}
.class-card::after {
  background: linear-gradient(111deg, transparent 32%, rgb(var(--portrait-light) / .14) 48%, rgb(255 245 224 / .20) 52%, transparent 66%);
  opacity: 0;
  transform: translateX(-100%);
}
.class-card:is(:focus-visible, :active) { --portrait-rim: .88; border-color: #e9dfcf89; }
.class-card[aria-pressed="true"] { --portrait-rim: .73; border-color: var(--ember); }
:root:not(.effects-off) .class-card[aria-pressed="true"] { border-color: rgb(var(--portrait-light) / .9); }
.card-name { position: absolute; z-index: 2; inset: auto 0 0; display: flex; align-items: end; min-height: 52px; padding: 13px clamp(8px, 1vw, 14px) 10px; background: linear-gradient(0deg, #101012eb, transparent); }
.card-name img { height: clamp(17px, 1.4vw, 24px); width: auto; filter: drop-shadow(0 1px 4px #000); }

.news { padding: 6px 0 42px; }
.news-grid { display: grid; grid-template-columns: 1.18fr 1fr; gap: 15px; }
.news-card { position: relative; isolation: isolate; overflow: hidden; height: clamp(172px, 16.8vw, 292px); width: 100%; text-align: left; background: #272729; }
.news-card::before, .news-card::after { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.news-card::before { inset: -6%; background: var(--story-atmosphere); opacity: .64; }
.news-card::after { background: linear-gradient(15deg, #101012ed 2%, #10101220 69%); }
.news-card[data-story="siege"] {
  --story-atmosphere: radial-gradient(ellipse at 70% 60%, #feac585b, transparent 32%),
    radial-gradient(ellipse at 91% 68%, #ff98614a, transparent 23%);
}
.news-card[data-story="world"] {
  --story-atmosphere: radial-gradient(ellipse at 26% 53%, #a7cdec58, transparent 51%),
    radial-gradient(ellipse at 70% 12%, #adcbef30, transparent 47%);
}
.story-art { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--duration); }
.story-label { position: absolute; inset: auto 17px clamp(15px, 1.6vw, 28px) clamp(15px, 1.8vw, 30px); display: grid; gap: 11px; }
.story-label img { height: 24px; width: auto; }
.story-label img + img { height: 14px; opacity: .94; }

.effects-off :is(.class-card, .news-card)::before,
.effects-off .class-card::after { display: none; }

@keyframes portrait-light-pass {
  0% { opacity: 0; transform: translateX(-100%); }
  27%, 71% { opacity: .74; }
  100% { opacity: 0; transform: translateX(100%); }
}

@keyframes siege-lantern-light {
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes world-mountain-mist {
  50% { opacity: .86; transform: translate(3%, -2%); }
}

@media (hover: hover) {
  .class-card:hover { --portrait-rim: .88; }
  .class-card:hover:not([aria-pressed="true"]) { border-color: #e9dfcf89; }
}

@media (prefers-reduced-motion: no-preference) {
  :root:not(.motion-off, .effects-off) .class-card:is(:focus-visible, :active)::after { animation: portrait-light-pass .8s ease-out both; }
  :root:not(.motion-off, .effects-off) .news-card:is(:focus-visible, :active) .story-art { transform: scale(1.035); }
  :root:not(.motion-off, .effects-off) .news-card[data-story="siege"]::before { animation: siege-lantern-light 8s ease-in-out infinite; }
  :root:not(.motion-off, .effects-off) .news-card[data-story="world"]::before { animation: world-mountain-mist 13s ease-in-out infinite; }

  @media (hover: hover) {
    :root:not(.motion-off, .effects-off) .class-card:hover::after { animation: portrait-light-pass .8s ease-out both; }
    :root:not(.motion-off, .effects-off) .news-card:hover .story-art { transform: scale(1.035); }
  }
}

.site-footer { padding: 26px var(--margin) 33px; display: flex; justify-content: center; border-top: 1px solid var(--line); }
.site-footer img { width: auto; height: 23px; opacity: .66; }

.support-float {
  position: fixed;
  z-index: 6;
  inset-inline-end: var(--support-right);
  inset-block-end: max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  inline-size: var(--support-size);
  block-size: calc(var(--support-size) + 8px);
  border: 1px solid #c8a675a6;
  border-radius: 3px;
  background: linear-gradient(150deg, #302921, #191819 80%);
  box-shadow: 0 5px 20px #0009, inset 0 0 0 1px #e9d0a815;
  color: #e7bf88;
  transition: border-color var(--duration), box-shadow var(--duration);
}
.support-float:focus-visible { border-color: var(--ivory); }
.support-label { inline-size: calc(var(--support-size) - 14px); block-size: auto; }
.support-icon { position: relative; inline-size: 22px; block-size: 22px; margin-block: 4px; scale: 1.38; }
.support-icon::before, .support-icon::after, .support-icon i, .support-icon i::after {
  content: "";
  position: absolute;
}
.support-icon::before {
  inset: 1px 3px 7px;
  border: 1.5px solid currentColor;
  border-block-end: 0;
  border-radius: 11px 11px 0 0;
}
.support-icon::after {
  inset: 10px auto auto 1px;
  width: 4px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 16px 0 currentColor;
}
.support-icon i {
  inset: auto 3px 1px auto;
  width: 8px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  border-bottom-right-radius: 5px;
}
.support-icon i::after {
  width: 4px;
  height: 2px;
  bottom: -1.75px;
  left: -1px;
  border-radius: 2px;
  background: currentColor;
}
@media (hover: hover) {
  .support-float:hover {
    border-color: #efcc9a;
    box-shadow: 0 5px 20px #0009, inset 0 0 14px #e7b77d24;
  }
}

dialog { width: min(560px, calc(100vw - 36px)); position: fixed; padding: 36px; border: 1px solid var(--line); background: #1d1f21; color: var(--ivory); }
dialog::backdrop { background: #08090bc9; }
dialog h2 { margin: 3px 38px 22px 0; }
dialog h2 img { height: 28px; width: auto; max-width: 100%; object-fit: contain; object-position: left; }
dialog p { margin: 0 0 29px; }
dialog p img { height: 16px; width: auto; max-width: 100%; object-fit: contain; object-position: left; }
.close { position: absolute; width: 36px; height: 36px; right: 16px; top: 14px; }
.close::before, .close::after { position: absolute; content: ""; top: 50%; left: 25%; width: 50%; height: 1px; background: currentColor; rotate: 45deg; }
.close::after { rotate: -45deg; }
.site-notice {
  width: min(500px, calc(100vw - 34px));
  max-height: calc(100dvh - 36px);
  padding: clamp(24px, 4.6vw, 34px);
  border-color: #ba986880;
  background: radial-gradient(ellipse at 12% 0%, #332920, #211e1c 55%, #19191a);
  box-shadow: 0 20px 70px #0009, inset 0 0 0 1px #e9d0a818;
}
.site-notice .close { width: 44px; height: 44px; top: 12px; right: 12px; color: var(--ivory); }
.site-notice h2 { display: flex; align-items: center; gap: 13px; margin: 1px 37px 19px 0; }
.site-notice h2::before {
  content: "";
  flex: 0 0 2px;
  height: 23px;
  background: var(--ember);
  transform: skewX(-19deg);
}
.site-notice h2 img { max-width: calc(100% - 15px); height: 28px; }
.notice-body { padding-top: 20px; border-top: 1px solid #cda87c42; }
.notice-body p { margin: 0 0 16px; }
.notice-body p:last-child { margin-bottom: 0; }
.notice-body p img { height: 17px; }
.notice-schedule { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 7px; }
.notice-schedule img.notice-date { height: 23px; }
.notice-body .notice-note img { height: 66px; }
.notice-body .notice-contact img { height: 16px; }
.notice-body .notice-contact { padding-top: 14px; border-top: 1px solid #cda87c26; }
.dialog-art { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
#news-dialog { width: min(820px, calc(100vw - 36px)); }
.settings-toggle { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 57px; margin-bottom: 19px; border-block: 1px solid var(--line); cursor: pointer; }
.settings-toggle img, .settings-button img { height: 17px; width: auto; }
.settings-toggle input { position: absolute; right: 0; width: 45px; height: 34px; margin: 0; opacity: 0; cursor: pointer; }
.settings-toggle i { width: 43px; height: 24px; border: 1px solid #bba48c; background: var(--ink); border-radius: 99px; display: flex; align-items: center; padding: 3px; pointer-events: none; }
.settings-toggle i::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--ivory); transition: translate var(--duration); }
.settings-toggle input:checked + i { background: #86543f; }
.settings-toggle input:checked + i::after { translate: 19px 0; }
.settings-toggle input:focus-visible + i { outline: 2px solid #f4a579; outline-offset: 4px; }
.settings-button { display: grid; place-items: center; min-height: 43px; padding: 0 13px; border: 1px solid #bba48c; }
.settings-button:hover, .close:hover { background: #f1e8d322; }
#download-dialog { padding-block: 45px; }
#download-dialog h2 { margin-bottom: 0; }

@media (max-width: 850px) {
  .masthead { gap: 21px; height: 67px; }
  .masthead nav { gap: 14px; }
  .masthead nav img { height: 14px; }
  .masthead-download { min-width: auto; padding-inline: 13px; }
  .hero {
    --hero-header: 67px;
    --hero-art-height: clamp(255px, 95vw, 450px);
    min-height: 0;
    background: var(--ink);
  }
  .hero-scenes, .hero-effects { top: var(--hero-header); bottom: auto; height: var(--hero-art-height); }
  .hero-art { object-position: right center; }
  .hero::before { display: none; }
  .hero::after {
    inset: var(--hero-header) 0 auto;
    height: var(--hero-art-height);
    background: linear-gradient(0deg, var(--ink), transparent 7%);
  }
  .hero-inner { padding: calc(var(--hero-header) + var(--hero-art-height) + 8px) 0 79px; }
  .hero-copy { width: min(100%, 510px); }
  .hero h1 { min-height: clamp(104px, 29vw, 144px); display: flex; align-items: center; }
  .hero:is([data-role="warrior"], [data-role="lancer"], [data-role="archer"]) .hero-lettering { --title-height: clamp(104px, 29vw, 144px); }
  .class-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
}

@media (max-width: 580px) {
  .masthead { height: auto; min-height: 96px; grid-template-columns: 1fr 1fr; row-gap: 1px; padding-top: 11px; }
  .brand { grid-column: 1; grid-row: 1; }
  .masthead-download { grid-column: 2; grid-row: 1; min-height: 35px; }
  .masthead nav { grid-column: 1 / -1; grid-row: 2; height: 40px; justify-content: space-between; gap: 0; }
  .masthead nav :is(a, button) { padding-inline: 2px; }
  .masthead nav img { height: clamp(12px, 4vw, 15px); }
  .hero { --hero-header: 96px; }
  .hero-role { margin-bottom: 14px; }
  .hero-lettering { --title-height: clamp(82px, 26vw, 122px); max-width: 445px; }
  .hero-subtitle { margin: 16px 0 20px; }
  .hero-subtitle img { height: 15px; }
  .hero-download { min-width: 148px; min-height: 43px; }
  .hero-download img { height: 16px; }
  .hero-controls { inset-block-end: 14px; gap: 12px; }
  .class-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .class-card .portrait { aspect-ratio: 4 / 3; }
  .card-name { min-height: 35px; padding-block: 9px 6px; }
  .card-name img { height: 16px; }
  .classes { padding-bottom: 32px; }
  .news-grid { grid-template-columns: 1fr; gap: 8px; }
  .news-card { height: auto; aspect-ratio: 2.25; }
  .story-label img { height: 21px; }
  .story-label img + img { height: 13px; }
  dialog { padding: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration: 0s; scroll-behavior: auto !important; }
}
