/* Alchemie - der Kessel des Alchemisten (ui/alchemy.js): everything under #alchemy; a ready batch blinks as #alch-ready
   left of the world boss timer. Panels .fp of imperial.css (like the Battle Pass). The kettles live: bubbles rise from a
   brewing one, the fire flickers, a ready one glows golden with sparkles (transform / opacity only). */
/* The marks left of the boss timer, one row from the right (#hud-ready, ui.js): the ready kettle, the ready grill
   (ui/cooking.js), Yang in the Abholfach of the auction house (ui/auction.js #ah-ready). 4 px left of the column of
   #wb-timer / #ev-box (social.css: right 90, 112 wide - the gap of the minimap to it); that column empty: in its place
   (.solo, ui/events.js place). Nutzer 14.11.2026: the kettle lay on the boss timer when it grew wider. */
#ui #hud-ready { position: absolute; top: 4px; right: 206px; display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 4px; pointer-events: none; }
#ui #hud-ready.solo, #ui.in-gw #hud-ready { right: 90px; }
#ui.in-fest #hud-ready { display: none; }
#ui #hud-ready > * { pointer-events: auto; }
#ui #hud-ready > #cook-ready { order: 1; }
#ui #hud-ready > #ah-ready { order: 2; }
#ui :is(#alch-ready, #cook-ready, #ah-ready) { position: relative; flex: none; width: 22px; height: 22px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
#ui :is(#alch-ready, #cook-ready, #ah-ready) img { display: block; width: 16px; height: 16px; pointer-events: none; }
#ui :is(#alch-ready, #cook-ready, #ah-ready) .et-dot { display: block; right: 1px; top: 1px; }
/* the golden blink on top of the frame (its own shadow stays) */
#ui :is(#alch-ready, #cook-ready, #ah-ready)::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px #ffd24a, 0 0 4px 1px rgba(255, 200, 80, .55);
  animation: alch-ready 1.2s ease-in-out infinite; }
