/* Tricky Piles landing: the game's printed-tabletop look (warm paper, plum ink, deep green). */
:root {
  --bg: #f3eadb;
  --paper: #fffaf2;
  --paper-hi: #fffdf8;
  --ink: #302638;
  --ink-deep: #17111d;
  --ink-soft: #625767;
  --line: #dfd2bf;
  --line-deep: #c7b69d;
  --brand: #176b60;
  --brand-deep: #104d46;
  --brand-soft: #deebe1;
  --gold: #c6a328;
  --c0: #8560cf; --c0-face: #b9a2ed; --c0-ink: #30145f;
  --c1: #218c88; --c1-face: #72cfc3; --c1-ink: #073f3a;
  --c2: #e57839; --c2-face: #f6b27f; --c2-ink: #672509;
  --c3: #c6a328; --c3-face: #f2d961; --c3-ink: #514005;
  --c4: #b54882; --c4-face: #df93bb; --c4-ink: #5a143c;
  --display: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
  --max: 1120px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .22 0 0 0 0 .15 0 0 0 .14 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--line-deep) 32%, transparent) 0.8px, transparent 1px);
  background-size: 10px 10px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible, .shots:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; left: -999px; top: 8px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
h1, h2, h3 { line-height: 1.15; font-family: var(--display); color: var(--ink-deep); letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(30px, 6vw, 46px); font-weight: 600; line-height: 1.05; }
.kicker { font: 800 12px/1 var(--body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.lead { font-size: clamp(17px, 2.2vw, 19px); color: var(--ink-soft); max-width: 34em; }

/* ---- Top bar ---- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-deep); font: 600 20px/1 var(--display); }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 2px 0 rgb(43 36 51 / 0.12); }
.top nav { display: none; gap: 22px; font-weight: 600; font-size: 15px; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--brand); }
@media (min-width: 760px) { .top nav { display: flex; } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 60px; padding: 0 26px 0 20px; border-radius: 16px;
  background: var(--brand); color: #fffaf2; text-decoration: none;
  font: 600 20px/1 var(--display); box-shadow: 0 4px 0 var(--brand-deep);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--brand-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brand-deep); }
.btn .gp { width: 26px; height: 26px; flex: none; }
.btn small { display: block; font: 700 11px/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; margin-bottom: 3px; }
.btn.small { min-height: 48px; font-size: 16px; padding: 0 16px 0 12px; }
.btn.small .gp { width: 20px; height: 20px; }
.note { font-size: 14px; color: var(--ink-soft); margin: 10px 0 0; }

/* ---- c1 cards ---- */
.k {
  --cw: 80px;
  position: relative; display: grid; place-items: center; flex: none;
  width: var(--cw); height: calc(var(--cw) * 4 / 3); border-radius: calc(var(--cw) * 0.17);
  background: var(--rl); color: var(--ik);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ik) 35%, var(--rl)), 0 3px 0 color-mix(in srgb, var(--ik) 45%, var(--rl)), 0 14px 22px -10px rgb(43 36 51 / 0.45);
  font: 600 calc(var(--cw) * 0.5)/1 var(--display);
}
.k .face {
  position: absolute; inset: calc(var(--cw) * 0.065); border-radius: calc(var(--cw) * 0.11); overflow: hidden;
  background: var(--grain), linear-gradient(165deg, rgb(255 255 255 / 0.3), transparent 45%), var(--fc);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.75);
}
.k .wm { position: absolute; right: -12%; bottom: -10%; width: 76%; height: 76%; fill: var(--rl); opacity: 0.2; }
.k .idx { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: calc(var(--cw) * 0.17); }
.k .idx svg { width: calc(var(--cw) * 0.1); height: calc(var(--cw) * 0.1); fill: currentColor; }
.k .tl { top: calc(var(--cw) * 0.12); left: calc(var(--cw) * 0.12); }
.k .br { right: calc(var(--cw) * 0.12); bottom: calc(var(--cw) * 0.12); rotate: 180deg; }
.k > b { position: relative; z-index: 1; font-weight: 600; }
.c0 { --rl: var(--c0); --fc: var(--c0-face); --ik: var(--c0-ink); }
.c1 { --rl: var(--c1); --fc: var(--c1-face); --ik: var(--c1-ink); }
.c2 { --rl: var(--c2); --fc: var(--c2-face); --ik: var(--c2-ink); }
.c3 { --rl: var(--c3); --fc: var(--c3-face); --ik: var(--c3-ink); }
.c4 { --rl: var(--c4); --fc: var(--c4-face); --ik: var(--c4-ink); }

