/* Meowlchemy: a night-time laboratory. Plum and ink, gold lamplight, a teal glow where things are made. */
:root {
  --bg-a: #2d2250;
  --bg-b: #140f26;
  --ink: #f7efe0;
  --ink-soft: #c5b9e0;
  --gold: #f2c14e;
  --gold-dark: #9a6a14;
  --teal: #6fe3d0;
  --paper: #fff8ea;
  --paper-ink: #2b1d3a;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bench-a: #6b4a30;
  --bench-b: #3e2a1c;
  color-scheme: dark;
}
* { box-sizing: border-box; touch-action: manipulation; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  position: fixed; inset: 0;
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse 120% 60% at 50% 0%, #4a3a82 0%, transparent 70%), linear-gradient(var(--bg-a), var(--bg-b));
  background-color: var(--bg-b);
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; }

/* looks for the bench, opened by things found (logic.js LOOKS) */
body.look-oak { --bench-a: #6b4a30; --bench-b: #3e2a1c; --bench-glow: rgba(255, 196, 110, .28); }
body.look-moss { --bench-a: #3f6a4a; --bench-b: #1f3a2a; --bench-glow: rgba(160, 240, 170, .26); }
body.look-night { --bench-a: #34305f; --bench-b: #181638; --bench-glow: rgba(150, 160, 255, .3); }
body.look-rose { --bench-a: #8a4a62; --bench-b: #4a2438; --bench-glow: rgba(255, 170, 200, .3); }
body.look-sea { --bench-a: #2f6a80; --bench-b: #14394c; --bench-glow: rgba(130, 230, 240, .3); }
body.look-ember { --bench-a: #7a3a22; --bench-b: #3a1610; --bench-glow: rgba(255, 140, 70, .34); }
body.look-star { --bench-a: #2a2a5a; --bench-b: #0e0e28; --bench-glow: rgba(255, 240, 160, .3); }
body.look-gold { --bench-a: #8a6a22; --bench-b: #44320c; --bench-glow: rgba(255, 224, 120, .38); }

.app { height: 100%; display: flex; flex-direction: column; padding: var(--sg-corner-top) 0 0; max-width: 640px; margin: 0 auto; }

.top { display: grid; grid-template-columns: 52px 1fr 60px; align-items: start; min-height: 44px; padding: 0 12px 0 calc(var(--sg-corner-left) - 0px); gap: 4px; }
.title { text-align: center; line-height: 1.05; min-width: 0; }
.title h1 { margin: 0; font-size: clamp(22px, 6.2vw, 27px); font-weight: 800; color: var(--gold); text-shadow: 0 2px 0 #120c22; white-space: nowrap; }
.title > p { margin: 2px 0 0; font-size: 15px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint-btn { position: relative; width: 48px; height: 44px; border: 0; border-radius: 14px; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.2); display: grid; place-items: center; cursor: pointer; justify-self: end; }
.hint-btn svg { width: 26px; height: 26px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hint-btn b { position: absolute; top: -5px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--gold); color: #3a2608; font-size: 13px; line-height: 20px; text-align: center; }
.hint-step { position: absolute; left: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--teal); color: #08302b; font: 800 12px/18px inherit; font-style: normal; text-align: center; }
.hint-btn.lit { box-shadow: inset 0 0 0 2px var(--gold); }
.goal-pill { position: relative; display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin: 3px auto 0; padding: 2px 10px 2px 4px; border: 0; border-radius: 13px; background: rgba(255,255,255,.1); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.2; cursor: pointer; box-shadow: inset 0 0 0 1.2px rgba(255,255,255,.18); }
.goal-pill::after { content: ""; position: absolute; inset: -9px -6px; }
.goal-pill img { width: 18px; height: 18px; flex: none; filter: brightness(0) invert(1) opacity(.45); }
.goal-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-pill[hidden] { display: none; }
.hint-btn.empty svg { stroke: rgba(255,255,255,.45); }
.hint-btn.empty b { background: rgba(255,255,255,.3); color: #fff; }
.hint-btn:active { transform: scale(.94); }

/* the workbench */
.bench {
  position: relative; flex: 1 1 0; min-height: 190px; margin: 6px 8px 0; border-radius: 22px 22px 8px 8px; overflow: hidden; touch-action: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, var(--bench-glow), transparent 70%),
    repeating-linear-gradient(94deg, rgba(0,0,0,.09) 0 3px, transparent 3px 14px, rgba(255,255,255,.035) 14px 16px, transparent 16px 31px),
    linear-gradient(var(--bench-a), var(--bench-b));
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), inset 0 3px 0 rgba(255,255,255,.14), inset 0 -18px 30px rgba(0,0,0,.35);
}
.sigil { position: absolute; left: 50%; top: 46%; width: min(86%, 330px); aspect-ratio: 1; transform: translate(-50%, -50%); color: rgba(255,255,255,.17); pointer-events: none; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.bench.hot .sigil { color: rgba(111,227,208,.55); }

.it {
  position: absolute; left: 0; top: 0; width: 72px; padding: 0; margin: 0; border: 0; background: none; touch-action: none; cursor: grab;
  display: flex; flex-direction: column; align-items: center; z-index: 2;
  transition: transform .16s cubic-bezier(.3, 1.4, .5, 1); will-change: transform;
}
.it img { width: 62px; height: 62px; display: block; pointer-events: none; filter: drop-shadow(0 4px 3px rgba(0,0,0,.4)); -webkit-user-drag: none; }
.it span { margin-top: -1px; max-width: 78px; font-size: 12px; font-weight: 700; line-height: 1.05; text-align: center; color: #fff; text-shadow: 0 1px 0 #000, 0 0 4px #000; pointer-events: none; }
.it.drag { transition: none; z-index: 6; cursor: grabbing; }
.it.drag img { transform: scale(1.14) rotate(-3deg); filter: drop-shadow(0 10px 8px rgba(0,0,0,.45)); }
.it.target img { transform: scale(1.18); filter: drop-shadow(0 0 10px var(--teal)) drop-shadow(0 0 4px var(--teal)); }
.it.spawn img { animation: pop .42s cubic-bezier(.3, 1.5, .5, 1); }
.it.mix { transition: transform .16s ease-in; }
.it.gone { transition: opacity .2s, transform .2s; opacity: 0; }
.it.shake img { animation: shake .36s; }
.it.born img { animation: born .62s cubic-bezier(.25, 1.7, .5, 1); }
@keyframes pop { 0% { transform: scale(.15); } 60% { transform: scale(1.22, .88); } 80% { transform: scale(.94, 1.08); } 100% { transform: scale(1); } }
@keyframes born { 0% { transform: scale(.1) rotate(-30deg); } 45% { transform: scale(1.4, 1.2) rotate(8deg); } 70% { transform: scale(.9, 1.1); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0) rotate(0); } 20% { transform: translateX(-7px) rotate(-6deg); } 45% { transform: translateX(7px) rotate(6deg); } 70% { transform: translateX(-4px) rotate(-3deg); } }
.float { position: absolute; z-index: 5; font-size: 14px; font-weight: 800; color: #fff; text-shadow: 0 1px 0 #000, 0 0 5px #000; pointer-events: none; transform: translate(-50%, 0); animation: floatup 1.1s ease-out forwards; white-space: nowrap; }
@keyframes floatup { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -34px; } }

.bench-tip { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: min(92%, 340px); margin: 0; padding: 9px 14px; border-radius: 14px; background: rgba(20,12,38,.82); color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.25; text-align: center; pointer-events: none; z-index: 8; box-shadow: 0 0 0 1.5px rgba(255,255,255,.18); }
.clear-btn { position: absolute; right: 8px; bottom: 8px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 14px; background: rgba(0,0,0,.4); color: var(--ink); font-size: 15px; font-weight: 700; z-index: 3; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.2); cursor: pointer; }
.bin { position: absolute; left: 8px; bottom: 8px; width: 52px; height: 52px; border-radius: 16px; background: rgba(0,0,0,.4); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.2); z-index: 3; display: grid; place-items: center; pointer-events: none; transition: background .15s, box-shadow .15s, transform .15s; }
.bin svg { width: 36px; height: 36px; overflow: visible; }
.bin-lid rect, .bin-lid path, .bin-body { fill: #3b2a63; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bin-lid { transform-box: fill-box; transform-origin: 0% 100%; transition: transform .18s ease-out; }
.bin-lid path { fill: none; }
.bin-ribs { fill: none; stroke: rgba(242,193,78,.55); stroke-width: 2; stroke-linecap: round; }
.bin.over { background: rgba(224,86,86,.35); box-shadow: inset 0 0 0 2px #ff8a8a, 0 0 14px rgba(255,120,120,.5); transform: scale(1.12); }
.bin.over .bin-lid { transform: rotate(-24deg) translateY(-2px); }
.bin.flip .bin-lid { animation: binflip .42s ease-out; }
.bin.flip { animation: binhop .42s ease-out; }
@keyframes binflip { 0% { transform: rotate(-24deg); } 40% { transform: rotate(-38deg) translateY(-3px); } 100% { transform: rotate(0); } }
@keyframes binhop { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.14); } }
.it.binned { transition: opacity .22s, transform .22s; opacity: 0; scale: .2; }
.clear-btn[hidden] { display: none; }

.found-card { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: min(94%, 360px); display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 18px; background: var(--paper); color: var(--paper-ink); z-index: 9; box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 3px var(--gold); animation: cardin .38s cubic-bezier(.3, 1.4, .5, 1); }
.found-card[hidden] { display: none; }
.found-card img { width: 64px; height: 64px; grid-row: span 3; }
.found-card .kick { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; color: #a8741c; }
.found-card h3 { margin: -4px 0 0; font-size: 22px; font-weight: 800; line-height: 1.05; }
.found-card p.q { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.2; }
@keyframes cardin { from { transform: translate(-50%, 40px); opacity: 0; } }

/* the tray: everything found */
.tray { flex: 0 0 41%; max-height: 360px; min-height: 210px; display: flex; flex-direction: column; margin: 0 8px calc(var(--safe-bottom) + 8px); background: rgba(10,6,24,.62); border-radius: 8px 8px 22px 22px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12); }
.chips { flex: none; display: flex; gap: 6px; padding: 8px 8px 4px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 12px; border: 0; border-radius: 22px; background: rgba(255,255,255,.1); color: var(--ink-soft); font-size: 15px; font-weight: 700; white-space: nowrap; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #888); flex: none; }
.chip small { font-size: 12px; opacity: .8; font-weight: 700; }
.chip.on { background: var(--gold); color: #3a2608; }
.chip.on small { opacity: .75; }
.grid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 4px 6px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); align-content: start; gap: 2px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 84px; padding: 4px 2px 2px; border: 0; border-radius: 14px; background: none; cursor: pointer; }
.tile img { width: 54px; height: 54px; pointer-events: none; }
.tile span { font-size: 12px; font-weight: 700; line-height: 1.05; text-align: center; color: var(--ink); max-width: 76px; }
.tile:active { background: rgba(255,255,255,.14); transform: scale(.96); }
.tile.new::after { content: ""; position: absolute; top: 4px; right: 12px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px #1c1530; }
.tile.hinted { background: rgba(242,193,78,.2); box-shadow: inset 0 0 0 2.5px var(--gold); animation: hintpulse 1s ease-in-out infinite; }
@keyframes hintpulse { 50% { background: rgba(242,193,78,.42); } }

/* a goal reached */
.goal-sheet { position: fixed; inset: 0; z-index: 36; display: grid; place-items: center; padding: 20px; background: rgba(8,4,20,.74); }
.goal-sheet[hidden] { display: none; }
.goal-card { width: min(100%, 340px); padding: 20px 18px 18px; border-radius: 24px; background: var(--paper); color: var(--paper-ink); text-align: center; box-shadow: 0 16px 50px rgba(0,0,0,.6), 0 0 0 4px var(--gold); animation: cardin2 .5s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes cardin2 { from { transform: scale(.7); opacity: 0; } }
.goal-icon img { width: 112px; height: 112px; animation: born .8s cubic-bezier(.25, 1.7, .5, 1); }
.goal-kicker { margin: 6px 0 0; font-size: 14px; font-weight: 800; letter-spacing: .1em; color: #a8741c; text-transform: uppercase; }
.goal-card h2 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.05; }
.goal-card p { margin: 6px 0 14px; font-size: 17px; font-weight: 600; line-height: 1.25; }
.primary { min-height: 52px; width: 100%; border: 0; border-radius: 16px; background: linear-gradient(#f6d27a, #e3a73a); color: #3a2608; font-size: 19px; font-weight: 800; box-shadow: 0 4px 0 #9a6a14; cursor: pointer; }
.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #9a6a14; }

/* full screens: the Book */
.screen { position: fixed; inset: 0; z-index: 16; display: flex; flex-direction: column; background: radial-gradient(ellipse 120% 50% at 50% 0%, #4a3a82, transparent 70%), linear-gradient(var(--bg-a), var(--bg-b)); background-color: var(--bg-b); }
.screen[hidden] { display: none; }
.screen-top { display: flex; align-items: center; gap: 12px; padding: var(--sg-corner-top) 16px 8px var(--sg-corner-left); }
.screen-top h2 { margin: 0; flex: 1; text-align: center; padding-right: 96px; font-size: 26px; font-weight: 800; color: var(--gold); }
.screen-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 12px calc(var(--safe-bottom) + 24px); touch-action: pan-y; }
.screen-body > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.goal { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 10px 6px 6px; border-radius: 16px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14); }
.goal img { width: 40px; height: 40px; flex: none; }
.goal.todo img { filter: brightness(0) opacity(.3); }
.goal b { display: block; font-size: 14px; line-height: 1.05; }
.goal span { font-size: 12.5px; color: var(--ink-soft); line-height: 1.1; display: block; }
.goal.done { background: rgba(242,193,78,.2); box-shadow: inset 0 0 0 2px var(--gold); }
.shelf { margin: 0 0 12px; padding: 10px 8px 8px; border-radius: 18px; background: rgba(255,255,255,.07); }
.shelf h3 { margin: 0 4px 6px; display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; }
.shelf h3 i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.shelf h3 small { margin-left: auto; font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.shelf.full h3 small { color: var(--gold); }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px 2px; }
.book-tile { display: flex; flex-direction: column; align-items: center; min-height: 80px; padding: 3px 1px; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.book-tile img { width: 50px; height: 50px; pointer-events: none; }
.book-tile span { font-size: 11.5px; font-weight: 700; line-height: 1.05; text-align: center; max-width: 72px; }
.book-tile.lost img { filter: brightness(0) opacity(.22); }
.book-tile.lost span { color: rgba(255,255,255,.3); }
.book-tile:active { background: rgba(255,255,255,.12); }

/* sheets */
.detail { text-align: center; }
.detail img { width: 108px; height: 108px; }
.detail h3 { margin: 4px 0 0; font-size: 26px; font-weight: 800; }
.detail p { margin: 4px 0; font-size: 17px; line-height: 1.3; }
.detail .recipe { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.detail .recipe figure { margin: 0; width: 76px; font-size: 12.5px; font-weight: 700; line-height: 1.05; }
.detail .recipe figure img { width: 54px; height: 54px; display: block; margin: 0 auto 2px; }
.detail .recipe .op { font-size: 24px; font-weight: 800; }
.looks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.look { min-height: 74px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 10px; border: 0; border-radius: 14px; color: #fff; text-align: left; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.25); background: linear-gradient(var(--a), var(--b)); }
.look small { font-size: 13px; font-weight: 600; opacity: .9; }
.look.on { box-shadow: inset 0 0 0 3.5px var(--gold); }
.look:disabled { opacity: .5; cursor: default; }
.ach-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ach-list li { padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.06); line-height: 1.2; }
.ach-list li b { display: block; font-size: 16px; }
.ach-list li span { font-size: 14px; opacity: .8; }
.ach-list li.got { background: #fbe7b4; }
.ach-list li.got b::before { content: "★ "; color: #a8741c; }

.toast { position: fixed; z-index: 40; left: 50%; top: calc(var(--sg-corner-top) + 56px); transform: translate(-50%, -10px); width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 14px; background: var(--paper); color: var(--paper-ink); font-size: 16px; font-weight: 700; line-height: 1.3; text-align: center; box-shadow: 0 8px 26px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

/* the title screen: the shared layout; these are only this game's colours */
#mm { --sg-bg: radial-gradient(ellipse 120% 60% at 50% 20%, #4a3a82, transparent 70%), linear-gradient(#2d2250, #140f26); --sg-ink: #f7efe0; --sg-ink-soft: #c5b9e0; --sg-title: #f2c14e; --sg-title-shadow: 0 3px 0 #120c22; --sg-accent: #f2c14e; --sg-accent-ink: #3a2608; --sg-card: rgba(255,255,255,.1); --sg-card-ink: #f7efe0; --sg-line: rgba(255,255,255,.2); }
.sg-sheet { --sg-sheet-bg: #fff8ea; --sg-sheet-ink: #2b1d3a; --sg-accent: #d99b2b; --sg-accent-ink: #3a2608; --sg-ink-soft: #6a5a80; }
.alc-title-art { width: 220px; height: 150px; display: block; margin: 0 auto; }

@media (max-height: 700px) {
  .tray { flex-basis: 44%; min-height: 190px; }
  .tile { min-height: 78px; }
  .tile img { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .sigil, .tile.hinted { animation: none !important; }
  .it.spawn img, .it.born img, .goal-icon img { animation-duration: .01s !important; }
  .bin, .bin * { animation: none !important; transition: none !important; }
  .it.binned { transition: none; }
}
body.calm .sigil, body.calm .tile.hinted { animation: none !important; }
body.calm .it.spawn img, body.calm .it.born img { animation-duration: .01s; }

/* search, sort and the smarter tray */
.chip-row { position: relative; flex: none; display: flex; align-items: center; gap: 2px; padding: 4px 4px 0 4px; }
.chip-row .chips { flex: 1; min-width: 0; padding: 4px 4px 4px; }
.tool-btn { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 22px; background: rgba(255,255,255,.1); display: grid; place-items: center; cursor: pointer; }
.tool-btn[hidden] { display: none; }
.tool-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool-btn:active { background: rgba(255,255,255,.22); }
.search-box { position: absolute; inset: 4px 4px 0 4px; display: flex; align-items: center; gap: 4px; background: #231a3f; border-radius: 22px; z-index: 2; }
.search-box[hidden] { display: none; }
.search-box input { flex: 1; min-width: 0; height: 44px; padding: 0 6px 0 16px; border: 0; border-radius: 22px; background: rgba(255,255,255,.12); color: var(--ink); font: 700 17px "Baloo 2", system-ui, sans-serif; -webkit-user-select: text; user-select: text; touch-action: auto; outline: none; -webkit-appearance: none; appearance: none; }
.search-box input:focus { box-shadow: inset 0 0 0 2px var(--gold); }
.search-box input::placeholder { color: rgba(255,255,255,.45); }
.chip.glow { animation: chipglow 1s ease-out; }
@keyframes chipglow { 0% { box-shadow: 0 0 0 0 var(--gold); } 30% { box-shadow: 0 0 0 5px rgba(242,193,78,.75); } 100% { box-shadow: 0 0 0 0 rgba(242,193,78,0); } }
.grid-empty { grid-column: 1 / -1; margin: 18px 8px; text-align: center; font-size: 16px; font-weight: 700; color: var(--ink-soft); }
.tile { touch-action: pan-y; }
.tile.done img { opacity: .55; }
.tile.done::before, .it.done::before { content: ""; position: absolute; top: 3px; right: 10px; width: 16px; height: 16px; border-radius: 50%; z-index: 1; background: #3fae62 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: 0 0 0 1.5px #1c1530; }
.it.done::before { top: -2px; right: 2px; }
.it.done img { opacity: .8; }
.tile.new.done::after { right: 30px; }
img.fly { position: fixed; z-index: 35; width: 54px; height: 54px; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }

/* the found card: how it was made, its shelf, rare finds */
.found-card { grid-template-columns: 64px 1fr; align-items: start; }
.found-card > img.big { width: 64px; height: 64px; grid-row: auto; }
.found-card.shelf { box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 3px var(--gc, transparent); }
.fc-body { min-width: 0; }
.fc-body p { margin: 0; }
.fc-body h3 { margin: -2px 0 0; }
.fc-body .how { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 1px 0 2px; font-size: 13px; font-weight: 700; }
.fc-body .how .mini { display: inline-flex; align-items: center; gap: 2px; }
.fc-body .how .mini img { width: 22px; height: 22px; }
.fc-body .shelf-line { font-size: 13px; font-weight: 700; color: #7a6a90; }
.fc-body .done-line { color: #2f8a52; }
.goal-card .goal-next { margin: -6px 0 14px; font-size: 15px; font-weight: 700; color: #6a5a80; }

/* the Book page of one thing */
.detail .detail-back { display: block; min-height: 44px; margin: -6px 0 0 -8px; padding: 0 12px; border: 0; background: none; font-size: 17px; font-weight: 800; color: #6a4ab0; text-align: left; cursor: pointer; }
.detail img.big { width: 96px; height: 96px; }
.detail .quip { font-style: normal; }
.detail .grp { display: flex; justify-content: center; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; }
.detail .grp i { width: 11px; height: 11px; border-radius: 50%; }
.detail .grp small { font-size: 15px; font-weight: 700; opacity: .7; }
.detail h4 { margin: 14px 0 0; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #8a6a1c; }
.detail .note { font-size: 15px; font-weight: 700; opacity: .85; }
.detail .fig { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 12px; min-height: 44px; }
.detail .fig:active { background: rgba(0,0,0,.08); }
.detail .makes { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; margin-top: 6px; }
.detail figure.sm { width: 64px; margin: 0; font-size: 11.5px; font-weight: 700; line-height: 1.05; }
.detail figure.sm img { width: 44px; height: 44px; margin: 0 auto 1px; display: block; }
.detail figure.lost { display: grid; place-items: center; width: 52px; height: 52px; margin: 6px 6px; border-radius: 14px; background: rgba(0,0,0,.08); }
.detail figure.lost b { font-size: 24px; color: rgba(0,0,0,.3); }
.detail .spawn-btn { margin-top: 14px; }

/* chapters */
.chapter-sheet .kick { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .08em; color: #8a6a1c; text-transform: uppercase; }
.chapter-sheet p { margin: 4px 0; font-size: 16px; line-height: 1.3; }
.chapter-sheet .pb { margin: 8px 0; --pb-ink: #2b1d3a; }
.chapter-sheet .steps { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.chapter-sheet .steps img { width: 38px; height: 38px; }
.chapter-sheet .step-q { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(0,0,0,.08); color: rgba(0,0,0,.3); font-size: 20px; font-weight: 800; }
.chapter-sheet .note { font-size: 14px; opacity: .8; }
.chapters { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.chapters li { padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.06); line-height: 1.2; }
.chapters li b { display: block; font-size: 16px; }
.chapters li span { font-size: 14px; opacity: .8; }
.chapters li.got { background: #fbe7b4; }
.chapters li.now { box-shadow: inset 0 0 0 2px #d99b2b; }
.ach-list li.secret { opacity: .7; }
.ach-list li.secret b { font-style: italic; }
.ach-list li.secret b::before { content: "? "; }

@media (prefers-reduced-motion: reduce) { .chip.glow { animation: none !important; } img.fly { display: none; } }
body.calm .chip.glow { animation: none !important; }
.search-box input::-webkit-search-cancel-button, .search-box input::-webkit-search-decoration { -webkit-appearance: none; display: none; }

/* feel pass (2026-11-29): a combine snaps and brews; a new thing is a full card, flipped in over the bench */
.it.mixing { pointer-events: none; }
.it.brew img { animation: brew .44s ease-in; filter: drop-shadow(0 0 9px var(--gold)) drop-shadow(0 0 3px #fff4c2); }
@keyframes brew {
  0% { transform: translate(0, 0) rotate(0) scale(1); }
  15% { transform: translate(-2px, 1px) rotate(-3deg) scale(1.02); }
  30% { transform: translate(2px, -1px) rotate(3deg) scale(1.03); }
  45% { transform: translate(-3px, 0) rotate(-4deg) scale(1.05); }
  60% { transform: translate(3px, 1px) rotate(4deg) scale(1.06); }
  75% { transform: translate(-4px, -1px) rotate(-5deg) scale(1.08); }
  90% { transform: translate(4px, 0) rotate(5deg) scale(1.1); }
  100% { transform: translate(0, 0) rotate(0) scale(.85); }
}
.found-card { top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(86%, 310px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 16px 16px 12px; border-radius: 22px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 0 3px var(--gold), 0 0 44px rgba(242,193,78,.4); animation: reveal .56s cubic-bezier(.25, 1.4, .5, 1); }
.found-card.shelf { box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 0 3px var(--gc, var(--gold)), 0 0 44px rgba(242,193,78,.4); }
.found-card::before { content: ""; position: absolute; left: 50%; top: -38px; width: 200px; height: 200px; margin-left: -100px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(242,193,78,.3) 0 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%);
  animation: rays 14s linear infinite; }
.found-card > img.big { position: relative; width: 104px; height: 104px; animation: born .7s cubic-bezier(.25, 1.7, .5, 1) .1s both; filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }
.found-card .fc-body { position: relative; width: 100%; }
.found-card .kick { font-size: 12px; margin-top: 2px; }
.found-card h3 { font-size: 26px; margin: 0; }
.found-card .fc-body .how { justify-content: center; margin: 4px 0; }
.found-card p.q { margin: 2px 0 4px; }
.found-card .fc-tap { margin-top: 6px; font-size: 12px; font-weight: 700; color: #8a7a98; }
@keyframes reveal {
  0% { transform: translate(-50%, -50%) perspective(700px) rotateY(80deg) scale(.6); opacity: 0; }
  60% { transform: translate(-50%, -50%) perspective(700px) rotateY(-8deg) scale(1.03); opacity: 1; }
  100% { transform: translate(-50%, -50%) perspective(700px) rotateY(0) scale(1); }
}
@keyframes rays { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } }
@media (max-height: 700px) {
  .found-card { padding: 12px 14px 10px; }
  .found-card > img.big { width: 76px; height: 76px; }
  .found-card::before { top: -50px; }
  .found-card h3 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .found-card { animation: fadein .2s ease-out; }
  .found-card::before { animation: none; }
  .found-card > img.big, .it.brew img { animation: none; }
}
body.calm .found-card { animation: fadein .2s ease-out; }
body.calm .found-card::before { animation: none; }
body.calm .found-card > img.big { animation: none; }
