/* Falling Blocks site. Colors are the app's own tokens (Theme.swift, docs/art-direction.md §3.2). */
:root {
  --bg-base: #141b2d;
  --bg-top: #1e2740;
  --surface: #232d48;
  --raised: #2c3858;
  --stroke: #3a4870;
  --text: #f2f4f8;
  --text-2: #9aa6c2;
  --accent: #f2b33d;
  --accent-edge: #b9841c;
  --danger: #e5484d;
  --success: #46b45a;

  /* Block_0..6: orange, cyan, purple, red, green, yellow, blue */
  --b0: #f28c28;
  --b1: #29b6d9;
  --b2: #8e5bd9;
  --b3: #e5484d;
  --b4: #46b45a;
  --b5: #f2c230;
  --b6: #3d6fe0;

  --radius: 20px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg-base); }

body {
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg-base) 640px) no-repeat, var(--bg-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Nav ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: 0.02em; }
.nav .brand img { width: 36px; height: 36px; border-radius: 8px; }
.nav a.link { color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.nav a.link:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 800; font-size: 1.05rem;
  padding: 13px 24px; border-radius: 14px; border: 1px solid var(--stroke);
  background: var(--raised); color: var(--text); transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 3px 0 var(--bg-base);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--bg-base); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg-base); box-shadow: 0 3px 0 var(--accent-edge); }
.btn.primary:active { box-shadow: 0 1px 0 var(--accent-edge); }

.store-badge { display: inline-block; border-radius: 10px; transition: transform 0.15s; }
.store-badge:hover { transform: translateY(-2px); }
.store-badge img { height: 54px; width: auto; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding: 28px 0 72px; }
.hero .logo { width: min(100%, 520px); margin-bottom: 22px; }
.hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); line-height: 1.2; font-weight: 800; margin-bottom: 14px; }
.hero p.lead { font-size: 1.15rem; color: var(--text-2); max-width: 30em; margin-bottom: 28px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero .facts { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-2); font-size: 0.92rem; font-weight: 700; }
.hero .facts span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; background: var(--b4); }

.hero-board { max-width: 380px; margin-left: auto; width: 100%; }

