/* ---------- Design tokens ---------- */
:root {
  --sky-900: #0b4f9c;
  --sky-700: #1477e0;
  --sky-500: #2a9cff;
  --sky-200: #bfe4ff;
  --sky-50:  #eef8ff;
  --grass-700: #3f9a12;
  --grass-500: #6cc81f;
  --grass-300: #a9ea5a;
  --sun-600: #f07b12;
  --sun-400: #ffa53a;
  --berry-500: #ff4f7b;
  --ink-900: #17304d;
  --ink-600: #4a6380;
  --ink-400: #8399b2;
  --line: #dcebf8;
  --card: #ffffff;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 18px 40px -18px rgba(14, 76, 150, .35), 0 2px 6px rgba(14, 76, 150, .08);
  --topbar-h: 88px;               /* height of the sticky top bar that the hero and sub-pages run under */
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--sky-50);
  -webkit-font-smoothing: antialiased;
  /* keep the footer at the bottom of the window on short pages */
  min-height: 100vh; display: flex; flex-direction: column;
}
body > main, body > .subpage { flex: 1 0 auto; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }

/* ---------- Game-style buttons ---------- */
.btn {
  --b-top: var(--sky-500); --b-bot: var(--sky-700); --b-edge: var(--sky-900);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: .01em;
  color: #fff; border: 0; cursor: pointer;
  padding: .8em 1.5em; border-radius: 999px;
  background: linear-gradient(180deg, var(--b-top), var(--b-bot));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 4px 0 var(--b-edge), 0 10px 18px -6px rgba(0,0,0,.3);
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--sky-700); outline-offset: 3px; }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 1px 0 var(--b-edge), 0 4px 8px -4px rgba(0,0,0,.3); }
.btn--play { --b-top: #8fe03a; --b-bot: var(--grass-500); --b-edge: var(--grass-700); font-size: 1.2rem; padding: .85em 1.8em; }
.btn svg { width: 1.15em; height: 1.15em; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: 12px 0;
}
.topbar__inner {
  display: flex; align-items: center; gap: 28px;
  padding: 8px 10px 8px 18px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  box-shadow: 0 10px 30px -14px rgba(11,79,156,.45);
}
.topbar__logo img { height: 46px; width: auto; }
.topbar nav { display: flex; gap: 6px; margin-right: auto; }
.topbar nav a {
  font-family: var(--font-display); font-weight: 600; color: var(--ink-600);
  padding: 8px 16px; border-radius: 999px; transition: background .15s, color .15s;
}
.topbar nav a:hover, .topbar nav a:focus-visible, .topbar nav a[aria-current] { background: var(--sky-50); color: var(--sky-700); }
.topbar .btn { padding: .6em 1.3em; font-size: .95rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin-top: calc(-1 * var(--topbar-h));  /* run the sky under the floating top bar */
  padding: 150px 0 170px;
  background: url("/assets/hero_sky.jpg") center 70% / cover no-repeat;
  overflow: hidden;
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; gap: 24px; }
.hero__copy { position: relative; z-index: 2; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sky-700); background: rgba(255,255,255,.85);
  padding: 7px 14px 7px 10px; border-radius: 999px;
  box-shadow: 0 4px 14px -6px rgba(11,79,156,.4);
}
.eyebrow i { width: 9px; height: 9px; border-radius: 50%; background: var(--grass-500); box-shadow: 0 0 0 4px rgba(108,200,31,.25); }
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 5vw, 4.1rem); line-height: 1.08; letter-spacing: .01em; word-spacing: .06em;
  margin: 22px 0 18px; color: #fff;
  /* a thick outline drawn behind the letters, like the game logo, so the heading reads on the pale sky;
     the extra letter and word spacing keeps the outlines from running together */
  -webkit-text-stroke: .12em var(--sky-900); paint-order: stroke fill;
  text-shadow: 0 .09em 0 var(--sky-900), 0 .2em .35em rgba(11,79,156,.35);
}
.hero h1 em { font-style: normal; color: #ffd83a; }
.hero p.lead {
  font-size: 1.15rem; line-height: 1.6; font-weight: 600; max-width: 30em;
  color: var(--ink-900); margin: 0 0 30px;
  background: rgba(255,255,255,.7); padding: 14px 18px; border-radius: var(--radius-md);
  backdrop-filter: blur(6px);
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero__meta { margin-top: 18px; font-size: .9rem; font-weight: 700; color: var(--sky-900); opacity: .8; }

.hero__art { position: relative; height: 520px; }
.hero__art img { position: absolute; filter: drop-shadow(0 18px 20px rgba(11,79,156,.35)); animation: bob 6s ease-in-out infinite; }
.hero__art .c-rogue    { width: 255px; left: 2%;  top: 10px;  animation-delay: -1.5s; }
.hero__art .c-fighter  { width: 330px; right: -2%; top: 30px;  animation-delay: -3s; }
.hero__art .c-archer   { width: 280px; left: 12%; top: 205px; animation-delay: -4.5s; z-index: 2; }
.hero__art .c-magician { width: 320px; left: 44%; top: 185px; z-index: 3; }
@keyframes bob { 50% { transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .hero__art img { animation: none; } }

/* puffy cloud edge between sky and page */
.hero__clouds { position: absolute; left: 0; right: 0; bottom: -1px; height: 120px; color: var(--sky-50); }
.hero__clouds svg { width: 100%; height: 100%; display: block; }

/* ---------- Panels row (account + news) ---------- */
.panels { position: relative; z-index: 3; margin-top: -120px; display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.card {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); border: 1px solid #fff;
}
.card__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px 0; }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin: 0; }

/* account */
.account { overflow: hidden; }
.account__banner {
  position: relative; height: 104px;
  background: linear-gradient(135deg, #8fe03a, var(--grass-500) 55%, #4fae15);
  display: flex; align-items: flex-end; padding: 0 24px 14px;
}
.account__banner h2 { margin: 0; max-width: 8.5em; line-height: 1.05;font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: #fff; text-shadow: 0 2px 0 var(--grass-700); }
.account__banner img { position: absolute; right: 10px; bottom: -6px; width: 116px; transform: scaleX(-1); filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }

/* news */
.news__list { list-style: none; margin: 0; padding: 10px 14px 16px; }
.news__featured {
  display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: center;
  margin: 18px 26px 6px; padding: 12px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--sky-50), #fff);
  border: 1px solid var(--line);
}
.news__featured:focus-visible { outline: 3px solid var(--sky-700); outline-offset: 3px; }
.news__featured img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 14px; }
.news__featured h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin: 8px 0 6px; line-height: 1.2; }
.news__featured p { margin: 0; color: var(--ink-600); font-weight: 600; line-height: 1.5; font-size: .95rem; }
.news__item a {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center;
  padding: 12px; border-radius: var(--radius-sm); transition: background .15s;
}
.news__item a:hover, .news__item a:focus-visible { background: var(--sky-50); }
.news__item a:focus-visible { outline: 3px solid var(--sky-700); outline-offset: 3px; }
.news__item + .news__item { border-top: 1px dashed var(--line); }
.news__item .t { font-weight: 700; }
.news__item--empty { padding: 12px; font-weight: 600; color: var(--ink-600); }
.news__item time { font-size: .85rem; font-weight: 700; color: var(--ink-400); }
.tag {
  justify-self: start; font: 700 .72rem var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; color: #fff;
}
.tag--update { background: var(--sky-500); }
.tag--notice { background: var(--ink-400); }
.tag--event  { background: var(--berry-500); }
.tag--maint  { background: var(--sun-600); }
.link-more { font: 600 .95rem var(--font-display); color: var(--sky-700); }

