/*
 * Rummy Kompis — one stylesheet for every page on rummykompis.com.
 *
 * Colours and radii are the app's own (components/ui/theme.ts), copied by hand because this site
 * has no build step and must not import from the app. Type is a system stack: the app pairs
 * Baloo 2 with Nunito, but a third-party font would mean a third-party request, and the site's
 * whole promise is that it makes none.
 */

:root {
  --background: #f7f3ec;
  --surface: #ffffff;
  --surface-muted: #f1ebe0;
  --ink: #26221c;
  --ink-soft: #7a7166;
  --faint: #e5ddcf;
  --primary: #d9541e;
  --primary-deep: #b84315;
  --primary-soft: #fbe3d7;
  --teal: #177e89;
  --teal-soft: #dcf0f0;
  --gold: #e9a820;
  --gold-soft: #fcf0d4;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --pill: 999px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

/* ─────────── masthead ─────────── */

.masthead {
  text-align: center;
  padding: 0.5rem 0 1.75rem;
}

.masthead img {
  width: 116px;
  height: 116px;
  border-radius: var(--radius-lg);
  display: block;
  margin: 0 auto 0.9rem;
  box-shadow: 0 6px 20px rgba(38, 34, 28, 0.12);
}

.masthead h1 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 800;
}

.masthead p {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.masthead a {
  color: inherit;
  text-decoration: none;
}

/* ─────────── cards ─────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--faint);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  margin: 0 0 1.25rem;
  box-shadow: 0 2px 8px rgba(38, 34, 28, 0.05);
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0 0 0.85rem;
}

.card p:last-child {
  margin-bottom: 0;
}

/* One language block. The heading is a small caps-ish label, not a flag: three short blocks in a
   row read better with a quiet marker than with a picker nobody would use once. */
.lang {
  border-top: 1px solid var(--faint);
  padding-top: 1.1rem;
  margin-top: 1.1rem;
}

.lang:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.lang-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: var(--pill);
  padding: 0.15rem 0.6rem;
  margin: 0 0 0.5rem;
}

/* ─────────── the code / token chip ─────────── */

.code-block {
  text-align: center;
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  padding: 1.1rem 1rem;
  margin: 0 0 1.25rem;
}

.code-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary-deep);
  margin-bottom: 0.35rem;
}

.code-value {
  display: block;
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.1;
  color: var(--primary-deep);
  word-break: break-all;
}

.code-value.is-token {
  font-size: 1.7rem;
  letter-spacing: 0.08em;
}

/* `.button` sets display:block, which would beat the UA stylesheet's rule for [hidden]. The pages
   toggle their code chip and their open button with el.hidden, so this has to win. */
[hidden] {
  display: none !important;
}

/* The second and third language of a button's label, under the first. */
.button-sub {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 0.1rem;
}

/* ─────────── buttons ─────────── */

.button {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1.2rem;
  border: 0;
  border-radius: var(--pill);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  margin: 0 0 0.7rem;
  transition: transform 0.06s ease-out, background-color 0.12s ease-out;
}

.button:active {
  transform: scale(0.985);
}

.button-primary {
  background: var(--primary);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--primary-deep);
}

.button-secondary {
  background: var(--surface-muted);
  color: var(--ink);
  border: 1px solid var(--faint);
}

.button-secondary:hover {
  background: var(--faint);
}

.button:last-child {
  margin-bottom: 0;
}

/* ─────────── install section ─────────── */

.install {
  background: var(--gold-soft);
  border-color: #f0dda8;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a6206;
  background: #f7e3b0;
  border-radius: var(--pill);
  padding: 0.15rem 0.6rem;
  margin-bottom: 0.6rem;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ─────────── notes and drafts ─────────── */

.notice {
  background: var(--primary-soft);
  border: 1px solid #f0c3ac;
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin: 0 0 1.5rem;
  color: var(--primary-deep);
  font-size: 0.95rem;
}

.notice strong {
  font-weight: 800;
}

.notice p {
  margin: 0 0 0.5rem;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice h2 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: var(--primary-deep);
}

.notice ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.notice li {
  margin-bottom: 0.55rem;
}

.notice li:last-child {
  margin-bottom: 0;
}

.notice code,
.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(38, 34, 28, 0.06);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}

/* ─────────── long-form prose (the privacy policy) ─────────── */

.prose {
  max-width: 40rem;
}

.prose h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 2rem 0 0.5rem;
  letter-spacing: -0.01em;
}

.prose h2:first-of-type {
  margin-top: 1rem;
}

.prose p,
.prose li {
  font-size: 1rem;
}

.prose ul {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose dl {
  margin: 0 0 1rem;
}

.prose dt {
  font-weight: 700;
  margin-top: 0.8rem;
}

.prose dd {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
}

/* ─────────── links and footer ─────────── */

a {
  color: var(--teal);
}

a:hover {
  color: #0f5a63;
}

.footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
  padding-top: 1rem;
}

.footer a {
  color: var(--ink-soft);
  margin: 0 0.4rem;
}

/* ─────────── copy feedback ─────────── */

.copy-done {
  display: block;
  text-align: center;
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 1.3rem;
  margin-top: 0.2rem;
}

@media (min-width: 34rem) {
  body {
    font-size: 18px;
  }

  .page {
    padding-top: 3rem;
  }

  .masthead h1 {
    font-size: 2.4rem;
  }

  .card {
    padding: 1.75rem 1.6rem;
  }
}
