/* K-593 ageup.app styles. Palette = game/theme.css UI v2 tokens (cream/ink/sage/gold/coral), font Mitr (game). Cartoon look: thick ink outline,
   hard drop "lift", inset gloss. Motion: .reveal -> .in (site.js IntersectionObserver), [data-parallax], falling .leaves, footer walker. */
:root {
  --cream: #F3E9D2; --cream-lt: #FBF6EA; --cream-dk: #E4D3B0; --paper: #FFF9EC;
  --ink: #3B2A1E; --ink-dim: #7A6048; --brown: #8B6B4E;
  --sage: #9DB88A; --sage-dk: #6F8F5C; --leaf: #7FA35A;
  --gold: #E8C56A; --gold-dk: #B8923A; --acorn: #E9A23B; --acorn-dk: #B9711C;
  --coral: #E39B86; --coral-dk: #B8664F; --blue: #8FAFC8; --blue-dk: #5F84A3;
  --sky1: #FCE1A8; --sky2: #F6B970;
  --lw: 3px; --r: 22px; --r-sm: 14px;
  --lift: 0 5px 0 rgba(59, 42, 30, .9);
  --shadow: 0 6px 0 rgba(59, 42, 30, .25), 0 14px 30px rgba(59, 42, 30, .18);
  --gloss: inset 0 3px 0 rgba(255, 255, 255, .5), inset 0 -4px 0 rgba(59, 42, 30, .15);
  --ease: cubic-bezier(.2, .9, .25, 1.15);
  --wrap: 1180px; --gut: 20px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; font: 400 17px/1.7 'Mitr', 'Prompt', Tahoma, sans-serif; color: var(--ink); overflow-x: hidden;
  background: var(--cream) radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .55), transparent 40%) fixed,
    radial-gradient(circle at 85% 60%, rgba(232, 197, 106, .18), transparent 45%) fixed; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .35;
  background-image: radial-gradient(rgba(139, 107, 78, .18) 1px, transparent 1.5px); background-size: 22px 22px; }
