/* =========================================================================
   Lorcappa — lorcappa.com  •  shared stylesheet (home + all deck subpages)
   -------------------------------------------------------------------------
   - DARK is the default theme (fantasy purple, not pitch black).
     Light mode = <html data-theme="light">, toggled by js/site.js.
     Both themes live in this one file as CSS custom properties, so a single
     stylesheet serves every page. To re-skin, edit the token blocks below.
   - Two languages live in the markup at once; CSS shows one set based on
     <html data-lang="en|ja">. English is the default on first visit.
   - No frameworks, no build step. Plain CSS only.
   ========================================================================= */

/* ---- Theme tokens : DARK (default) ------------------------------------- */
:root {
  /* Fantasy purple, like the Darkwood/Astral backgrounds. SWAP freely. */
  --bg-1: #1a1130;          /* base */
  --bg-2: #2a1c44;          /* glow */
  --bg-3: #100a1f;          /* deepest corner */
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f3f0fb;
  --text-muted: #c5bcdd;
  --accent: #ffcf5c;        /* lore gold */
  --accent-2: #b9a4ff;      /* lavender */
  --glow: rgba(185, 164, 255, 0.45);
  --link: #ffd97a;

  /* Shape / motion */
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1020px;           /* short, focused page width */
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* SWAP fonts here. System stack = zero network requests, instant render.
     To use a custom display font later, add @font-face and change --font-head. */
  --font-body: "Hiragino Maru Gothic ProN", "Segoe UI", system-ui,
               -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Hiragino Maru Gothic ProN", "Trebuchet MS", system-ui, sans-serif;
}

/* ---- Theme tokens : LIGHT (parchment, toggled from the header) ---------- */
:root[data-theme="light"] {
  --bg-1: #efe9dc;
  --bg-2: #f7f2e7;
  --bg-3: #e6ddcb;
  --surface: rgba(60, 40, 90, 0.05);
  --surface-2: rgba(60, 40, 90, 0.09);
  --border: rgba(60, 40, 90, 0.16);
  --text: #2a2140;
  --text-muted: #5a4f72;
  --accent: #b07d1a;
  --accent-2: #6a4fb0;
  --glow: rgba(106, 79, 176, 0.30);
  --link: #7a4fce;
}

/* ---- Reset-ish --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.6;
  /* Instant, weightless gradient background — no multi-MB wallpaper to load. */
  background:
    radial-gradient(1100px 620px at 50% -8%, var(--bg-2), transparent 60%),
    radial-gradient(800px 520px at 92% 4%, rgba(90, 209, 200, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-3));
  background-attachment: fixed;
}
/* Faint sparkle tile over the gradient (a few KB). SWAP images/pattern.svg
   for in-house artwork, or comment this whole block out to disable. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/images/pattern.svg");
  background-size: 160px 160px;
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); }

/* Accessible "visually hidden" helper (labels for screen readers). */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* =========================================================================
   Language switching: both languages are in the DOM; CSS shows one.
   Use <span lang="en">…</span><span lang="ja">…</span> pairs in the markup.
   ========================================================================= */
:root[data-lang="en"] [lang="ja"] { display: none; }
:root[data-lang="ja"] [lang="en"] { display: none; }

/* =========================================================================
   Page shell
   ========================================================================= */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---- Header : brand (left) + socials & toggles (right) ------------------ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.15rem;
}
.brand img {
  width: 44px; height: 44px;
  border-radius: 50%;                 /* keeps any square art circular */
  transition: transform .25s var(--ease);
}
.brand:hover img { transform: rotate(-6deg) scale(1.06); }

.header-actions { display: inline-flex; align-items: center; gap: 6px; }

/* Icon buttons (socials + toggles). Inline SVGs inherit currentColor,
   so they recolor automatically in light mode. SWAP any of them for image
   files by replacing the <svg> with an <img> in the HTML. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover,
.icon-btn:focus-visible {
  color: var(--accent);
  background: var(--surface);
  transform: translateY(-1px);
  outline: none;
}
.icon-btn:active { transform: translateY(0) scale(.94); }

/* Language toggle = globe icon + short label. Never wraps or shrinks. */
.lang-btn {
  width: auto;
  padding: 0 10px;
  gap: 5px;
  font-weight: 700;
  font-size: .82rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.lang-btn svg { flex-shrink: 0; }

/* Theme toggle: moon shows in dark mode, sun in light mode. */
.theme-btn .icon-sun { display: none; }
:root[data-theme="light"] .theme-btn .icon-moon { display: none; }
:root[data-theme="light"] .theme-btn .icon-sun { display: inline; }

/* =========================================================================
   Hero : LORCAPPA logo banner + tagline
   ========================================================================= */
.hero { text-align: center; padding: 6px 0 4px; }
.hero .logo-banner {
  width: min(560px, 86%);
  margin: 0 auto;
  filter: drop-shadow(0 4px 22px var(--glow));
}
.hero h1 { margin: 0; }              /* h1 wraps the logo image for SEO */
.hero .tagline {
  max-width: 52ch;
  margin: 12px auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 3.4vw, 1.2rem);
}

