@import url('./theme.css');

/* ---- base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
[hidden] { display: none !important; }
.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; }
.skip { position: fixed; top: -80px; left: 20px; z-index: 50; padding: 12px 16px; background: var(--gold); color: var(--ink); font-weight: 700; }
.skip:focus { top: 14px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: -1.2px; margin: 0; }
h1 em, h2 em { color: var(--gold); font-weight: 400; }
h2 { font-size: clamp(34px, 3.4vw, 49px); }
.eyebrow { display: flex; align-items: center; gap: 13px; margin: 0 0 20px; font-size: 10px; letter-spacing: 2.5px; color: var(--gold); font-weight: 700; }
.eyebrow span { width: 30px; height: 1px; background: var(--gold); }
.empty { color: var(--muted); font-size: 13px; }

/* ---- buttons ------------------------------------------------------------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 16px 26px; border: 1px solid #bca37188; background: none;
  color: var(--paper); font-size: 13px; font-weight: 700; letter-spacing: .5px; transition: background .2s, transform .2s, border-color .2s; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--gold); border-color: var(--gold); color: #172128; box-shadow: inset 0 0 0 3px #cbb788; }
.button.primary:hover { background: var(--gold-strong); }
.button.outline:hover { background: #c8af7715; border-color: var(--gold); }
.button.small { padding: 10px 16px; gap: 8px; }
.text-link { border: 0; padding: 0; background: none; color: var(--gold); font-size: 12px; letter-spacing: .4px; text-decoration: underline transparent; text-underline-offset: 4px; transition: text-decoration-color .2s; }
.text-link:hover { text-decoration-color: currentColor; }

/* ---- header -------------------------------------------------------------- */
.header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; height: 76px; padding: 0 6%;
  background: #101c22eb; border-bottom: 1px solid #c8af7726; backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; font: 18px var(--serif); letter-spacing: 2.5px; }
.brand strong { color: var(--gold); font-weight: 400; }
.brand-mark { font-size: 38px; line-height: 1; color: var(--gold); }
.site-nav { display: flex; gap: 30px; margin-left: auto; font-size: 13px; letter-spacing: 1px; color: #d8dbd7; }
.site-nav a { padding: 6px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--gold); border-color: var(--gold); }
.menu-toggle { display: none; width: 44px; height: 44px; margin-left: auto; border: 1px solid var(--line-strong); background: none; color: var(--paper); }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 20px; height: 2px; margin: 0 auto; background: currentColor; transition: transform .2s; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

