:root {
  /* Filled in per-load by main.js */
  --nation: #2b4a5e;
  --wc-pos: 0 0;
  --wc-size: 60vw;

  --card-bg: #f7f1e4;
  --card-rule: rgba(90, 60, 30, 0.14);
  --ink: #3a2b1f;
  --ink-soft: #6b5844;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  overflow: hidden;
}

/* ---- Random background stack ---- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg > * {
  position: absolute;
  inset: 0;
}

.bg-base {
  background-color: var(--nation);
}

/* Watercolour wash — grayscale texture over the nation colour with an
   `overlay` blend gives painterly light/dark variation of the hue, exactly
   like the game's tended tiles. */
.bg-watercolor {
  background-image: url(/assets/watercolor-cards.png);
  background-repeat: no-repeat;
  background-size: var(--wc-size);
  background-position: var(--wc-pos);
  mix-blend-mode: overlay;
  opacity: 0.9;
}

/* Terrain / improvement line pattern — drawn by main.js as one pattern PNG per
   hex in the game's offset-row grid, tinted the vivid nation colour. Canvas so
   the hexes interlock exactly (no straight-grid gaps). */
.bg-pattern {
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

/* Soft edge darkening so the card lifts off the busy background. */
.bg-vignette {
  background: radial-gradient(120% 120% at 50% 42%, transparent 40%, rgba(0, 0, 0, 0.28) 100%);
}

/* ---- Centered card ---- */

.card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(92vw, 420px);
  padding: 48px 44px 40px;
  background: var(--card-bg);
  border: 1px solid var(--card-rule);
  border-radius: 20px;
  box-shadow:
    0 32px 80px -32px rgba(0, 0, 0, 0.55),
    0 4px 12px -4px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.title {
  width: min(72vw, 260px);
  height: auto;
  display: block;
}

.tagline {
  margin: 0 4px 6px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ---- Buttons ---- */

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(280px, 100%);
  min-height: 50px;
  padding: 0 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  color: #fff;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }

.btn svg { width: 22px; height: 22px; flex: none; }

.btn-label { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.btn-sub { font-size: 11px; font-weight: 500; opacity: 0.85; }
.btn-main { font-size: 17px; font-weight: 600; letter-spacing: 0.2px; }

.btn-appstore { background: #0a0a0a; }
.btn-discord  { background: #5865f2; }

@media (max-width: 400px) {
  .card { padding: 40px 26px 34px; }
}
