/* ============================================================
   new2puzzles — "Paper & Play" design system
   Warm cream paper, sticker cards, thick ink borders,
   hard offset shadows. Baloo 2 headlines + Nunito Sans body.
   ============================================================ */

:root {
  --ink: #33261c;
  --paper: #fff9ef;
  --cream: oklch(0.962 0.018 85);
  --muted: #5c4a3a;
  --faded: #9c8a72;

  --c-crosswords: oklch(0.58 0.17 262);
  --c-sudoku: oklch(0.62 0.17 150);
  --c-jigsaw: oklch(0.63 0.19 30);
  --c-logic: oklch(0.58 0.18 300);
  --c-wordsearch: oklch(0.70 0.14 75);
  --c-nonograms: oklch(0.64 0.13 215);
  --c-cryptic: oklch(0.62 0.20 345);
  --c-escape: oklch(0.68 0.16 120);

  --bd: 2.5px solid var(--ink);
  --r: 20px;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);

  --display: 'Baloo 2', sans-serif;
  --body: 'Nunito Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--cream);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.12; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 700; font-size: 17px;
  padding: 11px 24px; border-radius: 14px; border: var(--bd);
  background: var(--ink); color: var(--paper);
  text-decoration: none; cursor: pointer;
  transition: transform 0.13s ease, box-shadow 0.13s ease;
}
.btn.accent { background: var(--c-wordsearch); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn.paper { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn.accent:hover, .btn.paper:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ── Nav ── */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 24px; text-decoration: none; }
.logo .mark { width: 34px; height: 34px; background: var(--c-jigsaw); border: var(--bd); border-radius: 10px; position: relative; flex-shrink: 0; }
.logo .mark::after { content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 13px; height: 13px; border-radius: 50%; background: var(--c-jigsaw); border: var(--bd); }
.nav-menu, .nav-actions { display: flex; align-items: center; gap: 24px; }
.navlinks { display: flex; gap: 28px; font-size: 16px; font-weight: 800; }
.navlinks a { text-decoration: none; }
.navlinks > a:hover, .navdrop > a:hover { text-decoration: underline; text-decoration-thickness: 2.5px; text-underline-offset: 4px; }

/* ── Nav dropdowns ── */
.navdrop { position: relative; }
.navdrop > a::after, .navdrop > .navdrop-label::after { content: '▾'; font-size: 12px; margin-left: 5px; }
.navdrop-label { cursor: default; }
.dropmenu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); padding-top: 12px; z-index: 100; }
.navdrop:hover .dropmenu, .navdrop:focus-within .dropmenu { display: block; }
.dropmenu .inner { background: var(--paper); border: var(--bd); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 8px; display: flex; flex-direction: column; min-width: 210px; }
.dropmenu a { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.dropmenu a:hover { background: color-mix(in oklch, var(--dc, var(--c-wordsearch)) 24%, white); text-decoration: none; }
.dropmenu a i { width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--ink); background: var(--dc, var(--c-wordsearch)); flex-shrink: 0; }
.dropmenu .sep { border-top: 2px solid color-mix(in oklch, var(--ink) 15%, transparent); margin: 6px 4px; }

/* ── Sticker frame (white card w/ border + hard shadow) ── */
.sticker { background: var(--paper); border: var(--bd); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-sm); display: inline-block; }

/* ── Section headers ── */
.secthead { text-align: center; margin-bottom: 34px; }
.secthead h2 { font-size: clamp(30px, 3.4vw, 40px); }
.secthead p { font-size: 17px; font-weight: 600; color: var(--muted); margin-top: 6px; }

/* ── Cards ── */
.card { background: var(--paper); border: var(--bd); border-radius: var(--r); box-shadow: var(--shadow); }

/* ── Pills ── */
.pill {
  display: inline-block; align-self: flex-start;
  font-size: 13px; font-weight: 900;
  background: color-mix(in oklch, var(--c, var(--c-wordsearch)) 35%, white);
  border: 2px solid var(--ink); padding: 3px 12px; border-radius: 99px;
}