#ui :is(#alch-ready, #cook-ready, #ah-ready):hover img { filter: brightness(1.25); }
#ui :is(#alch-ready, #cook-ready, #ah-ready):hover::after { animation: none; }
@keyframes alch-ready { 50% { opacity: 0; } }
/* (the HUD scales by --px on a phone: a finger = 44 CSS px) */
html.touch #ui :is(#alch-ready, #cook-ready, #ah-ready) { width: calc(44px / var(--px)); height: calc(44px / var(--px)); }
html.touch #ui :is(#alch-ready, #cook-ready, #ah-ready) img { width: 20px; height: 20px; }
#ui :is(#alchemy, #cooking) { width: 300px; }
:is(#alchemy, #cooking) .win-body { padding: 4px 5px 5px; }
:is(#alchemy, #cooking) .al-tic { flex: none; width: 10px; height: 10px; margin-right: 3px; image-rendering: auto; }

/* ---------- top: the Alchemie-Stufe ---------- */
:is(#alchemy, #cooking) .al-top .fp-b { padding: 3px 4px; }
:is(#alchemy, #cooking) .al-q { color: #c8b98c; cursor: default; }
:is(#alchemy, #cooking) .al-q.max { color: var(--green); }
#ui :is(#alchemy, #cooking) .al-xp { flex: none; width: 100%; }

/* ---------- the two columns: kettles | recipes + the chosen one (one height: the window never jumps) ---------- */
:is(#alchemy, #cooking) .al-main { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 4px; height: 268px; margin-top: 4px; }
:is(#alchemy, #cooking) .al-main .fp + .fp { margin-top: 0; }
:is(#alchemy, #cooking) .al-left { display: flex; flex-direction: column; min-height: 0; }
:is(#alchemy, #cooking) .al-right { display: flex; flex-direction: column; gap: 4px; min-height: 0; }

/* a kettle: the pot, what brews, bar, button */
:is(#alchemy, #cooking) .al-kettles { flex: 1; min-height: 0; overflow: auto; padding: 2px 3px; }
:is(#alchemy, #cooking) .al-k { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 3px; align-items: center; height: 50px; padding: 1px 1px 2px; box-shadow: inset 0 -1px 0 #2a241d; }
:is(#alchemy, #cooking) .al-k:last-child { box-shadow: none; }
:is(#alchemy, #cooking) .al-k.done { background: linear-gradient(90deg, rgba(242, 196, 90, .14), rgba(242, 196, 90, 0)); }
:is(#alchemy, #cooking) .al-kinfo { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-right: 3px; }
/* long names (a grilled fish in Hungarian) break into a second line instead of running out */
:is(#alchemy, #cooking) .al-kname { font-size: 7px; line-height: 8px; overflow-wrap: anywhere; }
:is(#alchemy, #cooking) .al-kq { font-size: 6px; line-height: 7px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#ui :is(#alchemy, #cooking) .al-kbar { flex: none; height: 9px; }
#ui :is(#alchemy, #cooking) .al-kbar > i { background: linear-gradient(#b8ffa0 0 1px, #5fd24a 1px, #2f8a25); transition: width .9s linear; }
#ui :is(#alchemy, #cooking) .al-kbar.done > i { background: linear-gradient(#ffe8a0 0 1px, #f2c45a 1px, #b8862e); }
:is(#alchemy, #cooking) .al-kbtn { margin-top: 1px; }
:is(#alchemy, #cooking) .al-kbtn > .btn { height: 11px; font-size: 7px; padding: 0 4px; }

/* the pot: 36 art px (the picture is 96 px: sharp at UI size 2), bubbles and sparkles over its rim */
:is(#alchemy, #cooking) .al-pot { position: relative; width: 36px; height: 36px; justify-self: center; }
:is(#alchemy, #cooking) .al-pot > img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: auto; pointer-events: none; z-index: 1; }
:is(#alchemy, #cooking) .al-pot.idle > img { filter: brightness(.85); }
:is(#alchemy, #cooking) .al-pot.lock > img { filter: grayscale(1) brightness(.45); }
:is(#alchemy, #cooking) .al-pot::before, :is(#alchemy, #cooking) .al-pot::after { content: ''; position: absolute; pointer-events: none; }
:is(#alchemy, #cooking) .al-pot.brew::before { left: 4px; right: 4px; top: -2px; height: 16px; border-radius: 50%; background: radial-gradient(closest-side, rgba(130, 255, 110, .55), rgba(130, 255, 110, 0));
  animation: al-glow 1.8s ease-in-out infinite alternate; z-index: 0; }
:is(#alchemy, #cooking) .al-pot.brew::after { left: 8px; right: 8px; bottom: -1px; height: 10px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 150, 50, .7), rgba(255, 90, 20, 0));
  animation: al-fire .45s steps(3) infinite alternate; z-index: 2; mix-blend-mode: screen; }
:is(#alchemy, #cooking) .al-pot.done::before { left: 0; right: 0; top: -4px; height: 22px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 215, 110, .65), rgba(255, 200, 80, 0));
  animation: al-glow 1.2s ease-in-out infinite alternate; z-index: 0; }
:is(#alchemy, #cooking) .al-bub { position: absolute; z-index: 3; bottom: 24px; left: calc(28% + var(--k) * 9%); width: 3px; height: 3px; border-radius: 50%; pointer-events: none;
  background: #b4ff9c; box-shadow: 0 0 2px #7dff5a; opacity: 0; animation: al-bub 1.7s ease-in infinite; animation-delay: calc(var(--k) * .34s); }
:is(#alchemy, #cooking) .al-bub:nth-child(odd) { width: 2px; height: 2px; animation-duration: 1.3s; }
:is(#alchemy, #cooking) .al-spark { position: absolute; z-index: 3; top: calc(2px + var(--k) * 3px); left: calc(18% + var(--k) * 24%); width: 3px; height: 3px; pointer-events: none;
  background: #fff3c0; box-shadow: 0 0 3px #ffd36a; transform: rotate(45deg) scale(0); animation: al-spark 1.5s ease-in-out infinite; animation-delay: calc(var(--k) * .5s); }
@keyframes al-bub { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: .95; } 100% { transform: translateY(-13px) scale(1.15); opacity: 0; } }
@keyframes al-glow { from { opacity: .55; transform: scale(.9); } to { opacity: 1; transform: scale(1.08); } }
@keyframes al-fire { from { opacity: .6; transform: scaleY(.85); } to { opacity: 1; transform: scaleY(1.15); } }
@keyframes al-spark { 0%, 100% { transform: rotate(45deg) scale(0); opacity: 0; } 50% { transform: rotate(45deg) scale(1.2); opacity: 1; } }

:is(#alchemy, #cooking) .al-lfoot { flex: none; padding: 2px 3px 3px; }
:is(#alchemy, #cooking) .al-msg { height: 16px; font-size: 6px; line-height: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
:is(#alchemy, #cooking) .al-all { height: 13px; font-size: 7px; }

/* the recipes */
:is(#alchemy, #cooking) .al-recs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
:is(#alchemy, #cooking) .al-list { flex: 1; min-height: 0; overflow: auto; padding: 1px; }
:is(#alchemy, #cooking) .al-row { --fp-row: 22px; cursor: pointer; }
:is(#alchemy, #cooking) .al-row .fp-t { font-size: 7px; line-height: 8px; }
:is(#alchemy, #cooking) .al-ric { width: 20px; height: 20px; }
:is(#alchemy, #cooking) .al-can { flex: none; font-size: 7px; line-height: 8px; }

/* the chosen recipe (one height for 1-4 ingredients) */
:is(#alchemy, #cooking) .al-brew { flex: none; height: 158px; display: flex; flex-direction: column; }
:is(#alchemy, #cooking) .al-brew > .fp-h > img { width: 10px; height: 10px; }
:is(#alchemy, #cooking) .al-bbody { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
:is(#alchemy, #cooking) .al-eff { height: 16px; font-size: 7px; line-height: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
:is(#alchemy, #cooking) .al-need { height: 61px; display: flex; flex-direction: column; }
:is(#alchemy, #cooking) .al-nl { display: flex; align-items: center; gap: 3px; height: 12px; padding: 0 2px; font-size: 7px; line-height: 8px; box-shadow: inset 0 -1px 0 #2a241d; }
:is(#alchemy, #cooking) .al-nl > img { flex: none; width: 10px; height: 10px; object-fit: contain; image-rendering: auto; }
:is(#alchemy, #cooking) .al-nn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e6dcc6; }
:is(#alchemy, #cooking) .al-nl > span:last-child { flex: none; }
/* the Qualität an ingredient needs (the potions of an Elixier, ticket #123): beside the name, never cut */
:is(#alchemy, #cooking) .al-nq { flex: none; white-space: nowrap; }
:is(#alchemy, #cooking) .al-sum { display: flex; justify-content: space-between; gap: 4px; font-size: 7px; line-height: 8px; color: #c8b98c; }
:is(#alchemy, #cooking) .al-sum > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(#alchemy, #cooking) .al-amt { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
:is(#alchemy, #cooking) .al-gobox > .btn { height: 15px; font-size: 8px; }
:is(#alchemy, #cooking) .al-brew .fp-note { margin-top: 1px; font-size: 6px; line-height: 7px; }
:is(#alchemy, #cooking) .fp-empty { min-height: 30px; }

/* ---------- phones: a finger for every target, the window as high as the screen and scrolling inside ---------- */
html.touch #ui :is(#alchemy, #cooking) { width: min(330px, calc((100% - 8px) / var(--wz))); height: calc((100% - 8px) / var(--wz)); display: flex; flex-direction: column; }
html.touch #ui :is(#alchemy, #cooking) .win-body { flex: 1; min-height: 0; overflow: auto; padding: 3px 4px; }
html.touch #ui :is(#alchemy, #cooking) .al-main { grid-template-columns: 132px minmax(0, 1fr); height: auto; min-height: 0; }
html.touch #ui :is(#alchemy, #cooking) .al-k { height: auto; min-height: calc(var(--finger) + 30px); }
html.touch #ui :is(#alchemy, #cooking) .al-kettles { overflow: visible; }
html.touch #ui :is(#alchemy, #cooking) .al-kbtn > .btn, html.touch #ui :is(#alchemy, #cooking) .al-all, html.touch #ui :is(#alchemy, #cooking) .al-amt > .btn, html.touch #ui :is(#alchemy, #cooking) .al-gobox > .btn { height: var(--finger); min-height: var(--finger); }
html.touch #ui :is(#alchemy, #cooking) .al-row { --fp-row: var(--finger); }
html.touch #ui :is(#alchemy, #cooking) .al-list { max-height: calc(var(--finger) * 4 + 4px); }
html.touch #ui :is(#alchemy, #cooking) .al-brew { height: auto; }
html.touch #ui :is(#alchemy, #cooking) .al-need { height: auto; }
html.touch #ui :is(#alchemy, #cooking) .al-nl { height: auto; min-height: 12px; }
html.touch #ui :is(#alchemy, #cooking) .al-amt { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.touch #ui :is(#alchemy, #cooking) .fp-h { height: 16px; line-height: 16px; }
