@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Caslon+Display&display=swap');
:root{--ink:#243f32;--paper:#f8f6ef;--green:#385f48}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:'DM Sans',Arial,sans-serif}button,input{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #a45a2b;outline-offset:4px}header{max-width:1180px;margin:auto;height:100px;display:flex;align-items:center;justify-content:space-between;padding:0 36px;border-bottom:1px solid #dcded3}.brand{text-decoration:none;color:var(--ink);font-size:26px;font-weight:600;letter-spacing:-1px}.brand span{font-size:38px;vertical-align:middle;margin-right:9px}.quiet{border:0;background:transparent;color:var(--ink);padding:12px}main{max-width:1108px;margin:auto;padding:48px 0 20px}.eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;text-transform:uppercase}.flower{font-size:235px;color:#e8ac7d;position:absolute;top:-27px;left:40px;line-height:1.3;transform:rotate(15deg)}footer{font-size:10px;color:#798073;display:flex;justify-content:space-between;padding:25px 0}dialog{border:1px solid #d8ddce;border-radius:20px;background:var(--paper);color:var(--ink);padding:26px;width:min(95vw,540px);max-height:94dvh;overflow:auto}dialog::backdrop{background:#1d302b70;backdrop-filter:blur(4px)}.modalhead{display:flex;justify-content:space-between;align-items:center;font-size:11px;letter-spacing:1px;text-transform:uppercase}dialog h2{font:36px Georgia,serif;margin:10px 0 15px}dialog p{font-size:14px;line-height:1.65;color:#607063}#feedback{min-height:24px;font-weight:600;color:#3d624b}#actions{display:flex;flex-wrap:wrap;gap:9px}.btn{background:var(--green);color:white;border:0;border-radius:8px;padding:12px 18px}.btn.secondary{background:#e6e9de;color:var(--ink)}.grid{display:grid;gap:6px;max-width:340px;margin:22px auto}.cell{aspect-ratio:1;border:1px solid #c8d2bf;border-radius:6px;display:grid;place-items:center;background:#fffef9;font-size:23px;color:var(--ink);text-align:center;min-width:0;width:100%}.cell.fixed{background:#e5eadc;font-weight:700}.cell.chosen{background:#507258;color:white}.cell.correct{background:#52775a;color:white}.cell.present{background:#b48b32;color:white}.cell.absent{background:#777e73;color:white}.wordentry{display:flex;gap:8px}.wordentry input{width:100%;min-width:0;text-transform:uppercase;border:1px solid #bac6b4;padding:12px;border-radius:8px;background:white}.choice{display:block;width:100%;text-align:left;margin:8px 0;border:1px solid #ccd5c6;border-radius:9px;padding:15px;background:#fffdf8;color:var(--ink)}.choice.selected{background:#d6e2cb;border-color:#547359}.domino{display:flex;justify-content:center;align-items:center;gap:10px}.tile{border:1px solid #bac6b1;background:#fffef8;padding:12px;border-radius:8px;font-size:22px;color:var(--ink)}.domrow{display:flex;gap:8px;align-items:center;justify-content:center;margin:12px 0}.slot{min-width:93px;min-height:55px}.tray{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:18px 0}.small{font-size:12px;text-align:center}#days button{display:block;width:100%;margin:8px 0;text-align:left}#board h3{font-weight:500;font-size:17px;line-height:1.7}@media(max-width:800px){header{padding:0 22px;height:80px}main{padding:30px 22px}}@media(max-width:520px){.brand{font-size:23px}.eyebrow{font-size:9px}footer{gap:15px;line-height:1.7}footer span{text-align:right}.tile{padding:10px}.slot{min-width:80px}}.roundline,.rangeends{display:flex;justify-content:space-between;font-size:11px;color:#637361;margin:12px 0}.photoframe{border-radius:12px;overflow:hidden;background:#e4e4db;min-height:140px}.photoframe img{width:100%;height:270px;object-fit:contain;display:block}.yearlabel{display:flex;justify-content:space-between;align-items:center;margin:20px 0 12px;font-size:14px}.yearlabel input{width:110px;padding:8px;border:1px solid #b8c3b2;border-radius:8px;background:#fffdf7;font-size:22px;color:var(--ink)}input[type=range]{width:100%;accent-color:var(--green);height:26px}.reveal{background:#e8eddf;padding:20px;border-radius:12px;margin:20px 0}.reveal h2{font-size:48px;margin:8px 0}.reveal a,.recap a,.credits a{color:#42664e}.reveal a,.credits{font-size:11px}.photoresult{text-align:center;padding:22px 0}.photoresult small{font-size:17px}.recap{display:flex;gap:14px;padding:15px 0;border-top:1px solid #d3dbca;align-items:center}.recap img{width:90px;height:80px;object-fit:cover;border-radius:6px}.recap strong{font-size:13px}.recap p,.recap a{font-size:11px;margin:5px 0}.btn:disabled{opacity:.45;cursor:wait}.modebar{display:flex;gap:8px;margin:20px 0}.instruction{background:#eceee3;padding:15px;border-radius:10px}.neighbourmetrics{display:flex;justify-content:space-between;font-size:11px;margin:20px 0 5px}.neighbourmetrics strong{display:block;font-size:23px;font-weight:500;margin-bottom:4px}.neighbourgrid{display:grid;gap:7px;max-width:340px;margin:20px auto}.neighbour{position:relative;aspect-ratio:1;background:#f6dfb8;border:1px solid #ceaf7e;border-radius:10px;min-width:0;color:#9b632b;display:flex;align-items:center;justify-content:center;flex-direction:column;font-size:29px}.neighbour.shape2{background:#d5e2e8;border-color:#9caeb8;color:#50778c}.neighbour.empty{background:transparent;border:1px dashed #b7c3ac;color:#a8b59d;font-size:23px}.neighbour small{font-size:10px;height:12px;line-height:12px}.neighbour.content{border-bottom:3px solid #58794f}.neighbour.selected{outline:3px solid #405f42;outline-offset:2px}.sliderlabel{display:block;font-size:13px;margin:15px 0 6px}.experimentnote{font-size:12px!important;line-height:1.7}.credits{font-size:10px!important;border-top:1px solid #d7ddcf;padding-top:16px}#photoerror{padding:15px}@media(max-width:520px){.photoframe img{height:230px}.neighbour{font-size:24px}.neighbourgrid{gap:5px}}

.difficultybar{border:1px solid #d7decd;background:#f0f2e8;border-radius:16px;padding:20px 24px;margin:0 0 20px}.difficultyheading{display:flex;justify-content:space-between;gap:16px;font-size:14px}.difficultyheading strong{color:#416449}.difficultybar p{font-size:12px;line-height:1.6;color:#62705d;margin:8px 0 0}.difficultybar .rangeends{margin:0}.difficultybar input{cursor:pointer}.neighbourface{width:85%;height:85%;max-height:65px;fill:#3d4030}.facebody{fill:#e6ac5f;stroke:#9b632b;stroke-width:1.5}.shape2 .facebody{fill:#a8c9d9;stroke:#50778c}.facemouth{fill:none;stroke:#3d4030;stroke-width:2.8;stroke-linecap:round}.neighbour.content .facebody{filter:brightness(1.07)}@media(max-width:520px){.difficultybar{padding:18px 16px}.difficultyheading{font-size:13px}}

/* Phone browsers: comfortable tap targets and narrow-screen layouts. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
button,input[type=range]{touch-action:manipulation}
@media(pointer:coarse){.quiet,.btn,.choice{min-height:44px}input[type=range]{min-height:44px}}
@media(max-width:520px){
  dialog{padding:18px;width:calc(100vw - 20px);max-width:540px;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px)}
  dialog input:not([type=range]){font-size:16px}
  .yearlabel input{font-size:22px}
  .neighbourgrid{gap:4px}.neighbour{min-height:40px;padding:0}
  .modebar{flex-wrap:wrap}
  .recap>div{min-width:0;overflow-wrap:anywhere}
}
@media(max-width:420px){
  main{padding:24px 16px}header{padding:0 16px}
  .difficultyheading{flex-wrap:wrap;gap:6px}
  footer{flex-direction:column;gap:6px}footer span{text-align:left}
}



.wordkeyboard{margin:20px auto 8px;max-width:460px}.keyrow{display:flex;justify-content:center;gap:4px;margin:5px 0}.letterkey{flex:1;max-width:42px;min-width:0;min-height:44px;padding:4px 0;border:1px solid #b8c3b0;border-radius:5px;background:#e1e5da;color:#243f32;font-size:14px;font-weight:700}.letterkey.wide{flex:1.5;max-width:64px;font-size:11px}.letterkey.correct{background:#52775a;color:white}.letterkey.present{background:#99731d;color:white}.letterkey.absent{background:#565d54;color:white}.letterkey:disabled{cursor:default;opacity:1}.photo-clue{background:#edf0e4;border-left:3px solid #64815b;border-radius:8px;padding:14px 16px;margin:14px 0}.photo-clue strong{font-size:12px}.photo-clue p{margin:6px 0 0;font-size:13px;line-height:1.6}.era-whisper{display:block;margin-top:8px;padding-top:8px;border-top:1px dashed #c3ccb5;color:#4d5f47;font-style:italic}

/* ───────── Feed: one full-screen, snap-scrolling card per puzzle ───────── */
body.feedmode { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body.feedmode header.feedbar { flex: none; width: 100%; max-width: none; height: 56px; padding: 0 14px; padding-top: env(safe-area-inset-top); background: var(--paper); z-index: 5; }
body.feedmode .brand { font-size: 19px; letter-spacing: -0.5px; white-space: nowrap; }
body.feedmode .brand span { font-size: 26px; margin-right: 5px; }
.pills { display: flex; gap: 6px; }
.pill { border: 1px solid #d3d9c8; background: #fffdf7; color: var(--ink); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill b { font-variant-numeric: tabular-nums; }
.revealcount { font-variant-numeric: tabular-nums; font-weight: 500; opacity: 0.75; }
.pill.bump { animation: bump 0.6s ease; }
@keyframes bump { 30% { transform: scale(1.18); background: #f6e3b5; } 100% { transform: none; } }
#feed { flex: 1; min-height: 0; width: 100%; max-width: none; padding: 0; margin: 0; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; }
#feed::-webkit-scrollbar { display: none; }
.spark { min-height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; justify-content: center; padding: 14px 14px 18px; border-bottom: 1px solid #e4e6dc; }
.sparkinner { position: relative; width: 100%; max-width: 560px; display: flex; flex-direction: column; border-radius: 22px; background: #fffdf8; border: 1px solid #e0e4d6; padding: 16px 18px 14px; box-shadow: 0 6px 24px #24403210; transition: box-shadow 0.4s, border-color 0.4s; }
.spark.is-done .sparkinner { border-color: #c9d9bf; }
.donebadge[hidden] { display: none; }
.sparkhead { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #6b7a67; }
.sparkday { color: #a45a2b; }
.sparktitle { font-family: "Libre Caslon Display", Georgia, serif; font-weight: 400; font-size: 30px; margin: 6px 0 4px; }
.donebadge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #507258; color: white; font: 700 14px "DM Sans", sans-serif; vertical-align: middle; }
.stage { flex: 1; display: flex; flex-direction: column; }
.stage[inert] { opacity: 0.55; }
.stage #board { flex: none; }
.howto { font-size: 13px; color: #607063; margin: 2px 0 4px; }
.howto summary { cursor: pointer; font-weight: 600; color: #416449; padding: 4px 0; }
.howto p { margin: 4px 0 0; line-height: 1.55; font-size: 13px; }
.stage #feedback { margin: 8px 0; min-height: 22px; font-size: 14px; }
.stage .grid { margin: 12px auto; }
.sparkfoot { display: flex; justify-content: center; padding-top: 6px; }
.nextspark { border: 0; background: transparent; color: #6b7a67; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.spark.is-done .nextspark { background: #e8efe0; color: #355a40; }
.cover { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; color: #607063; }
.coverart { font-size: 44px; letter-spacing: 6px; color: #b4825f; }
.coverhint { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.dayintro .sparkinner, .endcard .sparkinner { justify-content: center; align-items: center; text-align: center; background: #f0f2e8; }
.dayintro h2, .endcard h2, .notehero { font-family: "Libre Caslon Display", Georgia, serif; font-weight: 400; font-size: 34px; margin: 10px 0; }
.introcount b { font-size: 26px; color: #416449; }
.introdots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 260px; margin: 8px auto; }
.introdots i{ width: 10px; height: 10px; border-radius: 50%; background: #dfe3d6; }
.introdots i.done { background: #507258; }
.notecard .sparkinner { align-items: center; text-align: center; overflow: hidden; }
.notecard .coverart { margin-top: 8px; }
.todaycount b { font-size: 22px; color: #416449; }
#days button { display: flex; justify-content: space-between; width: 100%; }
#days button.full { background: #e3ecda; }
dialog.sheet { margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
dialog.sheet h2 { font-size: 26px; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Celebration: a short burst, a glow and a count-up chip. */
.spark.celebrating .sparkinner { border-color: #e9c46a; animation: glow 1.4s ease-out; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 #f2c94c00; } 25% { box-shadow: 0 0 0 6px #f2c94c88, 0 0 40px 12px #f2c94c55; } 100% { box-shadow: 0 6px 24px #24403210; } }
.burst { position: absolute; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst i { position: absolute; font-style: normal; line-height: 1; transform: translate(-50%, -50%) scale(0.2); opacity: 0; animation: pop 1.15s cubic-bezier(0.2, 0.7, 0.3, 1) var(--delay) forwards; }
@keyframes pop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 60px)) rotate(var(--rot)) scale(1); }
}
.solvedchip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #355a40; color: white; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; z-index: 4; animation: chip 2.6s ease forwards; box-shadow: 0 6px 18px #24403240; }
.solvedchip b { font-variant-numeric: tabular-nums; display: inline-block; animation: tick 0.4s 0.35s ease; }
@keyframes chip { 0% { opacity: 0; transform: translate(-50%, -12px) scale(0.8); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.06); } 20% { transform: translate(-50%, 0) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes tick { 50% { transform: scale(1.5); color: #f6d77b; } }
@media (prefers-reduced-motion: reduce) {
  .spark.celebrating .sparkinner { animation: none; box-shadow: 0 0 0 3px #e9c46a; }
  .solvedchip, .solvedchip b, .pill.bump { animation: none; }
  #feed { scroll-behavior: auto; }
}

/* ───────── New games ───────── */
.reveal .eyebrow { color: #a45a2b; }
.reveal h3 { font-family: "Libre Caslon Display", Georgia, serif; font-size: 26px; margin: 4px 0; }
.storytitle { text-align: center; font-weight: 700; margin: 4px 0; }
.storycards { list-style: none; padding: 0; margin: 6px 0; counter-reset: s; display: grid; gap: 6px; }
.storycards li { counter-increment: s; display: flex; gap: 8px; align-items: center; }
.storycards li::before { content: counter(s); font-weight: 700; color: #a8b3a1; width: 14px; }
.storycard { flex: 1; text-align: left; border: 1px solid #d3dccb; background: #fffdf8; color: var(--ink); border-radius: 12px; padding: 8px 12px; display: grid; gap: 2px; font-size: 13px; }
.storycard b { font-size: 14px; }
.storycard.picked { border-color: #547359; background: #e3ecda; transform: scale(1.01); }
.storycard.placed { background: #eaf2e2; }
.storycards li { position: relative; }
.storygrip { flex: none; width: 44px; align-self: stretch; min-height: 44px; display: grid; place-items: center; margin-left: -6px; color: #a8b3a1; font-size: 20px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.storycards.dragging { touch-action: none; user-select: none; -webkit-user-select: none; }
.storycards.dragging .storygrip { cursor: grabbing; }
.storycards li.lifted { z-index: 2; }
.storycards li.lifted::before { visibility: hidden; }
.storycards li.lifted .storycard { box-shadow: 0 6px 18px rgba(40, 60, 40, .18); border-color: #547359; }
.swatches { display: flex; justify-content: center; gap: 22px; margin: 6px 0; }
.swatches figure { margin: 0; text-align: center; font-size: 12px; color: #607063; }
.swatch { width: 110px; height: 110px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 4px 16px #24403225; margin-bottom: 6px; transition: background 0.35s; }
.swatch.matched { box-shadow: 0 0 0 4px #e9c46a, 0 4px 16px #24403225; }
.meter { position: relative; height: 8px; border-radius: 99px; background: #e6e9de; overflow: visible; margin: 8px auto; max-width: 300px; }
.meter i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #d9b26a, #6c9a6f); transition: width 0.3s; }
.meter.goal b { position: absolute; top: -4px; width: 2px; height: 16px; background: #a45a2b; }
.pigments { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.pigment { display: grid; justify-items: center; gap: 4px; border: 1px solid #d3dccb; background: #fffdf8; color: var(--ink); border-radius: 14px; padding: 10px 12px; min-width: 70px; font-size: 13px; }
.pigment span { width: 34px; height: 34px; border-radius: 50%; background: var(--pig); border: 2px solid #0001; }
.pigment small { color: #8a9686; }
.stars { text-align: center; font-size: 28px; color: #e0a92e; margin: 4px 0; letter-spacing: 4px; }
.mirrorgrid { display: grid; gap: 3px; max-width: 360px; aspect-ratio: 1; margin: 8px auto; }
.mirrorgrid > * { display: grid; place-items: center; min-height: 0; }
.lamp { font-size: 18px; color: #e3a530; }
.mcell { border: 1px solid #d3dccb; background: #fffdf8; border-radius: 6px; font-size: 22px; color: #3c5a76; padding: 0; min-width: 0; transition: background 0.25s; }
.mcell.lit { background: #fbefc4; }
.mcell.mflower { color: #b88; }
.mcell.mflower.lit { color: #d0557a; background: #fde6a0; }
.mcell.rock { background: #d9dcd2; color: #7c8378; }
.mirrorgrid.solved .mcell.lit { background: #f8de85; }
.lantgrid { display: grid; gap: 3px; max-width: 360px; margin: 8px auto; }
.lantgrid > * { aspect-ratio: 1; display: grid; place-items: center; min-width: 0; border-radius: 6px; }
.lcell { border: 1px solid #d3dccb; background: #fffdf8; font-size: 22px; color: #8a9584; padding: 0; transition: background 0.25s, box-shadow 0.25s; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.lcell.lit { background: #fbefc4; box-shadow: inset 0 0 10px rgba(240, 190, 60, 0.35); }
.lcell.bulb { background: #fde6a0; }
.lcell.clash { background: #f6c9c3; border-color: #d0574a; animation: lanclash 0.7s ease-in-out infinite alternate; }
@keyframes lanclash { to { background: #fbe1dc; } }
.lwall { background: #3f4a45; color: #f4efe2; font-weight: 700; font-size: 20px; }
.lwall.ok { background: #3f7a55; }
.lwall.over { background: #b5483d; }
.lantgrid.solved .lcell { background: #f8de85; }
#rules .lanrule { display: block; margin: 4px 0 8px; font-weight: 600; }
#rules .lansteps { display: grid; gap: 10px; margin-bottom: 8px; }
#rules .lanstep { display: block; }
#rules .lanpair { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
#rules .lanpair .lmini { margin-top: 0; }
#rules .lanok { color: #3f7a55; font-weight: 700; }
#rules .lmini { display: grid; gap: 2px; width: max-content; margin-top: 6px; }
#rules .lmini > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; border: 1px solid #d3dccb; background: #fffdf8; font-size: 13px; }
#rules .lmini .lo { background: #fbefc4; }
#rules .lmini .lb { background: #fde6a0; }
#rules .lmini .lx { background: #f6c9c3; border-color: #d0574a; }
#rules .lmini .ldiag { opacity: 0.45; }
#rules .lmini .lw { background: #3f4a45; border-color: #3f4a45; color: #f4efe2; font-weight: 700; }
#rules .lmini .lwok { background: #3f7a55; border-color: #3f7a55; }
/* Garden Beds: squares sit on an explicit grid; beds are wooden frames laid over them. */
.bedgrid { display: grid; gap: 3px; max-width: 360px; margin: 8px auto; aspect-ratio: 1; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.bcell { position: relative; z-index: 1; min-width: 0; min-height: 0; border: 1px dashed #c9bfa6; border-radius: 6px; background: #f4ecd9; font-size: 20px; padding: 0; display: grid; place-items: center; color: #5b4630; -webkit-touch-callout: none; }
.bcell.packet b { display: grid; place-items: center; width: 70%; height: 74%; border-radius: 5px; background: #fffdf8; border: 1.5px solid #b98a52; box-shadow: 0 1px 0 #b98a52; font-size: 18px; color: #6a4523; }
.bcell.anchor { outline: 3px solid #b98a52; outline-offset: -3px; }
.bed { z-index: 2; pointer-events: none; border: 4px solid #a8743f; border-radius: 9px; background: rgba(168, 116, 63, 0.08); box-shadow: inset 0 0 0 1px #d9b07a; }
.bed.ok { border-color: #7c5a2f; background: rgba(120, 170, 90, 0.18); }
.bed.bad { border-color: #c4473a; background: rgba(196, 71, 58, 0.08); animation: bedwobble 0.5s ease-in-out 2; }
.bed.preview { border-style: dashed; border-color: #a8743f; background: rgba(233, 196, 106, 0.22); }
.bedgrid.solved .bcell { background: #e3efd2; border-color: transparent; }
@keyframes bedwobble { 25% { transform: rotate(-1.2deg); } 75% { transform: rotate(1.2deg); } }
#rules .bedrule { display: block; margin-bottom: 8px; }
#rules .bedpair { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#rules .bedarrow { font-size: 20px; color: #7c5a2f; }
#rules .bmini { display: grid; grid-template: repeat(3, 26px) / repeat(3, 26px); gap: 2px; }
#rules .bmini > span { display: grid; place-items: center; border-radius: 4px; border: 1px dashed #c9bfa6; background: #f4ecd9; font-size: 13px; font-weight: 700; color: #6a4523; }
#rules .bmini > i { border: 3px solid #7c5a2f; border-radius: 6px; background: rgba(120, 170, 90, 0.18); }
.sixgrid { display: grid; grid-template-columns: repeat(6, 1fr); max-width: 330px; margin: 6px auto; border: 2px solid #6b7f62; border-radius: 8px; overflow: hidden; }
.six { position: relative; aspect-ratio: 1; border: 0; border-right: 1px solid #cdd6c4; border-bottom: 1px solid #cdd6c4; background: #fffdf8; color: #3c5a76; font-size: 20px; padding: 0; min-width: 0; }
.six:nth-child(6n) { border-right: 0; }
.six.br { border-right: 2px solid #6b7f62; }
.six.bb { border-bottom: 2px solid #6b7f62; }
.six.fixed { color: var(--ink); background: #eef1e6; font-weight: 700; }
.six.sel { background: #f6e3b5; }
.six small { position: absolute; top: 2px; left: 4px; font-size: 9px; font-weight: 700; color: #a45a2b; z-index: 1; }
.six .cage { position: absolute; inset: 3px; pointer-events: none; }
.six .cage.ct { border-top: 1.5px dashed #9aa894; }
.six .cage.cr { border-right: 1.5px dashed #9aa894; }
.six .cage.cb { border-bottom: 1.5px dashed #9aa894; }
.six .cage.cl { border-left: 1.5px dashed #9aa894; }
.sixgrid.solved .six { background: #eaf2e2; }
.numpad { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 330px; margin: 8px auto 0; }
.numpad button, .keys button { border: 1px solid #d3dccb; background: #f2f4ec; color: var(--ink); border-radius: 8px; padding: 10px 0; font-size: 17px; font-weight: 600; min-width: 0; }
.ladder { display: grid; gap: 5px; justify-content: center; margin: 6px 0; }
.rung { display: flex; gap: 5px; }
.rung span { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #d3dccb; border-radius: 8px; background: #fffdf8; font-weight: 700; font-size: 19px; }
.rung span.changed { background: #f6e3b5; border-color: #d8b25a; }
.rung.first span { background: #eef1e6; }
.rung.goal span { background: #507258; color: white; border-color: #507258; }
.rung.typing span { border-style: dashed; }
.rung.target span { background: transparent; border-style: dotted; color: #8a9686; }
.keys { display: grid; gap: 5px; margin-top: 8px; }
.keys div { display: flex; gap: 4px; justify-content: center; }
.keys button { flex: 1; max-width: 36px; padding: 11px 0; font-size: 14px; }
.keys button.wide { max-width: 54px; flex: 1.5; }
.ladsubmit { display: block; width: 100%; max-width: 360px; min-height: 48px; margin: 10px auto 0; font-size: 17px; font-weight: 700; opacity: .6; transition: opacity .2s, box-shadow .2s; }
.ladsubmit.ready { opacity: 1; box-shadow: 0 0 0 3px #f6e3b5; }
.bloomfive { max-width: 320px; gap: 5px; }
.bloomfive .cell { font-size: 17px; }
.cell.turn { color: #a45a2b; font-weight: 700; }
.cell.turn.chosen { color: #ffe0b8; }
.bloomfive.solved .cell { background: #6b9a6f; color: white; }
.duel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0; }
.duelphoto { position: relative; padding: 0; border: 3px solid transparent; border-radius: 12px; overflow: hidden; background: #e6e9de; aspect-ratio: 3 / 4; }
.duelphoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.duelphoto.picked { border-color: #507258; }
.duelphoto.middle { border-color: #e0a92e; }
.duelbadge { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; border-radius: 50%; background: #355a40; color: white; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.duelbadge:empty { display: none; }
.duelyear { position: absolute; bottom: 0; left: 0; right: 0; background: #000a; color: white; font-weight: 700; font-size: 13px; padding: 3px; }
.decades { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.neighbourgrid.solved .neighbour { background: #eaf2e2; }
@media (max-width: 380px) {
  .sparktitle { font-size: 26px; }
  .spark { padding: 10px 8px 12px; }
  .sparkinner { padding: 12px 12px 10px; }
  .rung span { width: 36px; height: 36px; }
  .swatch { width: 92px; height: 92px; }
}

/* Mobile: every card is exactly one screen; long games scroll inside their card so
   mandatory snapping never fights the player (oversized snap areas misbehave on iOS). */
html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.feedbar { height: calc(56px + env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
.spark { height: 100%; min-height: 0; position: relative; overflow: hidden; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.sparkinner { max-height: 100%; overflow-y: auto; overscroll-behavior-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sparkinner::-webkit-scrollbar { display: none; }
.sparkinner > * { flex-shrink: 0; }
.lovenote { font-family: "Libre Caslon Display", Georgia, serif; font-size: 24px; color: var(--ink); margin: 22px 0 12px; }
.lovenote span { display: block; color: #b07d5b; font-size: 26px; margin-bottom: 6px; }
@media (max-width: 380px) { .spark { padding-bottom: calc(12px + env(safe-area-inset-bottom)); } }
/* Comfortable 44px tap targets */
.nextspark { min-height: 44px; padding: 10px 18px; }
.keys button { min-height: 44px; }
.feedbar .pill { position: relative; }
.feedbar .pill::after { content: ""; position: absolute; inset: -6px -2px; }
@media (max-width: 360px) {
  .feedbar .brand { font-size: 17px; }
  .pills { gap: 4px; }
  .pill { padding: 6px 9px; font-size: 12px; }
}
/* Small rewards: flow bar, sound toggle, toasts, milestones, shiny cards, golden day */
.feedbar { position: relative; }
.soundpill { padding: 6px 9px; min-width: 36px; }
.soundpill span { font-size: 14px; line-height: 1; }
.soundpill[aria-pressed="false"] { opacity: 0.65; }
.flowbar { position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: #e6e8dd; }
.flowbar i { display: block; height: 100%; width: calc(var(--flow, 0) * 100%); background: linear-gradient(90deg, #f2c94c, #e9a23b); border-radius: 0 3px 3px 0; transition: width 0.6s ease; }
body.golden .flowbar i { background: linear-gradient(90deg, #e9a23b, #f6d77a, #e9a23b); }
.rewardline { color: #7a6a3a; font-size: 14px; margin: 6px 0 0; }
.solvedchip small { font-size: 11px; opacity: 0.85; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; background: #2f4a37; color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; box-shadow: 0 8px 24px #0003; white-space: nowrap; animation: toastin 0.35s ease-out; transition: opacity 0.4s, transform 0.4s; }
.toast.sticker { background: linear-gradient(110deg, #7b6cd9, #4fa3c7, #6cc49a, #e3a34a); }
.toast.gold { background: linear-gradient(110deg, #b9822a, #e9b949, #b9822a); color: #2a1d05; }
.toast.out { opacity: 0; transform: translate(-50%, 12px); }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 16px); } }
.milestone { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; pointer-events: none; transition: opacity 0.5s; }
.milestone.out { opacity: 0; }
.milestone .mscard { display: grid; gap: 4px; text-align: center; background: #fffdf8f2; border: 2px solid #e9c46a; border-radius: 24px; padding: 22px 30px; box-shadow: 0 20px 60px #24403240; animation: mspop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
.milestone .mscard b { font-family: "Libre Caslon Display", Georgia, serif; font-weight: 400; font-size: 38px; color: var(--ink); }
.milestone .mscard span { color: #6b5a2a; font-weight: 600; }
.milestone.ms-ten .mscard { border-color: #e9a23b; background: #fff7e6f2; }
.milestone.ms-all { background: radial-gradient(circle at 50% 45%, #fff3c880, transparent 70%); }
.milestone.ms-all .mscard { border-width: 3px; background: linear-gradient(160deg, #fffaf0, #fff1c9); }
.milestone.ms-all .mscard b { font-size: 46px; }
@keyframes mspop { from { transform: scale(0.6); opacity: 0; } }
.shinytag { font-weight: 700; background: linear-gradient(90deg, #7b6cd9, #4fa3c7, #6cc49a, #e3a34a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spark.shiny .sparkinner { border: 2px solid transparent; background: linear-gradient(150deg, #fffdf8, #f7f3ff 35%, #eefaf5 65%, #fff8ec) padding-box, linear-gradient(120deg, #b6a8ff, #8fd3f0, #a6e8c2, #f6d58b, #f3a7c8, #b6a8ff) 0 0 / 300% 300% border-box; animation: holo 4s linear infinite; }
@keyframes holo { to { background-position: 0 0, 300% 0; } }
body.golden .spark:not(.dayintro):not(.shiny) .sparkinner { background: linear-gradient(170deg, #fffaf0, #fdf1d2); border-color: #e9c46a; box-shadow: 0 6px 24px #e9a23b30; }
body.golden .feedbar .brand span { color: #c8901f; }
@media (prefers-reduced-motion: reduce) {
  .lcell.clash { animation: none; }
  .bed.bad { animation: none; }
  .spark.shiny .sparkinner { animation: none; }
  .toast, .milestone .mscard { animation: none; }
  .flowbar i { transition: none; }
}
@media (max-width: 360px) { .soundpill { padding: 6px 7px; min-width: 32px; } }
/* Clear & retry: quiet ↺ in the card's bottom-left corner */
.sparkfoot { position: relative; align-items: center; }
.retry { position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #8a9586; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.retry:hover, .retry:focus-visible { color: #355a40; background: #eef2e8; }
.retrybar { flex: 1; min-height: 44px; padding-left: 50px; font-size: 13px; color: #55634f; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.retrybar:empty { display: none; }
.retrybar button { pointer-events: auto; min-height: 44px; padding: 0 12px; border: 1px solid #cdd6c4; border-radius: 999px; background: #fff; color: #355a40; font: inherit; font-weight: 600; }
@media (max-width: 340px) { .todaylabel { display: none; } }
@media (max-width: 430px) { #todayPill.hasreveals .todaylabel { display: none; } }
.sparkfoot:has(.retrybar:not(:empty)) .nextspark { display: none; }
.sparkinner > .stage, .sparkinner > .sparkfoot { flex-shrink: 0; flex-basis: auto; }

/* Aha track: CAT-style Quant & LRDI cards */
.ahabadge { display: inline-block; margin: 0 0 8px; padding: 3px 9px; border: 1px solid #d9dccd; border-radius: 999px; font-size: 11px; letter-spacing: .3px; color: #6f786d; background: #f6f5ec; }
.ahaintro { font-size: 15px; line-height: 1.55; margin: 4px 0 8px; }
.ahaclues { margin: 0 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.ahaclues li { margin: 3px 0; }
#board h3.ahaask { font-size: 16px; font-weight: 600; line-height: 1.45; margin: 10px 0 8px; }
.ahachoices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ahachoices .choice { margin: 0; min-height: 44px; padding: 10px 12px; text-align: center; font-size: 15px; font-variant-numeric: tabular-nums; }
.choice.right, .choice.right:disabled { background: #52775a; border-color: #52775a; color: #fff; opacity: 1; }
.ahachoices.wide { grid-template-columns: 1fr; }
.ahachoices.wide .choice { text-align: left; }
.ahamatch { margin: 6px 0 10px; padding: 12px 10px; border-radius: 12px; background: #2f3a33; text-align: center; }
.matchsvg { width: 100%; max-width: 320px; height: auto; display: inline-block; }
.matchsvg .stick { stroke: #e7c98f; stroke-width: 4.2; stroke-linecap: round; }
.matchsvg .head { fill: #d2563f; }
.ahaentry { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 16px; }
.ahaentry input { flex: 1; min-width: 0; height: 48px; font-size: 18px; padding: 0 12px; border: 1px solid #bac6b4; border-radius: 10px; background: #fff; color: var(--ink); font-variant-numeric: tabular-nums; }
.ahaentry.eq input { letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.ahaeqhint { margin: 0 0 6px; font-size: 13px; color: #6b7468; }
.ahatable { overflow-x: auto; margin: 6px 0 10px; }
.ahatable table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ahatable th, .ahatable td { padding: 6px 8px; border-bottom: 1px solid #e0e3d6; text-align: right; }
.ahatable thead th { font-size: 12px; color: #6f786d; font-weight: 600; }
.ahatable tbody th { text-align: left; font-weight: 600; }
.grid.swipe { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.revealbtn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 1; min-height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: #8a9586; font: inherit; font-size: 12px; font-weight: 600; }
.revealbtn:hover, .revealbtn:focus-visible { color: #355a40; background: #eef2e8; }
.revealbtn[hidden], .sparkfoot:has(.retrybar:not(:empty)) .revealbtn { display: none; }
.spark.is-revealed .donebadge { display: none; }
/* Leaderboard */
.lbpill { padding: 6px 9px; min-width: 36px; }
.lbtabs { display: flex; gap: 6px; margin: 14px 0 10px; }
.lbtabs button { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; flex: 1; min-height: 44px; border: 1px solid #d3d9c8; border-radius: 999px; background: #fffdf7; color: var(--ink); font-weight: 600; }
.lbtabs button[aria-selected="true"] { background: #385f48; border-color: #385f48; color: #fff; }
.lblist { list-style: none; margin: 0; padding: 0; max-height: 46dvh; overflow-y: auto; overscroll-behavior: contain; }
.lblist li { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px; border-radius: 14px; }
.lblist li:nth-child(odd):not(.lbmsg) { background: #f3f1e8; }
.lblist li.me { background: #e3ecda; outline: 2px solid #9fbd8d; }
.lbrank { width: 2ch; text-align: right; font-variant-numeric: tabular-nums; color: #6b7a66; }
.lbname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbname small { color: #6b7a66; }
.lblist b { font-variant-numeric: tabular-nums; }
.lblist .lbmsg { color: #55634f; justify-content: center; text-align: center; }
.lbme { margin: 12px 0 4px; }
.lbnote { font-size: 13px; color: #6b7a66; margin: 4px 0 0; }
.linkish { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; min-height: 44px; border: 0; background: none; color: #355a40; font-weight: 600; text-decoration: underline; padding: 0 4px; }
.lbform { display: grid; gap: 10px; margin-top: 12px; }
.lbform input { -webkit-appearance: none; appearance: none; font: inherit; width: 100%; box-sizing: border-box; font-size: 16px; min-height: 48px; padding: 10px 14px; border: 1px solid #cdd6c4; border-radius: 14px; background: #fff; color: var(--ink); }
.lberror { min-height: 1em; margin: 0; color: #a4532f; font-size: 14px; }
@media (max-width: 430px) { .feedbar .brand { font-size: 17px; } .pills { gap: 4px; } .feedbar .pill { padding-left: 9px; padding-right: 9px; } }
.lbsave { -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer; min-height: 48px; border: 0; border-radius: 999px; background: #385f48; color: #fff; font-weight: 700; font-size: 16px; }
.lbhint { margin: 0; font-size: 14px; color: #6b7867; text-align: center; }
