/* Rune Haven website: dark fantasy theme (deep night sky, gold trim, parchment accents). */
:root {
  --bg: #0d0b14;
  --bg-2: #141120;
  --panel: #1a1628;
  --panel-2: #221d34;
  --line: #3a3150;
  --line-gold: #6b5427;
  --text: #ece6f5;
  --muted: #a99fbf;
  --gold: #e8c26a;
  --gold-2: #f6dc94;
  --gold-dark: #a8812e;
  --blue: #6fb6ff;
  --green: #6fd99a;
  --red: #ff7d7d;
  --purple: #b48cff;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font-head: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font-body);
}
img { max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: .5px; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(13, 11, 20, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-gold); }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); }
.brand-mark svg { width: 30px; height: 30px; display: block; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-dark)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-name.small { font-size: 1.1rem; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text); font-weight: 700; padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a.active { color: var(--gold); background: rgba(232, 194, 106, .08); }
.nav .nav-register { border: 1px solid var(--line); }
.nav .nav-play { margin-left: 6px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; width: 44px; height: 40px; cursor: pointer; padding: 9px; }
.nav-toggle span { display: block; height: 2px; background: var(--gold); margin: 4px 0; border-radius: 2px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 800;
  letter-spacing: .3px; border-radius: 10px; padding: 12px 22px; min-height: 46px; cursor: pointer; border: 1px solid transparent;
  text-align: center; transition: transform .08s, filter .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-gold { color: #1d1505 !important; background: linear-gradient(180deg, var(--gold-2), var(--gold) 50%, var(--gold-dark));
  border-color: #f3d58a; box-shadow: 0 4px 18px rgba(232, 194, 106, .25), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-gold:hover { filter: brightness(1.08); }
.btn-ghost { color: var(--text) !important; background: rgba(255, 255, 255, .04); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold-dark); color: var(--gold) !important; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-gold); }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 30%; transform: scale(1.03); }
.hero-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(13, 11, 20, .96) 0%, rgba(13, 11, 20, .82) 40%, rgba(13, 11, 20, .35) 100%),
              linear-gradient(0deg, var(--bg) 0%, rgba(13, 11, 20, 0) 40%); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.3fr .9fr; gap: 32px; align-items: center; padding: 72px 16px 64px; }
.eyebrow { display: inline-block; font-weight: 800; font-size: .78rem; letter-spacing: 2px; text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--line-gold); background: rgba(232, 194, 106, .07); border-radius: 999px; padding: 4px 12px; margin-bottom: 16px; }
.hero h1 { background: linear-gradient(180deg, #fff6d8, var(--gold) 60%, var(--gold-dark)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .6)); }
.hero .lead { font-size: 1.15rem; color: #d9d0ea; max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 8px; }
.hero-note { font-size: .9rem; color: var(--muted); }

/* status card */
.status-card { background: linear-gradient(180deg, rgba(34, 29, 52, .95), rgba(20, 17, 32, .95)); border: 1px solid var(--line-gold);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.status-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.status-head h3 { margin: 0; color: var(--gold); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  border-radius: 999px; padding: 3px 10px; border: 1px solid var(--line); color: var(--muted); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.online { color: var(--green); border-color: rgba(111, 217, 154, .4); }
.pill.online .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pill.offline { color: var(--red); border-color: rgba(255, 125, 125, .4); }
.pill.offline .dot { background: var(--red); }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: .75rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--font-head); font-size: 1.4rem; color: var(--gold-2); }

/* ---------- rates strip ---------- */
.rates { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-bottom: 1px solid var(--line); }
.rates-inner { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin: -36px auto 0; position: relative; z-index: 2; box-shadow: var(--shadow); }
.rate { background: var(--panel); padding: 16px 10px; text-align: center; }
.rate .v { font-family: var(--font-head); font-size: 1.6rem; color: var(--gold); line-height: 1.1; }
.rate .k { font-size: .78rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section-head h2 { color: var(--gold); }
.ornament { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold-dark); margin: 6px 0 12px; }
.ornament::before, .ornament::after { content: ""; height: 1px; width: 70px; background: linear-gradient(90deg, transparent, var(--gold-dark), transparent); }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--line-gold); }
.card h3 { color: var(--gold-2); }
.card p:last-child { margin-bottom: 0; }
.card .icon { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(232, 194, 106, .3), rgba(232, 194, 106, .06)); border: 1px solid var(--line-gold); }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 64px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 22px; top: 22px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; color: #1d1505; background: var(--gold); }