/* ---- Hero ---- */
.hero { display: grid; gap: 8px; align-items: center; padding: 12px 0 64px; }
.hero h1 { font-size: clamp(54px, 13vw, 104px); font-weight: 600; line-height: 0.92; letter-spacing: -0.04em; text-shadow: 0 3px 0 var(--paper), 0 4px 0 rgb(199 182 157 / 0.7); }
.hero .lead { margin: 18px 0 26px; font-size: clamp(19px, 2.6vw, 23px); color: var(--ink); }
.hero .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding: 0; list-style: none; }
.hero .tags li { padding: 6px 12px; border-radius: 99px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); font: 600 14px/1.2 var(--body); }
.table { position: relative; display: grid; place-items: center; min-height: 230px; }
.table::before { content: ''; position: absolute; width: min(520px, 110%); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgb(255 251 244 / 0.95), rgb(255 250 242 / 0) 66%); }
.fan { --cw: clamp(92px, 24vw, 168px); position: relative; width: calc(var(--cw) * 3.1); height: calc(var(--cw) * 1.7); }
.fan .k { --cw: inherit; position: absolute; left: 50%; top: calc(var(--cw) * 0.1); margin-left: calc(var(--cw) / -2); transform-origin: 50% 270%; animation: deal 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
.fan .k:nth-child(1) { rotate: -20deg; animation-delay: 0.05s; }
.fan .k:nth-child(2) { rotate: -6.7deg; animation-delay: 0.13s; }
.fan .k:nth-child(3) { rotate: 6.7deg; animation-delay: 0.21s; }
.fan .k:nth-child(4) { rotate: 20deg; animation-delay: 0.29s; }
.fan::after { content: ''; position: absolute; left: 10%; right: 10%; bottom: -6%; height: 16%; border-radius: 50%; background: radial-gradient(closest-side, rgb(48 38 56 / 0.22), transparent); z-index: -1; }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(8deg); } }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr 1fr; padding: 40px 0 96px; }
  .table { order: 2; min-height: 480px; }
  .hero .fan { --cw: 170px; }
}

/* ---- Sections ---- */
section { padding: 56px 0; }
.head { display: grid; gap: 10px; margin-bottom: 28px; }

/* How to play */
.steps { display: grid; gap: 16px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; padding: 18px; border-radius: 18px; background: var(--paper); box-shadow: 0 0 0 1px var(--line), 0 3px 0 1px rgb(199 182 157 / 0.45); }
.steps h3 { font-size: 22px; font-weight: 600; }
.steps p { margin: 4px 0 0; color: var(--ink-soft); font-size: 16px; }
.steps .n { counter-increment: s; font: 700 12px/1 var(--body); letter-spacing: 0.14em; color: var(--ink-soft); }
.steps .n::before { content: 'STEP ' counter(s); }
.mini { display: flex; align-items: flex-end; gap: 6px; }
.mini .k { --cw: 44px; }
.mini .pile { position: relative; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ik) 35%, var(--rl)), 0 3px 0 var(--paper), 0 4px 0 var(--line-deep), 0 6px 0 var(--paper), 0 7px 0 var(--line); }
.mini .arrow { width: 22px; height: 22px; color: var(--ink-soft); align-self: center; }
.mini .ghost { --cw: 44px; width: 44px; height: 58px; border-radius: 8px; border: 2px dashed var(--line-deep); display: grid; place-items: center; color: var(--ink-soft); }
.mini .ghost svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } .steps li { grid-template-columns: 1fr; align-items: start; padding: 24px; } }

