/* CLASH web theme — the single source of truth for apps/web.
 *
 * Values mirror apps/mobile/lib/ui/design_system/tokens/shell_colors.dart and
 * docs/platform/ICON_FAMILY.md so the web handoff (invite / challenge) and the
 * app read as one product: brand teal, v2 light surfaces, Lucide icons.
 *
 * The site has no build step, so pages link this file directly. Do not add
 * page-local palettes — every old page carried its own <style> copy, which is
 * how the web drifted into three different visual languages behind the app.
 */

:root {
  /* Brand — shell.colors */
  --brand: #0d9488;          /* brandPrimary */
  --brand-deep: #0f766e;     /* brandPrimaryDeep */
  --brand-strong: #0b7268;   /* brandPrimaryStrong: 4.5:1 with white text */
  --brand-soft: rgba(13, 148, 136, 0.12);
  /* Legacy alias: pages that used to define their own --accent keep working. */
  --accent: var(--brand-strong);
  --success: #16a34a;
  --warning: #f59e0b;
  /* Leaderboard rank tones (playable preview) */
  --rank-gold: #f59e0b;
  --rank-silver: #9ca3af;
  --rank-bronze: #b45309;
  --danger: #dc2626;
  /* Playable-preview alert mode (the in-game "running out of time" state) lives
     here too, so the game chrome and the brand palette stay in one place. */
  --danger-bg: #2a0a0a;
  --danger-cell: #3d1515;

  /* Surfaces — shell.colors */
  --bg: #f2f2f7;             /* background */
  --surface: #ffffff;        /* card */
  --surface-2: #f4f4f5;      /* surfaceBg */
  --border: #e4e4e7;         /* border */
  --text: #18181b;           /* textPrimary */
  --muted: #52525b;          /* textSecondary */

  --radius: 14px;
  --radius-lg: 24px;
  --max: 42rem;
  --font: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.05), 0 14px 34px rgba(24, 24, 27, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #2dd4bf;
    --brand-deep: #14b8a6;
    --brand-strong: #2dd4bf;
    --brand-soft: rgba(45, 212, 191, 0.14);
    --bg: #0b0b0f;
    --surface: #15151a;
    --surface-2: #1d1d24;
    --border: #2b2b34;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 40px rgba(0, 0, 0, 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--brand-strong); }
a:hover { color: var(--brand-deep); }
strong { color: var(--text); font-weight: 600; }
img { max-width: 100%; height: auto; }

/* ── Icons — Lucide sprite (assets/icons.svg) ───────────────────────────── */
.icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: -4px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; vertical-align: -6px; }
.icon-xl { width: 40px; height: 40px; vertical-align: -10px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand-strong); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--brand); color: var(--text); }
.btn-ghost { background: transparent; color: var(--muted); min-height: 40px; padding: 0 12px; }
.btn-block { width: 100%; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 22px;
}

.card h1 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}
/* Inviter name on the handoff card (e.g. "Ali seni düelloya çağırdı"). */
.card h1 .who { color: var(--brand-strong); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.code {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px 14px 18px;
  text-align: center;
  display: block;
  word-break: break-all;
}

/* ── Handoff copy ─────────────────────────────────────────────────────────
 * Card copy is not styled per language: /assets/i18n.js swaps the text and sets
 * <html lang> (en/tr/de/fr), and the markup starts in en — the app's fallback. */

/* ── Layout helpers ────────────────────────────────────────────────────── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 24px 20px 48px; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 18px; }
.center-page .card { width: 100%; max-width: 26rem; text-align: center; }
.stack > * + * { margin-top: 14px; }
.stack-tight > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-center { justify-content: center; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.lead { font-size: 1.0625rem; color: var(--muted); }

/* ── Document shell (legal / support pages) ────────────────────────────── */
header { border-bottom: 1px solid var(--border); padding: 1.25rem 1.5rem; background: var(--surface); }
header .inner, main { max-width: var(--max); margin: 0 auto; }
header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
header h1 .icon { color: var(--brand); }
header p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.875rem; }
.lang { margin-top: 0.75rem; font-size: 0.875rem; }
.lang a { text-decoration: none; }
.lang a:hover { text-decoration: underline; }

main { padding: 2rem 1.5rem 3rem; }
h2 { font-size: 1.05rem; margin: 2rem 0 0.75rem; color: var(--text); }
h2:first-of-type { margin-top: 0; }
h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; color: var(--text); }
p, ul, ol { margin: 0 0 1rem; color: var(--muted); }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }

.meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.steps {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 0.25rem;
  margin: 0 0 1rem;
}
.steps ol { margin-bottom: 0.75rem; }
.callout {
  border-left: 3px solid var(--brand);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  font-size: 0.9375rem;
}
.callout p { margin: 0; }
.faq-item { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem; }
.faq-item:last-of-type { border-bottom: none; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
