/* Tile Pals site: felt-green game table, cream mahjong tiles, rainbow wordmark from the store art.
   Layout: one centered column (max 1080px); hero = text + playable mini board on felt. */
:root {
  --bg: #f1f6ee;
  --surface: #ffffff;
  --ink: #1d2b22;
  --muted: #56685b;
  --line: #d6e2d3;
  --felt: #237a43;
  --felt-deep: #17592f;
  --felt-ink: #f3fff5;
  --tile: #fdf6e3;
  --tile-edge: #dcc48f;
  --tile-side: #c6a867;
  --gold: #f6b929;
  --link: #1d7a3e;
  --r-red: #ef4b4b; --r-orange: #f59a1b; --r-green: #2fb85a; --r-blue: #3a86f0; --r-purple: #9b5cf0; --r-pink: #ee5fa7;
  --display: "Fredoka", "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1d14; --surface: #152a1d; --ink: #e8f3ea; --muted: #a2b8a8; --line: #26402f;
    --felt: #1c6537; --felt-deep: #124526; --link: #7fdc9d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1d14; --surface: #152a1d; --ink: #e8f3ea; --muted: #a2b8a8; --line: #26402f;
  --felt: #1c6537; --felt-deep: #124526; --link: #7fdc9d; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 20px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 20px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.top nav { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); }

/* Wordmark: each letter takes a colour from the store logo */
.wordmark { font-family: var(--display); font-weight: 600; letter-spacing: .01em; }
.wordmark span { display: inline-block; color: var(--c); -webkit-text-stroke: 0; text-shadow: 0 3px 0 rgba(0,0,0,.18); }

/* Hero on felt */
.hero { background: radial-gradient(120% 90% at 70% 10%, var(--felt) 0%, var(--felt-deep) 75%); color: var(--felt-ink); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 56px 64px; }
.hero h1 { font-size: clamp(52px, 9vw, 96px); }
.hero .sub { font-family: var(--display); font-size: clamp(22px, 3vw, 30px); font-weight: 500; margin-top: 6px; }
.hero .lede { margin-top: 18px; max-width: 34em; color: color-mix(in srgb, var(--felt-ink) 85%, transparent); }
.stores { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.store { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px; border-radius: 14px; background: #0b0f0c; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.25); }
.store svg { width: 24px; height: 24px; fill: #fff; flex: none; }
.store small { display: block; font-size: 11px; opacity: .75; line-height: 1.1; }
.store b { display: block; font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.1; }
.soon { margin-top: 12px; font-size: 14px; color: color-mix(in srgb, var(--felt-ink) 75%, transparent); }

/* Mini board */
.board-card { justify-self: center; width: 100%; max-width: 420px; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); margin-bottom: 10px; }
.board-head .score { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.board-head .combo { font-size: 15px; color: var(--gold); font-weight: 600; min-height: 1.2em; }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile {
  position: relative; aspect-ratio: 4 / 5; max-width: 100%; border: 0; padding: 8% 6%; cursor: pointer;
  background: var(--tile); border-radius: 14px;
  box-shadow: 0 -3px 0 var(--tile-edge) inset, 0 6px 0 var(--tile-side), 0 10px 14px rgba(0,0,0,.28);
  transition: transform .15s ease, box-shadow .15s ease, opacity .25s ease;
}
.tile img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.tile:hover { transform: translateY(-2px); }
.tile.sel { background: #fff3b0; transform: translateY(-4px); box-shadow: 0 0 0 3px var(--gold), 0 8px 0 var(--tile-side), 0 12px 16px rgba(0,0,0,.3); }
.tile.shake { animation: shake .3s; }
.tile.gone { opacity: 0; transform: scale(.6); pointer-events: none; }
.board-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 14px; color: color-mix(in srgb, var(--felt-ink) 80%, transparent); gap: 12px; }
.board-foot button { font: 600 14px var(--display); color: var(--felt-deep); background: var(--gold); border: 0; border-radius: 999px; padding: 8px 16px; cursor: pointer; box-shadow: 0 3px 0 #c98f12; }
.pop { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font: 600 18px var(--display); color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,.35); pointer-events: none; animation: rise .8s ease-out forwards; white-space: nowrap; }
@keyframes rise { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: 0 -40px; } }
@keyframes shake { 25% { translate: -4px 0; } 75% { translate: 4px 0; } }

/* Sections */
section.block { padding-block: 64px; }
.eyebrow { font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--link); margin-bottom: 8px; }
section.block h2 { font-size: clamp(30px, 4.5vw, 42px); }
.intro { color: var(--muted); max-width: 38em; margin-top: 10px; }

.shots { display: flex; gap: 16px; overflow-x: auto; padding: 28px 20px 12px; margin-inline: -20px; scroll-snap-type: x mandatory; }
.shots img { flex: none; width: 220px; border-radius: 22px; scroll-snap-align: start; box-shadow: 0 8px 22px rgba(0,0,0,.18); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; margin-top: 34px; }
.fact { min-width: 0; }
.fact .num { font-family: var(--display); font-weight: 600; font-size: 30px; color: var(--felt); line-height: 1.1; }
:root[data-theme="dark"] .fact .num { color: var(--link); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fact .num { color: var(--link); } }
.fact h3 { font-size: 19px; margin-top: 4px; }
.fact p { color: var(--muted); margin-top: 6px; font-size: 16px; }

.support { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.support .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 40px; }
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.mail code { font: 700 17px var(--body); background: var(--bg); border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; user-select: all; overflow-wrap: anywhere; }
.btn { font: 600 15px var(--display); border: 0; border-radius: 999px; padding: 9px 18px; cursor: pointer; background: var(--felt); color: #fff; text-decoration: none; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 14px; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq details p { margin-top: 8px; color: var(--muted); }

footer { padding-block: 32px 44px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* Legal pages */
.legal .wrap { max-width: 780px; }
.legal-head { padding-block: 48px 8px; }
.legal-head h1 { font-size: clamp(36px, 6vw, 52px); }
.legal-head .meta { color: var(--muted); margin-top: 10px; font-size: 15px; }
.toc { margin-top: 24px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; }
.toc ol { margin: 6px 0 0; padding-left: 22px; columns: 2; column-gap: 28px; }
.toc li { break-inside: avoid; padding-block: 2px; }
.prose { padding-block: 16px 56px; }
.prose h2 { font-size: 24px; margin-top: 40px; scroll-margin-top: 16px; }
.prose h3 { font-size: 18px; margin-top: 22px; }
.prose p, .prose ul { margin-top: 12px; }
.prose ul { padding-left: 22px; }
.prose li { margin-top: 6px; }
.prose .table-scroll { overflow-x: auto; margin-top: 14px; }
.prose table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--display); font-weight: 600; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }

@media (max-width: 820px) {
  .hero .wrap, .support .wrap { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .toc ol { columns: 1; }
  .shots img { width: 180px; }
  .board { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