/* news */
.news-list { display: grid; gap: 14px; }
.news-item { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: start; }
.news-date { font-family: var(--font-head); color: var(--gold); font-size: .95rem; }
.news-tag { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--purple);
  border: 1px solid rgba(180, 140, 255, .4); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.news-item h3 { margin-bottom: .3em; }

/* page header */
.page-head { background: radial-gradient(ellipse at top, #2a2140 0%, var(--bg) 70%); border-bottom: 1px solid var(--line-gold); padding: 48px 0 32px; text-align: center; }
.page-head h1 { color: var(--gold); font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-head p { color: var(--muted); max-width: 680px; margin: 0 auto; }

/* guide layout */
.guide { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.toc { position: sticky; top: 84px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.toc a { display: block; color: var(--text); padding: 7px 10px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.toc a:hover { background: rgba(232, 194, 106, .08); color: var(--gold); }
.toc .toc-title { font-family: var(--font-head); color: var(--gold); font-size: .85rem; letter-spacing: 1px; text-transform: uppercase; padding: 4px 10px 8px; }
.prose h2 { color: var(--gold); margin-top: 1.6em; padding-top: .4em; border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { color: var(--gold-2); margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose code, kbd { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px; color: var(--gold-2); }
.callout { border: 1px solid var(--line-gold); background: rgba(232, 194, 106, .06); border-radius: var(--radius); padding: 14px 16px; margin: 1em 0; }
.callout.info { border-color: rgba(111, 182, 255, .4); background: rgba(111, 182, 255, .06); }
table.tbl { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--gold); font-weight: 800; font-size: .8rem; letter-spacing: 1px; text-transform: uppercase; background: rgba(0, 0, 0, .2); }
.tbl tr:hover td { background: rgba(255, 255, 255, .02); }
.table-wrap { overflow-x: auto; }

/* ---------- database ---------- */
.db-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tabs button { font: inherit; font-weight: 800; color: var(--muted); background: var(--panel); border: 0; padding: 10px 18px; cursor: pointer; min-height: 44px; }
.tabs button.active { color: #1d1505; background: var(--gold); }
.db-bar input, .db-bar select, .field input, .field select { font: inherit; color: var(--text); background: #0f0c18; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.db-bar input { flex: 1; min-width: 200px; }
.db-bar input:focus, .db-bar select:focus, .field input:focus, .field select:focus { outline: 2px solid var(--gold-dark); border-color: var(--gold-dark); }
.db-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.db-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.db-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid rgba(58, 49, 80, .6);
  cursor: pointer; color: var(--text); }
.db-row:hover, .db-row.active { background: rgba(232, 194, 106, .07); }
.db-row .ico { width: 24px; height: 24px; image-rendering: pixelated; justify-self: center; }
.db-row .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-row .meta { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.db-more { padding: 12px; text-align: center; color: var(--muted); font-size: .9rem; }
.db-detail { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-gold); border-radius: var(--radius); padding: 20px;
  position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.db-detail .head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.db-detail .head img.big { width: 75px; height: 100px; object-fit: contain; image-rendering: pixelated; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 8px; }
.db-detail h2 { margin: 0; color: var(--gold-2); font-size: 1.4rem; }
.db-detail .sub { color: var(--muted); font-size: .9rem; }
.desc { background: #f4ecd8; color: #2a2316; border-radius: 8px; padding: 12px 14px; font-size: .92rem; line-height: 1.5; margin: 12px 0;
  border: 1px solid #c9b88f; box-shadow: inset 0 0 20px rgba(120, 90, 30, .15); }
.desc .line { min-height: 1em; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.kv div { background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.kv .k { font-size: .7rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.kv .v { font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--text); background: rgba(255, 255, 255, .03); }
.chip.gold { color: var(--gold); border-color: var(--line-gold); }
.chip.red { color: var(--red); border-color: rgba(255, 125, 125, .4); }
.drop-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(58, 49, 80, .5); cursor: pointer; }
.drop-row img { width: 24px; height: 24px; image-rendering: pixelated; }
.drop-row .pct { font-weight: 800; color: var(--gold-2); font-size: .9rem; }
.drop-row:hover .nm { color: var(--gold); }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; }

/* ---------- forms (register) ---------- */
.form-card { max-width: 460px; margin: 0 auto; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-gold);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.field input, .field select { width: 100%; font-size: 16px; min-height: 48px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field-error { font-size: .85rem; color: var(--red); margin-top: 4px; }
.row { display: flex; gap: 10px; }
.choice { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; min-height: 48px; cursor: pointer; }
.choice input { width: auto; min-height: 0; }
.message { margin-top: 16px; padding: 12px; border-radius: 10px; display: none; }
.message.error { display: block; background: rgba(255, 125, 125, .1); color: var(--red); }
.message.ok { display: block; background: rgba(111, 217, 154, .1); color: var(--green); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-gold); background: var(--bg-2); margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; padding: 28px 16px 12px; flex-wrap: wrap; }
.footer-inner p { max-width: 420px; font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: flex-start; }
.footer-links a { color: var(--muted); font-weight: 700; }
.footer-links a:hover { color: var(--gold); }
.legal { font-size: .75rem; color: #7f7695; padding: 8px 16px 24px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding: 48px 16px 64px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .rates-inner { grid-template-columns: repeat(3, 1fr); }
  .guide { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .toc .toc-title { width: 100%; }
  .db-layout { grid-template-columns: 1fr; }
  .db-detail { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--line-gold); padding: 10px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav .nav-play { margin: 8px 0 0; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .rates-inner { grid-template-columns: repeat(2, 1fr); margin-top: -28px; }
  .news-item { grid-template-columns: 1fr; gap: 4px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .section { padding: 44px 0; }
}

/* ---------- RO widgets: WoE, rankings, costumes ---------- */
.widgets-section { padding-top: 40px; padding-bottom: 0; }
.widget { display: flex; flex-direction: column; gap: 8px; }
.widget > a:last-child { margin-top: auto; font-weight: 700; }
.widget-title { font-family: var(--font-head); color: var(--gold); font-size: 1.05rem; letter-spacing: 1px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 4px; }
.woe-card .eyebrow { align-self: flex-start; margin: 0; }
.countdown { font-family: var(--font-head); font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--gold-2); letter-spacing: 2px; line-height: 1.1; }
.woe-card.live { border-color: rgba(255, 125, 125, .6); box-shadow: 0 0 24px rgba(255, 90, 90, .18); }
.woe-card.live .eyebrow { color: var(--red); border-color: rgba(255, 125, 125, .5); background: rgba(255, 125, 125, .08); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.mini-rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.mini-rank li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; font-size: .95rem; }
.mini-rank .nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-rank .muted { font-size: .8rem; }
.medal, .rank-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; font-size: .85rem; }
.medal { color: #1d1505; }
.medal.m1 { background: linear-gradient(180deg, #fff1b8, #e8c26a 60%, #a8812e); box-shadow: 0 0 10px rgba(232, 194, 106, .5); }
.medal.m2 { background: linear-gradient(180deg, #ffffff, #c9cfd8 60%, #8a93a3); }
.medal.m3 { background: linear-gradient(180deg, #ffd9b0, #c98a4b 60%, #8a5426); }
.medal.m4, .medal.m5, .rank-no { background: rgba(255, 255, 255, .06); color: var(--muted); border: 1px solid var(--line); }
.social { display: grid; gap: 8px; }
.social-discord:hover { border-color: #5865f2; color: #aab2ff !important; }
.social-facebook:hover { border-color: #1877f2; color: #8fbaff !important; }
.rank-card { padding: 6px 10px; }
.rank-table .nm { font-weight: 800; color: var(--gold-2); }
.rank-table .zeny { color: var(--gold); font-weight: 700; white-space: nowrap; }
.realm h3 { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.castle { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(58, 49, 80, .5); }
.castle .nm { font-weight: 700; }
.castle .owner { color: var(--gold); font-weight: 800; }
.castle .owner.none { color: var(--muted); font-weight: 600; font-style: italic; }
.woe-head { background: radial-gradient(ellipse at top, #4a1d24 0%, var(--bg) 70%); }
.woe-top .card { min-height: 100%; }

/* costume showcase: the game's collection art on parchment cards */
.costume-section { padding-bottom: 0; }
.costume-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.costume { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: var(--radius);
  background: linear-gradient(180deg, #f6eedb, #e6d6b0); border: 1px solid #c9b88f; color: #3a2c12 !important; font-weight: 800; font-size: .85rem;
  text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transition: transform .15s; }
.costume:hover { transform: translateY(-3px); }
.costume img { width: 75px; height: 100px; object-fit: contain; image-rendering: pixelated; mix-blend-mode: multiply; }
@media (max-width: 960px) { .costume-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .costume-strip { grid-template-columns: repeat(2, 1fr); } .countdown { font-size: 2rem; } }

/* ---------- RO art layer (v3): overlapping characters, animated monsters, ornate frames ---------- */
/* hero with the Valkyrie breaking out of the banner */
.hero-art { overflow: visible; z-index: 3; }
.hero-art .hero-inner { grid-template-columns: 1fr 1fr; min-height: 560px; padding-bottom: 90px; }
.hero-copy { position: relative; z-index: 2; }
.hero-character { position: absolute; right: -40px; bottom: -70px; width: min(760px, 62vw); height: auto; z-index: 1; pointer-events: none;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .7)) drop-shadow(0 0 40px rgba(246, 220, 148, .25)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }
.hero-sky span { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 12px 4px rgba(246, 220, 148, .6);
  animation: twinkle 4s ease-in-out infinite; z-index: 1; }
.hero-sky span:nth-child(1) { top: 18%; left: 52%; }
.hero-sky span:nth-child(2) { top: 40%; left: 88%; animation-delay: 1.3s; }
.hero-sky span:nth-child(3) { top: 70%; left: 46%; animation-delay: 2.6s; }
@keyframes twinkle { 0%, 100% { opacity: .1; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.2); } }
.btn-ico { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; margin: -6px 0; }

/* Porings walking along the bottom of the hero */
.poring-parade { position: absolute; left: 0; right: 0; bottom: 4px; height: 50px; overflow: hidden; z-index: 2; pointer-events: none; }
.poring-parade img { position: absolute; bottom: 0; height: 44px; image-rendering: pixelated; animation: parade 38s linear infinite; }
.poring-parade img:nth-child(2) { animation-delay: -9s; }
.poring-parade img:nth-child(3) { animation-delay: -19s; }
.poring-parade img:nth-child(4) { animation-delay: -28s; height: 50px; }
@keyframes parade { from { left: -80px; } to { left: 100%; } }

/* ornate RO frame: gold corner flourishes on panels */
.frame { position: relative; }
.frame::before, .frame::after { content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none; border: 2px solid var(--gold-dark); }
.frame::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; box-shadow: -2px -2px 8px rgba(232, 194, 106, .25); }
.frame::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; box-shadow: 2px 2px 8px rgba(232, 194, 106, .25); }
.rates-inner.frame { overflow: visible; }

/* animated monster icons */
.mob-ico { height: 64px; width: auto; max-width: 90px; object-fit: contain; image-rendering: pixelated; display: block; margin-bottom: 8px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); transition: transform .2s; }
.features .card:hover .mob-ico { transform: translateY(-4px) scale(1.08); }
.w-ico { height: 30px; width: auto; vertical-align: middle; image-rendering: pixelated; margin: -6px 2px -6px 0; }
.widget .status-head { display: flex; align-items: center; justify-content: space-between; }

/* launch phase banner */
.phase-section { padding-bottom: 0; }
.phase { display: flex; gap: 22px; align-items: center; background: linear-gradient(90deg, rgba(120, 30, 40, .35), var(--panel) 60%);
  border: 1px solid var(--line-gold); border-radius: var(--radius); padding: 22px 26px; }
.phase h2 { color: var(--gold); margin: 8px 0 6px; }
.phase p { margin: 0; }
.phase-mob { height: 110px; width: auto; image-rendering: pixelated; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }

@media (max-width: 960px) {
  .hero-art .hero-inner { grid-template-columns: 1fr; min-height: 0; padding-bottom: 260px; }
  .hero-character { right: 50%; transform: translateX(50%); width: min(560px, 110vw); bottom: -40px; animation: none; }
}
@media (max-width: 600px) {
  .phase { flex-direction: column; text-align: center; }
  .hero-art .hero-inner { padding-bottom: 210px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-character, .hero-sky span, .poring-parade img { animation: none; }
}

/* v3 layout fixes: keep the hero text and rates strip clear of the character */
.hero-copy { max-width: 560px; }
.hero-character { right: 0; bottom: -10px; width: min(640px, 48vw); }
.rates { position: relative; z-index: 4; }
@media (max-width: 960px) {
  .hero-character { width: min(420px, 88vw); bottom: 0; }
  .hero-art .hero-inner { padding-bottom: calc(min(420px, 88vw) * .68 + 40px); }
}
@media (max-width: 960px) {
  .hero-character { right: auto; left: 50%; transform: translateX(-50%); }
}
html, body { overflow-x: clip; }   /* clip, not hidden: hidden breaks position: sticky */

/* ---------- v4: hero halo, Kafra tip, marquee, pre-registration ---------- */
/* The Valkyrie stands in the right half of the hero, feet fading into the rates strip. */
.hero-art .hero-inner { position: relative; }
.hero-character { left: 50%; right: auto; bottom: 0; width: 50%; max-width: 640px;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 98%); mask-image: linear-gradient(180deg, #000 72%, transparent 98%); }
.hero-halo { position: absolute; left: 75%; top: 54%; width: min(500px, 38vw); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(246, 220, 148, .32), rgba(246, 220, 148, .08) 46%, transparent 70%); }
.hero-halo::before, .hero-halo::after { content: ""; position: absolute; inset: 9%; border-radius: 50%; border: 1px solid rgba(246, 220, 148, .35); }
.hero-halo::after { inset: 15%; border: 2px dashed rgba(246, 220, 148, .25); animation: halo-spin 60s linear infinite; }
@keyframes halo-spin { to { transform: rotate(360deg); } }
.prereg-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 6px 16px 6px 8px; border-radius: 99px; font-size: .92rem;
  background: rgba(232, 194, 106, .12); border: 1px solid var(--line-gold); color: var(--text); }
.prereg-pill img { height: 30px; image-rendering: pixelated; margin: -6px 0; }
.prereg-pill strong { color: var(--gold-2); }
.prereg-pill:hover { background: rgba(232, 194, 106, .22); color: var(--text); }
@media (max-width: 960px) {
  .hero-character { left: 50%; width: min(420px, 88vw); transform: translateX(-50%); }
  .hero-halo { left: 50%; top: auto; bottom: calc(min(420px, 88vw) * .1); width: min(360px, 76vw); transform: translateX(-50%); }
}

/* Kafra tip under the start steps: a framed bust with a speech bubble */
.kafra-tip { display: flex; align-items: center; gap: 20px; margin-top: 24px; }
.kafra-portrait { position: relative; flex: none; width: 128px; height: 128px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--gold-dark); background: radial-gradient(circle at 50% 35%, #4a3a6a, #15111f 75%);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .45), 0 0 26px rgba(246, 220, 148, .28); }
.kafra-portrait img { position: absolute; width: 170%; height: auto; left: -50%; top: -2%; max-width: none; }
.kafra-bubble { position: relative; flex: 1; background: var(--panel-2); border: 1px solid var(--line-gold); border-radius: 14px; padding: 14px 18px; }
.kafra-bubble::before { content: ""; position: absolute; left: -9px; top: 50%; width: 16px; height: 16px; background: var(--panel-2);
  border-left: 1px solid var(--line-gold); border-bottom: 1px solid var(--line-gold); transform: translateY(-50%) rotate(45deg); }
.kafra-name { display: block; font-family: Cinzel, serif; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.kafra-bubble .btn { display: inline-flex; margin-top: 10px; }
@media (max-width: 600px) {
  .kafra-tip { flex-direction: column; text-align: center; }
  .kafra-bubble::before { left: 50%; top: -9px; transform: translateX(-50%) rotate(135deg); }
}

/* Scrolling news marquee under the top bar */
.marquee { display: block; overflow: hidden; white-space: nowrap; position: relative; z-index: 5; color: #f3e6c4; font-size: .92rem;
  background: linear-gradient(90deg, #4e1824, #261436 50%, #4e1824); border-bottom: 1px solid var(--line-gold); }
.marquee:hover { color: #fff; }
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus .marquee-track { animation-play-state: paused; }
.marquee-run { display: flex; align-items: center; gap: 22px; padding: 8px 11px; }
.marquee b { color: var(--gold-2); }
.marquee i { color: var(--gold); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }
.nav a.nav-prereg { color: var(--gold-2); }
.nav a.nav-prereg::before { content: "\2726"; margin-right: 5px; color: var(--gold); }

/* Pre-registration page */
.prereg-head { position: relative; z-index: 2; text-align: center; padding: 72px 16px 60px; }
.prereg-head .lead { margin: 0 auto; }
.prereg-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.prereg-count { display: inline-block; margin-top: 28px; padding: 16px 40px; background: rgba(13, 11, 20, .72); border: 1px solid var(--line-gold); border-radius: var(--radius); }
.prereg-count .k { font-size: .78rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.prereg-count .v { font-family: Cinzel, serif; font-weight: 800; font-size: 3.2rem; line-height: 1.1; color: var(--gold); text-shadow: 0 0 24px rgba(246, 220, 148, .35); }
.milestones { position: relative; }
.milestone-track { position: absolute; top: 15px; left: calc(100% / 12); right: calc(100% / 12); height: 6px; border-radius: 3px; background: var(--line); }
.milestone-fill { height: 100%; width: var(--p, 0%); border-radius: 3px; background: linear-gradient(90deg, var(--gold-dark), var(--gold-2));
  box-shadow: 0 0 12px rgba(246, 220, 148, .6); transition: width .8s ease; }
.milestone-list { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.milestone { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ms-node { position: relative; z-index: 1; width: 36px; height: 36px; margin-bottom: 16px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-2); border: 3px solid var(--line); color: #1a1208; font-weight: 800; }
.milestone.done .ms-node { background: var(--gold); border-color: var(--gold-2); box-shadow: 0 0 14px rgba(246, 220, 148, .7); }
.ms-card { position: relative; width: 100%; flex: 1; padding: 16px 10px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.milestone.done .ms-card { border-color: var(--line-gold); }
.milestone.grand .ms-card { border-color: var(--gold); background: linear-gradient(180deg, rgba(232, 194, 106, .18), var(--panel) 70%); box-shadow: 0 0 26px rgba(232, 194, 106, .25); }
.ms-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 2px 10px; border-radius: 99px;
  background: var(--gold); color: #1a1208; font-size: .68rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.ms-pic { height: 108px; margin-bottom: 10px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(180deg, #f6eedb, #e6d6b0); border: 1px solid #c9b88f; }
.ms-pic img { max-height: 96px; max-width: 90%; image-rendering: pixelated; mix-blend-mode: multiply; }
.cp-coin { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: Cinzel, serif; font-weight: 800; font-size: 1.9rem; color: #5a3d08;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e8c26a 55%, #a8812e); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2), 0 3px 8px rgba(0, 0, 0, .3); }
.ms-at { font-size: .75rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.ms-reward { font-family: Cinzel, serif; font-weight: 700; color: var(--gold-2); margin: 4px 0; line-height: 1.25; }
.ms-state { font-size: .82rem; color: var(--muted); }
.milestone.done .ms-state { color: #6fdc8c; font-weight: 700; }
.prereg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.prereg-card { padding: 26px; }
.prereg-card h2 { color: var(--gold); margin-top: 0; }
.prereg-mob { float: right; height: 54px; image-rendering: pixelated; margin: -6px 0 0 12px; }
.prereg-form { display: flex; gap: 10px; margin: 18px 0 8px; }
.prereg-form input { flex: 1; min-width: 0; min-height: 50px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--text); background: #0f0c18; border: 1px solid var(--line); border-radius: 10px; }
.prereg-form input:focus { outline: 2px solid var(--gold-dark); border-color: var(--gold-dark); }
.prereg-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.prereg-msg { min-height: 1.4em; margin: 6px 0; font-weight: 700; }
.prereg-msg.ok { color: #6fdc8c; }
.prereg-msg.err { color: #ff7d7d; }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.claim-steps { padding-left: 22px; line-height: 1.7; }
.claim-steps li { margin-bottom: 6px; }
.prereg-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
@media (max-width: 960px) {
  .milestone-list { grid-template-columns: 1fr; gap: 12px; }
  .milestone { flex-direction: row; align-items: center; gap: 14px; text-align: left; }
  .ms-node { margin: 0; flex: none; }
  .ms-card { display: grid; grid-template-columns: 76px 1fr; column-gap: 14px; align-items: center; padding: 12px; }
  .ms-pic { grid-row: span 3; height: 76px; margin: 0; }
  .ms-pic img { max-height: 66px; }
  .cp-coin { width: 50px; height: 50px; font-size: 1.5rem; }
  .milestone-track { top: 0; bottom: 0; left: 15px; right: auto; width: 6px; height: auto; }
  .milestone-fill { width: 100%; height: var(--p, 0%); }
  .ms-badge { left: auto; right: 12px; transform: none; }
  .prereg-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) { .prereg-form { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .hero-halo::after { animation: none; }
  .marquee { overflow-x: auto; }
}
.hero-art { overflow: hidden; }
.kafra-bubble .btn { display: flex; width: fit-content; }
/* The rates strip overlaps the hero by 36px: keep the Valkyrie and the monster parade above it. */
.hero-character { bottom: 56px; }
.poring-parade { bottom: 38px; }
.hero-art .hero-inner { padding-bottom: 130px; }
@media (max-width: 960px) {
  .hero-character { bottom: 40px; }
  .poring-parade { bottom: 30px; }
  .hero-art .hero-inner { padding-bottom: calc(min(420px, 88vw) * .68 + 80px); }
}
/* The monster sprites face left: mirror them so they face the way they walk. */
.poring-parade img { transform: scaleX(-1); }
/* Play Now keeps its gold button look on hover (the nav hover style would replace the background). */
.nav a.btn-gold:hover { color: #1d1505; background: linear-gradient(180deg, var(--gold-2), var(--gold) 50%, var(--gold-dark)); filter: brightness(1.1); }
/* Dropdowns: one styled gold chevron with room on the right, the same on every page. */
.wrap select, .db-bar select, .field select { -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer;
  padding-right: 40px; background-color: #0f0c18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23e8c26a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
select option { background: #15111f; color: var(--text); }
/* Refining page */
.refine-tabs { margin: 6px 0 12px; flex-wrap: wrap; }
.refine-table tr.risky td:first-child { color: var(--gold); }
.refine-table .breaks { color: #ff8a8a; font-weight: 700; }
/* ---------- Ads landing page (/join, layout-landing.html) ---------- */
.lp-top { position: sticky; top: 0; z-index: 50; background: rgba(13, 11, 20, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-gold); }
.lp-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.lp-top-cta { min-height: 40px; padding: 8px 18px; }
.lp-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-gold);
  background: radial-gradient(ellipse at 75% 20%, #3a2b52 0%, var(--bg) 65%); }
.lp-art { position: absolute; top: 0; right: max(0px, calc(50% - 640px)); bottom: 0; width: min(560px, 48%); pointer-events: none; }
.lp-art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 82%, transparent 100%), linear-gradient(0deg, transparent 0%, #000 22%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 82%, transparent 100%), linear-gradient(0deg, transparent 0%, #000 22%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.lp-hero-inner { position: relative; z-index: 1; padding: 64px 16px 56px; max-width: 1180px; }
.lp-hero-inner > * { max-width: 600px; }
.lp-title { font-size: clamp(2.8rem, 8vw, 5rem); margin-bottom: .15em;
  background: linear-gradient(180deg, #fff6d8, var(--gold) 60%, var(--gold-dark)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, .7)); }
.lp-tag { font-family: var(--font-head); font-size: clamp(1.15rem, 2.6vw, 1.55rem); color: #f3ead2; line-height: 1.35; margin-bottom: 24px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }
.lp-signup { padding: 22px; background: linear-gradient(180deg, rgba(34, 29, 52, .94), rgba(20, 17, 32, .94)); border-color: var(--line-gold); box-shadow: var(--shadow); }
.lp-signup .prereg-form { margin: 14px 0 4px; }
.lp-signup .btn { white-space: nowrap; }
.lp-gift { display: flex; gap: 12px; align-items: center; font-size: 1.05rem; line-height: 1.4; }
.lp-gift strong { color: var(--gold-2); }
.lp-gift-ico { flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.5rem;
  background: radial-gradient(circle at 30% 30%, rgba(232, 194, 106, .35), rgba(232, 194, 106, .08)); border: 1px solid var(--line-gold); }
.lp-fine { font-size: .82rem; margin: 8px 0 0; }
.lp-signup .prereg-msg { min-height: 0; margin: 8px 0 0; }
.lp-signup .prereg-msg:empty { display: none; }
.lp-count.few b { display: none; }
.lp-count { margin: 18px 0 0; color: #d9d0ea; text-shadow: 0 2px 8px rgba(0, 0, 0, .8); }
.lp-count b { font-family: var(--font-head); font-size: 1.5rem; color: var(--gold-2); margin-right: 4px; }
.lp-features { padding-top: 40px; padding-bottom: 8px; }
.lp-feature h3 { margin-bottom: .35em; }
.lp-feature p { font-size: .93rem; color: var(--muted); }
.lp-share { text-align: center; margin: 26px auto 0; max-width: 560px; }
.lp-faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.lp-faq-list details { padding: 0; }
.lp-faq-list summary { cursor: pointer; padding: 16px 20px; font-weight: 800; color: var(--gold-2); list-style: none; position: relative; padding-right: 44px; }
.lp-faq-list summary::-webkit-details-marker { display: none; }
.lp-faq-list summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--gold); font-size: 1.4rem; font-weight: 400; }
.lp-faq-list details[open] summary::after { content: "\2212"; }
.lp-faq-list details p { padding: 0 20px 16px; margin: 0; color: var(--muted); }
.lp-final { text-align: center; background: radial-gradient(ellipse at center, #2a2140 0%, var(--bg) 70%); }
.lp-final h2 { color: var(--gold); margin-bottom: 20px; }
.lp-footer { margin-top: 0; }
.lp-sticky { display: none; }
@media (max-width: 860px) {
  .lp-art { width: 78%; right: -8%; opacity: .5; }
  .lp-hero-inner { padding: 36px 16px 40px; }
}
@media (max-width: 600px) {
  .lp-art { width: 100%; right: 0; opacity: .38; }
  .lp-features .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lp-feature { padding: 14px; }
  .lp-feature .mob-ico { height: 44px; }
  .lp-feature h3 { font-size: 1rem; }
  .lp-feature p { font-size: .85rem; }
  .lp-signup { padding: 16px; }
  .lp-signup .btn { width: 100%; }
  .lp-top-cta { display: none; }
  .lp-sticky { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; transform: translateY(150%); transition: transform .25s; }
  .lp-sticky.show { transform: none; }
  .lp-body .lp-footer { padding-bottom: 76px; }
}