/* ── Newsletter band + footer ── */
.news { background: var(--ink); padding: 64px 0 70px; color: var(--paper); text-align: center; }
.news h2 { font-size: clamp(30px, 3.2vw, 38px); }
.news p { font-size: 17px; font-weight: 600; color: rgba(255, 249, 239, 0.75); margin: 10px 0 28px; }
.newsform { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.newsform input {
  width: 340px; max-width: 100%; padding: 13px 20px;
  border: 2.5px solid var(--paper); border-radius: 14px;
  font-size: 16px; font-weight: 600; font-family: var(--body);
  color: var(--paper); background: transparent; outline: none;
}
.newsform input::placeholder { color: rgba(255, 249, 239, 0.55); }
.newsform input:focus { border-color: var(--c-wordsearch); }

.footer { background: var(--ink); border-top: 1px solid rgba(255, 249, 239, 0.18); color: rgba(255, 249, 239, 0.6); padding: 26px 0 34px; font-size: 14.5px; font-weight: 600; }
.footer .row { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer .cols { display: flex; gap: 26px; flex-wrap: wrap; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ============================================================
   CSS-built puzzle motifs (simple shapes only)
   Each motif reads its hue from --c on itself or an ancestor.
   ============================================================ */

/* Sudoku — 3×3 box, highlighted center */
.m-sudoku { display: grid; grid-template-columns: repeat(3, 22px); gap: 2px; padding: 5px; background: var(--ink); border-radius: 6px; }
.m-sudoku b { width: 22px; height: 22px; border-radius: 3px; background: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--ink); line-height: 1; }
.m-sudoku b.hl { background: var(--c, var(--c-sudoku)); color: #fff; }

/* Crossword — 4×4 grid, black squares + lead cell */
.m-cross { display: grid; grid-template-columns: repeat(4, 17px); gap: 2px; padding: 5px; background: var(--ink); border-radius: 6px; }
.m-cross b { width: 17px; height: 17px; border-radius: 2px; background: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 11px; color: #fff; line-height: 1; }
.m-cross b.k { background: var(--ink); }
.m-cross b.a { background: var(--c, var(--c-crosswords)); }

/* Jigsaw — square + tab + notch */
.m-jigsaw { position: relative; width: 56px; height: 56px; background: var(--c, var(--c-jigsaw)); border-radius: 14px; margin: 13px 13px 13px 0; }
.m-jigsaw::before { content: ''; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--c, var(--c-jigsaw)); }
.m-jigsaw::after { content: ''; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--paper); }

/* Logic — ✕ / ✓ deduction grid */
.m-logic { display: grid; grid-template-columns: repeat(3, 22px); gap: 2px; padding: 5px; background: var(--ink); border-radius: 6px; }
.m-logic b { width: 22px; height: 22px; border-radius: 3px; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; color: rgba(0, 0, 0, 0.45); line-height: 1; }
.m-logic b.y { color: var(--c, var(--c-logic)); font-size: 12px; }

/* Word search — letters with a found diagonal */
.m-word { display: grid; grid-template-columns: repeat(4, 18px); gap: 2px; padding: 5px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; }
.m-word b { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 10px; color: var(--ink); line-height: 1; }
.m-word b.f { background: var(--c, var(--c-wordsearch)); color: #fff; }

/* Nonogram — 5×5 picture grid */
.m-nono { display: grid; grid-template-columns: repeat(5, 14px); gap: 2px; padding: 5px; background: var(--ink); border-radius: 6px; }
.m-nono b { width: 14px; height: 14px; border-radius: 2px; background: #fff; }
.m-nono b.f { background: var(--c, var(--c-nonograms)); }

/* Cryptic — clue cell with "?" */
.m-cryptic { position: relative; width: 62px; height: 62px; background: #fff; border: 3px solid var(--ink); border-radius: 10px; display: grid; place-items: center; }
.m-cryptic i { position: absolute; top: 3px; left: 7px; font-style: normal; font-size: 12px; font-weight: 800; color: var(--ink); line-height: 1; }
.m-cryptic span { font-family: var(--display); font-size: 34px; font-weight: 800; color: var(--c, var(--c-cryptic)); line-height: 1; }

/* Escape — arched door + keyhole */
.m-escape { width: 50px; height: 66px; background: var(--c, var(--c-escape)); border-radius: 25px 25px 8px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 6px; }
.m-escape::before { content: ''; width: 15px; height: 15px; border-radius: 50%; background: var(--ink); }
.m-escape::after { content: ''; width: 8px; height: 13px; background: var(--ink); border-radius: 0 0 4px 4px; }
