@font-face { font-family: "Nunito"; src: url(/fonts/nunito.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }

/* Celestial storybook, the app's palette: night indigo, parchment cards, sun gold, moon lilac. */
:root {
  --night: #1E2059; --dusk: #3B3A7A; --ink: #24245C; --ink-soft: #5B5A8E;
  --parchment: #FBF3E1; --parchment-2: #F3E6C8; --gold: #F6CF68; --gold-rim: #D9A441; --lilac: #CFCBF6;
  --rose: #D94E66; --rose-bg: #FBE0E4;
  --r: 26px; --shadow: 0 18px 40px -18px rgba(30, 32, 89, .55);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Nunito", system-ui, sans-serif; font-weight: 500; font-size: 17px; line-height: 1.55; color: var(--ink);
  background: linear-gradient(180deg, #D9CFF0 0, #BDB3E6 120vw, #8A82C8 260vw, #3B3A7A 520vw) #3B3A7A;
  min-height: 100vh; position: relative;
}
/* The app's painted sky, faded into the dusk gradient instead of ending in a hard edge. */
body::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 150vw;
  background: url(/img/sky-720.webp) center top / 100% auto no-repeat;
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); }
@media (min-width: 760px) {
  body { background: #3B3A7A; }
  body::before { position: fixed; height: 100vh; background: url(/img/sky-1400.webp) center / cover no-repeat; -webkit-mask-image: none; mask-image: none; }
}
a { color: var(--dusk); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--night); }
:focus-visible { outline: 3px solid var(--gold-rim); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-weight: 900; line-height: 1.12; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 7.4vw, 3.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .9em; }
img { max-width: 100%; height: auto; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 14px 16px 6px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 2px; text-decoration: none; font-weight: 900; font-size: 1.15rem; color: var(--ink); }
.brand span { margin-left: 8px; line-height: 1.05; }
.brand small { display: block; font-size: .72rem; font-weight: 800; opacity: .7; letter-spacing: .02em; }
.nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 100%; padding-bottom: 4px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; text-decoration: none; font-weight: 800; font-size: .95rem; color: var(--ink); padding: 7px 14px; border-radius: 99px;
  background: rgba(251, 243, 225, .72); border: 1.5px solid rgba(217, 164, 65, .45); }
.nav a[aria-current="page"] { background: var(--gold); border-color: var(--gold-rim); }
@media (min-width: 900px) { .nav { flex: 0 1 auto; margin-left: auto; padding: 0; } }

main { max-width: 1180px; margin: 0 auto; padding: 8px 16px 40px; }
.card { background: rgba(251, 243, 225, .95); border: 2px solid rgba(217, 164, 65, .55); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.lede { font-size: 1.12rem; font-weight: 600; color: var(--dusk); max-width: 38em; }
.more { font-weight: 800; }

/* home layout: text, the board, then rules + app; two columns on wide screens */
.hero { display: grid; gap: 0 26px; align-items: start; }
.hero-text { padding: 10px 2px 6px; }
.hero h1 { text-shadow: 0 2px 0 rgba(255, 255, 255, .6); }
@media (min-width: 980px) {
  .hero { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); }
  .hero-text { grid-column: 1 / -1; }
  .hero-side { grid-column: 2; grid-row: 2; }
}
.band { display: grid; gap: 0 18px; margin-top: 8px; }
@media (min-width: 760px) { .band { grid-template-columns: repeat(3, 1fr); } }

/* the play card */
.board-card { padding: 16px 16px 18px; background: linear-gradient(180deg, rgba(251, 243, 225, .98), rgba(243, 230, 200, .98)); border: 3px solid var(--gold-rim); }
.play-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-right: 96px; }
.pill { font-weight: 900; font-size: .95rem; padding: 4px 12px; border-radius: 99px; background: var(--night); color: var(--parchment); }
.pill.time { background: var(--gold); color: var(--ink); font-variant-numeric: tabular-nums; }
.board-wrap { position: relative; }
.peek { position: absolute; right: -6px; top: -82px; width: 104px; height: auto; pointer-events: none; transition: transform .35s ease; }
.done .peek { transform: translateY(-6px) rotate(-4deg); }