img { max-width: 100%; display: block; }
a { color: var(--sage-dk); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; font-weight: 600; }
:focus-visible { outline: 3px solid var(--acorn); outline-offset: 3px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn { --bg: var(--cream-lt); --bd: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: .45em 1.3em;
  font: 600 17px/1 'Mitr', sans-serif; color: var(--ink); text-decoration: none; background: var(--bg); border: var(--lw) solid var(--bd); border-radius: var(--r-sm);
  box-shadow: var(--lift), var(--gloss); cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s; white-space: nowrap; }
.btn:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 8px 0 rgba(59, 42, 30, .9), var(--gloss); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(59, 42, 30, .9), var(--gloss); }
.btn-play { --bg: linear-gradient(#F7C85F, var(--acorn)); color: #4A2A0C; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.btn-ghost { --bg: var(--paper); }
.btn-xl { min-height: 64px; font-size: 24px; padding: .4em 1.4em; border-radius: 18px; }
.btn-xl span { font-size: .8em; }

/* ---------- header ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .3s, box-shadow .3s, transform .35s; }
.top-in { max-width: var(--wrap); margin: auto; display: flex; align-items: center; gap: 18px; padding: 10px var(--gut); }
.top.solid { background: rgba(243, 233, 210, .92); backdrop-filter: blur(8px); box-shadow: 0 3px 0 rgba(59, 42, 30, .85); }
.top.hide { transform: translateY(-110%); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 22px; }
.brand img { width: 52px; height: 52px; transition: transform .4s var(--ease); filter: drop-shadow(0 3px 0 rgba(59, 42, 30, .35)); }
.brand:hover img { transform: rotate(-10deg) scale(1.08); }
.home .top:not(.solid) .brand span { color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 12px rgba(0, 0, 0, .4); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a, .burger nav a:not(.btn) { padding: 6px 14px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 500; border: 2px solid transparent; transition: background .2s, transform .2s; }
.nav a:hover { background: var(--paper); border-color: var(--ink); transform: translateY(-2px); }
.nav a[aria-current] { background: var(--gold); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.home .top:not(.solid) .nav a:not([aria-current]):not(:hover) { color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 10px rgba(0, 0, 0, .5); }
.top-play { min-height: 42px; font-size: 16px; }
.burger { display: none; margin-left: auto; position: relative; }
.burger summary { list-style: none; cursor: pointer; width: 48px; height: 44px; display: grid; place-content: center; gap: 5px; background: var(--paper); border: var(--lw) solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.burger summary::-webkit-details-marker { display: none; }
.burger summary span { display: block; width: 22px; height: 3px; background: var(--ink); border-radius: 3px; transition: transform .25s; }
.burger[open] summary span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[open] summary span:nth-child(2) { opacity: 0; }
.burger[open] summary span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.burger nav { position: absolute; right: 0; top: 56px; width: min(260px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 4px; padding: 12px;
  background: var(--paper); border: var(--lw) solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); animation: pop .3s var(--ease); }
.burger nav .btn { margin-top: 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.96); } }

/* ---------- hero ---------- */
.hero { position: relative; aspect-ratio: 2020 / 778; min-height: 420px; max-height: 92svh; width: 100%; overflow: hidden; background: var(--sky2); }
.hero-bg { position: absolute; inset: 0; will-change: transform; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; animation: heroIn 1.6s var(--ease) both; }
@keyframes heroIn { from { transform: scale(1.12); filter: saturate(.6) brightness(1.15); } }
.hero-shade { position: absolute; inset: auto 0 0; height: 18%; background: linear-gradient(transparent, rgba(243, 233, 210, .9)); pointer-events: none; z-index: 2; }
/* CTA sits under the banner (banner already carries logo + tagline), pulled up over its bottom edge */
.hero-cta { position: relative; z-index: 4; text-align: center; padding: 0 var(--gut); margin-top: -34px; animation: rise 1s .5s var(--ease) both; }
.hero-sub { margin: 16px 0 0; color: var(--ink-dim); font-size: clamp(15px, 1.8vw, 19px); font-weight: 500; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-btns .btn-play { animation: pulse 2.4s 2s ease-in-out infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }
@keyframes pulse { 0%, 100% { box-shadow: var(--lift), var(--gloss), 0 0 0 0 rgba(247, 200, 95, .7); } 50% { box-shadow: var(--lift), var(--gloss), 0 0 0 14px rgba(247, 200, 95, 0); } }
.scroll-hint { display: none; position: absolute; z-index: 3; bottom: 16px; left: 50%; translate: -50% 0; width: 28px; height: 44px; border: 3px solid #fff; border-radius: 16px; filter: drop-shadow(0 2px 0 var(--ink)); }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 6px; height: 10px; margin-left: -3px; background: #fff; border-radius: 3px; animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* falling oak leaves */
.leaves { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.leaves i { position: absolute; top: -40px; left: var(--x); width: calc(30px * var(--s)); color: var(--leaf); animation: fall var(--d) linear var(--delay) infinite; filter: drop-shadow(0 2px 0 rgba(59, 42, 30, .35)); }
.leaves i[style*="--h:1"] { color: var(--gold); }
.leaves i[style*="--h:2"] { color: var(--acorn); }
.leaves svg { width: 100%; animation: sway 2.8s ease-in-out infinite alternate; }
@keyframes fall { to { transform: translate3d(0, calc(100svh + 80px), 0); } }
@keyframes sway { from { transform: translateX(-24px) rotate(-35deg); } to { transform: translateX(24px) rotate(40deg); } }

/* ---------- sections ---------- */
.sec { position: relative; max-width: var(--wrap); margin: auto; padding: 90px var(--gut); }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 46px; }
.kicker { display: inline-block; padding: 4px 14px; margin-bottom: 12px; font-size: 14px; font-weight: 500; letter-spacing: .04em; color: #fff; background: var(--sage-dk); border: 2px solid var(--ink); border-radius: 99px; box-shadow: 0 3px 0 var(--ink); transform: rotate(-2deg); }
.sec-head h2, .heroes-copy h2, .final h2, .page-head h1 { font-size: clamp(30px, 4.4vw, 48px); color: var(--ink); text-shadow: 0 3px 0 var(--cream-lt), 0 4px 0 rgba(59, 42, 30, .15); }
.sec-head p { color: var(--ink-dim); font-size: 18px; margin: 0; }
.reveal { opacity: 0; transform: translateY(36px) scale(.98); transition: opacity .7s ease, transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }
.more { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }

/* features */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.feat { text-align: center; padding: 26px 22px 28px; background: var(--paper); border: var(--lw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); transition: transform .35s var(--ease); }
.feat:hover { transform: translateY(-8px) rotate(-1deg); }
.feat:nth-child(even):hover { transform: translateY(-8px) rotate(1deg); }
.feat img { width: 170px; height: 170px; object-fit: contain; margin: -70px auto 8px; filter: drop-shadow(0 6px 0 rgba(59, 42, 30, .2)); transition: transform .5s var(--ease); }
.feat:hover img { transform: scale(1.08) rotate(-4deg); }
.feat h3 { font-size: 22px; }
.feat p { margin: 0; color: var(--ink-dim); font-size: 16px; }
.world .feats { margin-top: 90px; row-gap: 90px; }

/* heroes band */
.heroes { max-width: none; padding: 60px 0; background: linear-gradient(180deg, transparent, rgba(157, 184, 138, .35) 20%, rgba(157, 184, 138, .35) 80%, transparent); }
.heroes-in { max-width: var(--wrap); margin: auto; padding: 0 var(--gut); display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.heroes-art { position: relative; height: 520px; }
.heroes-art .h { position: absolute; bottom: 0; height: auto; filter: drop-shadow(0 10px 0 rgba(59, 42, 30, .18)); animation: bob 3.6s ease-in-out infinite; }
.heroes-art .h1 { left: 0; width: 42%; bottom: 40px; animation-delay: -1.2s; }
.heroes-art .h2 { left: 26%; width: 50%; z-index: 2; }
.heroes-art .h3 { right: 0; width: 40%; bottom: 30px; animation-delay: -2.4s; }
@keyframes bob { 50% { translate: 0 -12px; } }
.ticks { list-style: none; padding: 0; margin: 18px 0 26px; }
.ticks li { position: relative; padding-left: 34px; margin: 8px 0; }
.ticks li::before { content: '🌰'; position: absolute; left: 0; top: -1px; }

/* cards */
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 370px)); justify-content: center; gap: 26px; }
.card { display: block; color: inherit; text-decoration: none; background: var(--paper); border: var(--lw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s; }
.card:hover { transform: translateY(-6px); box-shadow: 0 10px 0 rgba(59, 42, 30, .25), 0 20px 40px rgba(59, 42, 30, .2); }
.post-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: var(--lw) solid var(--ink); background: var(--cream-dk); }
.post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .post-img img { transform: scale(1.07); }
.post-body { padding: 16px 20px 20px; }
.post-body h3 { font-size: 21px; margin: 8px 0 6px; }
.post-body p { margin: 0 0 10px; color: var(--ink-dim); font-size: 15.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
time { font-size: 14px; color: var(--brown); }
.tag { display: inline-block; font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 99px; border: 2px solid var(--ink); background: var(--blue); color: #fff; }
.tag-event { background: var(--coral-dk); } .tag-wiki { background: var(--sage-dk); }
.state, .pin { position: absolute; top: 12px; left: 12px; padding: 4px 12px; font-size: 14px; font-weight: 600; border: 2px solid var(--ink); border-radius: 99px; box-shadow: 0 3px 0 var(--ink); background: var(--paper); }
.pin { left: auto; right: 12px; }
.state-live { background: #7FC86A; color: #183a10; animation: wob 2s ease-in-out infinite; }
.state-soon { background: var(--gold); }
.state-ended { background: var(--cream-dk); color: var(--ink-dim); }
@keyframes wob { 50% { transform: rotate(-4deg) scale(1.06); } }
.group-h { font-size: 26px; margin: 34px 0 20px; }
.group-h:first-child { margin-top: 0; }

/* podium */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 18px; max-width: 760px; margin: auto; }
.pod { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pod b { font-size: 20px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod small { color: var(--ink-dim); }
.pod .val { font-weight: 600; color: var(--gold-dk); }
.crown { font-size: 46px; animation: bob 3s ease-in-out infinite; }
.pod .step { width: 100%; margin-top: 10px; display: grid; place-items: center; font-size: 48px; font-weight: 600; color: #fff; text-shadow: 0 3px 0 var(--ink); border: var(--lw) solid var(--ink); border-radius: 18px 18px 6px 6px; box-shadow: var(--shadow), var(--gloss); }
.pod-1 .step { height: 170px; background: linear-gradient(var(--gold), var(--gold-dk)); }
.pod-2 .step { height: 120px; background: linear-gradient(#D7E0E6, #9AA9B4); }
.pod-3 .step { height: 90px; background: linear-gradient(#E0A877, #B07444); }

/* guide (mascot + speech bubble) */
.guide-in { display: flex; align-items: center; gap: 30px; max-width: 900px; margin: auto; }
.mascot { width: 220px; flex: none; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 8px 0 rgba(59, 42, 30, .18)); }
.bubble { position: relative; padding: 26px 30px; background: var(--paper); border: var(--lw) solid var(--ink); border-radius: 26px; box-shadow: var(--shadow); }
.bubble::before { content: ''; position: absolute; left: -19px; top: 50%; width: 30px; height: 30px; background: var(--paper); border: var(--lw) solid var(--ink); border-width: 0 0 var(--lw) var(--lw); transform: translateY(-50%) rotate(45deg); }
.bubble h2 { font-size: 28px; }
.bubble p { color: var(--ink-dim); }

.final { text-align: center; }
.final-in img { width: 220px; margin: 0 auto 6px; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 8px 0 rgba(59, 42, 30, .2)); }
.final p { color: var(--ink-dim); font-size: 18px; margin: 0 0 24px; }

/* ---------- inner pages ---------- */
.page-head { position: relative; overflow: hidden; padding: 130px var(--gut) 60px; text-align: center;
  background: linear-gradient(180deg, var(--sky2), var(--sky1) 55%, var(--cream)); border-bottom: 0; }
.page-head::after { content: ''; position: absolute; inset: auto 0 -1px; height: 40px; background: var(--cream);
  -webkit-mask: radial-gradient(28px 22px at 28px 0, transparent 97%, #000) 0 0 / 56px 100% repeat-x; mask: radial-gradient(28px 22px at 28px 0, transparent 97%, #000) 0 0 / 56px 100% repeat-x; }
.page-head-in { position: relative; z-index: 3; animation: rise .9s var(--ease) both; }
.page-head p { color: var(--ink-dim); font-size: 18px; margin: 0; }
.page-head .leaves i { animation-duration: calc(var(--d) * .7); }
.empty { text-align: center; color: var(--ink-dim); } .empty img { margin: 0 auto 10px; animation: bob 3s infinite; }

/* paper panel = game parchment feel */
.paper { position: relative; background: var(--paper); border: var(--lw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 34px clamp(20px, 4vw, 48px); }
.post-page { padding-top: 76px; }
.post-cover { max-width: var(--wrap); margin: 20px auto 0; padding: 0 var(--gut); }
.post-cover img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border: var(--lw) solid var(--ink); border-radius: var(--r) var(--r) 0 0; }
.post-page > .paper { max-width: 860px; margin: -60px auto 0; }
.post-page h1 { font-size: clamp(28px, 4vw, 40px); margin-top: 10px; }
.back { display: inline-block; margin-bottom: 14px; font-weight: 500; text-decoration: none; }
.ev-when { margin: 12px 0 0; padding: 10px 14px; border: 2px dashed var(--brown); border-radius: 12px; background: var(--cream-lt); }
.ev-when span { font-weight: 600; }
.post-cta { margin-top: 30px; text-align: center; }

.prose { margin-top: 22px; font-size: 17.5px; }
.prose h2 { font-size: 26px; margin: 1.6em 0 .5em; padding-bottom: 6px; border-bottom: 3px dotted var(--cream-dk); scroll-margin-top: 90px; }
.prose h3 { font-size: 21px; margin: 1.3em 0 .4em; scroll-margin-top: 90px; }
.prose ul, .prose ol { padding-left: 1.4em; } .prose li { margin: .3em 0; }
.prose ul li::marker { content: '🌿 '; }
.prose li.sub { margin-left: 1.4em; font-size: .95em; } .prose ul li.sub::marker { content: '· '; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; background: #FFF3CF; border: 2px solid var(--gold-dk); border-radius: 14px; box-shadow: 0 3px 0 rgba(184, 146, 58, .5); }
.prose blockquote p { margin: 0; }
.prose figure { margin: 1.4em 0; } .prose figure img { width: auto; max-width: 100%; margin: auto; border: var(--lw) solid var(--ink); border-radius: 16px; box-shadow: var(--shadow); cursor: zoom-in; }
.prose figcaption { text-align: center; font-size: 14px; color: var(--brown); margin-top: 8px; }
.prose code { background: var(--cream-dk); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.prose pre { background: var(--ink); color: var(--cream); padding: 14px; border-radius: 12px; overflow-x: auto; }
.prose .tbl { overflow-x: auto; margin: 1.2em 0; }
.prose table { border-collapse: separate; border-spacing: 0; width: 100%; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; font-size: 16px; }
.prose th { background: var(--sage); text-align: left; } .prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--cream-dk); }
.prose tr:nth-child(even) td { background: var(--cream-lt); }
.prose hr { border: 0; height: 3px; background: repeating-linear-gradient(90deg, var(--brown) 0 10px, transparent 10px 18px); margin: 2em 0; }

/* wiki */
.wiki { display: grid; grid-template-columns: 270px 1fr; gap: 30px; align-items: start; }
.wiki-page { padding-top: 110px; }
.wiki-side { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow: auto; background: var(--paper); border: var(--lw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.wiki-side summary { font-weight: 600; cursor: pointer; padding: 4px 6px; list-style: none; }
.wiki-side summary::-webkit-details-marker { display: none; }
.wg h4 { font-size: 14px; color: #fff; background: var(--sage-dk); display: inline-block; padding: 1px 10px; border-radius: 99px; margin: 14px 0 6px; }
.wg a { display: block; padding: 5px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 15.5px; transition: background .2s, transform .2s; }
.wg a:hover { background: var(--cream); transform: translateX(4px); }
.wg a[aria-current] { background: var(--gold); font-weight: 600; box-shadow: inset 0 0 0 2px var(--ink); }
.wiki-art h1 { font-size: clamp(28px, 4vw, 40px); margin-top: 10px; }
.lead { font-size: 19px; color: var(--ink-dim); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; background: var(--cream-lt); border: 2px dashed var(--brown); border-radius: 14px; }
.toc b { margin-right: 6px; } .toc a { font-size: 15px; padding: 2px 10px; border-radius: 99px; background: var(--paper); border: 2px solid var(--cream-dk); text-decoration: none; color: var(--ink); }
.toc a:hover { border-color: var(--ink); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 18px; border-top: 3px dotted var(--cream-dk); }
.pager a { font-weight: 500; text-decoration: none; }
.wiki-home .guide-in { margin: 0 0 30px; }
.wiki-home .mascot { width: 160px; }
.wiki-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.wcard { padding: 16px 20px; } .wcard b { font-size: 18px; } .wcard p { margin: 4px 0 0; color: var(--ink-dim); font-size: 15px; }

/* ranking */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip, .chip-more, .period button { font: 500 15px 'Mitr', sans-serif; padding: 7px 16px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--ink); transition: transform .15s, background .2s; }
.chip:hover, .period button:hover:not(:disabled) { transform: translateY(-2px); }
.chip.on, .period button.on { background: var(--gold); font-weight: 600; }
.period { display: flex; justify-content: center; gap: 8px; margin: 18px 0 26px; }
.period button:disabled { opacity: .4; cursor: not-allowed; }
.rank-board { max-width: 760px; margin: auto; transition: opacity .25s; }
.rank-board.loading { opacity: .4; }
.rank-title { text-align: center; font-size: 26px; }
.rank-tbl { width: 100%; border-collapse: collapse; }
.rank-tbl td { padding: 10px 12px; border-bottom: 2px dotted var(--cream-dk); }
.rank-tbl .rk { width: 64px; text-align: center; font-weight: 600; font-size: 20px; }
.rank-tbl .nm b { display: block; } .rank-tbl .nm small { color: var(--ink-dim); }
.rank-tbl .vl { text-align: right; font-weight: 600; color: var(--gold-dk); white-space: nowrap; }
.rank-tbl .mb { color: var(--ink-dim); white-space: nowrap; }
.rank-tbl tr.r1 td { background: rgba(232, 197, 106, .28); } .rank-tbl tr.r1 .rk, .rank-tbl tr.r2 .rk, .rank-tbl tr.r3 .rk { font-size: 28px; }
.rank-tbl tr { animation: rowIn .5s var(--ease) both; } .rank-tbl tr:nth-child(n) { animation-delay: calc(min(var(--n, 0), 20) * 30ms); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-16px); } }
.rank-tbl .none { text-align: center; color: var(--ink-dim); padding: 40px; }
.rank-at { text-align: center; font-size: 14px; color: var(--brown); margin: 16px 0 0; }

/* updates */
.upd { max-width: 900px; } .upd-row { display: grid; grid-template-columns: 140px 1fr; gap: 20px; margin-bottom: 22px; padding: 24px 28px; }
.upd-v b { display: inline-block; font-size: 20px; background: var(--sage); border: 2px solid var(--ink); border-radius: 12px; padding: 2px 12px; box-shadow: 0 3px 0 var(--ink); }
.upd-v time { display: block; margin-top: 8px; } .upd h3 { font-size: 21px; } .upd ul { margin: 0; padding-left: 1.2em; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; padding: 20px; background: rgba(59, 42, 30, .82); cursor: zoom-out; animation: pop .25s var(--ease); }
.lb img { max-height: 90vh; border: var(--lw) solid var(--cream); border-radius: 14px; }

/* ---------- footer ---------- */
.foot { position: relative; margin-top: 60px; color: var(--cream); }
.foot-forest { position: relative; height: clamp(150px, 18vw, 260px); background: url(/img/gen/footer-forest.webp) center bottom / auto 100% repeat-x; }
.walker { position: absolute; bottom: 7%; left: -80px; width: 54px; height: 80px; background: url(/img/acorn-walk.webp) 0 0 / 600% 100% no-repeat;
  animation: walk .6s steps(6) infinite, cross 26s linear infinite, hop .3s ease-in-out infinite alternate; }
@keyframes walk { to { background-position: 120% 0; } }
@keyframes cross { to { left: calc(100% + 80px); } }
@keyframes hop { to { translate: 0 -4px; } }
.foot-in { background: #3B2A1E; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; padding: 34px max(var(--gut), calc(50% - var(--wrap) / 2 + var(--gut))) 20px; }
.foot-brand { display: flex; gap: 14px; align-items: center; } .foot-brand b { font-size: 22px; } .foot-brand p { margin: 0; opacity: .8; }
.foot nav { display: flex; flex-direction: column; gap: 4px; } .foot nav a { color: var(--cream); opacity: .85; text-decoration: none; } .foot nav a:hover { opacity: 1; color: var(--gold); }
.copy { grid-column: 1 / -1; margin: 10px 0 0; font-size: 14px; opacity: .6; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav, .top-play { display: none; } .burger { display: block; }
  .feats { grid-template-columns: repeat(2, 1fr); }
  .heroes-in { grid-template-columns: 1fr; } .heroes-art { height: 380px; max-width: 520px; width: 100%; margin: auto; }
  .wiki { grid-template-columns: 1fr; } .wiki-side { position: static; max-height: none; }
  .foot-in { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --gut: 16px; }
  body { font-size: 16px; }
  .sec { padding: 64px var(--gut); }
  .feats, .wiki-cards { grid-template-columns: 1fr; } .grid3 { grid-template-columns: 1fr; }
  .world .feats { row-gap: 80px; }
  .hero { aspect-ratio: 4 / 3.3; min-height: 0; }
  .hero-btns .btn-xl { font-size: 18px; min-height: 52px; padding: .4em 1em; }
  .hero-bg img { object-position: 50% 50%; }
  .guide-in { flex-direction: column; text-align: center; }
  .bubble::before { left: 50%; top: -19px; transform: translateX(-50%) rotate(135deg); }
  .mascot { width: 160px; }
  .podium { gap: 8px; } .pod b { font-size: 16px; } .crown { font-size: 34px; } .pod .step { font-size: 34px; }
  .upd-row { grid-template-columns: 1fr; gap: 8px; }
  .post-page > .paper { margin: -30px var(--gut) 0; }
  .foot-in { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; } .leaves { display: none; }
}
.wiki-side summary::after { content: ' ▾'; } .wiki-side details[open] summary::after { content: ' ▴'; }

/* K-605 corner dock (views.mjs dock): fixed bottom-right, vertical stack socials / flags / go-top; ui = paper pill + ink border like .nav active */
.dock { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dk { --s: 46px; width: var(--s); height: var(--s); display: grid; place-items: center; padding: 0; color: var(--ink); background: var(--paper); border: var(--lw) solid var(--ink); border-radius: 50%;
  box-shadow: 0 3px 0 var(--ink); cursor: pointer; text-decoration: none; transition: transform .2s var(--ease), background .2s, color .2s; }
.dk:hover { transform: translateY(-3px); }
.dk:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--ink); }
.dk svg { width: 24px; height: 24px; }
.dk-discord:hover { background: #5865F2; color: #fff; } .dk-facebook:hover { background: #1877F2; color: #fff; } .dk-tiktok:hover { background: #111; color: #fff; } .dk-instagram:hover { background: #E1306C; color: #fff; }
.dk-langs { display: flex; flex-direction: column; gap: 6px; padding: 6px; background: var(--paper); border: var(--lw) solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
.dk-flag { --s: 34px; border-width: 2px; box-shadow: none; overflow: hidden; opacity: .55; }
.dk-flag img { width: 150%; height: 100%; object-fit: cover; }
.dk-flag.on { opacity: 1; outline: 3px solid var(--gold); outline-offset: 1px; }
.dk-flag:hover { opacity: 1; }
.dk-top { background: linear-gradient(#F7C85F, var(--acorn)); opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .25s, transform .25s var(--ease), visibility .25s; }
.dk-top.show { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 640px) { .dock { gap: 8px; } .dk { --s: 40px; } .dk svg { width: 21px; height: 21px; } .dk-flag { --s: 30px; } }
@media (prefers-reduced-motion: reduce) { .dk, .dk-top { transition: none; } }

/* K-966 Windows PC app download button (shown by site.js on Windows only) */
.btn-win { --bg: #2b6cb0; color: #fff; gap: .45em; }
.btn-win svg { flex: none; }
.btn-win[hidden] { display: none; }
.hero-dl { margin-top: 12px; }
.hero-dl:not(:has(.btn-win:not([hidden]))) { display: none; }