/* =========================================================================
   Tournament sections + decklist carousels
   ========================================================================= */
.section { margin: 34px 0; }
.section > h2 {
  font-family: var(--font-head);
  text-align: center;
  font-size: clamp(1.2rem, 4.5vw, 1.6rem);
  margin: 0 0 4px;
  color: var(--accent);
}
.section > .section-sub {
  text-align: center;
  margin: 0 0 12px;
  font-size: .9rem;
  color: var(--text-muted);
}

/* The carousel: one horizontal, scroll-snapping row. Pure HTML + CSS —
   no JavaScript, no libraries. It NEVER wraps to a second row and never
   makes the page itself scroll sideways; overflow stays inside this strip.
   On phones a partial next card peeks in from the right as the "swipe me"
   affordance; on desktop the styled scrollbar (and shift+wheel) scrolls it. */
.carousel {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(10px, 1.6vw, 16px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 6px 4px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-2) transparent;
}
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-track { background: transparent; }
.carousel::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 999px;
}
.carousel:hover::-webkit-scrollbar-thumb { background: var(--accent-2); }

/* One decklist thumbnail. Fixed flex-basis (not flex-grow) is what makes the
   strip scroll instead of squishing: cards keep a readable size and extras
   ride off the right edge. clamp() sizes them for iPhone → desktop. */
.deck {
  flex: 0 0 clamp(240px, 44vw, 340px);
  min-width: 0;
  scroll-snap-align: start;
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Card / thumbnail: keeps 16:9, comes "alive" on hover & touch. */
.card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;                /* decklist snapshots are 16:9 slides */
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.card img { width: 100%; height: 100%; object-fit: cover; }

/* Hover only on devices that truly hover (keeps phones from sticking). */
@media (hover: hover) {
  .deck:hover .card,
  .deck:focus-visible .card {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--accent-2),
                0 0 22px var(--glow);
  }
}
/* Touch / keyboard feedback so it feels alive everywhere. */
.deck:active .card { transform: translateY(-2px) scale(1.015); }
.deck:focus-visible { outline: none; }

/* Caption under each decklist: standing + player + archetype. */
.deck .caption {
  display: block;
  margin-top: 6px;
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
}
.deck .caption strong { color: var(--accent); font-weight: 700; }

/* "Coming soon" cards (placeholders, not links) render dimmer. */
.deck.soon { cursor: default; }
.deck.soon .card { opacity: .75; box-shadow: none; }

/* =========================================================================
   Footer — mailing list & helpful tips (Kit), then legal
   ========================================================================= */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.signup {
  max-width: 620px;
  margin: 0 auto;
  padding: 26px 18px 18px;
  text-align: center;
}
.signup h2 {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  margin: 0 0 4px;
  color: var(--accent);
}
.signup .blurb { margin: 0 0 14px; color: var(--text-muted); font-size: .95rem; }

.signup-form {
  display: flex;
  flex-wrap: wrap;            /* the form MAY wrap — it's not a gallery */
  gap: 8px;
  justify-content: center;
}
.signup-form input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 11px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.signup-form input::placeholder { color: var(--text-muted); }
.signup-form input:focus-visible {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--glow);
}

/* "Join" button drawn purely with CSS gradients + shadows (no image asset,
   à la Lea Verou's CSS Secrets). */
.btn {
  flex: 0 0 auto;
  padding: 11px 22px;
  font: inherit;
  font-weight: 800;
  color: #2a1a05;
  background: linear-gradient(180deg, #ffe08a, var(--accent));
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25), 0 6px 16px var(--glow);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease);
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }

.signup .status { min-height: 1.2em; margin: 10px 0 0; font-size: .9rem; }
.signup .status.ok { color: var(--accent-2); }
.signup .status.err { color: #ff9b9b; }
.signup .fineprint { margin: 14px 0 0; font-size: .76rem; color: var(--text-muted); }

/* Legal / attribution block (Ravensburger Community Code). */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 18px 4px;
  font-size: .72rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}
.legal a { color: inherit; }

.colophon {
  text-align: center;
  padding: 12px 16px 18px;
  font-size: .76rem;
  color: var(--text-muted);
}

/* =========================================================================
   Responsive — favor iPhone portrait, degrade gracefully upward.
   ========================================================================= */
@media (max-width: 600px) {
  .wrap { padding: 0 12px; }
  .site-header { padding: 10px 12px; }
  .brand .brand-name { display: none; }   /* keep just the face on tight screens */
  .icon-btn { width: 34px; height: 34px; }
  .lang-btn { width: auto; }
  .icon-btn svg { width: 18px; height: 18px; }
  .deck .caption { font-size: .74rem; }
}

/* Respect users who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto; }
}