.board { --n: 6; --gap: 7px; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: var(--gap); padding: var(--gap);
  background: #E9D6AA; border-radius: 18px; border: 2px solid var(--gold-rim); position: relative; }
.board .cell { position: relative; aspect-ratio: 1; border-radius: 12px; background: #FFF9EC; border: 0; padding: 0; margin: 0;
  display: grid; place-items: center; box-shadow: inset 0 -3px 0 rgba(217, 164, 65, .25); font: inherit; color: inherit; }
.board .cell img { width: 78%; height: 78%; object-fit: contain; }
.board .cell.given { background: #F1E3BF; }
.board.live .cell:not(.given) { cursor: pointer; transition: transform .08s ease, background .15s ease; }
.board.live .cell:not(.given):active { transform: scale(.94); }
@media (hover: hover) { .board.live .cell:not(.given):hover { background: #FFF3D2; } }
.board .cell.bad { background: var(--rose-bg); box-shadow: inset 0 0 0 3px var(--rose); }
.board .cell.mark { box-shadow: inset 0 0 0 3px var(--dusk); animation: pop .5s ease; }
@keyframes pop { 40% { transform: scale(1.08); } }
.sign { position: absolute; z-index: 2; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); border: 1.5px solid var(--gold-rim); color: var(--ink); font-weight: 1000; font-size: 14px; line-height: 1; pointer-events: none; }
.sign.r { right: calc(var(--gap) / -2 - 10px); top: 50%; transform: translateY(-50%); }
.sign.d { bottom: calc(var(--gap) / -2 - 10px); left: 50%; transform: translateX(-50%); }
.board.small { --gap: 5px; max-width: 300px; }
.board.small .cell { border-radius: 8px; }
.board.small .sign { width: 17px; height: 17px; font-size: 12px; }
.board.small .sign.r { right: calc(var(--gap) / -2 - 8px); }
.board.small .sign.d { bottom: calc(var(--gap) / -2 - 8px); }

.status { min-height: 3.1em; margin: 14px 2px 10px; font-weight: 700; color: var(--dusk); }
.controls { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px; border-radius: 99px; font: inherit;
  font-weight: 900; font-size: 1rem; text-decoration: none; cursor: pointer; border: 2px solid var(--gold-rim); color: var(--ink); }
.btn.gold { background: linear-gradient(180deg, #FFE08F, var(--gold)); box-shadow: 0 4px 0 var(--gold-rim); }
.btn.gold:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--gold-rim); }
.btn.ghost { background: #FFF9EC; }
.win { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 14px; border-radius: 20px; background: var(--night); color: var(--parchment); }
.win[hidden] { display: none; }
.win img { width: 96px; flex: none; }
.win-title { font-size: 1.5rem; font-weight: 1000; color: var(--gold); margin: 0; }
.win p { margin: 0 0 10px; }
.win-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.win .btn.ghost { background: transparent; color: var(--parchment); }

/* rules */
.rules { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.rules li { display: flex; gap: 12px; align-items: flex-start; }
.rules img { flex: none; margin-top: 1px; }
.sign-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); border: 1.5px solid var(--gold-rim); display: grid; place-items: center; font-weight: 1000; }

/* app block */
.app-top { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.app-top h2 { margin: 0; }
.app-top p { margin: 0; }
.app-icon { border-radius: 16px; box-shadow: 0 4px 10px rgba(30, 32, 89, .3); }
.app-list { padding-left: 1.1em; margin: 6px 0 12px; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.shots img { border-radius: 14px; border: 2px solid rgba(217, 164, 65, .55); }
.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.store { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 16px; border-radius: 14px; background: #111; color: #fff; text-decoration: none; }
.store:hover { color: #fff; background: #000; }
.store.soon { background: #6B6A8F; opacity: .8; }
.store-ico { width: 26px; height: 26px; color: #fff; }
.store-text { display: flex; flex-direction: column; line-height: 1.1; }
.store-small { font-size: .72rem; font-weight: 600; }
.store-big { font-size: 1.1rem; font-weight: 900; }

/* lists of puzzles */
.recent { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.recent a { display: grid; grid-template-columns: 3.4em 1fr auto; gap: 8px; padding: 9px 12px; border-radius: 14px; background: #FFF9EC; text-decoration: none; color: var(--ink); font-weight: 700; }
.recent a:hover { background: #FFF0C7; }
.recent .num { font-weight: 1000; color: var(--dusk); }
@media (min-width: 760px) { .recent.full { grid-template-columns: 1fr 1fr; } }

/* articles */
.crumbs { font-size: .9rem; font-weight: 700; margin: 6px 2px 12px; color: var(--ink-soft); }
.prose { max-width: 860px; }
.prose.wide { max-width: 1060px; }
.prose h1 { font-size: clamp(2rem, 6.6vw, 3rem); }
.prose ul { padding-left: 1.2em; }
.tips { display: grid; gap: 12px; }
@media (min-width: 700px) { .tips { grid-template-columns: 1fr 1fr; } }
.tip { background: #FFF9EC; border-radius: 18px; padding: 14px 16px; }
.tip p { margin: 0; }
.steps { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 14px; }
.step { display: grid; gap: 12px; align-items: center; background: #FFF9EC; border-radius: 18px; padding: 14px; }
@media (min-width: 700px) { .step { grid-template-columns: 1fr 240px; } }
.step .board.small { max-width: 240px; }
.step-n { font-weight: 1000; color: var(--dusk); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.step p { margin: 4px 0 0; }
.example-start { margin: 6px 0 4px; }
.split { display: grid; gap: 0 18px; align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
details.hint, details.spoiler { background: #FFF9EC; border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; }
details summary { font-weight: 900; cursor: pointer; color: var(--dusk); }
details[open] summary { margin-bottom: 8px; }
details.spoiler { background: var(--night); color: var(--parchment); }
details.spoiler summary { color: var(--gold); }
details.spoiler h3 { color: var(--gold); margin-top: 14px; }
.walk { padding-left: 1.3em; font-size: .95rem; }
.walk li { margin-bottom: 4px; }
.pn { display: flex; justify-content: space-between; font-weight: 900; margin: 4px 4px 18px; }
.cta-line { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* printable */
.sheet { background: #fff; border-radius: var(--r); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.print-item { margin: 0; }
.print-item figcaption { font-weight: 800; margin-top: 6px; color: var(--ink-soft); }
.sheet .board { background: #fff; border-color: #999; }
.sheet .board .cell { background: #fff; box-shadow: inset 0 0 0 1px #bbb; }
.sheet .board .cell.given { background: #f3f3f3; }

/* footer */
.foot { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; color: var(--parchment); }
.foot a { color: var(--gold); }
.foot .tools { background: rgba(30, 32, 89, .88); border-radius: var(--r); padding: 16px 20px; margin-bottom: 10px; font-weight: 700; }
.tools-title { font-weight: 900; margin: 0 0 6px; }
.foot .small { background: rgba(30, 32, 89, .7); display: inline-block; padding: 6px 12px; border-radius: 99px; }

@media (max-width: 380px) { body { font-size: 16px; } .card { padding: 16px; } .board { --gap: 5px; } .play-bar { padding-right: 84px; } .peek { width: 90px; top: -70px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  body { background: #fff; } .top, .foot, .no-print, .crumbs { display: none !important; }
  .sheet { box-shadow: none; padding: 0; } .answers { break-before: page; } details.answers > *:not(summary) { display: block; }
  .print-grid { grid-template-columns: repeat(2, 1fr); }
}
