:root {
  color-scheme: dark;
  --page: #0c1018;
  --surface: #141b26;
  --ink: #f8f3e9;
  --muted: #b6bac6;
  --gold: #f1cf89;
  --line: #3b3340;
  --red-action: #7c2633;
  --red-action-deep: #4e1722;
  --red-action-border: #ad5662;
  --red-action-ink: #fff3f0;
  --heading: Georgia, 'Times New Roman', serif;
  font: 16px/1.55 'Segoe UI', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
body[data-view="home"] :is(#account-view, #register-form),
body:not([data-view="home"]) #home-view,
body[data-view="register"] #login-form,
body[data-view="login"] #register-form { display: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled, fieldset:disabled button { cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid #ffe1a5;
  outline-offset: 4px;
}
p { margin: 0; color: var(--muted); }
h1, h2, h3 { margin: 0; line-height: 1.1; }
h1, h2 { font-family: var(--heading); font-weight: 600; }
h2 { font-size: clamp(1.9rem, 3vw, 2.65rem); }
h3 { font-size: 1.15rem; }
.wrap { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 5; padding: .75rem; background: var(--page); }
.skip-link:focus { top: 1rem; }
[id] { scroll-margin-top: 95px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse at 56% 100%, #2a2d3a, transparent 69%),
    linear-gradient(105deg, #14151e, #181b25 50%, #2a1922);
}
body[data-view="home"] .site-header {
  background: #11131b1a;
  transition: background-color 180ms ease-out;
}
body[data-view="home"] .site-header.is-scrolled {
  background-color: #12151cba;
  backdrop-filter: blur(8px);
}
.header-inner {
  width: min(1440px, calc(100% - 64px));
  margin-inline: auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.header-logo { display: block; flex: 0 0 auto; }
.header-logo img {
  display: block;
  width: clamp(116px, 14vw, 145px);
  height: auto;
  filter: var(--logo-glow, none);
  transition: filter 180ms ease-out;
}
.header-logo:focus-visible {
  --logo-glow: drop-shadow(0 0 4px #ffc265a6) drop-shadow(0 0 9px #e1983d82);
}
@media (hover: hover) {
  .header-logo:hover {
    --logo-glow: drop-shadow(0 0 4px #ffc265a6) drop-shadow(0 0 9px #e1983d82);
  }
}
@media (prefers-reduced-motion: reduce) {
  .header-logo img { transition: none; }
  body[data-view="home"] .site-header { transition: none; }
}
.main-nav, .header-actions { display: flex; align-items: center; gap: clamp(.8rem, 2vw, 1.75rem); }
.main-nav a, .header-actions a { font-size: .88rem; font-weight: 600; white-space: nowrap; }
.main-nav a, .header-actions > a:first-child { color: #e2dcd2; text-shadow: 0 1px 3px #000b; }
.main-nav a:hover, .header-actions > a:first-child:hover { color: #ffc0c4; }
.header-actions { gap: 1rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: .8rem 1.35rem;
  min-height: 46px;
  border: 1px solid #676674;
  border-radius: 5px;
  font-weight: 750;
  text-align: center;
}
.header-actions .button { min-height: 39px; padding: .52rem .86rem; }
.button-primary,
.event-filters button[aria-pressed="true"] {
  background: linear-gradient(var(--red-action), var(--red-action-deep));
  border-color: var(--red-action-border);
  color: var(--red-action-ink);
}
.button-primary:hover { background: linear-gradient(#913142, #641c2b); }
.button-dark { background: #171a25e8; color: #f5e8e5; }
.button-dark:hover { background: #262938; }

.hero {
  --hero-height: clamp(580px, 56.28vw, 1080px);
  --hero-actions-inset: clamp(2.5rem, 8.15vw, 8rem);
  --hero-viewport-offset: 6.5rem;
  --hero-art-bleed: 180px;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: end center;
  min-height: var(--hero-height);
  background: #1d2a40;
}
.hero-art {
  position: absolute;
  z-index: -2;
  inset: calc(-1 * var(--hero-art-bleed)) 0 0;
  overflow: hidden;
  container-type: size;
}
.hero-scene {
  /* Preserve sky above the characters after the hero reaches its height limit. */
  --scene-bottom: min(0px, calc(100cqh - var(--hero-art-bleed) - 56.25cqw));
  position: absolute;
  bottom: var(--scene-bottom);
  left: 50%;
  width: max(100%, calc(100cqh * 4 / 3));
  transform: translateX(-50%);
}
.hero-backdrop { display: block; width: 100%; height: auto; }
.hero-logo {
  position: absolute;
  top: max(26.6%, calc(100% - 100cqh + var(--hero-art-bleed) + 12px + var(--scene-bottom)));
  left: 50%;
  width: 21%;
  height: auto;
  transform: translateX(-50%);
}
.hero-griffin {
  position: absolute;
  z-index: -2;
  top: clamp(16px, 2.2vw, 42px);
  left: max(12px, calc(50% - max(190px, 22vw)));
  width: clamp(100px, 11vw, 210px);
  height: auto;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-rain {
    position: absolute;
    z-index: -2;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    mask-image: linear-gradient(transparent, #000 9%, #000 58%, transparent 94%);
  }
  .hero-rain::before, .hero-rain::after {
    content: '';
    position: absolute;
    inset: -256px -180px 0;
    animation: hero-rain-fall var(--rain-duration) linear infinite;
  }
  .hero-rain::before {
    --rain-step: 256px;
    --rain-duration: 930ms;
    background-size: 274px var(--rain-step);
    background-image:
      radial-gradient(ellipse .65px 12px at 24px 62px, #bed4f45e, transparent),
      radial-gradient(ellipse .65px 9px at 66px 160px, #c2dcfc47, transparent),
      radial-gradient(ellipse .65px 13px at 116px 110px, #d5e7ff59, transparent),
      radial-gradient(ellipse .7px 10px at 153px 218px, #b9d2ff55, transparent),
      radial-gradient(ellipse .65px 11px at 189px 25px, #d5e7ff4d, transparent),
      radial-gradient(ellipse .7px 8px at 247px 177px, #bed4f453, transparent);
  }
  .hero-rain::after {
    --rain-step: 208px;
    --rain-duration: 475ms;
    background-size: 323px var(--rain-step);
    background-image:
      radial-gradient(ellipse .8px 18px at 50px 29px, #dbeaff73, transparent),
      radial-gradient(ellipse .8px 22px at 101px 178px, #dbeaff70, transparent),
      radial-gradient(ellipse .9px 15px at 177px 83px, #cedfff73, transparent),
      radial-gradient(ellipse .8px 19px at 222px 156px, #e4efff63, transparent),
      radial-gradient(ellipse .9px 20px at 299px 45px, #dbeaff6b, transparent);
  }
  @keyframes hero-rain-fall {
    from { transform: skewX(-17deg) translateY(0); }
    to { transform: skewX(-17deg) translateY(var(--rain-step)); }
  }
}
.hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, transparent 46%, #0c101816 62%, #0c10189c 87%, var(--page));
}
.hero-content {
  padding: 2rem 1rem max(var(--hero-actions-inset), calc(var(--hero-height) + var(--hero-viewport-offset) - 100svh));
  text-align: center;
}
.hero h1 {
  margin: .45rem 0 1.3rem;
  color: #ffdc91;
  font: 700 clamp(2.45rem, 5.65vw, 5.35rem)/1.04 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  letter-spacing: -.028em;
  text-shadow: 0 2px 2px #170905, 0 0 .18em #20100d;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero h1 {
    background-image: linear-gradient(180deg, #fff8dc 14%, #ffdf99 42%, #e5a749 51%, #ffe0a0 66%, #df9f4d 94%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: .012em #673619;
    text-shadow: none;
    filter: drop-shadow(0 2px 1px #170905) drop-shadow(0 0 .09em #160a08) drop-shadow(0 0 .16em #a02b26b3);
  }
}
@media (forced-colors: active) {
  .hero h1 {
    background: none;
    color: CanvasText;
    -webkit-text-stroke: 0;
    text-shadow: none;
    filter: none;
  }
}
.hero-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.hero-actions .button { min-width: 160px; }

.home-content { padding-bottom: 4rem; }
.intro { padding: clamp(1.6rem, 4vw, 3.5rem) 0 2.5rem; max-width: 44rem; }
.section-kicker, .class-role { font-size: .73rem; line-height: 1.3; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.intro h2 { margin: .55rem 0 .65rem; }
.section { margin: 0 0 3.25rem; }
.section > h2 { margin-bottom: 1rem; }
.class-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.class-card {
  min-height: 170px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-top: 2px solid var(--class-accent);
  border-radius: 6px;
  background: radial-gradient(ellipse at 12% 0, var(--class-glow), transparent 72%), var(--surface);
}
.class-card h3 { font: 600 1.65rem/1.2 var(--heading); margin: .4rem 0 .5rem; }
.warrior { --class-accent: #b08057; --class-glow: #6f3c3640; }
.mage { --class-accent: #8d86c6; --class-glow: #443b7e5e; }
.archer { --class-accent: #67939d; --class-glow: #375f8552; }
.ranking {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-block: 1px solid var(--line);
}
.ranking h2 { margin: 0 0 .5rem; }
.ranking table { width: 100%; border-collapse: collapse; }
.ranking :is(th, td) { text-align: left; padding: .42rem .6rem; border-bottom: 1px solid #303746; }
.ranking th { color: var(--gold); font-size: .85rem; font-weight: 650; }
.ranking td { overflow-wrap: anywhere; }
.ranking tr:first-child td:first-child { color: #ffe0a0; font-weight: 700; }
.info-panel { padding: 1.55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.info-panel h2 { margin-bottom: 1rem; }
.info-panel h3 { margin-bottom: .45rem; }
.events-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .8rem 1.25rem; }
.event-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.event-filters button { padding: .42rem .95rem; border: 1px solid #495161; border-radius: 20px; background: var(--surface); color: var(--ink); }
.event-filters button:hover { border-color: var(--red-action-border); }
.event-filters button[aria-pressed="true"] { font-weight: 650; }
.event-group { margin-top: 1.85rem; }
.event-group > h3 { margin-bottom: .85rem; font: 600 clamp(1.3rem, 3vw, 1.8rem)/1.15 var(--heading); }
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 1rem; }
.event-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.event-card img { display: block; width: 100%; height: auto; aspect-ratio: 2; object-fit: cover; background: #1d2a3b; }
.event-card > div { flex: 1; padding: 1rem 1.15rem 1.2rem; border-top: 1px solid #55473e; }
.event-card h4 { margin: 0 0 .35rem; color: var(--gold); font: 600 1.23rem/1.24 var(--heading); }
.event-card p { font-size: .9rem; }
.guide-start { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.5rem; padding: 1rem 0; margin-bottom: 1rem; border-block: 1px solid var(--line); }
.guide-start p { flex: 1 1 28rem; }
.guide-panel { padding: clamp(1rem, 2.5vw, 1.6rem); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.guide-panel + .guide-panel { margin-top: 1rem; }
.guide-panel h3 { font: 600 clamp(1.25rem, 3vw, 1.65rem)/1.25 var(--heading); }
.level-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1rem; margin: 1rem 0; }
.level-list > div { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr); align-items: baseline; gap: .6rem; padding: .5rem .75rem; background: #0d131e; border-radius: 4px; }
.level-list dt { color: var(--gold); font-weight: 650; white-space: nowrap; }
.level-list dd { margin: 0; }
.guide-details { padding-inline-start: 1.2rem; margin: .85rem 0 0; color: var(--muted); }
.guide-details li + li { margin-top: .65rem; }
.guide-details strong { color: var(--ink); }
.guide-beta-note { margin-top: .5rem; padding: .55rem .7rem; border-inline-start: 2px solid #a4804a; background: #211e22; font-size: .91rem; }
.guide-beta-note strong { color: var(--gold); }
.text-link { display: inline-flex; align-items: center; gap: .5rem; color: var(--gold); font-weight: 650; }
.text-link:hover { text-decoration: underline; text-underline-offset: .22em; }
button.text-link { background: none; border: 0; padding: 0; }

.account-view {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  min-height: calc(100svh - 149px);
  padding: clamp(1.75rem, 6svh, 4rem) 0;
  overflow: hidden;
  background: #101521;
}
.account-art {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 70%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.account-view::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #10152112 12%, #10152128 38%, #101521d9 62%, #101521 70%),
    linear-gradient(0deg, #101521 0%, #10152100 35%);
}
.account-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 445px);
  grid-template-areas: 'brand intro' 'brand card';
  gap: 1rem clamp(1rem, 7vw, 6rem);
  align-items: start;
}
.account-intro { grid-area: intro; text-shadow: 0 2px 15px #070910; }
.account-intro h1 { font-size: clamp(2.5rem, 4.25vw, 3.65rem); margin: .4rem 0 .25rem; }
.account-intro p { color: #e7d5bc; }
.account-brand {
  position: absolute;
  grid-area: brand;
  top: min(max(7rem, calc(100svh - 19rem)), calc(100% - 3.75rem));
  left: 50%;
  width: min(100%, clamp(180px, 26vw, 345px));
  height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 12px #03040ad9);
}
.account-card { grid-area: card; background: #111722; border: 1px solid #94784e; border-radius: 8px; padding: clamp(1.25rem, 3vw, 2rem); box-shadow: 0 20px 70px #0006; }
.account-nav { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 1rem; border-bottom: 1px solid #4b4243; }
.account-nav a { display: block; padding: 0 .25rem .75rem; text-align: center; font-weight: 650; }
.account-nav a[aria-current="page"] { border-bottom: 2px solid #dfa956; color: #f8d99a; }
.status-note { padding: .8rem .9rem; margin: 0 0 1rem; background: #302719; border: 1px solid #685337; border-radius: 5px; color: #f0d7a7; font-size: .88rem; }
.status-note a { display: block; margin-top: .35rem; text-decoration: underline; text-underline-offset: .18em; }
.account-card form { display: grid; gap: .75rem; }
.account-card form + form { margin-top: .5rem; }
.account-card fieldset { display: grid; gap: .65rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.account-card label, .account-card summary { color: #e6ddce; font-size: .9rem; }
.account-card input:not([type="checkbox"]) { width: 100%; min-height: 43px; padding: .5rem .7rem; background: #0b101a; color: var(--ink); border: 1px solid #565263; border-radius: 4px; }
.account-card input:disabled { opacity: .57; }
.password-field { position: relative; }
.password-field input:not([type="checkbox"]) { padding-right: 5rem; }
.show-password { position: absolute; right: .38rem; top: .35rem; height: calc(100% - .7rem); border: 0; border-radius: 3px; padding: 0 .45rem; background: #283041; color: #f4dec0; font-size: .78rem; }
.show-password:disabled { opacity: .5; }
.form-row { display: flex; align-items: center; gap: .5rem; justify-content: space-between; flex-wrap: wrap; margin: .1rem 0; }
.check { display: inline-flex; align-items: center; gap: .35rem; }
.check input { accent-color: #e5bb74; margin: 0; }
.form-row .text-link, .back-login { font-size: .85rem; }
.account-card details p, .hint { font-size: .82rem; margin: .35rem 0; }
.account-card details label { display: block; margin: .5rem 0 .25rem; }
.account-card .full { width: 100%; }
.account-card .button:disabled { opacity: .55; }
#member > p { margin: .6rem 0 1rem; }
#logout { margin-top: .7rem; }
#account-message { margin-top: .8rem; font-size: .86rem; color: #badebd; }
#account-message.error { color: #ffb7ad; }
.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #11141e, #0b0e15 9rem);
}
.footer-content {
  --footer-gap: clamp(1.25rem, 3vw, 3rem);
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 3.3fr);
  gap: 1.75rem var(--footer-gap);
  padding: clamp(2.25rem, 5vw, 3.65rem) 0 2rem;
}
.footer-description { max-width: 18rem; color: #d7ccbb; line-height: 1.65; }
.footer-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem var(--footer-gap);
}
.footer-group h2 {
  margin-bottom: .75rem;
  color: var(--gold);
  font: 700 .825rem/1.4 'Segoe UI', Arial, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.footer-group ul { margin: 0; padding: 0; list-style: none; }
.footer-group li { color: #d6d8e0; font-size: .9rem; }
.footer-group li + li { margin-top: .5rem; }
.footer-group [aria-disabled="true"] { color: #9198a7; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: .22em; }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  border-top: 1px solid #2b2934;
  padding: 1rem 0 1.25rem;
  color: #b4b8c6;
  font-size: .875rem;
}
.footer-legal p { color: inherit; }
.footer-legal a { color: var(--gold); }

.policy-page { display: flex; flex-direction: column; min-height: 100svh; }
.policy-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.policy-content { flex: 1; max-width: 50rem; padding-block: clamp(2.25rem, 7vw, 5rem); }
.policy-content h1 { margin-bottom: 1.5rem; font-size: clamp(2.25rem, 5vw, 3.75rem); }
.policy-content p { color: #d6d8e0; line-height: 1.75; overflow-wrap: anywhere; }
.policy-content p + p { margin-top: 1rem; }
.policy-content section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.policy-content h2 { margin-bottom: .65rem; font-size: clamp(1.5rem, 3.5vw, 2rem); }
.policy-page .footer-legal { border-top: 0; }

@media (max-width: 930px) {
  .header-inner { flex-wrap: wrap; padding: .9rem 0 .6rem; gap: .65rem; }
  .main-nav { order: 3; width: 100%; justify-content: space-between; gap: 1rem; overflow-x: auto; padding: .3rem 1px .4rem; }
  .main-nav a { padding: .13rem 2px; }
  [id] { scroll-margin-top: 126px; }
  .footer-content { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 741px) and (max-height: 800px) {
  .account-view, .account-card { padding-block: 1.5rem; }
}

@media (max-width: 740px) {
  .account-view { align-content: start; padding: 0 0 2rem; }
  .account-art { width: 100%; height: clamp(275px, 75vw, 420px); }
  .account-view::after {
    background: linear-gradient(180deg, #1015210a, #10152132 clamp(115px, 28vw, 210px), #101521 clamp(270px, 74vw, 415px));
  }
  .account-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'brand' 'intro' 'card';
    grid-template-rows: clamp(176px, 54vw, 300px) auto auto;
    gap: .8rem;
    max-width: 500px;
  }
  .account-brand {
    position: static;
    align-self: end;
    justify-self: center;
    width: clamp(155px, 48vw, 235px);
    transform: none;
  }
  .account-intro h1 { font-size: clamp(2.15rem, 7vw, 3rem); }
}

@media (max-width: 660px) {
  .wrap, .header-inner { width: calc(100% - 36px); }
  .header-actions { gap: .6rem; }
  .header-actions a { font-size: .78rem; }
  .main-nav { flex-wrap: wrap; justify-content: flex-start; gap: .33rem .85rem; padding-block: .3rem .4rem; overflow: visible; }
  .main-nav a { font-size: .8rem; }
  [id] { scroll-margin-top: 170px; }
  .header-logo img { width: clamp(104px, 33vw, 126px); }
  .hero {
    --hero-height: clamp(510px, 132vw, 655px);
    --hero-actions-inset: clamp(2rem, 6vw, 3rem);
    --hero-viewport-offset: 11rem;
  }
  .hero-griffin {
    top: clamp(63px, 17vw, 87px);
    left: auto;
    right: max(8px, calc(50% - 200px));
    width: clamp(68px, 21vw, 100px);
  }
  .hero-actions .button { min-width: 0; padding-inline: .8rem; }
  .class-grid, .ranking, .level-list { grid-template-columns: minmax(0, 1fr); }
  .class-card { min-height: auto; }
  .ranking { gap: .85rem; }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