/* Rules strip */
.rules { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
@media (min-width: 640px) { .rules { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 980px) { .rules { grid-template-columns: repeat(3, 1fr); } }
.rule { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; column-gap: 18px; row-gap: 2px; align-items: start; padding: 16px 18px 16px 16px; border-radius: 18px; background: var(--paper); box-shadow: 0 0 0 1px var(--line), 0 3px 0 1px rgb(199 182 157 / 0.45); }
.rule .k { grid-row: 1 / 3; margin-top: 4px; }
.rule h3 { font-size: 20px; font-weight: 600; align-self: end; }
.rule p { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }
.rule .k { --cw: 66px; }
/* rule marks */
.mk-moon { position: absolute; z-index: 2; top: 0; right: 0; width: 46%; height: 36%; border-top-right-radius: inherit; background: linear-gradient(225deg, #263063 0 50%, transparent 50%); }
.mk-moon svg { position: absolute; right: 10%; top: 10%; width: 40%; fill: #fff4cf; }
.mk-star { position: absolute; z-index: 2; top: 6px; right: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 1px rgb(48 38 56 / 0.15); }
.mk-star svg { width: 14px; height: 14px; fill: var(--c3-ink); }
.mk-dbl { position: absolute; inset: calc(var(--cw) * 0.065); border-radius: calc(var(--cw) * 0.11); z-index: 1; background: linear-gradient(to top right, transparent calc(50% - 1px), #fffaf2 calc(50% - 1px) calc(50% + 1.5px), color-mix(in srgb, var(--rl) 50%, var(--fc)) calc(50% + 1.5px)); }
.mk-dbl b { position: absolute; font-size: calc(var(--cw) * 0.32); }
.mk-dbl b:first-child { left: 14%; top: 10%; } .mk-dbl b:last-child { right: 14%; bottom: 10%; }
.mk-ice { position: absolute; z-index: 2; right: 14%; top: 14%; bottom: 14%; width: 18%; border-radius: 99px; background: #f4fbff; box-shadow: 0 0 0 1.5px #5d9bc2; overflow: hidden; }
.mk-ice i { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: var(--c2); }
.mk-frost { position: absolute; inset: calc(var(--cw) * 0.065); border-radius: calc(var(--cw) * 0.11); background: linear-gradient(180deg, rgb(226 243 252 / 0.6), rgb(190 226 246 / 0.55)); box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.85); }
.mk-strap { position: absolute; z-index: 2; left: -10%; right: -10%; top: 58%; height: 22%; rotate: -6deg; display: flex; align-items: center; justify-content: center; gap: 6%; background: var(--c1); box-shadow: 0 2px 3px rgb(0 0 0 / 0.25); }
.mk-strap::before { content: ''; position: absolute; inset: 3px 0; border-top: 1.5px dashed rgb(255 250 242 / 0.6); border-bottom: 1.5px dashed rgb(255 250 242 / 0.6); }
.mk-strap svg { width: 12px; height: 12px; fill: #fffaf2; }
.mk-hop { position: absolute; z-index: 2; left: 14%; right: 14%; top: 12%; color: var(--ik); }
.mk-hop svg { width: 100%; height: auto; }
.mk-hop b { position: absolute; left: 50%; top: -6px; translate: -50% 0; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ik); color: #fffaf2; font-size: 12px; }
.mk-top { padding-top: 22%; }
.mk-low { padding-bottom: 30%; }
.mk-crown { position: absolute; top: -9px; left: 50%; translate: -50% 0; width: 26px; height: 16px; background: var(--gold); clip-path: polygon(0 100%, 0 30%, 25% 60%, 50% 0, 75% 60%, 100% 30%, 100% 100%); z-index: 3; }
.k.boss { --rl: var(--gold); --fc: #3a2f42; --ik: #fff6cf; }
.k.boss .face { background: var(--grain), #302638; }
.k.order b, .k.down b { display: grid; place-items: center; }
.k svg.big { width: calc(var(--cw) * 0.46); height: calc(var(--cw) * 0.46); fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; position: relative; z-index: 1; }

/* Daily + leaderboards */
.daily { display: grid; gap: 24px; align-items: center; }
.sheet { position: relative; padding: 26px 20px 20px; border-radius: 6px 6px 22px 22px; background: linear-gradient(180deg, var(--paper-hi), var(--paper)); box-shadow: 0 0 0 1px var(--line), 0 2px 0 1px rgb(199 182 157 / 0.6), 0 24px 40px -24px rgb(43 36 51 / 0.5); }
.sheet::before { content: ''; position: absolute; left: 8px; right: 8px; top: -6px; height: 12px; background: radial-gradient(circle at 6px 6px, var(--bg) 4px, transparent 4.5px) 0 0 / 15px 12px repeat-x; }
.today { display: flex; gap: 18px; align-items: center; padding-bottom: 18px; border-bottom: 1.5px dashed var(--line-deep); }
.pad { flex: none; display: flex; flex-direction: column; width: 78px; border-radius: 12px; overflow: hidden; background: var(--paper-hi); box-shadow: 0 0 0 1px var(--line-deep), 0 3px 0 1px var(--line), 0 5px 0 1px var(--paper), 0 6px 0 1px var(--line); text-align: center; }
.pad span { padding: 7px 0 5px; background: var(--c2); color: #fffaf2; font: 800 11px/1 var(--body); letter-spacing: 0.16em; }
.pad b { padding: 8px 0 10px; font: 600 30px/1 var(--display); color: var(--ink-deep); }
.today h3 { font-size: 24px; font-weight: 600; }
.today p { margin: 4px 0 0; color: var(--ink-soft); font-size: 15px; }
.boards { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 0 4px; margin: 0; list-style: none; text-align: center; }
.boards li + li { border-left: 1.5px dashed var(--line-deep); }
.boards svg { width: 26px; height: 26px; color: var(--brand); }
.boards b { display: block; margin-top: 6px; font: 600 18px/1.1 var(--display); color: var(--ink-deep); }
.boards span { display: block; font-size: 13px; color: var(--ink-soft); padding: 0 6px; }
.daily ul.list { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.daily ul.list li { display: flex; gap: 12px; align-items: flex-start; }
.daily ul.list svg { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--brand); }
@media (min-width: 900px) { .daily { grid-template-columns: 1fr 1fr; gap: 56px; } }

/* Screenshots */
.shots { display: flex; gap: 18px; overflow-x: auto; padding: 8px 4px 22px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.shots figure { flex: none; width: min(62vw, 250px); margin: 0; scroll-snap-align: center; }
.shots img { width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 18px; background: var(--paper); box-shadow: 0 0 0 1px var(--line), 0 18px 30px -18px rgb(43 36 51 / 0.55); }

/* Extras */
.extras { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding: 0; margin: 0; list-style: none; }
@media (min-width: 900px) { .extras { grid-template-columns: repeat(3, 1fr); } }
.extras li { padding: 16px 18px; border-radius: 16px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.extras b { display: block; font: 600 18px/1.2 var(--display); color: var(--ink-deep); }
.extras span { font-size: 15px; color: var(--ink-soft); }

/* Final call */
.cta { text-align: center; padding: 72px 0 64px; }
.cta .fan { --cw: 64px; margin: 0 auto 18px; }
.cta .fan .k { animation: none; }
.cta h2 { margin-bottom: 10px; }
.cta .lead { margin: 0 auto 24px; }

/* Footer */
footer { padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-soft); }
footer .row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }
footer .tm { margin: 14px 0 0; font-size: 12.5px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fan .k { animation: none; }
  .btn { transition: none; }
}

/* The web daily link under the hero button. */
.try { margin: 12px 0 0; font-weight: 600; }
.try a { color: inherit; text-underline-offset: 3px; }
