:root {
  --bg: #0b0d14;
  --bg2: #11141e;
  --card: #161a26;
  --line: rgba(232, 196, 120, .16);
  --gold: #e8c478;
  --gold2: #b98a3e;
  --ember: #e4572e;
  --text: #ece6da;
  --dim: #a59f93;
  --head: "Cinzel", Georgia, serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 18px/1.6 var(--body); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(28px, 4vw, 44px); }
h3 { font-size: 21px; }
p { margin: 0 0 1em; }
kbd { font: 600 14px var(--body); background: #232838; border: 1px solid #3a4158; border-bottom-width: 3px; border-radius: 6px; padding: 1px 8px; color: var(--text); white-space: nowrap; }
section[class], .rank { padding: 88px 24px; max-width: 1180px; margin: 0 auto; }
.eyebrow { color: var(--gold2); font: 700 14px var(--body); letter-spacing: .22em; text-transform: uppercase; margin-bottom: 10px; }
.center, section[class] > .eyebrow, section[class] > h2 { text-align: center; }
.dim { color: var(--dim); }

/* buttons */
.btn { display: inline-block; font: 700 17px var(--body); text-decoration: none; padding: 12px 28px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-2px); }
.btn.primary, .btn.main { background: linear-gradient(180deg, #f3d48d, #c8963f); color: #20160a; box-shadow: 0 6px 24px rgba(232, 196, 120, .28); }
.btn.primary:hover, .btn.main:hover { box-shadow: 0 8px 34px rgba(232, 196, 120, .48); }
.btn.ghost, .btn.alt { border-color: var(--gold2); color: var(--gold); background: rgba(11, 13, 20, .5); }
.btn.big { font-size: 20px; padding: 16px 40px; }
.btn.small { font-size: 15px; padding: 8px 18px; }
.btn.wide { display: block; width: 100%; text-align: center; margin-top: 10px; }

/* navigation */
.nav { position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; transition: background .2s, border-color .2s; border-bottom: 1px solid transparent; }
.nav.solid { background: rgba(11, 13, 20, .92); backdrop-filter: blur(8px); border-color: var(--line); }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 700 20px var(--head); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 600; font-size: 16px; }
.nav-links a:not(.btn):hover { color: var(--gold); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--gold); margin: 5px 0; }

/* hero */
.hero { position: relative; max-width: none !important; min-height: 100vh; min-height: 100svh; padding: 96px 24px 72px !important; display: flex; align-items: center; justify-content: center; text-align: center; background: linear-gradient(180deg, rgba(11, 13, 20, .55), rgba(11, 13, 20, .2) 45%, var(--bg)), url(/static/hero.jpg) center / cover no-repeat; }
.embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-in { position: relative; max-width: 780px; }
.hero-logo { margin: 0 auto 14px; width: min(620px, 86vw); filter: drop-shadow(0 8px 30px rgba(0, 0, 0, .7)); }
.hero h1 { font-size: clamp(28px, 4.4vw, 46px); text-shadow: 0 2px 16px rgba(0, 0, 0, .8); }
.hero-sub { font-size: clamp(18px, 2.2vw, 22px); text-shadow: 0 1px 10px rgba(0, 0, 0, .9); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 26px 0 22px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chips li { padding: 4px 14px; border: 1px solid var(--line); border-radius: 99px; background: rgba(11, 13, 20, .6); font-size: 15px; }
.scroll-hint { position: absolute; bottom: 22px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); animation: bob 1.8s infinite; }
@keyframes bob { 50% { translate: 0 8px; } }

/* status */
.status { padding: 0 24px !important; margin-top: -36px !important; position: relative; z-index: 2; }
.status-in { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.status-in div { padding: 18px 12px; text-align: center; }
.status-in div + div { border-left: 1px solid var(--line); }
.status-in b { font: 700 26px var(--head); color: var(--gold); display: block; }
.status-in small { color: var(--dim); font-size: 14px; }
.status-in .dot + b { display: inline; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 8px; background: #d9534f; }
.dot.up { background: #58d68d; box-shadow: 0 0 10px #58d68d; }
.status-in small { display: block; }

/* promises */
.promise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 34px; }
.promise-grid article { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 30px 26px; }
.promise-grid .num { font: 900 30px var(--head); color: var(--gold2); display: block; margin-bottom: 8px; }
.promise-grid p { color: var(--dim); margin: 0; }

/* classes */
.classes { max-width: none !important; background: radial-gradient(ellipse at 30% 60%, rgba(228, 87, 46, .13), transparent 60%), var(--bg2); }
.class-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 26px 0 8px; }
.class-tabs button { font: 700 17px var(--head); background: none; color: var(--dim); border: 0; border-bottom: 2px solid transparent; padding: 8px 18px; cursor: pointer; }
.class-tabs button.on { color: var(--gold); border-color: var(--gold); }
.class-stage { max-width: 1020px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.stage { position: relative; height: 620px; display: flex; justify-content: center; }
.stage img { height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 14px 34px rgba(0, 0, 0, .7)); }
.stage.live img { visibility: hidden; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.stage-canvas:active { cursor: grabbing; }
.stage-hint { display: none; position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; color: var(--dim); font-size: 14px; pointer-events: none; }
.stage.live .stage-hint { display: block; }
.class-info h3 { font-size: 36px; color: var(--gold); }
.class-info dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; align-items: center; margin: 22px 0 0; }
.class-info dt { color: var(--dim); }
.class-info dd { margin: 0; }
.bar { display: block; height: 8px; border-radius: 4px; background: #262b3b; overflow: hidden; }
.bar::after { content: ""; display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold2), var(--gold)); transition: width .3s; }
.bar[data-v="1"]::after { width: 20%; } .bar[data-v="2"]::after { width: 40%; } .bar[data-v="3"]::after { width: 60%; } .bar[data-v="4"]::after { width: 80%; } .bar[data-v="5"]::after { width: 100%; }

