:root {
  color-scheme: light;
  --cream: #f7f0df;
  --paper: #fffaf0;
  --ink: #292a27;
  --sage: #657f69;
  --plum: #624758;
  --brass: #936923;
  --line: #b7aa91;
  --focus: #592f98;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--cream); }
body { margin: 0; color: var(--ink); background: var(--cream); overflow-x: clip; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: fixed; top: -6rem; left: 1rem; z-index: 5; padding: .7rem; background: var(--paper); }
.skip:focus { top: 1rem; }
.ribbon { padding: .45rem; text-align: center; background: var(--plum); color: #fff8ed; font-size: .7rem; font-weight: 800; letter-spacing: .04em; }
.site, main, footer { width: min(100%, 50rem); margin: auto; padding-inline: max(.65rem, env(safe-area-inset-left)) max(.65rem, env(safe-area-inset-right)); }
.site { padding-block: .6rem; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font: 700 1.1rem Georgia, serif; }
.brand small { display: block; color: var(--plum); font: .68rem ui-sans-serif, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.seal { display: grid; width: 40px; height: 40px; place-items: center; border: 2px double var(--brass); border-radius: 50%; color: var(--plum); font: 700 .8rem Georgia, serif; }
main { padding-block: .75rem; outline: 0; }
footer { padding-block: .75rem calc(.75rem + env(safe-area-inset-bottom)); color: #555b52; font-size: .75rem; text-align: center; }
.hero { padding: .45rem 0 .8rem; }
.eyebrow { margin: 0; color: var(--plum); font-size: .72rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.hero h1, .heading h1 { margin: .15rem 0; font: 700 clamp(1.55rem, 7.4vw, 2.7rem)/1.08 Georgia, serif; }
.hero p:last-child { max-width: 36rem; line-height: 1.4; }
.cards { display: grid; gap: .6rem; }
.card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; column-gap: .7rem; padding: .65rem; border: 1px solid var(--line); border-left: 4px solid var(--sage); background: var(--paper); }
.card:nth-child(2) { border-left-color: var(--brass); }
.card:nth-child(3) { border-left-color: var(--plum); }
.card h2 { margin: 0; font: 700 1.1rem Georgia, serif; }
.card p { grid-column: 2 / 4; margin: .1rem 0 .45rem; font-size: .87rem; }
.card button { grid-column: 3; grid-row: 1; }
.motif { display: grid; grid-row: 1 / 3; width: 40px; height: 40px; place-items: center; color: var(--plum); font: 700 1.5rem Georgia, serif; }
.playing .ribbon, .playing .site, .playing footer { display: none; }
.playing main { width: min(100%, 34rem); padding-block: max(.35rem, env(safe-area-inset-top)) max(.4rem, env(safe-area-inset-bottom)); }
.game { padding: .15rem .1rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; }
.actions button, .entry button, .chain-controls button, .game > button, .card button, summary {
  min-height: 44px; min-width: 44px; border-radius: .42rem; border: 1px solid var(--plum);
  padding: .5rem .7rem; background: var(--paper); color: var(--plum); font-weight: 750;
}
.actions button { flex: 0 1 auto; overflow-wrap: anywhere; }
.actions .help { margin: 0; }
.actions .help[open] { flex-basis: 100%; order: 3; }
.primary, .card .primary, .game .primary { background: var(--plum); color: #fff; border-color: var(--plum); }
.heading { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-height: 58px; margin: .3rem 0 .15rem; }
.heading h1 { max-width: 19ch; }
.heading-distill { flex-direction: column-reverse; justify-content: center; gap: .05rem; text-align: center; }
.heading-distill h1 { max-width: none; }
.game-distill .lead { text-align: center; }
.lead { margin: .15rem 0 .45rem; font-weight: 650; line-height: 1.3; }
.feedback { margin: .4rem 0; padding: .35rem .5rem; border-left: 3px solid var(--sage); background: #e9eee5; line-height: 1.3; font-weight: 650; }
.feedback:empty { display: none; }
.score { max-width: 430px; margin: .45rem auto; padding: .45rem .55rem; border-left: 3px solid var(--brass); background: #f0e6d0; font-size: .85rem; font-weight: 750; line-height: 1.35; }
.result { margin: .35rem 0; font-size: .87rem; line-height: 1.35; }
.help { margin-top: .35rem; }
.help summary { display: inline-flex; align-items: center; list-style: none; cursor: pointer; padding-inline: .7rem; font-size: .82rem; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: ' ?'; font-weight: 900; }
.help[open] { padding-bottom: .3rem; }
.help p { margin: .35rem 0; line-height: 1.4; }
.next { display: block; width: 100%; margin-top: .45rem; }
.shelves { display: grid; gap: .4rem; max-width: 430px; margin: .4rem auto; }
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .2rem; padding: .18rem .16rem .3rem; border-bottom: 4px solid #987140; background: #eee4d1; }
.shelf.sorted { border-bottom-color: var(--sage); box-shadow: inset 3px 0 var(--sage); background: #e2eadf; }
.jar { position: relative; min-width: 0; min-height: 54px; padding: .35rem .12rem; border: 1px solid #927d63; border-radius: .5rem .5rem .2rem .2rem; background: #fffaf0; color: var(--ink); font-size: clamp(.76rem, 3.2vw, .88rem); font-weight: 800; overflow-wrap: anywhere; touch-action: manipulation; }
.jar[aria-pressed=true] { border: 3px solid var(--plum); background: var(--plum); color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.jar[aria-pressed=true]::after { content: '✓'; position: absolute; top: 1px; right: 3px; font-size: .7rem; }
.letters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; max-width: 340px; margin-inline: auto; }
.letter { min-width: 0; min-height: 44px; border: 1px solid var(--sage); border-radius: .45rem; background: #e1eadc; color: #27352b; font-weight: 900; }
.letter.centre { background: var(--brass); border-color: #765621; color: #fff; }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(92px, auto); gap: .25rem; max-width: 340px; margin: .4rem auto 0; }
.entry input { width: 100%; min-height: 44px; padding: .45rem; border: 1px solid #8e7d68; border-radius: .4rem; background: #fff; text-transform: uppercase; }
.entry-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: .25rem; }
.treasures { max-width: 430px; margin: .35rem auto 0; padding: .35rem .5rem; border-top: 1px solid var(--line); }
.treasures h2 { margin: 0 0 .2rem; color: var(--plum); font: 700 1rem Georgia, serif; }
.treasures p { margin: .2rem 0; font-size: .86rem; line-height: 1.3; }
.treasures strong { display: inline-block; min-width: 3.5rem; color: var(--plum); text-transform: capitalize; }
.treasures .opened strong { color: #365c40; }
.flask-art { flex: none; width: 90px; text-align: center; }
.flask-art svg { display: block; width: 80px; height: 68px; margin-inline: auto; }
.sprig { fill: none; stroke: var(--sage); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.glass { fill: #faf7eb; stroke: var(--plum); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.liquid { fill: #c3d5bd; stroke: none; }
.catalyst { fill: var(--brass); }
.flask-art text { fill: #fff; font: 800 16px ui-sans-serif, sans-serif; }
.flask-dots { display: flex; justify-content: center; gap: 3px; }
.flask-dots i { width: 6px; height: 6px; border: 1px solid var(--brass); border-radius: 50%; }
.flask-dots i.open { background: var(--brass); }
.bank { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; max-width: 430px; margin-inline: auto; }
.ingredient, .slot, .fixed { min-width: 0; min-height: 49px; padding: .25rem .1rem; border: 1px solid var(--sage); border-radius: .45rem; background: #e5eadf; color: var(--ink); font-size: clamp(.76rem, 3.1vw, .88rem); font-weight: 800; overflow-wrap: anywhere; }
.ingredient:disabled { opacity: 1; color: #3e4b40; background: #d9dfd2; text-decoration: line-through; }
.ingredient[aria-pressed=true], .slot[aria-pressed=true] { outline: 3px solid var(--plum); outline-offset: -3px; background: #e7d9e3; }
.chain-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .2rem; max-width: 430px; margin: .7rem auto .4rem; }
.fixed { display: flex; min-height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: .05rem; background: var(--plum); color: #fff; border-color: var(--plum); }
.fixed small { font-size: .55rem; letter-spacing: .04em; }
.fixed strong { font-size: .8rem; line-height: 1; }
.chain-controls { display: grid; grid-template-columns: 1.4fr 1fr; gap: .35rem; max-width: 430px; margin-inline: auto; }
@media (min-width: 650px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } .card { grid-template-columns: 42px 1fr; } .card button { grid-column: 1 / 3; grid-row: auto; } }
@media (max-width: 350px) { .site, main, footer { padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right)); } .jar, .ingredient, .slot, .fixed { font-size: .76rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; } }
