/* Bellguard: Kingdom Defense — site styles. Palette mirrors the game's gfx/Palette.kt. */
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("../fonts/nunito_extrabold.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url("../fonts/nunito_semibold.ttf") format("truetype"); }

:root {
  --bg: #141922;
  --panel: rgba(23, 28, 38, .88);
  --panel-solid: #1b2130;
  --wood: #5a3a1e;
  --wood-dark: #3b2512;
  --gold: #f2c53d;
  --gold-dark: #c9951e;
  --blue: #3d7bd9;
  --blue-dark: #2c5faf;
  --green: #4caf50;
  --red: #e5484d;
  --text: #fff8e7;
  --dim: #c8c2b4;
  --parchment: #f3e9d2;
  --parchment-ink: #2b2b2b;
  --parchment-dim: #5c5143;
  --radius: 14px;
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", sans-serif;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg) url("../img/hero-bg.jpg") center top / cover no-repeat fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(12, 16, 24, .55) 0%, rgba(12, 16, 24, .82) 40%, rgba(12, 16, 24, .94) 100%);
}
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffe08a; }
h1, h2, h3 { font-weight: 800; line-height: 1.2; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p, li { max-width: 72ch; }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: min(var(--maxw), 100% - 2rem); margin: 0 auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--gold); color: #000; padding: .5rem 1rem; z-index: 10; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--panel); backdrop-filter: blur(6px); border-bottom: 2px solid var(--wood); box-shadow: inset 0 -1px 0 var(--gold-dark); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.25rem; }
.brand img { height: 42px; width: auto; }
.nav { display: flex; gap: .2rem 1rem; flex-wrap: wrap; margin-left: auto; font-size: .95rem; }
.nav a { color: var(--dim); text-decoration: none; padding: .35rem .2rem; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }
.lang { font-size: .9rem; border: 1px solid var(--gold-dark); border-radius: 999px; padding: .25rem .8rem; color: var(--gold); text-decoration: none; white-space: nowrap; }
.lang:hover { background: rgba(242, 197, 61, .12); }

/* Hero */
.hero { text-align: center; padding: clamp(2.5rem, 8vw, 6rem) 0 2.5rem; }
.hero .logo { width: min(640px, 90%); margin: 0 auto 1.2rem; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); }
.hero h1 { margin-bottom: .4rem; text-shadow: 0 3px 10px rgba(0, 0, 0, .6); }
.tagline { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: var(--text); margin: 0 auto 1.6rem; max-width: 60ch; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.meta { color: var(--dim); font-size: .95rem; margin-top: 1rem; }

/* Google Play button */
.play-btn { display: inline-flex; align-items: center; gap: .7rem; background: #000; color: #fff; border: 1.5px solid #a6a6a6; border-radius: 10px; padding: .5rem 1.1rem .5rem .8rem; text-decoration: none; line-height: 1.1; transition: transform .15s ease, box-shadow .15s ease; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.play-btn:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .55); }
.play-btn svg { width: 34px; height: 38px; flex: none; }
.play-btn small { display: block; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.play-btn b { display: block; font-size: 1.25rem; font-weight: 800; }

/* Panels */
.panel { background: var(--panel); border: 2px solid var(--wood); border-radius: var(--radius); box-shadow: inset 0 0 0 1px rgba(242, 197, 61, .35), 0 10px 30px rgba(0, 0, 0, .45); padding: clamp(1.2rem, 3vw, 2.2rem); }
section { margin: 2.5rem auto; }
.section-title { text-align: center; margin-bottom: 1.4rem; }
.section-title::after { content: ""; display: block; width: 84px; height: 3px; margin: .6rem auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

/* Feature cards */
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature { background: var(--panel); border: 2px solid var(--wood); border-radius: var(--radius); box-shadow: inset 0 0 0 1px rgba(242, 197, 61, .3); padding: 1.2rem 1.3rem; }
.feature .icon { font-size: 1.8rem; line-height: 1; margin-bottom: .5rem; }
.feature h3 { color: var(--gold); }
.feature p { margin: 0; color: var(--dim); font-size: .97rem; }

/* Gallery */
.gallery { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .gallery { grid-template-columns: 1fr 1fr 1fr; } }
.gallery figure { margin: 0; }
.gallery a { display: block; border: 2px solid var(--wood); border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(242, 197, 61, .3), 0 8px 20px rgba(0, 0, 0, .45); transition: transform .15s ease; }
.gallery a:hover { transform: scale(1.02); }
.gallery figcaption { font-size: .85rem; color: var(--dim); text-align: center; margin-top: .4rem; }

/* Legal / prose pages */
.prose { background: var(--parchment); color: var(--parchment-ink); border: 3px solid var(--wood); border-radius: var(--radius); box-shadow: inset 0 0 0 2px #d9c9a3, inset 0 0 0 3px var(--gold-dark), 0 12px 34px rgba(0, 0, 0, .5); padding: clamp(1.4rem, 4vw, 3rem); margin: 2rem auto; max-width: 880px; }
.prose a { color: #8a5a10; }
.prose a:hover { color: #b8781a; }
.prose h1 { color: var(--wood-dark); font-size: clamp(1.7rem, 4vw, 2.5rem); }
.prose h2 { color: var(--wood-dark); margin-top: 2em; padding-bottom: .25em; border-bottom: 2px solid #d9c9a3; font-size: clamp(1.25rem, 2.6vw, 1.6rem); }
.prose h3 { color: var(--wood-dark); margin-top: 1.4em; }
.prose .updated { color: var(--parchment-dim); font-size: .95rem; margin-top: -.5rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1rem 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .5rem .6rem; border: 1px solid #d9c9a3; }
.prose th { background: #e9dcbd; }
.prose .note { background: #fff6dd; border-left: 4px solid var(--gold-dark); padding: .8rem 1rem; border-radius: 6px; }
.prose code { background: #e9dcbd; padding: .1em .35em; border-radius: 4px; font-size: .92em; }
.prose pre { background: #e9dcbd; padding: .9rem 1rem; border-radius: 8px; overflow-x: auto; font-size: .9rem; }
.prose dl dt { font-weight: 800; margin-top: 1rem; color: var(--wood-dark); }
.prose dl dd { margin: .2rem 0 0; }

/* Footer */
.site-footer { margin-top: 3rem; padding: 1.6rem 0 2.2rem; background: var(--panel-solid); border-top: 2px solid var(--wood); box-shadow: inset 0 1px 0 var(--gold-dark); color: var(--dim); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.site-footer a { color: var(--dim); }
.site-footer a:hover { color: var(--text); }

.center { text-align: center; }
.btn { display: inline-block; background: var(--blue); color: #fff; font-weight: 800; padding: .7rem 1.4rem; border-radius: 10px; text-decoration: none; border: 2px solid var(--blue-dark); box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.btn:hover { background: #4a8aec; color: #fff; }

/* Phones: brand and language switch share the first row, the nav takes the second. */
@media (max-width: 640px) {
  body { background-attachment: scroll; }
  .site-header .wrap { gap: .4rem .8rem; padding: .4rem 0; }
  .lang { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: center; }
}