/* systems */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; grid-auto-flow: dense; margin-top: 34px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; overflow: hidden; }
.tile p { color: var(--dim); margin: 0; font-size: 16px; }
.tile.wide { grid-column: span 2; }
.tile.shot { padding: 0; display: flex; flex-direction: column; cursor: zoom-in; }
.tile.shot img { width: 100%; height: 210px; object-fit: cover; transition: transform .3s; }
.tile.shot:hover img { transform: scale(1.04); }
.tile.shot div { padding: 16px 20px 20px; }
.tile.shot h3 { margin-bottom: 4px; }

/* gallery */
.gallery-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 30px; }
.gallery-row button { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: none; cursor: zoom-in; aspect-ratio: 16 / 10; }
.gallery-row button:first-child { grid-column: span 2; grid-row: span 2; }
.gallery-row img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-row button:hover img { transform: scale(1.05); }
.lightbox { position: fixed; z-index: 40; inset: 0; background: rgba(0, 0, 0, .9); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 92vh; border-radius: 8px; }
.lightbox button { position: absolute; top: 14px; right: 20px; background: none; border: 0; color: #fff; font-size: 38px; cursor: pointer; }

/* tables */
.board { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 17px; }
.board th { text-align: left; color: var(--dim); font-size: 14px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.board td { padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.board .num { text-align: right; }
.board .rank { padding: 11px 14px; max-width: none; margin: 0; font: 700 18px var(--head); color: var(--dim); width: 54px; }
.board .who { font-weight: 700; }
.board tr.r1 .rank { color: #f3d48d; } .board tr.r2 .rank { color: #c9d1dc; } .board tr.r3 .rank { color: #d39a6a; }
.board .empire.e1 { color: #ec7063; } .board .empire.e2 { color: #f4d03f; } .board .empire.e3 { color: #5dade2; }
.board tbody tr:hover { background: rgba(232, 196, 120, .05); }

/* start, faq, final */
.start-steps { list-style: none; counter-reset: s; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.start-steps li { counter-increment: s; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 26px; text-align: center; }
.start-steps li::before { content: counter(s); display: block; font: 900 38px var(--head); color: var(--gold); }
.start-steps b { display: block; font: 700 19px var(--head); }
.start-steps span { color: var(--dim); }
.faq { max-width: 780px !important; }
.faq details { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 20px; margin-top: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { color: var(--dim); margin: 10px 0 0; }
.final { text-align: center; }
.roster { display: flex; justify-content: center; align-items: flex-end; margin-bottom: 26px; }
.roster img { height: clamp(190px, 34vw, 400px); width: auto; margin: 0 -1.5%; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .7)); }
.roster img:nth-child(2), .roster img:nth-child(3) { height: clamp(210px, 38vw, 440px); z-index: 1; }

/* page headers */
.page-head { padding: 124px 24px 26px !important; text-align: center; }
.page-head .lead { color: var(--dim); font-size: 20px; }
.page-head h1 { font-size: clamp(32px, 5vw, 52px); }
.head-stats { display: flex; justify-content: center; gap: 26px; color: var(--dim); }
.head-stats b { color: var(--gold); font: 700 22px var(--head); }

/* guide */
.guide { max-width: 1120px; margin: 0 auto; padding: 20px 24px 80px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; align-items: start; }
.guide-nav { position: sticky; top: 84px; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.guide-nav a { color: var(--dim); text-decoration: none; padding: 5px 14px; font-size: 16px; border-left: 2px solid transparent; margin-left: -1px; }
.guide-nav a.on, .guide-nav a:hover { color: var(--gold); border-color: var(--gold); }
.guide-body section { padding: 0 0 38px; }
.guide-body h2 { font-size: 28px; color: var(--gold); }
.check { list-style: none; padding: 0; }
.check li { padding-left: 26px; position: relative; margin-bottom: 7px; }
.check li::before { content: "\25C6"; color: var(--gold2); font-size: 12px; position: absolute; left: 4px; top: 6px; }
.numbered li { margin-bottom: 7px; }
.note { background: var(--bg2); border-left: 3px solid var(--gold2); padding: 12px 16px; border-radius: 0 8px 8px 0; color: var(--dim); }
.class-table { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.class-table div { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.class-table p { margin: 4px 0 0; color: var(--dim); font-size: 16px; }
.keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 22px; margin-bottom: 14px; }
.keys div { display: flex; align-items: center; gap: 5px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.keys span { margin-left: auto; color: var(--dim); font-size: 16px; }
.plain { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.plain th, .plain td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.guide-cta { text-align: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 30px; }

/* rankings */
.rank { padding-top: 12px; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin-bottom: 28px; }
.podium-card { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 12px; }
.podium-card.p1 { padding: 30px 12px; border-color: var(--gold2); box-shadow: 0 0 30px rgba(232, 196, 120, .16); }
.podium-card .place { display: block; font: 900 30px var(--head); color: var(--gold); }
.podium-card b { display: block; font-size: 20px; overflow-wrap: anywhere; }
.podium-card small { display: block; color: var(--dim); }
.podium-card em { font-style: normal; color: var(--gold); font-weight: 700; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a { text-decoration: none; color: var(--dim); padding: 6px 16px; border: 1px solid var(--line); border-radius: 99px; font-weight: 600; }
.tabs a.on { color: #20160a; background: var(--gold); border-color: var(--gold); }
.rank-title { margin-top: 46px; font-size: 28px; }

/* forms */
.auth { min-height: 100vh; padding: 100px 20px 60px; display: flex; align-items: center; justify-content: center; background: linear-gradient(rgba(11, 13, 20, .78), rgba(11, 13, 20, .95)), url(/static/hero.jpg) center / cover; }
.auth-card { width: 100%; max-width: 440px; background: rgba(22, 26, 38, .96); border: 1px solid var(--line); border-radius: 16px; padding: 34px 32px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.wide-card .auth-card { max-width: 580px; }
.auth-mark { margin: 0 auto 8px; }
.auth h1 { text-align: center; font-size: 28px; }
.auth-card > .dim { text-align: center; }
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 16px; }
input { width: 100%; padding: 11px 14px; font: 400 17px var(--body); color: var(--text); background: #0f121b; border: 1px solid #333a50; border-radius: 8px; }
input:focus { outline: 2px solid var(--gold2); border-color: transparent; }
.hint { font-size: 14px; color: var(--dim); margin: 10px 0; }
.hp { position: absolute; left: -9999px; }
.msg { padding: 10px 14px; border-radius: 8px; }
.msg.err { background: rgba(217, 83, 79, .15); border: 1px solid rgba(217, 83, 79, .5); color: #f2a9a6; }
.secret { background: #0f121b; border: 1px dashed var(--gold2); border-radius: 10px; padding: 14px; text-align: center; margin-bottom: 16px; }
.secret span, .secret small { display: block; color: var(--dim); font-size: 14px; }
.secret b { font: 700 28px var(--head); color: var(--gold); letter-spacing: .1em; }
.file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.file small { color: var(--dim); overflow-wrap: anywhere; }
.steps-list { padding-left: 22px; margin-top: 18px; }
.steps-list li { margin-bottom: 7px; }

/* footer */
.footer { border-top: 1px solid var(--line); background: #090b11; padding: 36px 24px; }
.footer-in { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand b { font: 700 19px var(--head); display: block; }
.footer-brand span { color: var(--dim); font-size: 15px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer nav a { color: var(--dim); text-decoration: none; }
.footer nav a:hover { color: var(--gold); }
.legal { grid-column: 1 / -1; color: #787365; font-size: 14px; margin: 0; }

@media (max-width: 900px) {
  section[class], .rank { padding-top: 60px; padding-bottom: 60px; }
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 14px; padding: 20px; background: rgba(11, 13, 20, .97); border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav.open { background: rgba(11, 13, 20, .97); }
  .promise-grid, .start-steps, .class-stage { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .gallery-row { grid-template-columns: repeat(2, 1fr); }
  .gallery-row button:first-child { grid-row: auto; }
  .stage { height: 460px; }
  .guide { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .guide-nav { position: static; flex-direction: row; flex-wrap: wrap; border-left: 0; gap: 6px; }
  .guide-nav a { border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; margin: 0; font-size: 15px; }
  .footer-in { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  section[class], .rank, .page-head { padding-left: 16px !important; padding-right: 16px !important; }
  .nav { padding: 0 16px; }
  .bento { grid-template-columns: 1fr; }
  .tile.wide { grid-column: auto; }
  .status-in b { font-size: 21px; }
  .status-in small { font-size: 12px; }
  .class-table, .keys { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; }
  .board { font-size: 15px; }
  .board th:nth-child(4), .board td:nth-child(4), .board th:nth-child(6), .board td:nth-child(6) { display: none; }
  .board th, .board td, .board .rank { padding: 9px 7px; }
  .podium { grid-template-columns: 1fr; }
  .podium-card.p1 { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-hint { animation: none; }
  .btn, .tile.shot img, .gallery-row img { transition: none; }
}
