/* Crown & Banner: the website. The game's own look: dark wood and iron, gold trim, a book serif. */
:root {
  --ink: #0d0b09;
  --panel: #17130f;
  --panel-2: #1f1913;
  --line: rgba(232, 198, 106, 0.28);
  --gold: #e8c66a;
  --gold-deep: #b8913a;
  --cream: #efe6d2;
  --dim: #b7ab92;
  --green: #2f5d34;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, Cambria, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 18px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--gold); }
a:hover { color: #fff1c4; }

.wrap { width: min(1120px, 92vw); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top bar */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 12px 4vw;
  background: linear-gradient(rgba(13, 11, 9, 0.92), rgba(13, 11, 9, 0.6));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.top .brand { display: flex; align-items: center; gap: 10px; color: var(--gold); text-decoration: none; font-size: 20px; letter-spacing: 0.06em; }
.top .brand img { width: 30px; height: 30px; border-radius: 6px; }
.top nav { display: flex; gap: 22px; margin-left: auto; }
.top nav a { color: var(--dim); text-decoration: none; font-size: 16px; }
.top nav a:hover { color: var(--cream); }
@media (max-width: 760px) { .top nav a:not(.buy-link) { display: none; } }

/* ---- buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 30px;
  font: 600 19px var(--serif); letter-spacing: 0.04em;
  color: #1a1206;
  background: linear-gradient(#f3d98d, var(--gold) 45%, var(--gold-deep));
  border: 1px solid #fbe7a8; border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(232, 198, 106, 0.18), 0 10px 30px rgba(0, 0, 0, 0.45);
  cursor: pointer; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.button:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 0 0 4px rgba(232, 198, 106, 0.28), 0 14px 34px rgba(0, 0, 0, 0.5); color: #1a1206; }
.button:disabled, .button[aria-disabled="true"] { filter: grayscale(0.8) brightness(0.7); cursor: default; transform: none; }
.button.small { padding: 8px 18px; font-size: 16px; }
.button.ghost { background: transparent; color: var(--gold); border-color: var(--line); box-shadow: none; }
.button.ghost:hover { color: #fff1c4; border-color: var(--gold); }
.price { font-size: 15px; font-weight: 400; opacity: 0.85; }
.price:empty { display: none; }

/* ---- hero */
.hero {
  position: relative; min-height: min(100vh, 900px);
  display: flex; align-items: flex-end;
  background: url("media/keyart.jpg") center / cover no-repeat, var(--ink);
}
@media (max-width: 760px) { .hero { background-position: left top; } }   /* (narrow: keep the logo, top left of the art, in view) */
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13, 11, 9, 0) 45%, rgba(13, 11, 9, 0.85) 82%, var(--ink));
}
.hero .wrap { position: relative; z-index: 1; padding: 0 0 70px; }
.hero .tagline { font-size: clamp(24px, 3.4vw, 38px); color: var(--cream); margin: 0 0 8px; text-shadow: 0 2px 12px #000; }
.hero .sub { color: var(--dim); margin: 0 0 26px; max-width: 640px; text-shadow: 0 2px 10px #000; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.badge { display: inline-block; padding: 3px 12px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 99px; color: var(--gold); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; background: rgba(13, 11, 9, 0.6); }

/* ---- sections */
section { padding: 90px 0; }
section.alt { background: linear-gradient(var(--panel), var(--ink)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(30px, 4vw, 44px); color: var(--gold); font-weight: 600; letter-spacing: 0.03em; margin: 0 0 12px; }
h2 + .lead { color: var(--dim); margin: 0 0 40px; max-width: 720px; }
h3 { color: var(--gold); font-weight: 600; margin: 0 0 6px; font-size: 22px; }
.rule { width: 120px; height: 2px; margin: 0 0 22px; background: linear-gradient(90deg, var(--gold), transparent); }

.trailer { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); background: #000; }
.trailer video { width: 100%; aspect-ratio: 16 / 9; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.feature { padding: 24px 26px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.feature p { margin: 0; color: var(--dim); font-size: 17px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 22px; }
.gallery figure { margin: 0; }
.gallery button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: none; cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.3s; }
.gallery button:hover img { transform: scale(1.03); }
.gallery figcaption { color: var(--dim); font-size: 15px; padding: 8px 2px 0; }

.lightbox { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 3vw; background: rgba(0, 0, 0, 0.9); cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 92vh; border: 1px solid var(--line); border-radius: 6px; }

/* ---- buying */
.buy { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .buy { grid-template-columns: 1fr; } }
.buy-card { padding: 32px; background: var(--panel-2); border: 1px solid var(--gold-deep); border-radius: 12px; box-shadow: 0 0 0 4px rgba(232, 198, 106, 0.08); }
.buy-card .amount { font-size: 42px; color: var(--cream); margin: 4px 0 2px; min-height: 1.2em; }
.buy-card .note { color: var(--dim); font-size: 15px; margin: 14px 0 0; }
ul.ticks { list-style: none; padding: 0; margin: 18px 0 26px; }
ul.ticks li { padding-left: 30px; position: relative; margin: 8px 0; }
ul.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 12px; height: 7px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg); }
table.specs { width: 100%; border-collapse: collapse; font-size: 17px; }
table.specs th { text-align: left; color: var(--dim); font-weight: 400; padding: 8px 16px 8px 0; vertical-align: top; width: 38%; }
table.specs td { padding: 8px 0; border-bottom: 1px solid rgba(232, 198, 106, 0.12); }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; color: var(--cream); font-size: 20px; list-style: none; }
details summary::before { content: "+"; color: var(--gold); display: inline-block; width: 26px; }
details[open] summary::before { content: "\2212"; }
details p { color: var(--dim); margin: 10px 0 0 26px; }

/* ---- plain pages (terms, thanks, download) */
.page { padding: 130px 0 80px; min-height: 80vh; }
.page .wrap { width: min(820px, 92vw); }
.page h1 { color: var(--gold); font-weight: 600; font-size: clamp(32px, 4vw, 46px); margin: 0 0 8px; }
.page h2 { font-size: 26px; margin-top: 34px; }
.page p, .page li { color: var(--dim); }
.page strong { color: var(--cream); }
.box { padding: 26px 28px; margin: 26px 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.box p:first-child { margin-top: 0; }
form.inline { display: flex; flex-wrap: wrap; gap: 12px; }
input[type="email"], input[type="text"] {
  flex: 1 1 280px; padding: 12px 14px; font: 18px var(--serif); color: var(--cream);
  background: var(--ink); border: 1px solid var(--line); border-radius: 6px;
}
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.status { min-height: 1.6em; color: var(--dim); }
.status.bad { color: #e98a6f; }
.status.good { color: #9fd59a; }

footer { padding: 40px 0 50px; border-top: 1px solid var(--line); color: var(--dim); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }
footer a { color: var(--dim); }

/* ---- moving parts (home.js): rising into view, counters, kingdoms, news */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

.stats { padding: 40px 0; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(232, 198, 106, 0.06), transparent); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 24px; text-align: center; }
.stat b { display: block; font-size: clamp(40px, 5vw, 58px); color: var(--gold); font-weight: 600; line-height: 1.1; text-shadow: 0 0 24px rgba(232, 198, 106, 0.35); }
.stat span { color: var(--dim); font-size: 16px; }

.kingdom-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.kingdom-tabs button { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; font: 17px var(--serif); color: var(--cream);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.kingdom-tabs button:hover { border-color: var(--k); }
.kingdom-tabs button[aria-pressed="true"] { border-color: var(--k); background: color-mix(in srgb, var(--k) 22%, var(--panel-2)); }
.kingdom-tabs .crest { width: 14px; height: 18px; background: var(--k); clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); }
.kingdom-card { display: grid; grid-template-columns: 180px 1fr; gap: 34px; padding: 32px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--k) 55%, transparent);
  background: radial-gradient(circle at 0 0, color-mix(in srgb, var(--k) 20%, transparent), transparent 60%), var(--panel-2); }
.kingdom-card.swap { animation: swap 0.5s ease; }
@keyframes swap { from { opacity: 0.2; transform: translateY(8px); } }
.kingdom-card .banner { width: 150px; height: 230px; position: relative; background: linear-gradient(180deg, color-mix(in srgb, var(--k) 85%, #fff 10%), color-mix(in srgb, var(--k) 70%, #000));
  clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); box-shadow: inset 0 0 0 4px rgba(232, 198, 106, 0.6); animation: wave 4s ease-in-out infinite; transform-origin: top center; }
.kingdom-card .banner span { position: absolute; left: 50%; top: 40%; width: 56px; height: 56px; translate: -50% -50%; border: 3px solid var(--gold); border-radius: 50%; }
@keyframes wave { 50% { transform: skewX(-2.5deg) scaleY(0.985); } }
@media (max-width: 700px) { .kingdom-card { grid-template-columns: 1fr; } .kingdom-card .banner { height: 160px; width: 120px; } }
@media (prefers-reduced-motion: reduce) { .kingdom-card .banner, .kingdom-card.swap { animation: none; } }
.kingdom-card h3 { font-size: 30px; color: var(--k); filter: brightness(1.25); }
.kingdom-card .motto { color: var(--gold); font-style: italic; margin: 0 0 10px; }
.kingdom-card p { color: var(--dim); }
.mix { margin-top: 18px; display: grid; gap: 8px; max-width: 460px; }
.mix-row { display: grid; grid-template-columns: 80px 1fr 46px; align-items: center; gap: 12px; font-size: 16px; }
.mix-bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mix-bar i { display: block; height: 100%; background: var(--k); border-radius: 99px; animation: grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes grow { from { width: 0; } }
.mix-row b { color: var(--cream); font-weight: 400; text-align: right; }

.news-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.news-item { padding: 24px 26px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; transition: transform 0.2s, border-color 0.2s; }
.news-item:hover { transform: translateY(-3px); border-color: var(--gold-deep); }
.news-item time, .note-entry time { color: var(--gold); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.news-item p { color: var(--dim); font-size: 16px; }
.more { margin-top: 26px; }
.note-entry { padding: 26px 0; border-bottom: 1px solid var(--line); }
.note-entry h2 { margin-top: 4px; }
.note-entry li { margin: 6px 0; }
.note-entry code { color: var(--cream); }

.community { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 22px; margin: 26px 0; }
.community-card { display: block; padding: 28px; text-decoration: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; transition: transform 0.2s, border-color 0.2s; }
.community-card:hover { transform: translateY(-3px); border-color: var(--gold-deep); }
.community-card h2 { margin: 0 0 8px; }
.community-card p { color: var(--dim); }
.top nav a { white-space: nowrap; }
