/* Far Fetched: styles for the server-rendered pages (homepage, Learn, country guides, FAQ, legal pages).
   The game at /play uses styles.css instead. Keep this file small: these pages must load fast. */
:root {
  --bg: #0b1020;
  --bg-2: #111832;
  --panel: #151d3b;
  --panel-2: #1b2550;
  --line: #26315f;
  --text: #e8ecff;
  --muted: #9aa6d1;
  --accent: #6b9dff;
  --accent-2: #7c5cff;
  --good: #2fd27a;
  --bad: #ff5470;
  --warn: #ffb547;
  --gold: #ffd166;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --wrap: 1120px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1b2a66 0%, transparent 60%), var(--bg);
  background-color: var(--bg);
  color: var(--text); font-size: 16px; line-height: 1.55;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
img, svg { max-width: 100%; }
.muted { color: var(--muted); }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.small { font-size: .875rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--panel-2); color: var(--text); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: rgba(11, 16, 32, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; gap: 8px; align-items: center; font-size: 1.15rem; color: var(--text); font-weight: 600; flex: none; }
.brand b { color: var(--accent); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.5rem; display: inline-flex; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a:not(.btn) { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.nav a:not(.btn):hover, .nav a.active { color: var(--text); background: var(--panel); text-decoration: none; }
.nav .btn { margin-left: 8px; }
/* Phones: logo and Play button on the first row, the links on a second row. */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 2px 4px; padding: 8px 12px; }
  .topbar::after { content: ''; order: 1; flex-basis: 100%; }
  .site-nav { display: contents; }
  .site-nav .btn { order: 1; margin-left: auto; flex: none; }
  .site-nav a:not(.btn) { order: 2; padding: 6px 8px; font-size: .92rem; }
  .site-nav a:not(.btn):first-child { margin-left: -8px; }
  h1 { font-size: 1.7rem; }
}

/* ---------- Buttons, panels, forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); padding: 10px 16px; border-radius: 10px; font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: border-color .15s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, #2f63d9, #6243e0); border-color: transparent; color: #fff; }
.btn.primary:hover { border-color: #a9c2ff; }
.btn.small { padding: 6px 12px; font-size: .875rem; border-radius: 8px; }
.btn.big { padding: 13px 22px; font-size: 1.08rem; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.panel { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
input[type=text], input[type=email], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px;
  padding: 10px 12px; font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(107, 157, 255, .25); }
label.field { display: block; margin: 0 0 12px; }
label.field > span { display: block; font-size: .875rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.form-msg { min-height: 1.4em; font-size: .95rem; }
.form-msg.ok { color: var(--good); }
.form-msg.bad { color: var(--bad); }

/* ---------- Footer ---------- */
.footer {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px 16px; align-items: center;
  padding: 18px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; margin-top: 32px;
}
.footer > :first-child { justify-self: start; }
.footer > :last-child { justify-self: end; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
@media (max-width: 860px) {
  .footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer > :first-child, .footer > :last-child { justify-self: center; }
}

/* ---------- Article-style pages (legal, guides, Learn, FAQ...) ---------- */
.legal { max-width: 820px; width: 100%; margin: 0 auto; padding: 24px 20px 16px; }
.legal .panel { padding: 28px clamp(18px, 4vw, 40px); }
.legal h1 { margin: 0 0 6px; }
.legal h2 { margin: 30px 0 10px; font-size: 1.3rem; }
.legal h3 { margin: 20px 0 6px; font-size: 1.05rem; }
.legal p, .legal li { line-height: 1.7; }
.legal ul, .legal ol { padding-left: 22px; }
.legal li + li { margin-top: 4px; }
.legal .updated { color: var(--muted); margin: 0 0 18px; }
.legal .summary { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.legal table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-top: 1px solid var(--line); }
.legal th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.legal-nav { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 16px; }
.seo .lead { font-size: 1.12rem; color: var(--text); }
.seo-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.seo-more { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.seo-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.seo-crumbs { font-size: .875rem; color: var(--muted); margin: 0 0 10px; }
.seo-crumbs a { color: var(--muted); }
.meta-line { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.callout { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.callout.tip { border-left-color: var(--good); }
figure { margin: 18px 0; }
figure svg { display: block; width: 100%; height: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
figcaption { color: var(--muted); font-size: .875rem; margin-top: 6px; }
.toc { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; margin: 16px 0; }
.toc ol { margin: 6px 0 0; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.related a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--text); }
.related a:hover { border-color: var(--accent); text-decoration: none; }
.related small { display: block; color: var(--muted); margin-top: 2px; }

/* Country guides, stats posts, embed page */
.cg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; margin: 8px 0 4px; }
.cg-grid a { padding: 4px 0; }
.cg-facts { max-width: 560px; }
.cg-facts th { width: 120px; }
.st-bars { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 6px; }
.st-bar { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 48px; align-items: center; gap: 10px; font-size: .95rem; }
.st-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-track { height: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.st-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.st-bars.warn .st-fill { background: var(--warn); }
.st-bars.good .st-fill { background: var(--good); }
.st-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 560px) { .st-bar { grid-template-columns: 1fr 44px; } .st-track { grid-column: 1 / -1; grid-row: 2; } }
.emb-preview { margin: 8px 0 4px; }
.emb-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 6px 0 8px; }
.emb-code { width: 100%; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; }

/* ---------- Homepage ---------- */
.home { width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.h-sec { padding: 44px 0 8px; }
.h-sec > .wrap > h2 { font-size: 1.6rem; margin-bottom: 6px; }
.h-sec .intro { color: var(--muted); max-width: 720px; margin: 0 0 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { display: block; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card h3 { color: var(--text); margin-bottom: 6px; }
.card p { margin: 0; color: #c3cbea; font-size: .95rem; }
.card .meta { display: block; color: var(--muted); font-size: .8rem; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg-2); border-radius: 99px; padding: 6px 14px; color: var(--text); }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
.more { margin: 14px 0 0; font-weight: 600; }
.band { margin-top: 44px; }
.band .panel { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.band h2 { margin: 0; }

/* ---------- Landing: the top of the homepage, the same look as the game's own start screen ---------- */
.landing { padding: 20px 0 4px; }
.landing-hero { text-align: center; padding: 36px 24px 28px;
  background: radial-gradient(ellipse at top, rgba(79, 140, 255, .18), transparent 70%), linear-gradient(180deg, var(--panel), var(--bg-2)); }
.landing-logo { display: block; margin: 0 auto 10px; width: 170px; height: auto; filter: drop-shadow(0 10px 24px rgba(79, 140, 255, .35)); }
.landing-hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.3rem); margin: 6px 0 12px; }
.landing-hero .lead { max-width: 640px; margin: 0 auto 18px; color: var(--muted); font-size: 1.08rem; }
.landing-hero .welcome { margin: -6px 0 16px; }
.landing-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 16px; }
.btn.ghost { background: transparent; }
.g-wrap { display: flex; justify-content: center; min-height: 44px; margin: -4px 0 8px; }
.g-msg { color: var(--bad); margin: 0 0 8px; font-size: .9rem; }
.g-msg:empty { display: none; }
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .82rem; color: var(--muted); }
.chip b { color: var(--text); }
.landing-boards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 760px) {
  .landing-boards { grid-template-columns: 1fr; }
  .landing-hero { padding: 28px 16px 22px; }
  .landing-logo { width: 130px; }
  .landing-cta .btn.big { flex: 1 1 100%; font-size: 1rem; padding: 12px 16px; }
  .landing-cta .btn.big:nth-child(n+3) { flex: 1 1 40%; }
}
.lb-head { display: flex; align-items: center; gap: 10px; }
.lb-head h2 { font-size: 1.05rem; margin: 0; }
.lb-head a { margin-left: auto; }
.mini-board { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: mb; }
.mini-board li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); counter-increment: mb; }
.mini-board li:first-child { border-top: 0; }
.mini-board li::before { content: counter(mb); color: var(--muted); width: 18px; font-weight: 700; }
.mini-board .name { font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-board .spacer { flex: 1; }
.face { display: inline-block; line-height: 1; }
.lvl { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: linear-gradient(135deg, #2f63d9, #6243e0); color: #fff; font-size: .72rem; font-weight: 800; }
.flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; font-size: .9rem; margin: 0; }
/* The game's slowly spinning globe behind the top of the homepage (desktops only; added by a script after the page loads) */
.globe-bg { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; opacity: .7;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 96%); mask-image: linear-gradient(to bottom, #000 55%, transparent 96%); }
.globe-bg canvas { display: block; }
@media (max-width: 899px) { .globe-bg { display: none; } }
body.globe-bg-on main, body.globe-bg-on .footer { position: relative; z-index: 1; }
body.globe-bg-on .landing .panel { background: linear-gradient(180deg, rgba(21, 29, 59, .72), rgba(17, 24, 50, .76)); }
body.globe-bg-on .landing-hero { background: radial-gradient(ellipse at top, rgba(79, 140, 255, .14), transparent 70%), linear-gradient(180deg, rgba(21, 29, 59, .55), rgba(17, 24, 50, .6)); }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
