/* =========================================================
   BREW — styles
   The game is laid out on a fixed 1600×900 stage that is
   scaled to fit the window (see fit() in game.js).
   ========================================================= */
:root {
  --ink: #2a1a14;
  --paper: #f4ecd8;
  --paper-2: #e9dcbc;
  --wall: #4b2a26;
  --wall-dark: #331b18;
  --wood: #6b3d2c;
  --wood-light: #8f5a3f;
  --counter: #86504c;
  --tray: #2a1715;
  --slot: #b98773;
  --gold: #f2c14e;
  --gold-deep: #c8922a;
  --purple: #9b82d6;
  --good: #6fbf6a;
  --bad: #d9574a;
  --f-title: 'Pirata One', 'UnifrakturCook', Georgia, serif;
  --f-talk: 'Grenze', Georgia, serif;
  --f-ui: 'Nunito', system-ui, sans-serif;
  --f-hand: 'Caveat', 'Comic Sans MS', cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #140b09; overflow: hidden; }
body { font-family: var(--f-ui); color: var(--ink); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
svg { display: block; }
.hidden { display: none !important; }

#viewport { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #2a1714 0%, #120807 80%); }
#game { position: relative; width: 1600px; height: 900px; flex: none; overflow: hidden; transform-origin: center center;
  background: var(--wall-dark); box-shadow: 0 0 80px rgba(0,0,0,.8); }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 14px; font-weight: 800; font-size: 18px; letter-spacing: .2px;
  background: linear-gradient(#f7eed9, #e3d2ab); color: var(--ink);
  border: 3px solid #5a3a22; box-shadow: 0 4px 0 #5a3a22, 0 8px 14px rgba(0,0,0,.35);
  transition: transform .12s, box-shadow .12s, filter .15s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 6px 0 #5a3a22, 0 12px 18px rgba(0,0,0,.35); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #5a3a22, 0 3px 6px rgba(0,0,0,.35); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
.btn.primary { background: linear-gradient(#ffd97a, #eab04a); border-color: #6a4412; box-shadow: 0 4px 0 #6a4412, 0 8px 14px rgba(0,0,0,.35); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 6px 0 #6a4412, 0 12px 18px rgba(0,0,0,.35); }
.btn.danger { background: linear-gradient(#f5a08a, #d9574a); border-color: #6a1f18; color: #fff; box-shadow: 0 4px 0 #6a1f18, 0 8px 14px rgba(0,0,0,.35); }
.btn.ghost { background: rgba(244,236,216,.12); color: var(--paper); border-color: rgba(244,236,216,.5); box-shadow: none; }
.modal .btn.ghost, .speech .btn.ghost { color: var(--ink); border-color: #8a6a3a; background: rgba(0,0,0,.04); }
.btn.big { font-size: 24px; padding: 14px 30px; border-radius: 18px; }
.btn small { font-weight: 700; opacity: .7; font-size: 14px; }
.btn.pulse:not(:disabled) { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 4px 0 #6a4412, 0 0 0 0 rgba(242,193,78,.7); } 50% { box-shadow: 0 4px 0 #6a4412, 0 0 0 12px rgba(242,193,78,0); } }

/* ---------------- HUD ---------------- */
#hud { position: absolute; left: 0; top: 0; width: 1600px; height: 64px; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: linear-gradient(#3a201b, #2a1613); border-bottom: 3px solid #1a0d0b; box-shadow: 0 4px 12px rgba(0,0,0,.4); color: var(--paper); }
.hud-title { font-family: var(--f-title); font-size: 34px; color: var(--gold); text-shadow: 0 2px 0 #5a2a10; margin-right: 12px; letter-spacing: .5px; }
.hud-chip { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 21px;
  background: rgba(0,0,0,.3); border: 2px solid rgba(244,236,216,.15); font-size: 20px; }
.hud-chip b { font-weight: 900; font-size: 22px; }
.hud-chip .lbl { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; opacity: .65; font-weight: 800; }
.hud-chip.gold b { color: var(--gold); min-width: 40px; }
.strikes i { font-style: normal; font-weight: 900; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.15); }
.strikes i.on { background: var(--bad); color: #fff; border-color: #ffb3a8; animation: pop .4s; }
.hud-spacer { flex: 1; }
.hud-btn { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px; font-weight: 800; font-size: 16px;
  background: rgba(244,236,216,.1); border: 2px solid rgba(244,236,216,.2); color: var(--paper); transition: background .15s; }
.hud-btn:hover { background: rgba(244,236,216,.2); }
.hud-btn .nav-ico { width: 26px; height: 26px; }
.hud-btn.icon-only { padding: 0 9px; }
.hud-btn.off { opacity: .45; }

/* ---------------- scene area ---------------- */
#scene-area { position: absolute; left: 0; top: 64px; width: 1600px; height: 596px; overflow: hidden; }
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s, transform .35s, visibility 0s .35s; transform: translateX(40px); }
#scene-area[data-dir="back"] .scene:not(.active) { transform: translateX(-40px); }
.scene.active { opacity: 1; visibility: visible; transform: none; transition: opacity .35s, transform .35s, visibility 0s; }
.scene > * { position: absolute; }

/* ---------------- strip, tray, nav ---------------- */
#strip { position: absolute; left: 0; top: 660px; width: 1600px; height: 46px; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 16px;
  background: linear-gradient(#3a1f1a, #2e1815); border-top: 3px solid #1a0d0b; border-bottom: 2px solid #1a0d0b; color: var(--paper); padding: 0 200px; }
.strip-hint { font-size: 17px; font-weight: 700; opacity: .8; }
.strip-hint b { color: var(--gold); }
.strip-hint i { opacity: .6; }
.strip-label { font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; white-space: nowrap; }
.strip-pct { font-weight: 900; width: 60px; font-size: 18px; }
.bar { position: relative; flex: 1; height: 26px; border-radius: 13px; background: #1a0d0b; border: 2px solid #5a3a22; overflow: hidden; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000), var(--c)); transition: width .12s; border-radius: 12px; }
.bar-shine { position: absolute; inset: 3px 8px auto; height: 6px; border-radius: 4px; background: rgba(255,255,255,.25); }

.meter { position: relative; flex: 1; height: 32px; display: flex; border-radius: 10px; overflow: visible; border: 3px solid #1a0d0b; background: #1a0d0b; }
.zone { flex: 1; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: 1.5px; position: relative; z-index: 1; color: rgba(255,255,255,.85); text-shadow: 0 1px 2px #000; }
.z-weak { background: #4a6a8a; border-radius: 7px 0 0 7px; }
.z-normal { background: #5a8a4a; border-left: 3px solid #1a0d0b; border-right: 3px solid #1a0d0b; }
.z-strong { background: #a8503a; border-radius: 0 7px 7px 0; }
.zone.target { box-shadow: inset 0 0 0 3px var(--gold); color: #fff; }
.zone.target span { background: rgba(0,0,0,.35); padding: 1px 10px; border-radius: 8px; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 2; background: rgba(255,255,255,.28); border-radius: 7px 0 0 7px; pointer-events: none; mix-blend-mode: overlay; }
.meter-marker { position: absolute; top: -10px; bottom: -10px; width: 6px; margin-left: -3px; left: 0; z-index: 3; background: #fff; border-radius: 3px; box-shadow: 0 0 0 2px #1a0d0b, 0 0 12px #fff; }
.meter.burnt .meter-marker { background: #333; }
.burn-warn { color: var(--bad); opacity: 0; }
.burn-warn.show { opacity: 1; animation: blink .35s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

#tray { position: absolute; left: 0; top: 706px; width: 1600px; height: 110px; z-index: 6;
  background: linear-gradient(#2a1715, #22120f); border-bottom: 3px solid #140a08;
  display: flex; align-items: center; padding: 0 20px 0 150px; gap: 14px; }
#tray::before { content: ''; position: absolute; left: 140px; right: 190px; bottom: 10px; height: 16px; border-radius: 8px; background: #3a211c; box-shadow: inset 0 3px 6px rgba(0,0,0,.5); }
#tray-label { position: absolute; left: 124px; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); font-weight: 900; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: rgba(244,236,216,.35); }
#tray-items { position: relative; flex: 1; display: flex; align-items: center; gap: 12px; height: 100%; overflow-x: auto; overflow-y: hidden; padding: 0 10px; scrollbar-width: thin; }
.tray-item { position: relative; flex: none; width: 96px; height: 96px; border-radius: 16px; cursor: grab; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  background: rgba(185,135,115,.14); border: 2px solid rgba(185,135,115,.35); transition: transform .12s, background .15s, border-color .15s; touch-action: none; }
.tray-item:hover { transform: translateY(-4px); background: rgba(185,135,115,.28); border-color: var(--slot); }
.tray-item:active { cursor: grabbing; }
.tray-item.dragging-src { opacity: .35; }
.tray-item.selected { border-color: var(--gold); background: rgba(242,193,78,.2); box-shadow: 0 0 0 3px rgba(242,193,78,.3); }
.ti-icon { width: 64px; height: 64px; margin-top: 4px; pointer-events: none; }
.ti-icon svg { width: 100%; height: 100%; }
.bottle-choice .ti-icon, .potion-item .ti-icon { width: 50px; }
.ti-label { font-size: 12px; font-weight: 800; color: var(--paper); text-align: center; line-height: 1.05; padding: 0 4px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.ti-count { position: absolute; top: -6px; right: -6px; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--gold); color: var(--ink); font-weight: 900; font-size: 14px; display: flex; align-items: center; justify-content: center; border: 2px solid #6a4412; pointer-events: none; }
.ti-badge { position: absolute; top: -6px; left: -6px; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 2px solid #5a3a22; padding: 2px; pointer-events: none; }
.ti-badge svg { width: 100%; height: 100%; }
.potion-item { width: 180px; }
.potion-item .ti-label { white-space: normal; font-size: 12px; }
.tray-empty, .tray-note { color: rgba(244,236,216,.5); font-weight: 700; font-size: 16px; font-style: italic; padding: 0 10px; }
.tray-note { font-size: 14px; }
.tray-divider { width: 3px; height: 70px; border-radius: 2px; background: rgba(244,236,216,.15); margin: 0 8px; flex: none; }
.tray-trash { display: flex; flex-direction: column; align-items: center; gap: 2px; color: rgba(244,236,216,.6); font-weight: 800; font-size: 12px; padding: 8px; border-radius: 12px; }
.tray-trash:hover { background: rgba(217,87,74,.25); color: #fff; }
.tray-trash .nav-ico { width: 34px; height: 34px; }
#tray-book { position: relative; flex: none; width: 150px; height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 16px; transition: transform .15s; }
#tray-book svg { width: 120px; }
#tray-book span { font-weight: 800; font-size: 13px; color: rgba(244,236,216,.75); margin-top: -4px; }
#tray-book:hover { transform: translateY(-4px) rotate(-2deg); }

#pip { position: absolute; left: 18px; top: 8px; width: 96px; height: 96px; z-index: 3; transition: transform .2s; }
#pip:hover { transform: scale(1.06) rotate(-4deg); }
#pip.chirp .canary-svg { animation: hop .5s; }
@keyframes hop { 30% { transform: translateY(-14px) rotate(-6deg); } 60% { transform: translateY(0) rotate(3deg); } }
#pip-bubble { position: absolute; left: 20px; bottom: 168px; width: 420px; z-index: 30; padding: 12px 16px 14px; border-radius: 18px;
  background: var(--paper); border: 3px solid #5a3a22; box-shadow: 0 8px 20px rgba(0,0,0,.4); font-size: 17px; font-weight: 700; line-height: 1.35; animation: bubbleIn .3s; pointer-events: none; }
#pip-bubble::after { content: ''; position: absolute; left: 50px; bottom: -58px; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 58px solid #5a3a22; }
#pip-bubble::before { content: ''; position: absolute; left: 54px; bottom: -48px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 50px solid var(--paper); z-index: 1; }
#pip-bubble b { color: #7a3a14; }
#pip-bubble i { color: #6a5a4a; }
.pip-name { font-family: var(--f-title); font-size: 20px; color: var(--gold-deep); line-height: 1; margin-bottom: 4px; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(10px) scale(.95); } }

#nav { position: absolute; left: 0; top: 816px; width: 1600px; height: 84px; z-index: 6; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(#5a3322, #3e2217); border-top: 3px solid #8f5a3f; }
.nav-arrow { color: rgba(244,236,216,.35); font-size: 34px; font-weight: 900; margin-top: -4px; }
.nav-btn { position: relative; display: flex; align-items: center; gap: 10px; width: 250px; height: 64px; padding: 0 14px; border-radius: 16px;
  background: linear-gradient(#b98763, #946447); border: 3px solid #3a2012; box-shadow: 0 4px 0 #3a2012, inset 0 2px 0 rgba(255,255,255,.25);
  color: #2a1408; transition: transform .12s, filter .15s; }
.nav-btn:hover { transform: translateY(-3px); filter: brightness(1.08); }
.nav-btn .nav-ico { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); }
.nav-num { width: 26px; height: 26px; flex: none; border-radius: 50%; background: rgba(42,20,8,.25); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; color: #f4ecd8; }
.nav-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.05; }
.nav-txt b { font-family: var(--f-title); font-size: 26px; font-weight: 400; letter-spacing: .3px; }
.nav-txt small { font-size: 12px; font-weight: 800; opacity: .7; text-transform: uppercase; letter-spacing: .8px; }
.nav-btn.active { background: linear-gradient(#ffe29a, #eab04a); transform: translateY(-4px); box-shadow: 0 6px 0 #3a2012, 0 0 0 3px rgba(242,193,78,.4), inset 0 2px 0 rgba(255,255,255,.5); }
.nav-dot { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); border: 3px solid #3a2012; display: none; }
.nav-btn.suggest { animation: navGlow 1.3s ease-in-out infinite; }
.nav-btn.suggest .nav-dot { display: block; animation: pop .5s; }
@keyframes navGlow { 0%,100% { box-shadow: 0 4px 0 #3a2012, 0 0 0 0 rgba(242,193,78,.8); } 50% { box-shadow: 0 4px 0 #3a2012, 0 0 0 10px rgba(242,193,78,0); } }
.nav-btn.busy .nav-dot { display: block; background: #f5923a; }
.nav-btn.alert { animation: alertGlow .5s ease-in-out infinite; }
.nav-btn.alert .nav-dot { display: block; background: var(--bad); }
@keyframes alertGlow { 50% { box-shadow: 0 4px 0 #3a2012, 0 0 0 8px rgba(217,87,74,.6); } }
.bump { animation: pop .4s !important; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ---------------- toasts / tooltip / fx ---------------- */
#toasts { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 10px 22px; border-radius: 14px; background: rgba(42,26,20,.92); color: var(--paper); font-weight: 800; font-size: 18px; border: 2px solid rgba(244,236,216,.25);
  box-shadow: 0 8px 20px rgba(0,0,0,.4); animation: toastIn .3s; transition: opacity .35s, transform .35s; white-space: nowrap; }
.toast b { color: var(--gold); }
.toast.good { border-color: var(--good); }
.toast.warn { border-color: var(--gold); }
.toast.bad { border-color: var(--bad); background: rgba(90,24,18,.95); }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.95); } }

#tooltip { position: absolute; left: 0; top: 0; z-index: 90; pointer-events: none; max-width: 300px; padding: 10px 14px; border-radius: 12px;
  background: var(--paper); border: 2px solid #5a3a22; box-shadow: 0 6px 16px rgba(0,0,0,.4); font-size: 15px; font-weight: 700; line-height: 1.3; }
#tooltip b { display: block; font-size: 17px; font-weight: 900; }
.tip-dim { color: #7a6a5a; font-weight: 700; font-size: 14px; }
.tip-eff, .eff-pill { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; padding: 3px 12px 3px 5px; border-radius: 14px; font-weight: 900; font-size: 14px;
  background: color-mix(in srgb, var(--c) 25%, #fff); border: 2px solid color-mix(in srgb, var(--c) 70%, #000); color: color-mix(in srgb, var(--c) 40%, #000); }
.eff-pill.plain { --c: #a89a8a; }
.eff-ico { width: 20px; height: 20px; }

#fx-layer, #drag-layer { position: absolute; inset: 0; pointer-events: none; z-index: 95; }
#drag-layer { z-index: 96; }
.drag-ghost { position: absolute; left: 0; top: 0; width: 100px; height: 100px; filter: drop-shadow(0 12px 12px rgba(0,0,0,.45)); }
.drag-ghost svg { width: 100%; height: 100%; }
.drag-ghost.drag-cancel { transition: opacity .25s; opacity: 0; }
.drop-ok { outline: 3px dashed rgba(242,193,78,.7); outline-offset: 6px; border-radius: 24px; }
.drop-hover { outline: 4px solid var(--gold); outline-offset: 6px; background-color: rgba(242,193,78,.12); }
.pt { position: absolute; border-radius: 50%; pointer-events: none; animation: ptFly .9s ease-out forwards; }
.pt-spark { border-radius: 2px; transform: rotate(45deg); box-shadow: 0 0 8px currentColor; }
.pt-smoke { filter: blur(3px); opacity: .7; }
@keyframes ptFly { from { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2) rotate(180deg); opacity: 0; } }
.float-text { position: absolute; transform: translate(-50%, -50%); font-family: var(--f-title); font-size: 44px; color: #fff; text-shadow: 0 3px 0 #2a1a14, 0 0 18px rgba(0,0,0,.5); pointer-events: none; animation: floatUp 1.5s ease-out forwards; white-space: nowrap; }
.float-text.gold { color: var(--gold); }
.float-text.good { color: #bff0a0; }
.float-text.bad { color: #ff8a7a; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -150%) scale(1); } }
.fly { position: absolute; left: 0; top: 0; width: 80px; height: 80px; transition: transform .65s cubic-bezier(.5,-0.3,.6,1), opacity .65s; filter: drop-shadow(0 6px 8px rgba(0,0,0,.4)); }
.fly svg { width: 100%; height: 100%; }
.shake { animation: shake .45s; }
@keyframes shake { 20% { translate: -8px 0; } 40% { translate: 8px 0; } 60% { translate: -5px 0; } 80% { translate: 4px 0; } }

/* ---------------- modal ---------------- */
#modal-layer { position: absolute; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(20,10,8,.55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; }
#modal-layer.show { opacity: 1; }
.modal { position: relative; width: 620px; max-height: 820px; overflow: auto; padding: 32px 40px 28px; border-radius: 26px; text-align: center;
  background: linear-gradient(var(--paper), var(--paper-2)); border: 4px solid #5a3a22; box-shadow: 0 0 0 8px rgba(244,236,216,.12), 0 30px 60px rgba(0,0,0,.6);
  font-size: 18px; line-height: 1.45; animation: modalIn .35s cubic-bezier(.3,1.4,.5,1); }
@keyframes modalIn { from { transform: scale(.85) translateY(20px); opacity: 0; } }
.modal h2 { font-family: var(--f-title); font-weight: 400; font-size: 50px; line-height: 1; margin: 4px 0 12px; color: #4a2410; }
.modal p { margin: 10px 0; }
.modal .kw, .kw { color: #c8841a; font-weight: 900; }
.modal-kicker { font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: 2px; color: #a8743a; }
.modal-buttons { display: flex; justify-content: center; gap: 14px; margin-top: 20px; }
.discovery { overflow: hidden; }
.disc-rays { position: absolute; left: 50%; top: 150px; width: 700px; height: 700px; margin: -350px 0 0 -350px; pointer-events: none; opacity: .35;
  background: repeating-conic-gradient(from 0deg, rgba(242,193,78,.6) 0deg 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 18s linear infinite;
  mask-image: radial-gradient(circle, #000 20%, transparent 65%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%); }
@keyframes spin { to { transform: rotate(360deg); } }
.disc-icon { position: relative; width: 150px; height: 150px; margin: 0 auto; animation: discPop .7s cubic-bezier(.3,1.6,.5,1); filter: drop-shadow(0 8px 10px rgba(0,0,0,.3)); }
.disc-icon svg { width: 100%; height: 100%; }
@keyframes discPop { from { transform: scale(0) rotate(-40deg); } }
.disc-formula { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 10px; font-family: var(--f-title); font-size: 34px; color: #8a5a2a; }
.disc-formula svg { width: 58px; height: 58px; }
.day-stars, .rc-stars { font-size: 44px; color: var(--gold); letter-spacing: 4px; text-shadow: 0 2px 0 #8a5a14; }
.day-stars span, .rc-stars span { color: rgba(0,0,0,.15); text-shadow: none; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat-grid div { background: rgba(90,58,34,.1); border-radius: 14px; padding: 12px 6px; border: 2px solid rgba(90,58,34,.2); }
.stat-grid b { display: block; font-size: 30px; font-weight: 900; color: #5a3a22; }
.stat-grid small { font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; color: #8a6a4a; }
.game-over .go-portrait { width: 192px; height: 225px; margin: -10px auto 0; }
.go-portrait img { width: 100%; height: 100%; image-rendering: pixelated; }
.intro { width: 680px; text-align: left; }
.intro h2, .intro .modal-kicker { text-align: center; }
.intro-pip { width: 110px; height: 110px; margin: -6px auto 0; animation: hop 1.6s ease-in-out infinite; }

/* ---------------- recipe book ---------------- */
.book-modal { width: 1240px; padding: 0; background: none; border: 0; box-shadow: none; text-align: left; overflow: visible; max-height: none; }
.book { position: relative; display: flex; padding: 22px; border-radius: 22px; background: linear-gradient(135deg, #6a3a22, #4a2414); border: 4px solid #2e1810; box-shadow: 0 30px 60px rgba(0,0,0,.6); }
.book::after { content: ''; position: absolute; left: 50%; top: 22px; bottom: 22px; width: 30px; margin-left: -15px; background: linear-gradient(90deg, rgba(0,0,0,.25), rgba(0,0,0,0) 40%, rgba(0,0,0,0) 60%, rgba(0,0,0,.25)); pointer-events: none; }
.book-page { flex: 1; min-height: 660px; padding: 28px 34px; background: linear-gradient(90deg, #efe0bb, #f6ead0); }
.book-page.left { border-radius: 12px 4px 4px 12px; box-shadow: inset -12px 0 20px rgba(90,58,34,.2); }
.book-page.right { border-radius: 4px 12px 12px 4px; background: linear-gradient(90deg, #f6ead0, #efe0bb); box-shadow: inset 12px 0 20px rgba(90,58,34,.2); }
.bk-title { font-family: var(--f-title); font-size: 46px; color: #4a2410; line-height: 1; }
.bk-title small { font-family: var(--f-hand); font-size: 24px; color: #8a6a4a; margin-left: 8px; }
.bk-count { font-family: var(--f-hand); font-size: 24px; font-weight: 700; color: #8a5a2a; margin-bottom: 12px; }
.bk-grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(7, 1fr); gap: 8px; }
.bk-cell { aspect-ratio: 1.25; border-radius: 10px; border: 2px dashed rgba(90,58,34,.25); display: flex; align-items: center; justify-content: center; padding: 4px; }
.bk-cell svg { height: 100%; width: auto; }
.bk-cell.known { background: rgba(255,255,255,.4); border: 2px solid rgba(90,58,34,.35); transition: transform .12s, background .15s; }
.bk-cell.known:hover { transform: scale(1.08); background: #fff8e4; }
.bk-cell.unknown { background: rgba(90,58,34,.1); border: 2px solid rgba(90,58,34,.25); }
.bk-cell.unknown svg { filter: brightness(0); opacity: .55; }
.bk-cell.sel { border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(242,193,78,.6); background: #fff4d0; }
.bk-cell.blank { cursor: default; }
.book-close { position: absolute; right: -16px; top: -16px; width: 48px; height: 48px; border-radius: 50%; background: var(--paper); border: 3px solid #2e1810; font-weight: 900; font-size: 22px; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.book-close:hover { background: #fff; }
.bk-detail { text-align: center; }
.bk-big { width: 170px; height: 170px; margin: 0 auto; filter: drop-shadow(0 8px 8px rgba(90,58,34,.3)); }
.bk-big svg { width: 100%; height: 100%; }
.bk-big.unknown svg { filter: brightness(0); opacity: .5; }
.bk-detail h3, .bk-intro h3 { font-family: var(--f-title); font-weight: 400; font-size: 44px; margin: 4px 0 0; color: #4a2410; line-height: 1; }
.bk-sub { font-family: var(--f-hand); font-size: 24px; color: #8a6a4a; margin-bottom: 6px; }
.bk-detail p { font-size: 17px; line-height: 1.45; margin: 10px 0; }
.bk-riddle { font-family: var(--f-hand); font-size: 26px !important; color: #6a3a1a; }
.bk-formula { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0; font-family: var(--f-title); font-size: 30px; color: #8a5a2a; }
.bk-formula button { display: flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 12px; border: 2px solid rgba(90,58,34,.25); background: rgba(255,255,255,.35); }
.bk-formula button:hover { background: #fff8e4; }
.bk-formula svg { width: 56px; height: 56px; }
.bk-formula small { font-family: var(--f-ui); font-weight: 800; font-size: 13px; }
.bk-facts { display: flex; gap: 12px; justify-content: center; margin-top: 10px; }
.bk-facts div { padding: 8px 16px; border-radius: 12px; background: rgba(90,58,34,.1); }
.bk-facts small { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #8a6a4a; }
.bk-facts b { font-size: 17px; }
.bk-uses { margin-top: 12px; font-size: 16px; }
.bk-intro ol { font-size: 18px; line-height: 1.5; padding-left: 24px; }
.bk-intro li { margin-bottom: 8px; }
.bk-effects { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------------- title screen ---------------- */
#title-screen { position: absolute; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(40,20,16,.55), rgba(15,7,6,.92)); backdrop-filter: blur(6px); }
#title-screen.show { display: flex; }
.title-card { text-align: center; color: var(--paper); animation: modalIn .6s cubic-bezier(.3,1.3,.5,1); }
.title-bottle { width: 150px; height: 235px; margin: 0 auto -10px; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(155,130,214,.6)); }
.title-bottle svg { width: 100%; height: 100%; }
@keyframes bob { 50% { transform: translateY(-12px) rotate(3deg); } }
.title-card h1 { font-family: var(--f-title); font-weight: 400; font-size: 140px; line-height: .9; margin: 0; color: var(--gold); text-shadow: 0 6px 0 #5a2a10, 0 0 40px rgba(242,193,78,.35); }
.title-sub { font-family: var(--f-hand); font-size: 40px; margin-bottom: 34px; opacity: .9; }
.title-buttons { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.title-buttons .btn.big { min-width: 320px; flex-direction: column; gap: 0; font-size: 28px; }
.title-foot { margin-top: 30px; font-size: 15px; font-weight: 700; opacity: .5; }

/* =========================================================
   SCENE ART
   ========================================================= */
/* ---- counter ---- */
.counter-back { inset: 0; filter: blur(3.5px) brightness(.75) saturate(.9);
  background: radial-gradient(ellipse at 50% 40%, #8a5a3a 0%, #5a3526 45%, #3a211c 100%); }
.counter-back > * { position: absolute; }
.cb-window { left: 700px; top: 20px; width: 200px; height: 260px; border-radius: 100px 100px 10px 10px; background: linear-gradient(#fff3c4, #f2c67a); box-shadow: 0 0 80px 30px rgba(255,220,150,.5); border: 10px solid #4a2a1a; }
.cb-sun { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 46px, #4a2a1a 46px 54px); border-radius: inherit; opacity: .9; }
.cb-shelf { width: 480px; height: 110px; }
.cb-shelf svg { width: 100%; height: 100%; }
.cb-lamp { top: 200px; width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle, #fff3b0, rgba(255,200,100,0) 70%); box-shadow: 0 0 60px 30px rgba(255,200,100,.35); }
.wall-left { left: 0; top: 0; width: 520px; height: 460px; background:
  repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 2px, transparent 2px 86px), linear-gradient(90deg, #4b2a26, #5a332c); box-shadow: 8px 0 20px rgba(0,0,0,.4); }
.wall-right { right: 0; top: 0; width: 260px; height: 460px; background: linear-gradient(90deg, #4a2a1e, #5c3526); border-left: 8px solid #3a2016; box-shadow: -8px 0 20px rgba(0,0,0,.4); }
.wr-shelf { position: absolute; left: 0; width: 260px; height: 104px; filter: brightness(.9); }
.wr-shelf svg { width: 100%; height: 100%; }
.deco-frames > div { position: absolute; }
.deco-frames { left: 0; top: 0; }
.frame { position: relative; width: 140px; height: 170px; filter: drop-shadow(4px 6px 6px rgba(0,0,0,.4)); }
.frame-svg { width: 100%; height: 100%; }
.frame-inner { position: absolute; left: 18px; top: 18px; width: 104px; height: 134px; border-radius: 50%; overflow: hidden; display: flex; align-items: flex-start; justify-content: center; }
.frame-inner img { width: 128px; image-rendering: pixelated; filter: sepia(.9) saturate(.6) contrast(.9) brightness(1.05); margin-top: 4px; }
.herb-rack { left: 290px; top: -8px; width: 230px; }
.herb-rack.small { width: 200px; }
.herb-rack svg { width: 100%; }
.sticky { font-family: var(--f-hand); font-size: 22px; line-height: 1.05; padding: 14px 12px; width: 150px; background: #f6ecd6; color: #6a3a1a; box-shadow: 3px 5px 8px rgba(0,0,0,.35); text-align: center; }
.sticky::before { content: ''; position: absolute; left: 50%; top: -8px; width: 50px; height: 16px; margin-left: -25px; background: rgba(230,200,160,.75); }
.sticky.n1 { left: 300px; top: 250px; transform: rotate(-4deg); }
.sticky.n2 { left: 340px; top: 350px; transform: rotate(8deg); font-weight: 700; background: #f7e3d6; width: 160px; }

#customer-wrap { left: 520px; bottom: 138px; width: 384px; height: 450px; z-index: 1; transition: opacity .3s; }
#customer-wrap.empty { opacity: 0; pointer-events: none; }
#customer-img { width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; filter: drop-shadow(0 10px 16px rgba(0,0,0,.35)); animation: breathe 3.5s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 50% { transform: scaleY(1.012) translateY(-2px); } }
#customer-wrap.enter { animation: custEnter .6s cubic-bezier(.3,1.3,.5,1); }
@keyframes custEnter { from { transform: translateY(120px); opacity: 0; } }
#customer-wrap.leave { animation: custLeave .55s ease-in forwards; }
@keyframes custLeave { to { transform: translateX(-260px); opacity: 0; } }
#customer-wrap.drop-ok { outline-offset: -10px; }

.speech { left: 896px; top: 30px; width: 450px; min-height: 210px; z-index: 3; padding: 40px 44px 20px 52px; cursor: pointer; animation: speechIn .35s cubic-bezier(.3,1.4,.5,1);
  background: #f7eedb; border-radius: 48% 52% 46% 54% / 55% 48% 52% 45%; border: 7px solid #1c110d; filter: drop-shadow(0 10px 14px rgba(0,0,0,.35)); }
.speech::before { content: ''; position: absolute; left: -30px; top: 140px; width: 60px; height: 44px; background: #f7eedb; border: 7px solid #1c110d; border-right: 0; border-top: 0; transform: skewY(-28deg); border-radius: 0 0 0 40px; z-index: -1; }
.speech.small { min-height: 150px; }
@keyframes speechIn { from { transform: scale(.6); opacity: 0; transform-origin: 0 80%; } }
.speech-name { position: absolute; left: 50%; top: -28px; transform: translateX(-40%); font-family: var(--f-title); font-size: 44px; line-height: 1; color: #4a2410;
  -webkit-text-stroke: 7px #f2d98a; paint-order: stroke fill; white-space: nowrap; }
.speech-text { font-family: var(--f-talk); font-weight: 700; font-size: 22px; line-height: 1.3; color: #1c110d; min-height: 90px; }
.speech-text .kw { color: #d98a1a; -webkit-text-stroke: .6px #6a3a0a; font-weight: 700; }
.speech-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 10px; min-height: 10px; }
.speech-actions .btn { font-size: 17px; padding: 8px 16px; }
.page-count { font-weight: 900; font-size: 14px; color: #8a6a4a; }

.counter-top { left: 0; bottom: 0; width: 1600px; height: 146px; z-index: 2;
  background: linear-gradient(#7d4a46, #6a3c39 30%, #5a3230); border-top: 6px solid #8a5550; box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
.counter-edge { position: absolute; left: 0; right: 0; top: 0; height: 26px; background: linear-gradient(#9a615b, #7d4a46); box-shadow: 0 6px 8px rgba(0,0,0,.25); }
.counter-top::after { content: ''; position: absolute; left: 0; right: 0; top: 60px; bottom: 0; background: repeating-linear-gradient(90deg, rgba(0,0,0,.1) 0 3px, transparent 3px 200px); }
#calendar { left: 130px; top: 360px; width: 150px; height: 124px; z-index: 3; transform: rotate(-4deg); filter: drop-shadow(3px 6px 6px rgba(0,0,0,.4)); }
.cal-top { height: 16px; background: #7a3a2a; border-radius: 6px 6px 0 0; border: 2px solid #3a1a10; }
.cal-body { background: #f6ecd6; height: 104px; border: 2px solid #8a6a4a; border-top: 0; border-radius: 0 0 6px 6px; padding: 4px 8px; text-align: center; font-family: var(--f-hand); line-height: 1; }
.cal-body small { font-size: 18px; color: #8a6a4a; }
.cal-body b { font-size: 36px; color: #4a2410; margin-left: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 4px; }
.cal-grid i { height: 14px; border: 1px solid #c8b08a; position: relative; }
.cal-grid i.x::after { content: '✕'; position: absolute; inset: -3px 0 0; font-style: normal; color: #c43a3a; font-weight: 900; font-size: 13px; }
#bell-wrap { left: 1062px; top: 386px; width: 140px; z-index: 3; }
#bell-wrap .bell-svg { width: 140px; transition: transform .15s; filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); }
#bell-wrap:hover .bell-svg { transform: translateY(-3px); }
.bell-label { position: absolute; left: 50%; top: -34px; transform: translateX(-50%); white-space: nowrap; padding: 4px 12px; border-radius: 10px; background: var(--gold); border: 2px solid #6a4412; font-weight: 900; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#bell-wrap.ready .bell-label { opacity: 1; animation: bob 1.4s ease-in-out infinite; }
#bell-wrap.ready .bell-svg { animation: bellGlow 1.4s ease-in-out infinite; }
@keyframes bellGlow { 50% { filter: drop-shadow(0 0 14px rgba(242,193,78,.9)); } }
#bell-wrap.ding .bell-svg { animation: ding .45s; }
@keyframes ding { 25% { transform: rotate(-10deg) scale(1.05); } 60% { transform: rotate(8deg); } }
#counter-potion { left: 930px; top: 282px; width: 118px; height: 185px; z-index: 3; cursor: grab; opacity: 0; transform: translateY(20px); transition: opacity .3s, transform .3s; pointer-events: none; touch-action: none; }
#counter-potion.has { opacity: 1; transform: none; pointer-events: auto; animation: bob 2.4s ease-in-out infinite; }
#counter-potion svg { width: 100%; height: 100%; }
#jar-wrap { left: 1222px; top: 326px; width: 118px; height: 148px; z-index: 3; }
#jar-wrap svg { width: 100%; height: 100%; }
#ball-wrap { left: 1446px; top: 342px; width: 118px; height: 128px; z-index: 3; transition: transform .2s; }
#ball-wrap:hover { transform: scale(1.06); filter: drop-shadow(0 0 16px rgba(185,163,240,.8)); }
#ball-wrap svg { width: 100%; height: 100%; }

#receipt { left: 36px; top: 10px; width: 440px; z-index: 10; padding: 22px 26px 20px; border-radius: 6px; background: #fbf5e6;
  box-shadow: 0 20px 40px rgba(0,0,0,.5); font-size: 16px; font-weight: 700;
  -webkit-mask: radial-gradient(circle at 10px 100%, transparent 8px, #000 8.5px) -10px 0 / 20px 100% repeat-x; mask: radial-gradient(circle at 10px 100%, transparent 8px, #000 8.5px) -10px 0 / 20px 100% repeat-x;
  padding-bottom: 28px; }
#receipt.pop { animation: receiptIn .5s cubic-bezier(.3,1.3,.5,1); }
@keyframes receiptIn { from { transform: translateY(-60px) rotate(-3deg); opacity: 0; } }
.rc-title { font-family: var(--f-title); font-size: 40px; text-align: center; line-height: 1; color: #4a2410; }
.rc-title.bad { color: var(--bad); }
.rc-stars { text-align: center; font-size: 36px; margin-bottom: 8px; }
.rc-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #d8c8a8; }
.rc-k { width: 74px; font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: #8a6a4a; }
.rc-bar { width: 90px; height: 12px; border-radius: 6px; background: #e8dcc4; overflow: hidden; }
.rc-bar i { display: block; height: 100%; border-radius: 6px; }
.rc-d { flex: 1; text-align: right; font-size: 15px; }
.rc-d small { color: #8a7a6a; }
.rc-ok { color: #3f8a3a; font-weight: 900; }
.rc-money { display: flex; justify-content: space-between; padding: 6px 0 0; font-size: 17px; }
.rc-total { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 10px; border-top: 3px double #8a6a4a; font-size: 22px; font-weight: 900; }
.rc-total b { display: flex; align-items: center; gap: 6px; color: #8a5a14; }
.rc-bad { font-size: 18px; text-align: center; }
.rc-strike { text-align: center; font-weight: 900; font-size: 22px; color: #fff; background: var(--bad); border-radius: 12px; padding: 6px; margin: 10px 0; }
.rc-tip { font-size: 15px; color: #7a6a5a; text-align: center; }
#receipt > .btn { display: flex; margin: 16px auto 0; }

/* ---- ticket ---- */
#ticket { position: absolute; right: 22px; top: 14px; width: 228px; z-index: 12; padding: 26px 18px 16px; background: #fbf6e8; border-radius: 4px 4px 14px 4px;
  box-shadow: 0 10px 22px rgba(0,0,0,.45); transform: rotate(1.5deg); font-weight: 700;
  background-image: repeating-linear-gradient(transparent 0 29px, #d8e0ec 29px 30px); background-position: 0 14px; }
#ticket.write { animation: ticketIn .6s cubic-bezier(.3,1.4,.5,1); }
@keyframes ticketIn { from { transform: translateY(-80px) rotate(-10deg); opacity: 0; } }
.pin { position: absolute; left: 50%; top: -8px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a7a, #b8302a); box-shadow: 0 3px 4px rgba(0,0,0,.4); }
.tk-head { display: flex; justify-content: space-between; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 2px; color: #a8743a; }
.tk-num { color: #4a2410; }
.tk-name { font-family: var(--f-hand); font-size: 32px; font-weight: 700; line-height: 1; color: #2a3a6a; margin: 2px 0 8px; }
.tk-row { display: flex; align-items: center; justify-content: space-between; min-height: 34px; }
.tk-k { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: #8a7a6a; }
.tk-v { display: flex; align-items: center; gap: 5px; font-family: var(--f-hand); font-size: 25px; font-weight: 700; color: #2a3a6a; }
.tk-v.eff { color: color-mix(in srgb, var(--c) 55%, #000); }
.tk-v .eff-ico { width: 24px; height: 24px; }
.pip-s { display: inline-block; width: 10px; height: 16px; border-radius: 3px; background: #e0d6c0; border: 1.5px solid #b8a888; }
.pip-s.on { background: #2a3a6a; border-color: #2a3a6a; }
.tk-bottle { width: 22px; height: 34px; display: inline-block; }
.tk-bottle svg { width: 100%; height: 100%; }
.tk-patience { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: #8a7a6a; }
.pat-bar { flex: 1; height: 10px; border-radius: 5px; background: #e8dcc4; overflow: hidden; }
#pat-fill { height: 100%; width: 100%; border-radius: 5px; transition: width .5s, background .5s; }

/* ---- garden ---- */
.garden-back { inset: 0; background: repeating-linear-gradient(90deg, #5a3a26 0 118px, #4a2e1e 118px 122px), #5a3a26; }
.garden-back > * { position: absolute; }
.g-window { left: 360px; top: 20px; width: 880px; height: 300px; border: 14px solid #3a2416; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 30px rgba(0,0,0,.3), 0 10px 20px rgba(0,0,0,.4); }
.g-sky { position: absolute; inset: 0; background: linear-gradient(#8ec8ea, #cfe8f2 70%, #f4eed0); }
.g-sky > * { position: absolute; }
.g-sun { right: 120px; top: 30px; width: 80px; height: 80px; border-radius: 50%; background: #fff3b0; box-shadow: 0 0 60px 20px rgba(255,240,170,.8); }
.g-cloud { height: 40px; border-radius: 30px; background: #fff; opacity: .9; animation: drift 40s linear infinite; }
.g-cloud::before { content: ''; position: absolute; left: 20%; top: -20px; width: 50%; height: 50px; border-radius: 50%; background: #fff; }
.g-cloud.c1 { left: 80px; top: 60px; width: 140px; }
.g-cloud.c2 { left: 480px; top: 110px; width: 100px; animation-duration: 55s; }
@keyframes drift { from { transform: translateX(-200px); } to { transform: translateX(900px); } }
.g-hill { border-radius: 50% 50% 0 0; bottom: -100px; }
.g-hill.h1 { left: -100px; width: 700px; height: 260px; background: #8cbf6a; }
.g-hill.h2 { left: 400px; width: 800px; height: 220px; background: #7aae5a; }
.g-mullion { background: #3a2416; }
.g-mullion.v { left: 50%; top: 0; bottom: 0; width: 12px; margin-left: -6px; }
.g-mullion.h { top: 45%; left: 0; right: 0; height: 12px; }
.g-hang { top: -10px; width: 130px; height: 160px; filter: brightness(.8); }
.g-hang svg { width: 100%; height: 100%; }
.g-hang::after { content: ''; position: absolute; left: 20px; right: 20px; bottom: -10px; height: 40px; background: linear-gradient(#cf7b4f, #9c4f2f); border-radius: 4px 4px 20px 20px; border: 3px solid #5a2a16; }
.bench { left: 0; top: 380px; width: 1600px; height: 216px; background: linear-gradient(#6b4428, #4e301c); border-top: 4px solid #3a2012; }
.bench-top { position: absolute; left: 0; right: 0; top: 0; height: 22px; background: linear-gradient(#a8744a, #8a5a36); border-bottom: 4px solid #3a2012; }
.bench::after { content: ''; position: absolute; left: 0; right: 0; top: 26px; bottom: 0; background: repeating-linear-gradient(90deg, transparent 0 318px, rgba(0,0,0,.2) 318px 322px); }
.pot-slot { width: 220px; height: 363px; top: 30px; z-index: 2; }
#pot-left { left: 250px; }
#pot-result { left: 690px; }
#pot-right { left: 1130px; }
.pot-body { position: absolute; left: 0; bottom: 0; width: 220px; height: 150px; }
.pot-body svg { width: 100%; height: 100%; }
.pot-plant { position: absolute; left: 20px; bottom: 138px; width: 180px; height: 225px; transform-origin: 50% 100%; cursor: pointer; }
.pot-plant svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.pot-plant.sprout { animation: sprout .5s cubic-bezier(.3,1.5,.5,1); }
@keyframes sprout { from { transform: scale(.3, 0); } }
.pot-plant.grow { animation: grow 1.4s cubic-bezier(.3,1.3,.5,1); }
@keyframes grow { 0% { transform: scale(0); filter: brightness(3); } 70% { filter: brightness(1.4); } }
#pot-result.ready .pot-plant { animation: readyBob 1.6s ease-in-out infinite; }
#pot-result.ready .pot-plant svg { filter: drop-shadow(0 0 16px rgba(255,240,170,.9)); }
@keyframes readyBob { 50% { transform: translateY(-6px) scale(1.02); } }
.pot-empty { position: absolute; left: 30px; right: 30px; bottom: 170px; height: 150px; border: 4px dashed rgba(244,236,216,.35); border-radius: 26px; display: flex; align-items: center; justify-content: center; text-align: center;
  color: rgba(244,236,216,.6); font-weight: 800; font-size: 18px; pointer-events: none; transition: opacity .2s; }
#pot-result .pot-empty { font-family: var(--f-title); font-size: 90px; color: rgba(242,193,78,.45); border-color: rgba(242,193,78,.35); }
.pot-slot.filled .pot-empty { opacity: 0; }
.pot-plaque { position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); white-space: nowrap; padding: 3px 14px; border-radius: 10px; background: #f4ecd8; border: 2px solid #5a3a22; font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 #5a3a22; }
.pot-plaque:empty { display: none; }
.pot-remove { position: absolute; right: 8px; top: 30px; width: 34px; height: 34px; border-radius: 50%; background: var(--paper); border: 2px solid #5a3a22; font-weight: 900; font-size: 15px; opacity: 0; transition: opacity .2s; z-index: 2; }
.pot-slot.filled:hover .pot-remove { opacity: 1; }
.pot-slot.drop-ok, .pot-slot.drop-hover { border-radius: 30px; }
.g-arrows { left: 0; top: 0; width: 1600px; height: 400px; pointer-events: none; z-index: 1; }
.g-plus { display: none; }
#btn-combine { left: 50%; top: 470px; transform: translateX(-50%); min-width: 290px; z-index: 3; }
#btn-combine:hover:not(:disabled) { transform: translateX(-50%) translateY(-2px); }
#btn-combine:active:not(:disabled) { transform: translateX(-50%) translateY(3px); }
#btn-combine:not(:disabled) { background: linear-gradient(#ffd97a, #eab04a); border-color: #6a4412; }
#btn-combine.harvest { background: linear-gradient(#bff0a0, #6fbf6a); border-color: #2f6a22; }
.g-can { left: 1380px; top: 300px; width: 120px; height: 80px; background: linear-gradient(#9aa6b0, #6a767f); border-radius: 12px 12px 20px 20px; border: 3px solid #3a444a; }
.g-can::before { content: ''; position: absolute; right: -60px; top: 6px; width: 70px; height: 12px; background: #7a868f; border: 3px solid #3a444a; transform: rotate(-30deg); border-radius: 4px; }
.g-can::after { content: ''; position: absolute; left: 20px; top: -30px; width: 60px; height: 40px; border: 6px solid #6a767f; border-bottom: 0; border-radius: 30px 30px 0 0; }

/* ---- prep ---- */
.prep-back { inset: 0; background: linear-gradient(90deg, #4b2a26, #5a332c 50%, #4b2a26); }
.prep-back::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 58px, rgba(0,0,0,.12) 58px 61px); }
.prep-back > * { position: absolute; }
.p-shelf { width: 420px; height: 110px; filter: brightness(.85); }
.p-shelf svg { width: 100%; height: 100%; }
.p-window { left: 820px; top: 26px; width: 360px; height: 220px; border: 12px solid #3a2016; border-radius: 10px; background: linear-gradient(#1a2a4a, #3a4a7a); overflow: hidden; }
.p-night::before { content: ''; position: absolute; right: 40px; top: 30px; width: 60px; height: 60px; border-radius: 50%; background: #f6f0d0; box-shadow: 0 0 40px 10px rgba(246,240,208,.4), inset -14px -6px 0 #d8d0b0; }
.p-night::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(2px 2px at 40px 50px, #fff, transparent), radial-gradient(2px 2px at 120px 30px, #fff, transparent), radial-gradient(1.5px 1.5px at 200px 90px, #fff, transparent), radial-gradient(2px 2px at 80px 140px, #fff, transparent), radial-gradient(1.5px 1.5px at 160px 170px, #fff, transparent); }
.p-window::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 10px; margin-left: -5px; background: #3a2016; }
.desk { left: 0; top: 300px; width: 1600px; height: 296px; background: linear-gradient(#7a4a2e, #5a3420); border-top: 4px solid #3a2012; }
.desk-top { position: absolute; left: 0; right: 0; top: 0; height: 180px; background: repeating-linear-gradient(90deg, #8f5a3f 0 200px, #86523a 200px 204px); border-bottom: 5px solid #3a2012; box-shadow: inset 0 10px 20px rgba(255,255,255,.08); }
.candles { width: 120px; height: 124px; }
.candles svg { width: 100%; height: 100%; }
.cflame { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .6s ease-in-out infinite alternate; }
@keyframes flick { to { transform: scaleY(1.15) skewX(4deg); } }
#book-desk { left: 60px; top: 330px; width: 220px; z-index: 2; transition: transform .2s; }
#book-desk svg { width: 220px; filter: drop-shadow(4px 8px 6px rgba(0,0,0,.4)); transform: rotate(-6deg); }
#book-desk:hover { transform: translateY(-6px); }
#book-desk:hover svg { filter: drop-shadow(0 0 14px rgba(242,193,78,.8)); }
.desk-label { display: block; margin-top: 4px; font-family: var(--f-hand); font-size: 26px; font-weight: 700; color: var(--paper); text-align: center; }
.station { z-index: 2; }
.station-plaque { position: absolute; left: 50%; top: -58px; transform: translateX(-50%); white-space: nowrap; padding: 6px 18px; border-radius: 12px; background: #f4ecd8; border: 3px solid #5a3a22;
  font-family: var(--f-title); font-size: 26px; color: #4a2410; box-shadow: 0 4px 0 #5a3a22; z-index: 3; }
.station-plaque small { font-family: var(--f-ui); font-size: 13px; font-weight: 800; color: #8a6a4a; margin-left: 4px; text-transform: uppercase; }
.station-empty { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 10px 20px; border-radius: 16px; border: 3px dashed rgba(244,236,216,.55); color: var(--paper); font-weight: 800; font-size: 18px; background: rgba(42,26,20,.45); pointer-events: none; white-space: nowrap; }
.station.busy .station-empty { display: none; }
.station-cancel { position: absolute; right: -10px; top: -12px; width: 38px; height: 38px; border-radius: 50%; background: var(--paper); border: 3px solid #5a3a22; font-weight: 900; font-size: 16px; display: none; z-index: 4; }
.station.busy .station-cancel { display: block; }
#mortar-station { left: 400px; top: 250px; width: 300px; height: 230px; cursor: grab; touch-action: none; }
#mortar-station.grinding { cursor: grabbing; }
.mortar-art { position: absolute; inset: 0; }
.mortar-art svg { width: 100%; height: 100%; }
.mortar-bowl { position: absolute; left: 36px; top: -60px; width: 228px; height: 156px; overflow: hidden; border-radius: 0 0 50% 50% / 0 0 22px 22px; pointer-events: none; }
.mortar-item { position: absolute; left: 50%; bottom: 0; width: 110px; height: 110px; transform-origin: 50% 90%; transform: translate(-50%, 0); }
.mortar-item svg { width: 100%; height: 100%; }
.mortar-powder { position: absolute; left: 150px; top: 70px; width: 170px; height: 34px; border-radius: 50%; opacity: 0; pointer-events: none; transform: translateX(-50%) scale(.3);
  background: radial-gradient(ellipse at 45% 35%, color-mix(in srgb, var(--c) 60%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000)); }
#pestle { position: absolute; left: 0; top: 0; width: 60px; height: 220px; pointer-events: none; transform-origin: 50% 95%; transform: translate(200px, -150px) rotate(24deg); transition: transform .25s; z-index: 2; }
#mortar-station.grinding #pestle { transition: none; }
#pestle svg { width: 100%; height: 100%; filter: drop-shadow(4px 6px 4px rgba(0,0,0,.35)); }
#mortar-station.active:not(.grinding) #pestle { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { translate: -10px 6px; } }
#board-station { left: 760px; top: 300px; width: 560px; height: 230px; touch-action: none; }
.board-art { position: absolute; inset: 0; }
.board-art svg { width: 100%; height: 100%; }
.tail-wrap { position: absolute; left: 20px; top: 50px; width: 520px; height: 120px; pointer-events: none; }
.tail-wrap svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 4px rgba(0,0,0,.3)); }
.tail-seg { transition: transform .25s cubic-bezier(.3,1.5,.5,1); }
.cut-line line:first-child { animation: dashMove 1s linear infinite; }
@keyframes dashMove { to { stroke-dashoffset: -32; } }
#knife { position: absolute; left: 0; top: 0; width: 56px; height: 176px; pointer-events: none; opacity: 0; z-index: 3; transition: opacity .15s; }
#knife svg { width: 100%; height: 100%; filter: drop-shadow(6px 8px 4px rgba(0,0,0,.35)); }
#knife.chop svg { animation: chop .18s ease-out; }
@keyframes chop { 50% { transform: translateY(24px); } }
#board-station.active.hovering { cursor: none; }
#board-station.active.hovering #knife { opacity: 1; }

/* ---- brew ---- */
.brew-back { inset: 0; }
.brew-back > * { position: absolute; }
.stone-wall { inset: 0; background-color: #3a3236;
  background-image: radial-gradient(ellipse 60px 34px at 60px 36px, #4a4146 60%, transparent 62%), radial-gradient(ellipse 60px 34px at 180px 36px, #453d42 60%, transparent 62%),
    radial-gradient(ellipse 60px 34px at 0 106px, #4d4449 60%, transparent 62%), radial-gradient(ellipse 60px 34px at 120px 106px, #433b40 60%, transparent 62%), radial-gradient(ellipse 60px 34px at 240px 106px, #4a4146 60%, transparent 62%);
  background-size: 240px 140px; }
.stone-wall::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 38% 70%, rgba(245,146,58,.35), transparent 55%), linear-gradient(transparent 60%, rgba(0,0,0,.4)); }
.b-window { left: 860px; top: 24px; width: 240px; height: 180px; border: 12px solid #3a2016; background: linear-gradient(#3a4a7a, #1a2a4a); border-radius: 8px; overflow: hidden; }
.b-curtain { position: absolute; top: 0; bottom: 0; width: 70px; background: repeating-linear-gradient(90deg, #d8c8a8 0 12px, #c8b898 12px 20px); }
.b-curtain.l { left: 0; border-radius: 0 0 60px 0; }
.b-curtain.r { right: 0; border-radius: 0 0 0 60px; }
.b-shelf { left: 1120px; width: 220px; height: 104px; }
.b-shelf svg { width: 100%; height: 100%; }
.hearth { left: 280px; top: 470px; width: 560px; height: 126px; background: linear-gradient(#5a4a4a, #3a2e2e); border-top: 6px solid #6a5a5a; border-radius: 8px 8px 0 0; }
#cauldron-wrap { left: 350px; top: 20px; width: 420px; height: 560px; z-index: 2; }
#cauldron-wrap > * { position: absolute; }
.chain { top: -20px; width: 16px; height: 180px; background: repeating-linear-gradient(#6a6670 0 14px, #3a363e 14px 16px, transparent 16px 20px); border-left: 3px solid #2a262e; border-right: 3px solid #2a262e; border-radius: 6px; }
.chain.l { left: 40px; transform: rotate(8deg); }
.chain.r { right: 40px; transform: rotate(-8deg); }
.cauldron-art { left: 0; top: 130px; width: 420px; height: 330px; }
.cauldron-art svg { width: 100%; height: 100%; filter: drop-shadow(0 16px 20px rgba(0,0,0,.5)); }
.liquid { transition: fill .6s; }
.fire-wrap { left: 60px; top: 390px; width: 300px; height: 150px; }
.fire-wrap svg { width: 100%; height: 100%; }
.fl { transform-box: fill-box; transform-origin: 50% 100%; animation: flame 1.2s ease-in-out infinite alternate; }
.fl2 { animation-duration: .9s; animation-delay: -.3s; }
.fl3 { animation-duration: .7s; animation-delay: -.5s; }
@keyframes flame { 0% { transform: scale(.85, .8) skewX(-3deg); } 100% { transform: scale(1, 1.05) skewX(4deg); } }
.st-empty .flames, .st-filled .flames, .st-done .flames, .st-burnt .flames { opacity: .35; transform: scale(.6); transform-origin: 50% 100%; transform-box: fill-box; }
.flames { transition: opacity .5s, transform .5s; }
.st-brewing .flames { opacity: 1; transform: scale(1.1); transform-origin: 50% 100%; transform-box: fill-box; }
.st-brewing .fire-wrap { filter: drop-shadow(0 0 30px rgba(245,146,58,.9)); }
.bubbles-fx { left: 0; top: 230px; width: 420px; height: 20px; pointer-events: none; }
.bubbles-fx i { position: absolute; bottom: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); animation: bubbleUp 1.2s ease-out forwards; }
.bubbles-fx i.smoke { border: 0; background: #3a3430 !important; filter: blur(4px); animation-duration: 1.2s; }
@keyframes bubbleUp { 0% { transform: translateY(0) scale(.3); opacity: 1; } 70% { opacity: .9; } 100% { transform: translateY(-120px) scale(1.2); opacity: 0; } }
.st-brewing .cauldron-art { animation: rumble .15s linear infinite; }
@keyframes rumble { 50% { transform: translate(1px, -1px); } }
#cauldron-wrap.drop-ok, #cauldron-wrap.drop-hover { outline-offset: -40px; border-radius: 50%; }
#contents { left: 150px; top: 30px; width: 200px; height: 300px; z-index: 3; }
.content-bubble { position: absolute; width: 96px; height: 96px; border-radius: 50%; padding: 12px; background: radial-gradient(circle at 35% 30%, #fff, #f4ecd8 60%, #e0d0b0);
  border: 4px solid #1c110d; box-shadow: 0 6px 12px rgba(0,0,0,.4); animation: bubPop .4s cubic-bezier(.3,1.6,.5,1) backwards, floaty 3s ease-in-out infinite;
  left: calc(var(--i) * 70px - (var(--i) > 1) * 140px); top: calc(var(--i) * 20px + (var(--i) > 1) * 90px); }
.content-bubble:nth-child(1) { left: 0; top: 60px; }
.content-bubble:nth-child(2) { left: 100px; top: 0; }
.content-bubble:nth-child(3) { left: -60px; top: 170px; }
.content-bubble:nth-child(4) { left: 60px; top: 120px; }
.content-bubble svg { width: 100%; height: 100%; }
.content-bubble:hover { transform: scale(1.08); }
@keyframes bubPop { from { transform: scale(0); } }
@keyframes floaty { 50% { translate: 0 -6px; } }
.contents-trail { display: none; }
#brew-panel { left: 830px; top: 300px; width: 460px; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 14px; }
#brew-result { width: 100%; text-align: center; color: var(--paper); }
.br-hint { font-weight: 800; font-size: 18px; opacity: .8; padding: 10px 16px; border-radius: 14px; background: rgba(0,0,0,.3); }
.br-kicker { font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); }
.br-kicker.bad { color: #ff8a7a; }
.br-name { font-family: var(--f-title); font-size: 44px; line-height: 1.05; color: #fff; text-shadow: 0 3px 0 #1a0d0b; }
.br-effects { display: flex; justify-content: center; gap: 8px; margin: 8px 0 12px; }
#brew-result p { margin: 6px 0; font-size: 17px; }
#brew-result .tip-dim { color: rgba(244,236,216,.7); }
#btn-brew { min-width: 280px; }
#btn-brew.hot { background: linear-gradient(#ffb070, #e8552f); border-color: #6a1f10; color: #fff; animation: hotPulse .6s ease-in-out infinite; font-size: 28px; }
@keyframes hotPulse { 50% { transform: scale(1.05); box-shadow: 0 4px 0 #6a1f10, 0 0 30px rgba(245,146,58,.9); } }
.small-btn { font-size: 15px; padding: 7px 14px; }
.small-btn .nav-ico { width: 22px; height: 22px; }

/* ---- bottle ---- */
.bottle-back { inset: 0; }
.bottle-back > * { position: absolute; }
.bt-wall { inset: 0; background: repeating-linear-gradient(90deg, #5a3a2a 0 98px, #4e3224 98px 102px); }
.bt-wall::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 45% 40%, rgba(255,220,150,.18), transparent 60%); }
.bt-shelf { left: 40px; width: 440px; height: 16px; background: linear-gradient(#a8744a, #7a4a2e); border: 3px solid #3a2012; border-radius: 4px; box-shadow: 0 8px 10px rgba(0,0,0,.35); }
.bt-display { left: 60px; top: 30px; width: 420px; height: 120px; filter: brightness(.85); }
.deco-bottle { position: absolute; width: 60px; height: 112px; }
.deco-bottle svg { width: 100%; height: 100%; }
.workbench { left: 0; top: 380px; width: 1600px; height: 216px; background: linear-gradient(#6b4428, #4e301c); border-top: 4px solid #3a2012; }
.workbench-top { position: absolute; left: 0; right: 0; top: 0; height: 24px; background: linear-gradient(#b27a4f, #8f5a3f); border-bottom: 4px solid #3a2012; }
#pour-station { left: 100px; top: 200px; width: 300px; height: 260px; z-index: 2; transition: transform .2s; }
#pour-station:hover:not(.empty) { transform: translateY(-4px); }
.mini-cauldron { position: absolute; left: 20px; top: 50px; width: 260px; height: 205px; }
.mini-cauldron svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 14px rgba(0,0,0,.45)); }
.ladle { position: absolute; left: 200px; top: 0; width: 20px; height: 130px; background: linear-gradient(90deg, #8a8680, #d8d4ce, #8a8680); border-radius: 10px; border: 2px solid #3a3632; transform: rotate(28deg); transform-origin: 50% 100%; z-index: 1; transition: transform .4s; }
.ladle::after { content: ''; position: absolute; left: -24px; bottom: -22px; width: 64px; height: 34px; border-radius: 0 0 32px 32px; background: linear-gradient(#b8b4ae, #7a7670); border: 3px solid #3a3632; }
.pour-label { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); padding: 4px 16px; border-radius: 12px; background: var(--gold); border: 2px solid #6a4412; font-weight: 900; font-size: 16px; opacity: 0; transition: opacity .2s; }
.pour-label:empty { display: none; }
#pour-station.ready .pour-label { opacity: 1; animation: bob 1.4s ease-in-out infinite; }
#pour-station.ready .mini-cauldron svg { animation: bellGlow 1.4s ease-in-out infinite; }
#pour-station.empty { cursor: not-allowed; }
.pouring .ladle { transform: translate(250px, -40px) rotate(-70deg); }
.stream { left: 580px; top: 90px; width: 14px; height: 0; border-radius: 7px; opacity: 0; z-index: 3; transition: height .3s .3s, opacity .2s .3s; }
.pouring .stream { height: 190px; opacity: .9; }
#bottle-stand { left: 480px; top: 30px; width: 280px; height: 500px; z-index: 2; }
.stand-bottle { position: absolute; left: 0; top: 0; width: 280px; height: 440px; }
.stand-bottle svg { width: 100%; height: 100%; }
#bottle-stand.bump .stand-bottle { animation: pop .4s; }
.stand-empty { position: absolute; left: 30px; right: 30px; top: 150px; height: 220px; border: 4px dashed rgba(244,236,216,.4); border-radius: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: rgba(244,236,216,.75); font-weight: 900; font-size: 22px; text-align: center; pointer-events: none; }
.stand-empty small { font-size: 15px; font-weight: 700; opacity: .8; }
#bottle-stand.has .stand-empty { display: none; }
.pedestal { position: absolute; left: 50px; right: 50px; top: 440px; height: 30px; border-radius: 50%; background: radial-gradient(ellipse, #c8a672, #7a5a36); border: 3px solid #3a2012; }
#bottle-steps { left: 830px; top: 30px; width: 380px; z-index: 3; padding: 18px 22px; border-radius: 18px; background: rgba(244,236,216,.95); border: 3px solid #5a3a22; box-shadow: 0 10px 24px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 8px; }
.steps-title { font-family: var(--f-title); font-size: 34px; color: #4a2410; line-height: 1; }
.step { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 12px; }
.step-n { width: 32px; height: 32px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #e0d0b0; font-weight: 900; color: #8a6a4a; }
.step.ok .step-n { background: var(--good); color: #fff; }
.step b { display: block; font-size: 17px; }
.step small { font-size: 14px; color: #7a6a5a; font-weight: 700; }
.step.ok b { color: #3f7a2a; }
#bottle-steps .btn { margin-top: 8px; }