/* ---------- Download ---------- */
.section { padding: 88px 0 0; }
.section__head { text-align: center; margin-bottom: 34px; }
.section__head h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 3.4vw, 2.8rem); margin: 10px 0 8px; }
.section__head p { margin: 0 auto; max-width: 36em; color: var(--ink-600); font-weight: 600; font-size: 1.05rem; }

.download {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); background: #fff;
}
.download__art { position: relative; min-height: 380px; background: url("/assets/scene01.jpg") center / cover; }
.download__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,0) 60%, #fff); }
.download__art img { position: absolute; left: 24px; bottom: -10px; width: 250px; filter: drop-shadow(0 12px 14px rgba(0,0,0,.3)); }
.download__body { padding: 40px 44px 40px 20px; display: grid; gap: 22px; align-content: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  font: 700 1.2rem var(--font-display); color: #fff;
  background: linear-gradient(180deg, var(--sun-400), var(--sun-600));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 3px 0 #b8540a;
}
.steps b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.steps span { color: var(--ink-600); font-weight: 600; font-size: .95rem; }
.download__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.download__note { margin: 0; font-size: .85rem; font-weight: 700; color: var(--ink-600); }
.download__meta { font-size: .85rem; font-weight: 700; color: var(--ink-400); line-height: 1.5; }

.reqs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 22px; }
.req { background: #fff; border-radius: var(--radius-md); padding: 16px 18px; border: 1px solid var(--line); }
.req small { display: block; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); }
.req strong { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }

/* ---------- Worlds strip ---------- */
.worlds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.world { position: relative; margin: 0; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--shadow-card); }
.world img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.world:hover img { transform: scale(1.06); }
.world figcaption {
  position: absolute; left: 12px; bottom: 12px;
  font: 600 1rem var(--font-display); color: #fff;
  background: rgba(11,79,156,.55); backdrop-filter: blur(6px);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Footer ---------- */
.footer { margin-top: 96px; background: var(--sky-900); color: #cfe6ff; position: relative; }
.footer__wave { position: absolute; left: 0; right: 0; top: -59px; height: 60px; color: var(--sky-900); }
.footer__wave svg { width: 100%; height: 100%; display: block; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; padding: 34px 0 40px; }
.footer img { height: 44px; width: auto; }
.footer nav { display: flex; gap: 22px; font-weight: 700; }
.footer nav a:hover { color: #fff; }
.footer p { flex-basis: 100%; margin: 0; font-size: .8rem; font-weight: 600; color: #8db6e0; line-height: 1.6; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { height: 420px; transform: scale(.8); transform-origin: top center; margin-bottom: -80px; }
  .panels { grid-template-columns: 1fr; margin-top: -90px; }
  .download { grid-template-columns: 1fr; }
  .download__art::after { background: linear-gradient(180deg, rgba(255,255,255,0) 60%, #fff); }
  .download__body { padding: 8px 28px 32px; }
  .reqs, .worlds { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .topbar nav { display: none; }
  .account__banner h2 { max-width: 7em; }
  .download__art { min-height: 300px; }
  .world figcaption { font-size: .85rem; }
  .topbar__inner { justify-content: space-between; }
  .hero { padding-top: 120px; }
  .hero__art { height: 360px; transform: scale(.62); margin-bottom: -140px; margin-inline: -20%; }
  .news__featured { grid-template-columns: 1fr; }
  .news__item a { grid-template-columns: 1fr auto; }
  .news__item .tag { grid-column: 1 / -1; }
}

/* ---------- Disabled game button ---------- */
.btn:disabled, .btn:disabled:hover, .btn:disabled:active {
  filter: grayscale(.85); opacity: .7; cursor: not-allowed; transform: none;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 4px 0 var(--b-edge), 0 10px 18px -6px rgba(0,0,0,.3);
}

/* ---------- Account card (registration closed) ---------- */
.account__soon { padding: 22px 24px 26px; display: grid; gap: 8px; }
.account__soon h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.account__soon p { margin: 0; color: var(--ink-600); font-weight: 600; line-height: 1.55; }

/* ---------- Sub-pages (news, post, 404) ---------- */
.subpage {
  margin-top: calc(-1 * var(--topbar-h));  /* run the sky band under the floating top bar, like the hero */
  padding: 120px 0 0;
  background: linear-gradient(180deg, var(--sky-200), var(--sky-50) 360px);
}
.page__head { margin-bottom: 26px; }
.page__head h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 3.4vw, 2.8rem); margin: 0; }

.newslist { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.newslist a { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; padding: 14px; border-radius: var(--radius-lg); transition: background .15s; }
.newslist a:hover, .newslist a:focus-visible { background: var(--sky-50); }
.newslist a:focus-visible { outline: 3px solid var(--sky-700); outline-offset: 3px; }
.newslist a.no-image { grid-template-columns: 1fr; padding: 18px 22px; }
.newslist__empty { padding: 22px; font-weight: 600; color: var(--ink-600); }
.newslist img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 14px; }
.newslist h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin: 8px 0 6px; line-height: 1.2; }
.newslist p { margin: 0; color: var(--ink-600); font-weight: 600; line-height: 1.5; }
.newslist time, .post time { margin-left: 8px; font-size: .85rem; font-weight: 700; color: var(--ink-400); }
.pager { display: flex; justify-content: space-between; margin-top: 24px; }

.post { overflow: hidden; padding-bottom: 32px; }
.post__image { width: 100%; aspect-ratio: 21/9; object-fit: cover; }
.post__body { padding: 28px clamp(20px, 5vw, 56px) 0; }
.post h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.15; margin: 12px 0 18px; }
.post__content { max-width: 44em; font-size: 1.05rem; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; }
.post__content pre { overflow-x: auto; }
.post__content a { color: var(--sky-700); text-decoration: underline; }
.post__back { display: inline-block; margin-top: 28px; }

.lost { display: grid; justify-items: center; gap: 14px; padding: 48px 24px 56px; text-align: center; }
.lost img { width: 200px; filter: drop-shadow(0 12px 14px rgba(11,79,156,.3)); }
.lost h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 3.4vw, 2.6rem); margin: 0; }
.lost p { margin: 0 0 8px; color: var(--ink-600); font-weight: 600; }

@media (max-width: 640px) {
  .newslist a { grid-template-columns: 1fr; }
}
