:root {
  color-scheme: dark;
  --ground: #100d0e;
  --panel: #181315;
  --ink: #f5eadd;
  --muted: #c0aca2;
  --gold: #f0c38c;
  --low-gold: #b88757;
  --edge: #533936;
  --serif: Georgia, 'Times New Roman', serif;
  --body: 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 1rem/1.58 var(--body); }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.08; }
section[id] { scroll-margin-top: 5.5rem; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
[hidden] { display: none !important; }
.wrap { width: min(1180px, calc(100% - 5.5rem)); margin-inline: auto; }

.skip-link { position: fixed; top: .75rem; left: .75rem; transform: translateY(-200%); z-index: 9; background: var(--gold); color: var(--ground); padding: .55rem 1rem; }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid #68443780; background: #120e10f5; backdrop-filter: blur(14px); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 76px; gap: 1.7rem; }
.brand { width: fit-content; display: block; text-decoration: none; }
.brand img { width: 156px; height: auto; aspect-ratio: 160 / 38; object-fit: contain; object-position: left; }
.site-header nav { display: flex; align-items: center; gap: clamp(1.1rem, 3vw, 2.7rem); }
.site-header nav a { text-decoration: none; color: #e0ccc0; font-size: .92rem; font-weight: 650; }
.site-header nav a:hover, .site-footer a:hover { color: var(--gold); }
.site-header nav .mobile-registration { display: none; }
.menu-toggle { display: none; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .65rem; min-height: 48px; padding: .62rem 1.16rem; font-size: .93rem; font-weight: 730; line-height: 1.25; text-decoration: none; border: 1px solid currentColor; border-radius: 4px; cursor: pointer; transition: color .2s, background-color .2s, border-color .2s; }
.button-header { justify-self: end; color: var(--gold); background: #43282542; border-color: #94694b; min-height: 40px; }
.button-gold { background: #e8bc85; color: #311b17; border-color: #f3d0a1; box-shadow: 0 0 25px #cc71382c; }
.button-gold:hover { background: #ffdcab; }
.button-ghost { background: #171012c9; border-color: #9e765b; color: #f7e4d2; }
.button-header:hover, .button-ghost:hover { background: #503029; border-color: var(--gold); }
.play-symbol { width: 0; height: 0; border-block: 5px solid transparent; border-left: 8px solid currentColor; }

.hero { position: relative; display: grid; isolation: isolate; min-height: clamp(530px, 43vw, 675px); overflow: clip; background: #1d1414; }
.hero-art, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-art { object-fit: cover; object-position: 58% 50%; }
.hero::after { z-index: -1; content: ''; background: linear-gradient(0deg, var(--ground) 0, #100d0ef2 4%, #100d0e38 25%, transparent 53%), linear-gradient(90deg, #120d10 0, #120d10f0 16%, #181013bc 35%, #20131540 57%, #35191700 82%); }
.hero-inner { display: grid; align-items: center; padding-block: 3.2rem 4.5rem; }
.hero-copy { max-width: 525px; }
.kicker { display: flex; align-items: center; gap: .75rem; color: var(--gold); font-size: .875rem; font-weight: 740; text-transform: uppercase; letter-spacing: .16em; line-height: 1.3; }
.kicker span { display: inline-block; width: 20px; height: 1px; background: var(--low-gold); flex-shrink: 0; }
.hero h1 { font-size: clamp(4.35rem, 7.6vw, 7.75rem); line-height: .93; letter-spacing: -.066em; margin-block: 1.2rem 1.3rem; text-shadow: 0 4px 38px #1a0a07d0; }
.hero h1 em { font-weight: inherit; color: var(--gold); letter-spacing: -.06em; }
.hero-summary { max-width: 425px; color: #e5d1c3; font-size: clamp(1.03rem, 1.4vw, 1.18rem); line-height: 1.65; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.7rem; }

.section-head h2, .guild-content h2, .vip-banner h2 { color: var(--ink); font-size: clamp(2.55rem, 4.5vw, 4.55rem); letter-spacing: -.045em; margin-block: .57rem .64rem; }
.section-head > p:last-child, .section-head > div > p:last-child, .section-intro, .vip-banner > p:last-child { color: var(--muted); font-size: 1.04rem; max-width: 520px; text-wrap: pretty; }
.ranking-section { padding-block: 2.7rem 5.2rem; background: radial-gradient(ellipse 60% 46% at 52% -4%, #34201c 0%, transparent 76%), var(--ground); }
.ranking-head { display: flex; gap: 2rem; align-items: center; justify-content: space-between; margin-bottom: 1.9rem; }
.ranking-date { color: var(--muted); font-size: .875rem; line-height: 1.45; display: grid; gap: .2rem; padding: .5rem 0 .5rem 1rem; border-left: 1px solid #916440; }
.ranking-date b { font-weight: 660; color: var(--gold); }
.ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1.25rem; }
.leaderboard { border: 1px solid var(--edge); background: #181314; position: relative; overflow: clip; border-radius: 5px; }
.leaderboard-dungeon { --board-image: url('assets/dungeon.webp'); --board-accent: #edc48e; --board-first: #33211a; }
.leaderboard-fire { --board-image: url('assets/fire.webp'); --board-accent: #f5b88c; --board-first: #391e1a; }
.board-head { min-height: 136px; padding: 1.05rem 1.45rem 1.15rem; background: linear-gradient(90deg, #1b1216 0%, #1b1215da 36%, #21141242 100%), var(--board-image) center 55% / cover; border-bottom: 1px solid var(--edge); }
.board-tag { color: var(--board-accent); font-size: .875rem; font-weight: 740; letter-spacing: .13em; text-transform: uppercase; }
.board-head h3 { font-size: clamp(2.2rem, 3vw, 3.1rem); letter-spacing: -.04em; margin-bottom: .22rem; }
.board-head > p:last-child { color: #e4cfc0; font-size: .94rem; }
.board-table.is-expanded { max-block-size: 32rem; overflow: auto; scrollbar-color: var(--board-accent) #1b1316; }
.board-table.is-expanded:focus-visible { outline-offset: -2px; }
.leaderboard table { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board-table.is-expanded table { border-collapse: separate; border-spacing: 0; }
.leaderboard :is(th, td) { padding: .54rem .5rem; text-align: left; border-top: 1px solid #4c33294f; overflow-wrap: anywhere; }
.leaderboard :is(th, td):first-child { width: 5.1rem; padding-left: 1.45rem; }
.leaderboard :is(th, td):last-child { width: 6rem; padding-right: 1.45rem; text-align: right; }
.leaderboard thead th { color: #cab3a4; font-size: .875rem; font-weight: 620; }
.board-table.is-expanded thead th { position: sticky; inset-block-start: 0; background: #21181a; box-shadow: 0 1px var(--edge); }
.leaderboard tbody th { font-weight: 650; }
.leaderboard tbody td:first-child { color: #b7a39a; }
.leaderboard tbody td:last-child { color: var(--board-accent); font-weight: 760; }
.leaderboard tbody:first-of-type tr:first-child { background: var(--board-first); }
.leaderboard tbody:first-of-type tr:first-child td:first-child { color: var(--board-accent); box-shadow: inset 3px 0 #c68654; font-weight: 750; }
.leaderboard tbody tr td[colspan] { text-align: left; font-weight: 650; }
.leaderboard tbody tr:nth-child(even) { background: #211819; }
.leaderboard tbody tr:hover { background: #2d201e; }
.board-actions { display: flex; padding: .75rem 1.45rem; border-top: 1px solid var(--edge); }
.board-toggle { min-height: 44px; color: var(--board-accent); }
.board-toggle::after { content: ''; width: .46rem; height: .46rem; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-.12rem) rotate(45deg); }
.board-toggle[aria-expanded='true']::after { transform: translateY(.12rem) rotate(225deg); }
.ranking-note { color: var(--muted); font-size: .9375rem; margin-top: .95rem; }

.guild-section { padding-block: 4.5rem; background: radial-gradient(ellipse at 8% 36%, #34222294, transparent 64%), #181214; border-block: 1px solid #4d302d; }
.guild-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); }
.guild-visual { position: relative; min-height: 500px; align-self: stretch; isolation: isolate; border: 1px solid #825a44; overflow: clip; background: #26191c; box-shadow: 0 1.5rem 3rem #0d0a0a80; }
.guild-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 52% 50%; z-index: -2; }
.guild-visual::before { content: ''; position: absolute; inset: .55rem; border: 1px solid #edd0a958; pointer-events: none; }
.guild-visual::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #120d11da, transparent 40%); }
.guild-visual-caption { position: absolute; bottom: 1.65rem; left: 1.55rem; display: flex; align-items: center; gap: .6rem; color: #f4ddc8; font-size: .9rem; }
.visual-line { width: 1.2rem; height: 1px; background: var(--gold); }
.guild-content { min-width: 0; }
.guild-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1.35rem; padding-bottom: .45rem; border-bottom: 1px solid var(--edge); }
.guild-tabs button { padding: .47rem .72rem; min-height: 44px; color: #d9c1b4; background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: .92rem; font-weight: 690; }
.guild-tabs button:hover { color: var(--gold); }
.guild-tabs button[aria-selected='true'] { border-color: #93684a; color: #ffe0b8; background: #462927; }
.guild-guide { min-height: 248px; margin-top: 1.18rem; }
.guild-guide h3 { margin-bottom: .82rem; font-size: 1.55rem; letter-spacing: -.02em; }
.guild-guide ul, .vip-list { margin: 0; padding: 0; list-style: none; }
.guild-guide li { display: grid; gap: .15rem; border-left: 1px solid #875940; padding-left: .85rem; margin-bottom: .8rem; font-size: .98rem; color: var(--muted); }
.guild-guide li strong { color: var(--gold); font-weight: 650; }

.vip-section { padding-block: 5.3rem; background: #110e10; }
.vip-layout { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.52fr); align-items: stretch; border: 1px solid #61413b; border-radius: 5px; overflow: clip; }
.vip-banner { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 360px; padding: 2rem; background: radial-gradient(ellipse 75% 70% at 54% 22%, #672727 0%, #321c1e 61%, #1b1316 100%); }
.vip-banner img { position: absolute; z-index: -1; top: -2.7rem; left: 50%; transform: translateX(-50%); width: min(350px, 85%); height: auto; filter: drop-shadow(0 4px 24px #792f28); }
.vip-banner::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, #1b1316 1%, #1e1317e8 32%, transparent 76%); }
.vip-banner h2 { font-size: clamp(2.35rem, 3.5vw, 3.8rem); }
.vip-banner > p:last-child { max-width: 360px; font-size: .98rem; }
.vip-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 1px; background: #4c302e; }
.vip-list li { padding: 1.28rem 1.2rem; display: grid; grid-template-columns: 3.1rem minmax(0, 1fr); gap: .85rem; align-items: start; background: #1b1417; }
.vip-number { width: 3.1rem; min-height: 2.55rem; padding: .21rem; display: grid; place-items: center; border: 1px solid #855447; border-radius: 4px; background: #352025; color: #f7c996; font: 700 1rem/1.3 var(--serif); text-align: center; }
.vip-list h3 { color: #f3e2d2; font: 730 1rem/1.35 var(--body); margin-bottom: .3rem; }
.vip-list p { color: var(--muted); font-size: .96rem; line-height: 1.5; }
.vip-list li:last-child { grid-column: 1 / -1; }

.faq-section { padding-block: 4rem 5.25rem; border-top: 1px solid #50332d; background: radial-gradient(ellipse 40% 78% at 8% 10%, #281919, transparent 85%), #151013; }
.faq-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.5fr); align-items: start; gap: clamp(2rem, 5vw, 5rem); }
.faq-layout .section-head > p:last-child { max-width: 295px; }
.question-list { display: grid; gap: .6rem; }
.question-list details { border: 1px solid #5b3b33; border-radius: 4px; background: #211719; }
.question-list summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 52px; padding: .8rem 1rem; cursor: pointer; color: #f4dfd0; font-weight: 700; line-height: 1.4; }
.question-list summary::-webkit-details-marker { display: none; }
.question-list summary::after { content: '+'; color: var(--gold); font-size: 1.45rem; font-weight: 400; line-height: 1; flex-shrink: 0; }
.question-list details[open] { border-color: #9b6b4d; background: #2a1c1e; }
.question-list details[open] summary::after { content: '−'; }
.question-list details p { padding: 0 1rem .95rem; color: #d5beb1; font-size: 1rem; }
.question-list details a { color: var(--gold); text-underline-offset: .18em; }

.registration-section { padding-block: clamp(2.6rem, 6vw, 5.25rem); border-top: 1px solid #50332d; background: #100d0f; }
.registration-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); border: 1px solid #8b5a46; border-radius: 6px; overflow: clip; box-shadow: 0 1.5rem 3.5rem #07050799; }
.registration-art { position: relative; isolation: isolate; min-height: 335px; display: grid; align-items: end; padding: clamp(1.35rem, 4vw, 3rem); background: #2f1719; }
.registration-art img, .registration-art::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.registration-art img { object-fit: cover; object-position: 48% 55%; }
.registration-art::after { content: ''; z-index: -1; background: linear-gradient(0deg, #180f13 3%, #1b1115dc 23%, #1c101545 60%, #29192412); }
.registration-art > div > p { color: #e1cbbd; }
.registration-panel { min-width: 0; display: grid; align-content: center; gap: 1rem; padding: clamp(1.15rem, 3vw, 2.5rem); background: radial-gradient(ellipse at 100% 0%, #382122, transparent 70%), #1b1417; }
.registration-panel h3 { margin-bottom: .85rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.registration-panel form { display: grid; gap: .45rem; }
.registration-panel form label { font-weight: 650; }
.registration-panel input { width: 100%; min-height: 48px; padding: .55rem .75rem; border: 1px solid #8a6354; border-radius: 4px; background: #120e11; color: var(--ink); font: inherit; }
.registration-panel input + label { margin-top: .25rem; }
.registration-panel input[aria-invalid='true'] { border: 2px solid #e79c8c; }
.registration-panel input:focus-visible { outline-offset: 2px; }
.registration-panel .button { width: fit-content; max-width: 100%; margin-top: .45rem; }
.registration-panel button:disabled { opacity: .65; cursor: default; }
.registration-help { color: var(--muted); font-size: .9rem; }
.registration-help a, .registration-text-button { color: var(--gold); text-underline-offset: .2em; }
.registration-text-button { display: inline-flex; align-items: center; justify-content: flex-start; min-height: 44px; padding: .3rem .18rem; border: 0; background: transparent; cursor: pointer; text-decoration: underline; text-align: left; }
.registration-preview, .registration-status { padding: .66rem .8rem; border-left: 2px solid #bf8f63; background: #302120; overflow-wrap: anywhere; }
.registration-preview p { color: #dac7b8; font-size: .92rem; }
.registration-status[data-kind='error'] { border-color: #e79c8c; color: #ffd6cb; }
#registration-delivery, #registration-next { margin-bottom: .65rem; color: #e3cdbf; overflow-wrap: anywhere; }
#registration-code { max-width: 19rem; font-variant-numeric: tabular-nums; letter-spacing: .16em; }
#registration-code-step > .registration-text-button { display: flex; }

.site-footer { padding-block: 1.2rem; background: #0d0b0d; border-top: 1px solid #472d2a; }
.footer-inner { display: flex; align-items: center; gap: 1rem; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.footer-inner .brand img { width: 128px; }
.footer-inner > a:last-child { color: var(--gold); text-underline-offset: .2em; }
.trailer-dialog { width: min(950px, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 1rem; background: #1b1416; color: var(--ink); border: 1px solid #9b6b4d; border-radius: 5px; box-shadow: 0 2rem 7rem #000b; }
.trailer-dialog::backdrop { background: #070506dc; backdrop-filter: blur(5px); }
.trailer-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; }
.trailer-top h2 { font-size: clamp(1.25rem, 4vw, 2rem); }
.trailer-top .button { min-height: 42px; }
.trailer-dialog video { display: block; width: 100%; max-height: 70dvh; background: #050304; }

@media (max-width: 990px) {
  .wrap { width: calc(100% - 3rem); }
  .hero::after { background: linear-gradient(0deg, var(--ground), #100d0ec2 8%, transparent 55%), linear-gradient(90deg, #140e10f7 0, #170e11cf 32%, #18101344 69%, transparent 100%); }
  .guild-layout { gap: 1.65rem; }
  .vip-layout { grid-template-columns: minmax(0, .78fr) minmax(0, 1.35fr); }
  .vip-list li { grid-template-columns: minmax(0, 1fr); gap: .42rem; }
}

@media (max-width: 690px) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { grid-template-columns: 1fr auto; gap: .8rem; min-height: 64px; position: relative; }
  .brand img { width: 138px; }
  .button-header { display: none; }
  .menu-toggle { display: inline-flex; gap: .55rem; align-items: center; justify-content: center; min-height: 44px; color: var(--gold); background: #221717; border: 1px solid #795442; border-radius: 4px; padding: 0 .68rem; font-size: .9rem; font-weight: 670; cursor: pointer; }
  .menu-lines { display: inline-block; width: 13px; height: 8px; border-block: 1px solid currentColor; }
  .site-header nav { display: none; position: absolute; inset: calc(100% + .45rem) 0 auto; padding: .42rem; gap: .18rem; background: #1b1316; border: 1px solid #815942; border-radius: 4px; box-shadow: 0 .7rem 2rem #0009; }
  .site-header nav.is-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-header nav a { padding: .64rem .65rem; min-height: 44px; border: 1px solid #4b322e; }
  .site-header nav .mobile-registration { display: block; grid-column: 1 / -1; color: var(--gold); border-color: #94694b; background: #43282542; }
  section[id] { scroll-margin-top: 4.5rem; }
  .hero { min-height: 0; }
  .hero-art { height: min(106vw, 475px); object-position: 64% 41%; }
  .hero::after { background: linear-gradient(180deg, #190e1355 0, transparent 16%, #180e1260 34%, #161015d5 49%, #120d11 70%, var(--ground) 100%); }
  .hero-inner { padding-block: clamp(9rem, 46vw, 15rem) 2.8rem; }
  .hero h1 { font-size: clamp(3.75rem, 12vw, 5.15rem); margin-block: .9rem 1rem; }
  .hero-summary { max-width: 370px; }
  .hero-actions { margin-top: 1.3rem; gap: .52rem; }
  .hero-actions .button { padding-inline: .8rem; }
  .ranking-section { padding-block: 1.9rem 3.5rem; }
  .ranking-head { flex-direction: column; align-items: flex-start; gap: .7rem; margin-bottom: 1.35rem; }
  .ranking-grid, .guild-layout, .vip-layout, .faq-layout, .registration-layout { grid-template-columns: minmax(0, 1fr); }
  .board-head { padding-inline: 1rem; }
  .leaderboard :is(th, td):first-child { width: 4rem; padding-left: 1rem; }
  .leaderboard :is(th, td):last-child { width: 5rem; padding-right: 1rem; }
  .board-actions { padding-inline: 1rem; }
  .board-toggle { width: 100%; }
  .guild-section, .vip-section, .faq-section { padding-block: 3.2rem; }
  .guild-visual { min-height: clamp(215px, 60vw, 330px); }
  .guild-content { min-width: 0; }
  .guild-guide { min-height: 0; }
  .vip-banner { min-height: 300px; padding: 1.35rem; }
  .vip-banner img { width: min(265px, 72%); top: -1.4rem; }
  .vip-list li { padding: 1rem .75rem; }
  .faq-layout { gap: 1.35rem; }
  .faq-layout h2 br { display: none; }
  .registration-art { min-height: 190px; }
  .registration-panel .button { width: 100%; }
  .footer-inner { flex-wrap: wrap; }
}

@media (max-width: 350px) {
  .hero h1 { font-size: clamp(3rem, 16vw, 3.75rem); }
  .hero-actions .button { width: 100%; }
  .vip-list { grid-template-columns: minmax(0, 1fr); }
  .vip-list li { grid-template-columns: 3.1rem minmax(0, 1fr); gap: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
