/* PuzzlBall marketing site. Court colors (blue #1d428a, orange #f26b1d) and the app's own fonts
   (C:\dev\BettrPuzzl\www\fonts, SIL Open Font License), laid out like the BettrBall site. */
@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bricolage-grotesque.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(fonts/figtree.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Luckiest Guy"; src: url(fonts/luckiest-guy.woff2) format("woff2"); font-display: block; }

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --text: #0d1321;
  --muted: #5b6678;
  --faint: #8a94a6;
  --line: #d6dde8;
  --grid: #0d1d40;
  --thin: rgba(13, 29, 64, 0.24);
  --brand: #1d428a;
  --brand-dark: #16336b;
  --brand-muted: #c9d6ee;
  --accent: #f26b1d;
  --accent-hover: #ff8a3d;
  --accent-ink: #111111;
  /* Region colors ("Candy"), the same as the app */
  --r1: #ffe066; --r2: #ff9ec4; --r3: #7fd8ff; --r4: #b5ee7a; --r5: #c8a6ff;
  --r6: #ffb877; --r7: #6fe3c8; --r8: #ff8f80; --r9: #9fb5ff; --r10: #e4e7ee;
  --display: "Bricolage Grotesque", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--brand); }
a:hover { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.wrap { width: min(1248px, 100% - 48px); margin: 0 auto; }
.wrap.narrow { width: min(760px, 100% - 48px); }
section[id] { scroll-margin-top: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none; white-space: nowrap;
  box-shadow: 0 3px 0 #b84a0c; transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); transform: translateY(-1px); box-shadow: 0 4px 0 #b84a0c; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b84a0c; }
.btn-lg { height: 58px; padding: 0 30px; font-size: 17px; }
.btn-sm { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.35); box-shadow: none; font-weight: 700; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; box-shadow: none; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo:hover { color: inherit; }
.mark { display: block; width: 46px; height: 46px; flex: none; }
.word { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.word span, .app-brand b span { color: var(--accent); }

/* ---------- Hero: a full-width blue band ---------- */
.hero { position: relative; overflow: hidden; background: var(--brand); color: #fff; padding-bottom: 88px; }
.pieces svg { position: absolute; fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 0.6; pointer-events: none; }
.pieces svg:nth-child(1) { width: 760px; right: -200px; top: 60px; transform: rotate(12deg); }
.pieces svg:nth-child(2) { width: 300px; left: -90px; bottom: -60px; transform: rotate(-18deg); }
.pieces svg:nth-child(3) { width: 180px; left: 46%; top: -40px; transform: rotate(30deg); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 28px 0; position: relative; z-index: 2; }
.nav-links { display: flex; align-items: center; gap: 30px; font-size: 15px; font-weight: 600; }
.nav-links a:not(.btn) { color: var(--brand-muted); text-decoration: none; }
.nav-links a:not(.btn):hover { color: #fff; }
.hero-grid { display: flex; align-items: center; justify-content: space-between; gap: 48px; position: relative; padding-top: 24px; }
.hero-copy { max-width: 640px; display: flex; flex-direction: column; gap: 26px; }
.kicker {
  display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.hero .kicker { color: #ffb27a; }
.hero .kicker .dot { background: #ffb27a; }
h1 { font-size: clamp(46px, 6.8vw, 88px); line-height: 0.98; font-weight: 800; letter-spacing: -0.045em; }
.lede { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; color: var(--muted); max-width: 560px; }
.hero .lede { color: var(--brand-muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px 0 12px; border-radius: 12px;
  background: #0d1321; color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.18);
}
.store:hover { color: #fff; background: #000; }
.store svg { width: 24px; height: 24px; flex: none; }
.store span { display: flex; flex-direction: column; font-weight: 700; font-size: 16px; line-height: 1.1; }
.store small { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; opacity: 0.8; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--brand-muted); font-weight: 600; }
.chips li + li::before { content: '•'; color: rgba(255, 255, 255, 0.35); margin-right: 24px; }

/* ---------- Phone mockups (a light copy of the app) ---------- */
.phone {
  width: 360px; flex: none; border-radius: 48px; background: #0d1321; padding: 10px; color: var(--text);
  box-shadow: 0 30px 80px rgba(13, 29, 64, 0.35);
}
.phone-hero { width: 380px; border-radius: 52px; padding: 11px; margin-right: 50px; transform: rotate(2.5deg); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(255, 255, 255, 0.06); }
.screen { border-radius: 38px; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; min-height: 680px; }
.phone-hero .screen { border-radius: 42px; }
.app-head { background: var(--brand); color: #fff; padding: 44px 16px 14px; display: flex; align-items: center; justify-content: space-between; }
.app-brand { display: flex; align-items: center; gap: 8px; }
.app-brand svg { width: 34px; height: 34px; }
.app-brand b { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.app-right { display: flex; align-items: center; gap: 10px; }
.plus-pill { background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 11.5px; padding: 6px 11px; border-radius: 999px; }
.timer { font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--brand-muted); font-variant-numeric: tabular-nums; }
.app-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.seg { display: inline-flex; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.seg span { padding: 5px 10px; border-radius: 999px; }
.seg span.on { background: var(--brand); color: #fff; }
.seg.games { align-self: stretch; }
.seg.games span { flex: 1; text-align: center; font-size: 12.5px; }
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.controls span { text-align: center; padding: 9px 0; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.controls span:first-child { color: var(--faint); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

/* Boards (drawn by the script in index.html) */
.board {
  display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); grid-template-rows: repeat(var(--n, 6), minmax(0, 1fr));
  aspect-ratio: 1; width: 100%; border: 3px solid var(--grid); border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 18, 0.12);
}
.cell { display: grid; place-items: center; border-top: 1.5px solid var(--thin); border-left: 1.5px solid var(--thin); min-width: 0; min-height: 0; }
.cell.tt { border-top: 3px solid var(--grid); }
.cell.tl { border-left: 3px solid var(--grid); }
.cell.r0 { border-top: 0; }
.cell.c0 { border-left: 0; }
.cell .logo { width: 82%; height: 82%; }
.cell .x { width: 30%; height: 30%; }
.cell .x path { stroke: #1b2420; stroke-width: 1.6; stroke-linecap: round; }

.board.roll { position: relative; isolation: isolate; background: var(--surface); container-type: inline-size; }
.rc { border-top: 1.5px solid rgba(13, 19, 33, 0.15); border-left: 1.5px solid rgba(13, 19, 33, 0.15); min-width: 0; min-height: 0; }
.rc.r0 { border-top: 0; }
.rc.c0 { border-left: 0; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; }
.trail polyline {
  fill: none; stroke: var(--accent); stroke-width: 0.44; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: roll 7s ease-in-out infinite;
}
@keyframes roll { 0% { stroke-dashoffset: 1; } 60%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .trail polyline { animation: none; stroke-dashoffset: 0; } }
.num {
  z-index: 2; place-self: center; width: 62%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff;
  border: 2px solid var(--grid); box-shadow: 0 0 0 2.5px #fff, 0 2px 4px 2.5px rgba(15, 23, 18, 0.12);
  font-family: "Luckiest Guy", var(--display); line-height: 1; padding-top: 0.12em;
  font-size: calc(100cqw / var(--n) * 0.36);
}

/* League mockup */
.lg-title { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.lg-title b { font-family: var(--display); font-size: 16px; }
.lg-title small { font-size: 11px; color: var(--muted); }
.h2h { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.vs-row { display: flex; justify-content: space-between; align-items: flex-end; }
.vs-row small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.vs-row b { font-family: var(--display); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.vs-row .right { text-align: right; }
.vs { font-size: 11px; color: var(--faint); font-weight: 800; padding-bottom: 8px; }
.h2h > small { font-size: 11px; }
.standings .st { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; }
.standings .st:last-child { border-bottom: 0; }
.standings .st.me { background: rgba(242, 107, 29, 0.1); }
.standings .rk { width: 14px; color: var(--faint); font-weight: 700; }
.standings b { flex: 1; }
.standings .rec { color: var(--muted); font-variant-numeric: tabular-nums; }
.standings .tm { width: 48px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 40px; }
h2 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.02; font-weight: 800; letter-spacing: -0.04em; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.num-badge {
  width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center;
  font: 20px "Luckiest Guy", var(--display); padding-top: 3px; border: 2px solid var(--grid); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); margin-bottom: 8px;
}
.steps h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.steps p { color: var(--muted); line-height: 1.55; }

.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.play-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.play-head h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 12px; }
.board-card { max-width: 340px; align-self: center; }
.play-tag { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.play-tag.roll, .play-tag.free { background: var(--brand); color: #fff; }

.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 16px; font-weight: 500; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.4; }
.ticks li::before {
  content: '✓'; flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 900; background: rgba(242, 107, 29, 0.14); color: var(--accent);
}

.panel { border-radius: 32px; padding: 64px; display: flex; align-items: center; justify-content: space-between; gap: 48px; overflow: hidden; }
.panel.reverse { flex-direction: row-reverse; }
.panel-copy { max-width: 500px; display: flex; flex-direction: column; gap: 20px; }
.panel-copy p { font-size: 19px; line-height: 1.5; font-weight: 500; }
.panel-orange { background: var(--accent); color: var(--accent-ink); }
.panel-orange .ticks li { font-weight: 600; }
.panel-orange .ticks li::before { background: var(--accent-ink); color: var(--accent); }
.panel-blue { background: var(--brand); color: #fff; }
.panel-blue .panel-copy p { color: var(--brand-muted); }
.panel-blue .kicker { color: #ffb27a; }
.panel-blue .kicker .dot { background: #ffb27a; }
.panel-blue .ticks li::before { background: rgba(255, 255, 255, 0.14); color: #ffb27a; }

/* Board sizes through the week */
.week { background: var(--surface); color: var(--text); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 50px rgba(120, 40, 0, 0.3); flex: none; }
.week-row { display: grid; grid-template-columns: 64px repeat(7, 54px); gap: 6px; align-items: center; }
.week-head b { text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.week-row .game { font-family: var(--display); font-size: 15px; }
.week-row span { height: 54px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; border: 2px solid var(--grid); }
.week .s6 { background: var(--r4); }
.week .s7 { background: var(--r1); }
.week .s8 { background: var(--r6); }
.week .s9 { background: var(--r8); }

/* Puzzl+ */
.tiers { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; align-items: stretch; }
.tier { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.tier .play-tag { align-self: flex-start; }
.tier h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.tier-plus { border: 2px solid var(--accent); box-shadow: 0 16px 40px rgba(242, 107, 29, 0.15); }
.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.prices div { border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.prices b { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.prices small { color: var(--muted); font-size: 13px; }
.fine { font-size: 13px; color: var(--muted); line-height: 1.5; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 22px; line-height: 1; font-weight: 700; }
.faq details[open] summary::after { content: '–'; }
.faq p { color: var(--muted); line-height: 1.6; margin-top: 10px; }

.final {
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 72px 24px; border-radius: 32px; color: #fff;
  background: radial-gradient(ellipse at 50% 130%, rgba(242, 107, 29, 0.55), transparent 60%), var(--brand);
}
.final .lede { max-width: 480px; color: var(--brand-muted); }
.final-mark { width: 84px; height: 84px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; margin-top: 40px; }
.footer-grid { display: flex; flex-direction: column; gap: 14px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.footer .logo { color: var(--text); }
.footer .mark { width: 36px; height: 36px; }
.footer .word { font-size: 19px; }
.footer .small { font-size: 13px; color: var(--faint); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .phone-hero { margin-right: 0; }
  .panel { padding: 48px; }
  .panel-orange { flex-direction: column; align-items: stretch; }
  .panel-orange .week { align-self: center; }
}
@media (max-width: 900px) {
  .hero-grid { flex-direction: column; align-items: flex-start; }
  .phone-hero { align-self: center; transform: none; }
  .steps, .play-grid, .tiers { grid-template-columns: 1fr; }
  .panel, .panel.reverse { flex-direction: column; align-items: stretch; padding: 40px 28px; }
  .panel .phone { align-self: center; }
}
@media (max-width: 640px) {
  .wrap, .wrap.narrow { width: calc(100% - 32px); }
  .nav { padding: 18px 0; }
  .nav-links { gap: 18px; }
  .nav-links a[href^="#"] { display: none; }
  .mark { width: 40px; height: 40px; }
  .word { font-size: 21px; }
  .hero { padding-bottom: 56px; }
  .pieces svg:nth-child(1) { width: 480px; right: -220px; top: 160px; }
  .hero-copy { gap: 22px; }
  .btn-lg { width: 100%; }
  .chips { gap: 6px 10px; }
  .chips li + li::before { margin-right: 10px; }
  .phone, .phone-hero { width: 100%; max-width: 340px; }
  .screen { min-height: 0; }
  .section { padding: 48px 0; }
  .panel, .panel.reverse { border-radius: 24px; padding: 32px 20px; }
  .steps li, .play-card, .tier { padding: 22px; border-radius: 18px; }
  .play-head h3, .tier h3 { font-size: 22px; }
  .week { padding: 14px; gap: 6px; }
  .week-row { grid-template-columns: 46px repeat(7, minmax(0, 1fr)); gap: 4px; }
  .week-row span { height: 40px; font-size: 11px; border-radius: 8px; border-width: 1.5px; }
  .week-head b { font-size: 10px; letter-spacing: 0.02em; }
  .week-row .game { font-size: 12px; }
  .prices b { font-size: 21px; }
  .prices div { padding: 12px 6px; }
  .final { padding: 48px 20px; border-radius: 24px; }
}