/* ---------- Board and tiles ---------- */
.board { background: var(--surface); border: 1px solid var(--stroke); border-radius: 16px; padding: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.field { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; }
.field.wide { aspect-ratio: auto; }
.grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); }
.grid.fill { position: absolute; inset: 0; grid-template-rows: repeat(var(--rows), 1fr); }
.cell { aspect-ratio: 1; padding: 2px; }
.cell.empty::after { content: ""; display: block; width: 100%; height: 100%; border-radius: 12%; background: var(--raised); box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.22); }
.cell { container-type: inline-size; }
.b {
  display: block; width: 100%; height: 100%; border-radius: 10%; background-color: var(--c);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.07));
  box-shadow: inset 8cqw 8cqw 0 rgba(255, 255, 255, 0.2), inset -8cqw -8cqw 0 rgba(0, 0, 0, 0.22);
}
.cell .ghost { display: block; width: 100%; height: 100%; border-radius: 12%; border: 1.5px dashed rgba(255, 255, 255, 0.75); background: rgba(255, 255, 255, 0.12); }
.cell .flash { display: block; width: 100%; height: 100%; border-radius: 10%; background: #fff; opacity: 0.85; }
.c0 { --c: var(--b0); } .c1 { --c: var(--b1); } .c2 { --c: var(--b2); } .c3 { --c: var(--b3); }
.c4 { --c: var(--b4); } .c5 { --c: var(--b5); } .c6 { --c: var(--b6); }

/* The drop in the hero: one bar falls into the gap, the row clears, the stack settles. */
.hero-board .layer { position: absolute; inset: 0; }
.hero-board .bar { position: absolute; left: 37.5%; width: 37.5%; top: 0; height: 12.5%; animation: bar-drop 6s infinite; }
.hero-board .ghostbar { position: absolute; left: 37.5%; width: 37.5%; top: 87.5%; height: 12.5%; animation: ghost 6s infinite; }
.hero-board .floor { animation: floor 6s infinite; }
.hero-board .stack { animation: settle 6s infinite; }
.hero-board .flashrow { position: absolute; left: 0; right: 0; top: 87.5%; height: 12.5%; animation: flashrow 6s infinite; pointer-events: none; }
.hero-board .flashrow .b { --c: #fff; }

@keyframes bar-drop {
  0% { transform: translateY(0); opacity: 0; }
  8% { transform: translateY(0); opacity: 1; }
  30% { transform: translateY(0); opacity: 1; }
  40% { transform: translateY(700%); opacity: 1; }
  58% { transform: translateY(700%); opacity: 1; }
  59% { transform: translateY(700%); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
@keyframes ghost { 0%, 8% { opacity: 0; } 12%, 32% { opacity: 1; } 34%, 100% { opacity: 0; } }
@keyframes floor { 0%, 58% { opacity: 1; } 59%, 94% { opacity: 0; } 100% { opacity: 1; } }
@keyframes flashrow { 0%, 41% { opacity: 0; } 46% { opacity: 1; } 58% { opacity: 0.9; } 66%, 100% { opacity: 0; } }
@keyframes settle {
  0%, 58% { transform: none; opacity: 1; }
  70%, 90% { transform: translateY(12.5%); opacity: 1; }
  94% { transform: translateY(12.5%); opacity: 0; }
  94.1% { transform: none; opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.hand { display: flex; justify-content: space-around; align-items: center; margin-top: 8px; padding: 10px 6px; background: var(--surface); border: 1px solid var(--stroke); border-radius: 16px; }
.hand .piece { width: calc(var(--cols) * 11%); }
.mini .hand { margin-top: 0; padding: 12px 6px; }
.mini .hand .piece { width: calc(var(--cols) * 18px); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 10px; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.2; font-weight: 800; margin-bottom: 12px; }
.sub { color: var(--text-2); max-width: 38em; margin-bottom: 36px; font-size: 1.05rem; }

.cards { display: grid; gap: 16px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 22px; position: relative; overflow: hidden; }
.card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.card p { color: var(--text-2); }
.card p + p { margin-top: 10px; }
.card.mode::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.card .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--c, var(--accent)); color: var(--bg-base); font-weight: 900; margin-bottom: 14px; }

.mini { width: 170px; margin: 0 auto 18px; }
.mini .board { padding: 5px; border-radius: 12px; box-shadow: none; }
.mini .cell { padding: 1.5px; }

/* Goal tiles */
.goals { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.goal { display: flex; align-items: center; gap: 8px; background: var(--raised); border: 1px solid var(--stroke); border-radius: 12px; padding: 6px 12px 6px 6px; font-weight: 700; font-size: 0.92rem; }
.tile { width: 30px; height: 30px; border-radius: 4px; display: grid; place-items: center; background: var(--p); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.22), inset -2px -2px 0 rgba(0, 0, 0, 0.25); }
.tile svg { width: 66%; height: 66%; }

/* Screenshots */
.shots { display: flex; gap: 16px; overflow-x: auto; padding: 4px 16px 18px; margin: 0 -16px; scroll-snap-type: x proximity; }
.shots img { flex: none; width: min(240px, 62vw); height: auto; border-radius: 22px; border: 1px solid var(--stroke); scroll-snap-align: start; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); }
@media (min-width: 1000px) { .shots { overflow: visible; } .shots img { flex: 1 1 0; width: auto; min-width: 0; } }

/* Opponents */
.ai { display: flex; flex-direction: column; gap: 6px; }
.ai .top { display: flex; align-items: baseline; gap: 10px; }
.ai h3 { margin: 0; }
.ai .rank { color: var(--text-2); font-weight: 800; font-size: 0.85rem; }
.pips { display: flex; gap: 3px; margin: 2px 0 6px; }
.pips i { width: 100%; max-width: 14px; height: 6px; border-radius: 2px; background: var(--bg-base); }
.pips i.on { background: var(--c); }
.ai p { font-size: 0.93rem; line-height: 1.5; }

/* Boosters */
.booster { display: flex; gap: 14px; align-items: flex-start; }
.booster .ico { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--raised); border: 1px solid var(--stroke); display: grid; place-items: center; color: var(--accent); }
.booster .ico svg { width: 26px; height: 26px; }
.booster h3 { font-size: 1.05rem; margin-bottom: 2px; }
.booster p { font-size: 0.93rem; }

/* Good to know */
.facts-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.facts-list li { background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px; padding: 14px 18px; }
.facts-list strong { display: block; font-weight: 800; }
.facts-list span { color: var(--text-2); font-size: 0.95rem; }
.langs { margin-top: 20px; color: var(--text-2); font-size: 0.95rem; }

/* Closing call to action */
.closing { text-align: center; }
.closing .panel { background: var(--surface); border: 1px solid var(--stroke); border-radius: 28px; padding: 56px 20px; position: relative; overflow: hidden; }
.closing .panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent); }
.closing img.icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 22px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4); }
.closing p { color: var(--text-2); margin-bottom: 26px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--stroke); padding: 34px 0 44px; color: var(--text-2); font-size: 0.92rem; }
.footer .row { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.footer a { text-decoration: none; font-weight: 700; }
.footer a:hover { color: var(--text); }
.footer .links { display: flex; gap: 24px; }

/* ---------- Privacy / long text ---------- */
.doc-head { padding: 24px 0 8px; }
.doc-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.2; }
.doc-head .updated { color: var(--text-2); margin-top: 8px; font-weight: 700; }
.doc { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 36px clamp(18px, 4vw, 44px); margin: 24px 0 64px; }
.doc h2 { font-size: 1.35rem; margin: 34px 0 10px; padding-top: 22px; border-top: 1px solid var(--stroke); }
.doc h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc h3 { font-size: 1.05rem; margin: 20px 0 6px; font-weight: 800; }
.doc p, .doc li { color: #cdd5e6; }
.doc p { margin-bottom: 12px; }
.doc ul { margin: 0 0 14px 1.3em; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--text); font-weight: 800; }
.doc a { color: var(--accent); text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-bottom: 40px; text-align: center; }
  .hero .logo { margin-left: auto; margin-right: auto; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero .cta, .hero .facts { justify-content: center; }
  .hero-board { margin: 0 auto; max-width: 320px; }
  .cards.three, .cards.four { grid-template-columns: repeat(2, 1fr); }
  section { padding: 48px 0; }
}
@media (max-width: 600px) {
  .cards.three, .cards.two, .cards.four, .facts-list { grid-template-columns: 1fr; }
  .store-badge img { height: 50px; }
  .footer .row { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-board .bar, .hero-board .ghostbar, .hero-board .floor, .hero-board .stack, .hero-board .flashrow { animation: none; }
  .hero-board .bar { transform: translateY(700%); }
  .hero-board .ghostbar, .hero-board .flashrow { opacity: 0; }
  html { scroll-behavior: auto; }
}

#more h2 { margin-bottom: 28px; }