/* ---- hero ----------------------------------------------------------------- */
.hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 700px; padding: 56px var(--gutter) 72px; overflow: hidden; }
.hero-art { position: absolute; inset: 0; z-index: -2; background: url('/assets/login_background.png') 70% 45% / cover no-repeat; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #101c22 0%, #101c22ed 26%, #101c2280 52%, #101c2210 100%), linear-gradient(0deg, #101c22, #101c2200 32%); }
.hero-content { max-width: 600px; }
.hero-logo { width: min(420px, 82vw); margin: 0 0 18px -10px; }
/* The original logo has dark lettering: a light glow that follows its outline
   keeps it readable over the dark side of the art. */
.hero-logo img { display: block; width: 100%; height: auto;
  filter: drop-shadow(0 0 1px #f4ecdbe6) drop-shadow(0 0 2px #f4ecdbb3) drop-shadow(0 0 10px #f4ecdb59) drop-shadow(0 8px 20px #0007); }
.hero h1 { font-size: clamp(44px, 5.4vw, 78px); max-width: 560px; }
.hero-text { max-width: 430px; margin: 24px 0 30px; color: #c3cbca; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.server-line { display: flex; align-items: center; gap: 9px; margin: 30px 0 0; font-size: 12px; color: #bac5be; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #a3a8a8; flex: none; }
.status-dot.online { background: #91c79b; box-shadow: 0 0 10px #91c79b70; }
.status-dot.offline { background: var(--danger); }
.hero-caption { position: absolute; right: 7%; bottom: 56px; display: flex; flex-direction: column; gap: 5px; padding-left: 22px; border-left: 1px solid var(--gold);
  text-shadow: 0 1px 10px #000; }
.hero-caption span { font-size: 10px; letter-spacing: 2px; color: var(--gold); }
.hero-caption strong { font: 400 22px var(--serif); }
.hero-caption small { font-size: 11px; color: #c6cec8; }

/* ---- sections -------------------------------------------------------------- */
.section { padding: 88px var(--gutter); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 44px; }
.section-heading > p, .ranking-intro > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* news */
.news { background: linear-gradient(180deg, var(--ink), var(--ink-2)); }
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.news-card { display: flex; flex-direction: column; gap: 12px; padding: 26px; border: 1px solid var(--line); background: #0e1a20; }
.news-card.pinned { border-color: #d7bc7f66; box-shadow: inset 3px 0 0 var(--gold); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.badge { display: inline-block; padding: 3px 8px; border: 1px solid currentColor; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; }
.badge.news { color: var(--gold); }
.badge.notice { color: var(--rose); }
.badge.event { color: var(--mint); }
.badge.update { color: #a9c3e6; }
.news-card h3 { font-size: 24px; letter-spacing: -.4px; }
.news-body { margin: 0; color: #c7cec9; font-size: 14px; white-space: pre-line; }
.news-card details summary { cursor: pointer; color: var(--gold); font-size: 12px; }

/* classes */
.class-tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.class-tabs button { flex: 1 0 auto; min-width: 100px; padding: 18px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: #96a3a5;
  font-size: 12px; letter-spacing: 1px; }
.class-tabs button[aria-selected="true"] { color: var(--gold); border-color: var(--gold); background: linear-gradient(0deg, #d7b8710e, transparent); }
.class-detail { display: flex; align-items: center; gap: 48px; min-height: 290px; padding: 34px 30px; }
.class-symbol { display: grid; place-items: center; min-width: 220px; height: 230px; background: radial-gradient(ellipse, #85b6a21a, transparent 65%); }
.class-symbol img { object-fit: contain; filter: drop-shadow(0 0 22px #d5af6940); }
.class-text { flex: 1; }
.class-detail h3 { font-size: 38px; margin-bottom: 14px; }
.class-detail .eyebrow { margin-bottom: 10px; }
.class-detail p:not(.eyebrow) { font-size: 14px; color: var(--muted); }
.class-detail > .button { white-space: nowrap; }
.class-stats { display: flex; flex-wrap: wrap; gap: 28px; color: #d0d4cf; font-size: 12px; }
.class-stats span { display: flex; flex-direction: column; }
.class-stats b { color: var(--gold); font-size: 20px; font-weight: 400; font-family: var(--serif); }

/* world */
.world { background: var(--ink-2); border-block: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chips button { padding: 8px 14px; border: 1px solid var(--line-strong); background: none; color: #c9d0cc; font-size: 12px; letter-spacing: .4px; }
.chips button[aria-pressed="true"] { border-color: var(--gold); color: var(--ink); background: var(--gold); }
.map-count { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.map-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.map-card { margin: 0; overflow: hidden; border: 1px solid #d2ba8628; background: #101b21; }
.map-card img { display: block; width: 100%; aspect-ratio: 1.2; object-fit: cover; filter: saturate(.7); transition: transform .4s, filter .4s; }
.map-card:hover img { transform: scale(1.035); filter: saturate(1); }
.map-card figcaption { padding: 18px 20px; }
.map-card small { font-size: 9px; letter-spacing: 2px; color: var(--gold); }
.map-card h3 { margin-top: 8px; font-size: 22px; letter-spacing: -.4px; }
.more-row { display: flex; justify-content: center; margin-top: 30px; }

/* ranking */
.ranking { display: grid; grid-template-columns: 1fr 1.2fr; gap: 75px; align-items: start; }
.ranking-intro h2 { margin-bottom: 20px; }
.ranking .text-link { margin-top: 16px; }
.table-head { display: flex; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: 1.5px; color: var(--gold); }
.ranking-board ol { list-style: none; margin: 0; padding: 0; }
.ranking-board li { display: flex; align-items: center; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.rank-position { width: 36px; font: 22px var(--serif); color: #8a9593; }
.ranking-board li:nth-child(-n+3) .rank-position { color: var(--gold); }
.rank-icon { width: 34px; height: 34px; object-fit: contain; }
.rank-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rank-name small { display: block; font-size: 11px; color: var(--muted); }
.rank-level { font: 22px var(--serif); color: var(--gold); }
#ranking-empty { padding: 22px 0; color: var(--muted); font-size: 13px; }

/* downloads */
.release-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.release-list article { display: flex; flex-direction: column; gap: 12px; padding: 24px 0; border-top: 1px solid var(--line); }
.release-list h3 { font-size: 28px; }
.release-list p { margin: 0; min-height: 40px; color: var(--muted); font-size: 12px; }
.release-list .button { align-self: flex-start; padding: 12px 16px; font-size: 12px; }
.release-list .unavailable { color: #7f8c8b; font-size: 12px; }

/* status */
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 0; }
.status-grid > div { padding: 24px; border: 1px solid var(--line); background: #0e1a20; }
.status-grid dt { font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); }
.status-grid dd { margin: 10px 0 0; font: 30px var(--serif); overflow-wrap: anywhere; }
.status-grid dd.online { color: var(--mint); }
.status-grid dd.offline { color: var(--danger); }

/* banner and footer */
.journey-banner { padding: 75px 20px 90px; text-align: center; border-top: 1px solid var(--line); background: radial-gradient(ellipse at 50% 100%, #41564b4d, transparent 65%); }
.journey-banner .eyebrow { justify-content: center; }
.journey-banner h2 { font-size: clamp(36px, 4.6vw, 54px); }
.journey-banner .button { margin-top: 28px; }
.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 30px; padding: 30px 6%; border-top: 1px solid var(--line); color: #a4aeaa; }
.footer p { margin: 0; font-size: 11px; }
.footer nav { display: flex; gap: 22px; font-size: 12px; }
.footer a:hover { color: var(--gold); }

/* ---- account dialog --------------------------------------------------------- */
dialog { width: min(540px, calc(100vw - 28px)); max-height: 92vh; padding: 44px; border: 1px solid var(--line-strong); background: #16252c; color: var(--paper);
  box-shadow: 0 30px 160px #0009; }
dialog::backdrop { background: #050e15c7; backdrop-filter: blur(8px); }
dialog h2 { font-size: 36px; margin-bottom: 24px; }
.close-button { position: absolute; top: 10px; right: 14px; width: 40px; height: 40px; border: 0; background: none; color: var(--paper); font-size: 30px; line-height: 1; }
.auth-tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.auth-tabs button { width: 50%; padding: 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); }
.auth-tabs button.active { color: var(--gold); border-color: var(--gold); }
label { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; color: #b8c1bc; font-size: 12px; }
input, select, textarea { width: 100%; padding: 13px; border: 1px solid #65716b88; border-radius: 0; background: #0e1a20; color: var(--paper); font-size: 14px; }
input::placeholder { color: #6c7c78; font-size: 12px; }
input:user-invalid { border-color: var(--danger); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 86px; }
.reveal { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); padding: 6px 10px; border: 1px solid var(--line-strong); background: none; color: var(--gold); font-size: 11px; }
.hint { margin: -8px 0 14px; font-size: 11px; color: var(--muted); }
form > .button { width: 100%; margin: 8px 0; }
#profile-email { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.character-card { display: flex; align-items: center; gap: 14px; margin: 12px 0; padding: 14px 16px; border: 1px solid var(--line); }
.character-card img { width: 40px; height: 40px; object-fit: contain; }
.character-card > div { flex: 1; min-width: 0; }
.character-card strong { display: block; overflow-wrap: anywhere; }
.character-card small { display: block; font-size: 11px; color: var(--muted); }
#character-detail { margin: 18px 0; padding: 18px; border: 1px solid var(--line); font-size: 12px; }
#character-detail h3 { font-size: 24px; }
#character-detail ul { padding-left: 18px; color: var(--muted); max-height: 220px; overflow: auto; }
details { margin: 24px 0; padding-top: 16px; border-top: 1px solid var(--line); }
summary { cursor: pointer; margin-bottom: 14px; color: var(--gold); font-size: 13px; }
.form-message { min-height: 20px; margin-bottom: 0; color: var(--rose); font-size: 12px; }
.form-message.success { color: var(--mint); }

/* ---- responsive ---------------------------------------------------------------- */
@media (max-width: 1100px) {
  .site-nav { gap: 20px; }
  .map-gallery { grid-template-columns: repeat(3, 1fr); }
  .release-list, .status-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --gutter: 6%; }
  .menu-toggle { display: grid; place-items: center; }
  .site-nav { position: absolute; top: 76px; left: 0; right: 0; display: none; flex-direction: column; gap: 0; margin: 0; padding: 8px 6% 18px;
    background: #101c22f7; border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .header { gap: 14px; }
  .hero { min-height: 640px; }
  .hero-caption { display: none; }
  .hero-art { background-position: 65%; }
  .section { padding: 64px var(--gutter); }
  .class-detail { flex-wrap: wrap; gap: 20px; padding: 26px 0; }
  .class-symbol { min-width: 180px; height: 190px; }
  .map-gallery { grid-template-columns: repeat(2, 1fr); }
  .ranking { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 640px) {
  .header { height: 68px; padding: 0 16px; }
  .site-nav { top: 68px; padding: 8px 16px 18px; }
  .brand { font-size: 13px; letter-spacing: 1px; }
  .brand-mark { font-size: 28px; }
  .button.small { padding: 9px 11px; font-size: 11px; }
  #account-button span[aria-hidden] { display: none; }
  .hero { min-height: 0; padding: 40px 16px 56px; }
  .hero::before { background: linear-gradient(90deg, #101c22f0, #101c22b0), linear-gradient(0deg, #101c22, transparent); }
  .hero-logo { margin-left: -6px; }
  .hero h1 { font-size: 44px; }
  .hero-text { font-size: 14px; }
  .section { padding: 54px 16px; }
  .section-heading { display: block; margin-bottom: 26px; }
  .section-heading > p { margin-top: 18px; }
  .news-list { grid-template-columns: 1fr; }
  .class-detail { justify-content: center; text-align: center; }
  .class-detail .eyebrow, .class-stats { justify-content: center; }
  .class-symbol { width: 100%; height: 150px; }
  .class-symbol img { width: 120px; height: 120px; }
  .class-detail > .button { margin: 6px auto 0; }
  .map-gallery { gap: 12px; }
  .map-card figcaption { padding: 14px; }
  .map-card h3 { font-size: 18px; }
  .release-list, .status-grid { grid-template-columns: 1fr; }
  .status-grid dd { font-size: 26px; }
  .footer { flex-direction: column; align-items: flex-start; padding: 28px 16px; }
  dialog { padding: 36px 20px 24px; }
  dialog h2 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
