.alchemy {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(31, 38, 42, 0.86), rgba(19, 20, 21, 0) 170px),
        #1b1b1d;
}

.alchemy [hidden] {
    display: none !important;
}

.alchemy-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    background: #18191b;
    border-top: 1px solid #292931;
    border-bottom: 1px solid #111;
}

.alchemy-tabs__link {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 8px;
    color: #d9e2ea;
    text-align: center;
    text-decoration: none;
    background: #232429;
    border: 1px solid #292931;
    border-radius: 7px;
}

.alchemy-tabs__text {
    position: relative;
    z-index: 1;
}

.alchemy-tabs__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    overflow: hidden;
    background: rgba(4, 12, 19, 0.7);
    border: 1px solid rgba(91, 188, 255, 0.16);
    border-radius: 4px;
    pointer-events: none;
}

.alchemy-tabs__progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #2577bd, #5bbcff);
    border-radius: inherit;
    transition: width 0.9s ease;
}

.alchemy-tabs__link--skill-ready .alchemy-tabs__progress {
    display: none;
}

.alchemy-tabs__link--active {
    color: #5bbcff;
    border-color: #3b789f;
    box-shadow: inset 0 0 0 1px rgba(91, 188, 255, 0.18);
}

.alchemy-tabs__link--ready-pulse {
    animation: alchemyReadyTabPulse 1.05s ease-out both;
}

.alchemy-tab-panel {
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.alchemy-tab-panel[hidden] {
    display: none;
}

.alchemy__scene {
    position: relative;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    grid-template-rows: 160px;
    align-items: center;
    overflow: hidden;
    gap: 10px;
    padding: 8px 10px 10px;
    background:
        radial-gradient(circle at 34% 74%, rgba(46, 251, 51, 0.14), transparent 28%),
        radial-gradient(circle at 20% 10%, rgba(91, 188, 255, 0.16), transparent 34%),
        radial-gradient(circle at 82% 20%, rgba(155, 33, 248, 0.14), transparent 30%),
        linear-gradient(180deg, #272225 0%, #17191b 76%, #111 100%);
    border-bottom: 2px solid #111;
    box-shadow: inset 0 -20px 34px rgba(0, 0, 0, 0.35);
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.alchemy__scene:before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 54px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.34));
    pointer-events: none;
}

.alchemy__shelf {
    position: absolute;
    top: 13px;
    display: flex;
    gap: 5px;
    align-items: flex-end;
    padding: 5px 7px 7px;
    background: rgba(19, 20, 21, 0.72);
    border: 1px solid #292931;
    border-bottom-color: #0a0a0b;
    border-radius: 6px;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.28);
}

.alchemy__shelf--left {
    left: 10px;
}

.alchemy__shelf--right {
    right: 10px;
}

.alchemy__shelf span {
    display: block;
    width: 9px;
    height: 18px;
    background: linear-gradient(180deg, #5bbcff 0 34%, #192a2f 35% 100%);
    border: 1px solid #111;
    border-radius: 5px 5px 3px 3px;
}

.alchemy__shelf span:nth-child(2) {
    height: 23px;
    background: linear-gradient(180deg, #9b21f8 0 36%, #271730 37% 100%);
}

.alchemy__shelf span:nth-child(3) {
    height: 15px;
    background: linear-gradient(180deg, #f87721 0 35%, #332016 36% 100%);
}

.alchemy__workbench {
    position: relative;
    z-index: 1;
    grid-row: 1 / 2;
    width: 148px;
    height: 142px;
    align-self: end;
}

.alchemy__workbench:after {
    content: "";
    position: absolute;
    z-index: 0;
    left: 0;
    right: 0;
    bottom: -5px;
    height: 20px;
    background: linear-gradient(180deg, #3b281c, #211711);
    border: 1px solid #0b0705;
    border-radius: 5px;
}

.alchemy__cauldron {
    position: absolute;
    left: 20px;
    bottom: 22px;
    width: 108px;
    height: 76px;
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.12), transparent 16%),
        linear-gradient(180deg, #3d4447 0%, #1b1f21 56%, #080909 100%);
    border: 2px solid #111;
    border-radius: 14px 14px 38px 38px;
    box-shadow:
        inset 0 -11px 0 rgba(0, 0, 0, 0.3),
        0 12px 16px rgba(0, 0, 0, 0.35),
        0 0 24px rgba(61, 168, 91, 0.12);
}

.alchemy__cauldron:before {
    content: "";
    position: absolute;
    left: -9px;
    right: -9px;
    top: -11px;
    height: 22px;
    background:
        linear-gradient(180deg, #596166, #30363a);
    border: 2px solid #111;
    border-radius: 50%;
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.08);
}

.alchemy__cauldron:after {
    content: "";
    position: absolute;
    left: -15px;
    right: -15px;
    bottom: -8px;
    height: 11px;
    background: rgba(0, 0, 0, 0.42);
    border-radius: 50%;
    filter: blur(2px);
}

.alchemy__liquid {
    position: absolute;
    z-index: 1;
    left: 9px;
    right: 9px;
    top: -6px;
    height: 12px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 26% 28%, rgba(255, 255, 255, 0.58), transparent 13%),
        radial-gradient(ellipse at 70% 64%, rgba(155, 33, 248, 0.42), transparent 38%),
        linear-gradient(105deg, #34d96b 0%, #34c6cf 42%, #7653f2 78%, #9b21f8 100%);
    background-size: 100% 100%, 120% 120%, 180% 100%;
    border: 1px solid rgba(171, 242, 255, 0.26);
    border-radius: 50%;
    opacity: 0;
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.24),
        inset 0 -5px 8px rgba(17, 8, 34, 0.34),
        0 0 18px rgba(91, 188, 255, 0.28);
    transition: opacity 0.22s ease;
    transform-origin: center center;
    animation: alchemyLiquid 3.2s ease-in-out infinite;
}

.alchemy__liquid:before,
.alchemy__liquid:after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.alchemy__liquid:before {
    left: -8px;
    right: -8px;
    top: -4px;
    height: 11px;
    background:
        radial-gradient(ellipse at 16% 55%, rgba(255, 255, 255, 0.62) 0 8%, transparent 9%),
        radial-gradient(ellipse at 42% 48%, rgba(255, 255, 255, 0.34) 0 6%, transparent 7%),
        radial-gradient(ellipse at 76% 52%, rgba(255, 255, 255, 0.44) 0 7%, transparent 8%),
        linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(226, 255, 248, 0.34), rgba(255, 255, 255, 0));
    border-radius: 50%;
    opacity: 0.78;
    animation: alchemyLiquidWave 2.4s ease-in-out infinite;
}

.alchemy__liquid:after {
    inset: 2px 4px 3px;
    background:
        radial-gradient(circle at 30% 58%, rgba(246, 238, 113, 0.42), transparent 12%),
        radial-gradient(circle at 66% 42%, rgba(91, 188, 255, 0.58), transparent 16%);
    border-radius: 50%;
    mix-blend-mode: screen;
    opacity: 0.44;
    animation: alchemyLiquidGlow 2.8s ease-in-out infinite alternate;
}

.alchemy--cooking .alchemy__liquid {
    opacity: 0.92;
    animation-duration: 1.6s;
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.24),
        inset 0 -5px 8px rgba(17, 8, 34, 0.34),
        0 0 18px rgba(91, 188, 255, 0.42),
        0 0 32px rgba(46, 251, 51, 0.22);
}

.alchemy__flame {
    position: absolute;
    z-index: 0;
    left: 51px;
    bottom: 11px;
    width: 46px;
    height: 54px;
    background:
        radial-gradient(circle at 52% 74%, #f6ee71 0 18%, transparent 19%),
        radial-gradient(circle at 50% 70%, #f1d600 0 26%, #f87721 44%, rgba(248, 119, 33, 0.22) 62%, transparent 70%);
    filter: blur(0.2px);
    transform-origin: center bottom;
    animation: alchemyFlame 0.9s ease-in-out infinite alternate;
}

.alchemy--cooking .alchemy__flame {
    animation-duration: 0.42s;
}

.alchemy__bubble,
.alchemy__steam {
    position: absolute;
    z-index: 2;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.alchemy__bubble {
    width: 9px;
    height: 9px;
    border: 1px solid rgba(91, 188, 255, 0.9);
    animation: alchemyBubble 2.4s linear infinite;
}

.alchemy--cooking .alchemy__bubble {
    animation-duration: 1.15s;
}

.alchemy__bubble--one {
    left: 28px;
    top: -9px;
}

.alchemy__bubble--two {
    left: 54px;
    top: -2px;
    animation-delay: 0.7s;
}

.alchemy__bubble--three {
    left: 76px;
    top: -10px;
    animation-delay: 1.35s;
}

.alchemy__steam {
    width: 14px;
    height: 22px;
    border-left: 2px solid rgba(175, 180, 186, 0.28);
    transform: rotate(12deg);
    animation: alchemySteam 2.8s ease-in-out infinite;
}

.alchemy__steam--one {
    left: 29px;
    top: -34px;
}

.alchemy__steam--two {
    right: 30px;
    top: -31px;
    animation-delay: 0.8s;
    transform: rotate(-12deg);
}

.alchemy__spark {
    position: absolute;
    z-index: 3;
    width: 4px;
    height: 4px;
    background: #f6ee71;
    border-radius: 50%;
    box-shadow: 0 0 6px #f87721;
    opacity: 0;
    animation: alchemySpark 2.2s linear infinite;
}

.alchemy:not(.alchemy--cooking) .alchemy__bubble,
.alchemy:not(.alchemy--cooking) .alchemy__steam {
    display: none;
}

.alchemy__spark--one {
    left: 42px;
    top: 54px;
}

.alchemy__spark--two {
    left: 112px;
    top: 74px;
    animation-delay: 0.65s;
}

.alchemy__spark--three {
    left: 84px;
    top: 34px;
    animation-delay: 1.25s;
}

.alchemy__result {
    position: absolute;
    z-index: 5;
    left: 26px;
    top: -36px;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.24), rgba(91, 188, 255, 0.1) 54%, transparent 72%);
    border-radius: 50%;
    pointer-events: none;
}

.alchemy__result[hidden] {
    display: none;
}

.alchemy__result img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 7px rgba(91, 188, 255, 0.65));
}

.alchemy__result--show {
    animation: alchemyResult 1.45s ease-out both;
}

.alchemy__result--sending {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-18px) scale(0.82);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}

.alchemy-ready-fly {
    position: fixed;
    z-index: 9999;
    object-fit: contain;
    pointer-events: none;
    will-change: transform, opacity;
    filter:
        drop-shadow(0 0 8px rgba(91, 188, 255, 0.72))
        drop-shadow(0 0 14px rgba(46, 251, 51, 0.34));
    transform-origin: center center;
}

.alchemy__scene-text {
    position: relative;
    z-index: 1;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: grid;
    gap: 5px;
    align-self: center;
    padding: 17px 10px;
    line-height: 1.35;
    text-align: center;
    background: rgba(19, 20, 21, 0.58);
    border: 1px solid rgba(41, 41, 49, 0.82);
    border-radius: 7px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.alchemy__scene-text > .gems {
    font-size: 24px;
    line-height: 1.05;
    text-shadow: 0 0 9px rgba(91, 188, 255, 0.38);
}

.alchemy__scene-note {
    min-height: 17px;
    color: #afb4ba;
    font-size: 12px;
}

.alchemy__brew {
    position: absolute;
    z-index: 4;
    left: 2px;
    right: 2px;
    bottom: -1px;
    height: 16px;
    pointer-events: none;
}

.alchemy__brew[hidden] {
    display: none;
}

.alchemy__brew-track {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #070808;
    border: 1px solid #0b0705;
    border-top-color: #4a3322;
    border-left-color: #4a3322;
    border-radius: 5px;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.8),
        0 0 8px rgba(46, 251, 51, 0.14);
}

.alchemy__brew-track span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #28462d 0%, #7fc735 46%, #2efb33 100%);
    box-shadow: 0 0 9px rgba(46, 251, 51, 0.5);
    transition-property: width;
    transition-timing-function: linear;
}

.alchemy__brew-time {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #ececec;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 2px #000, 0 0 5px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
}

.alchemy-current[hidden] {
    display: none;
}

.alchemy-current {
    display: grid;
    gap: 8px;
}

.alchemy-current__title {
    color: #f6ee71;
    font-family: Georgia, serif;
    font-size: 17px;
    line-height: 1.1;
    text-shadow: 0 0 8px rgba(246, 238, 113, 0.22);
}

.alchemy-current__body {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    text-align: left;
}

.alchemy-current__img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background:
        radial-gradient(circle at 50% 42%, rgba(46, 251, 51, 0.13), transparent 62%),
        #111315;
    border: 1px solid #292931;
    border-radius: 7px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 10px rgba(91, 188, 255, 0.16);
}

.alchemy-current__info {
    min-width: 0;
}

.alchemy-current__name {
    overflow: hidden;
    color: #2efb33;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alchemy-current__name.gems {
    color: #5bbcff;
}

.alchemy-current__name.rarity_1,
.alchemy-current__name.rarity_2 {
    color: #c5c5c5;
}

.alchemy-current__name.rarity_3,
.alchemy-current__name.rarity_4 {
    color: #3da85b;
}

.alchemy-current__name.rarity_5,
.alchemy-current__name.rarity_6 {
    color: #00aced;
}

.alchemy-current__name.rarity_7,
.alchemy-current__name.rarity_8 {
    color: #9b21f8;
}

.alchemy-current__name.rarity_9,
.alchemy-current__name.rarity_10 {
    color: #f87721;
}

.alchemy-current__name.rarity_11,
.alchemy-current__name.rarity_12,
.alchemy-current__name.rarity_13 {
    color: #d83a3a;
}

.alchemy-current__name.rarity_14 {
    color: #e19efb;
}

.alchemy-current__desc {
    margin-top: 3px;
    overflow: hidden;
    color: #afb4ba;
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alchemy-current__state {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 10px;
    color: #2efb33;
    font-size: 12px;
    line-height: 1.2;
    background: rgba(27, 31, 33, 0.86);
    border: 1px solid rgba(46, 251, 51, 0.28);
    border-radius: 5px;
}

.alchemy-current__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.alchemy-current__actions .btn {
    min-width: 0 !important;
    height: 34px;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 14px;
}

.alchemy-current__cancel {
    color: #ececec;
    background: #8a2f25 linear-gradient(#8a2f25 50%, #692018 50%);
    border-color: #a94739 #a94739 #4e1712 #4e1712;
}

.alchemy-current__speedup[hidden] + .alchemy-current__cancel {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(210px, 100%);
}

.alchemy-current__receive {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(220px, 100%);
}

.alchemy--busy .alchemy__scene-text > .gems,
.alchemy--busy .alchemy__scene-text > .strong,
.alchemy--busy .alchemy__scene-text > .alchemy__scene-note {
    display: none;
}

.alchemy__status {
    margin: 8px;
    padding: 8px 10px;
    text-align: center;
    line-height: 1.35;
    background: #232429;
    border: 1px solid #111;
    border-left-color: #292931;
    border-radius: 7px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.alchemy__status--ok {
    color: #2efb33;
}

.alchemy__status--error {
    color: #fa2f4d;
}

.alchemy-guild-gift-alert {
    position: fixed;
    z-index: 10020;
    top: max(0px, env(safe-area-inset-top));
    left: 50%;
    width: min(600px, 100vw);
    box-sizing: border-box;
    transform: translateX(-50%);
    pointer-events: none;
}

.alchemy-guild-gift-alert .alert__event {
    position: static;
    width: 100%;
}

.alchemy__section {
    position: relative;
}

.alchemy-skill {
    margin: 8px;
    padding: 10px;
    border: 1px solid #292931;
    border-radius: 8px;
}

.alchemy-skill__head {
    display: grid;
    grid-template-columns: minmax(20px, 1fr) auto minmax(20px, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    color: #5bbcff;
    font-size: 18px;
    text-align: center;
}

.alchemy-skill__head span {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(91, 188, 255, 0.46), transparent);
}

.alchemy-skill__body {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.alchemy-skill__emblem {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.alchemy-skill__seal {
    display: grid;
    place-items: center;
    width: 120px;
    height: 120px;
    background:
        radial-gradient(circle, rgba(91, 188, 255, 0.24), rgba(91, 188, 255, 0.04) 58%, transparent 60%),
        #101419;
    border: 2px solid rgba(91, 188, 255, 0.38);
    border-radius: 50%;
    box-shadow:
        inset 0 0 18px rgba(91, 188, 255, 0.14),
        0 0 22px rgba(91, 188, 255, 0.13);
    perspective: 420px;
}

.alchemy-skill__seal img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(91, 188, 255, 0.42));
    transform-origin: center center;
    transform-style: preserve-3d;
    backface-visibility: visible;
}

.alchemy-skill--level-up .alchemy-skill__seal {
    animation: alchemySkillSealUp 1.35s ease-out both;
}

.alchemy-skill--level-up .alchemy-skill__seal img {
    animation: alchemySkillIconUp 1.35s ease-out both;
}

.alchemy-skill__level {
    min-width: 96px;
    padding: 7px 10px;
    color: #d7efff;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(180deg, #244b68, #102334);
    border: 1px solid rgba(91, 188, 255, 0.42);
    border-radius: 7px;
}

.alchemy-skill--level-up .alchemy-skill__level {
    animation: alchemySkillLevelGlow 1.2s ease-out both;
}

.alchemy-skill__level-value--pop {
    display: inline-block;
    animation: alchemySkillLevelPop 0.48s cubic-bezier(0.2, 0.82, 0.24, 1.18) both;
}

.alchemy-skill__content {
    min-width: 0;
}

.alchemy-skill__progress-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    color: #d9e2ea;
}

.alchemy-skill__progress {
    overflow: hidden;
    height: 18px;
    margin-bottom: 12px;
    background: #0d0e10;
    border: 1px solid #292931;
    border-radius: 9px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.alchemy-skill__progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2577bd, #5bbcff);
    border-radius: inherit;
    box-shadow: 0 0 12px rgba(91, 188, 255, 0.38);
}

.alchemy-skill__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.alchemy-skill__card {
    display: grid;
    gap: 5px;
    justify-items: center;
    min-height: 148px;
    padding: 10px 8px;
    text-align: center;
    background: rgba(19, 20, 21, 0.72);
    border: 1px solid #292931;
    border-radius: 7px;
}

.alchemy-skill__card img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.alchemy-skill__card b {
    color: #d9e2ea;
}

.alchemy-skill__card span {
    color: #9fb0bf;
    font-size: 12px;
    line-height: 1.25;
}

.alchemy-skill__card strong {
    align-self: end;
    min-width: 86px;
    padding: 5px 8px;
    font-size: 18px;
    background: rgba(4, 12, 19, 0.68);
    border: 1px solid rgba(91, 188, 255, 0.22);
    border-radius: 6px;
}

.alchemy-skill__card--speed strong {
    color: #8dff82;
}

.alchemy-skill__card--duration strong {
    color: #e18cff;
}

.alchemy-skill__card--upgraded {
    animation: alchemySkillCardUp 1.25s ease-out both;
}

.alchemy-skill__card--upgraded img {
    animation: alchemySkillCardIconUp 1.25s ease-out both;
}

.alchemy-skill__card--upgraded strong {
    animation: alchemySkillCardValueUp 1.05s ease-out both;
}

.alchemy-skill__next {
    margin-top: 10px;
    padding: 8px 10px;
    color: #9fb0bf;
    font-size: 13px;
    text-align: center;
    background: rgba(4, 12, 19, 0.44);
    border: 1px solid #292931;
    border-radius: 7px;
}

.alchemy-skill__upgrade {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.alchemy-skill__upgrade .btn_disabled {
    cursor: pointer;
    pointer-events: auto;
}

.alchemy__section-title {
    padding: 8px 10px;
    text-align: center;
    background:
        linear-gradient(90deg, transparent, rgba(91, 188, 255, 0.08), transparent),
        #202022;
    border-top: 1px solid #292931;
    border-bottom: 1px solid #111;
}

.alchemy-recipes,
.alchemy-inventory {
    display: grid;
    gap: 0;
    -webkit-tap-highlight-color: transparent;
}

.alchemy-recipe {
    position: relative;
    display: flex;
    gap: 9px;
    padding: 10px 8px;
    background:
        linear-gradient(90deg, rgba(91, 188, 255, 0.035), transparent 42%),
        #1b1b1d;
    border-bottom: 1px solid #111;
}

.alchemy-recipe__skill-required {
    margin-top: 10px;
    padding: 8px 10px;
    color: #e8445e;
    text-align: center;
    border-radius: 6px;
}

.alchemy-recipe:nth-child(even),
.alchemy-inventory__item:nth-child(even) {
    background:
        linear-gradient(90deg, rgba(155, 33, 248, 0.035), transparent 44%),
        #232429;
}

.alchemy-recipe--locked {
    opacity: 0.68;
}

.alchemy-recipe--busy {
    filter: brightness(1.12);
}

.alchemy-recipe--current-brew {
    box-shadow: inset 3px 0 0 rgba(46, 251, 51, 0.72);
}

.alchemy-recipe--busy:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(91, 188, 255, 0.08), transparent);
    animation: alchemyRowBusy 1.1s linear infinite;
    pointer-events: none;
}

.alchemy-recipe__view {
    height: fit-content;
    display: flex;
    flex-direction: column;
    align-items: start;
    padding-left: 10px;
    gap: 5px;
}

.alchemy-recipe__img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background:
        radial-gradient(circle at 50% 45%, rgba(91, 188, 255, 0.12), transparent 62%),
        #131415;
    border: 1px solid #292931;
    border-radius: 7px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 2px 0 rgba(0, 0, 0, 0.34);
}

.alchemy-recipe__body {
    min-width: 0;
    flex: 1;
}

.alchemy-recipe__head {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

.alchemy-recipe__head > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.alchemy-recipe__count {
    flex: 0 0 auto;
    padding: 5px 0;
}

.alchemy-recipe__timer {
    flex: 0 0 auto;
    align-self: flex-start;
    padding: 2px 5px;
    color: #2efb33;
    font-size: 14px;
    line-height: 1.2;
    background: rgba(19, 20, 21, 0.78);
    border: 1px solid rgba(46, 251, 51, 0.34);
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(46, 251, 51, 0.12);
    white-space: nowrap;
}

.alchemy-recipe__meta {
    display: flex;
    flex-wrap: wrap;
    color: #5bbcff;
    line-height: 1.25;
    font-size: 14px;
}

.alchemy-potion-timer {
    flex: 0 0 auto;
    align-self: flex-start;
    padding: 2px 6px;
    color: #2efb33;
    font-size: 13px;
    line-height: 1.2;
    background: rgba(19, 20, 21, 0.78);
    border: 1px solid rgba(46, 251, 51, 0.34);
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(46, 251, 51, 0.12);
    white-space: nowrap;
}

.alchemy-recipe__desc {
    color: #afb4ba;
    font-size: 14px;
    line-height: 1.35;
}

.alchemy-recipe__ingredients {
    justify-content: center;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.alchemy-ingredient-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    min-height: 24px;
    padding: 2px 6px;
    color: #ececec;
    font-size: 14px;
    line-height: 1.2;
    background: #131415;
    border: 1px solid #292931;
    border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.alchemy-ingredient-chip img {
    border-radius: 50%;
    background: #081018;
}

.alchemy-ingredient-chip--miss {
    color: #fa2f4d;
    border-color: rgba(250, 47, 77, 0.35);
}

.alchemy-missing-line {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.alchemy-recipe__actions button[data-missing] {
    cursor: pointer;
    pointer-events: auto;
}

.alchemy-recipe__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
}

.alchemy-recipe__amount {
    width: 50px;
    height: 34px;
    color: #ececec;
    text-align: center;
    background: #313436;
    border: 1px solid #111;
    border-top-color: #4a4f52;
    border-left-color: #4a4f52;
    border-radius: 5px;
    box-sizing: border-box;
}

.alchemy-recipe__actions .btn {
    min-width: 104px;
    height: 36px;
    font-size: 16px;
}

.alchemy-recipe__speedup-btn {
    min-width: 102px !important;
    padding-left: 8px;
    padding-right: 8px;
    color: #ececec;
    background: #956127 linear-gradient(#956127 50%, #885117 50%);
    border-color: #aa6d2a #aa6d2a #6a4015 #6a4015;
}

.alchemy-recipe__speedup-btn--ready {
    box-shadow: 0 0 10px rgba(248, 119, 33, 0.34);
}

.alchemy-recipe__speedup-btn.btn_disabled {
    opacity: 0.72;
    background: #5f5f5f -webkit-gradient(linear, left top, left bottom, color-stop(50%, #555), color-stop(50%, #464646));
    background: #5f5f5f linear-gradient(#555 50%, #464646 50%);
    border-color: #606060 #606060 #373737 #373737;
}

.alchemy-recipe__instant-btn {
    min-width: 118px !important;
    gap: 2px;
    padding-left: 8px;
    padding-right: 8px;
}

.alchemy--busy .alchemy-recipe[data-recipe-id] .alchemy-recipe__actions {
    display: none;
}

.alchemy-inventory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alchemy-pet-bonus-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
}

.alchemy-pet-bonus-list .pet-bonus-list__item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.alchemy-inventory__item {
    min-width: 0;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: center;
    min-height: 42px;
    padding: 7px 8px;
    border-bottom: 1px solid #111;
}

.alchemy-inventory__item.js-alchemy-ingredient-source {
    cursor: pointer;
}

.alchemy-inventory__img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    padding: 2px;
    box-sizing: border-box;
    background: #081018;
    border: 1px solid #292931;
    border-radius: 50%;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.45));
}

.alchemy-inventory__name {
    overflow: hidden;
    color: #ececec;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.alchemy-inventory__count {
    min-width: 20px;
    color: #5bbcff;
    font-size: 12px;
    text-align: right;
}

.alchemy-inventory__item--updated {
    animation: alchemyInventoryItemUpdated 1.35s ease-out both;
}

.alchemy-inventory__count--updated {
    animation: alchemyInventoryCountUpdated 1.35s ease-out both;
}

.alchemy-guild-gift--closing {
    animation: alchemyGuildGiftClose 0.5s ease forwards;
}

.alchemy-source-pop {
    display: inline-flex;
    min-width: 190px;
    max-width: 270px;
    flex-direction: column;
    gap: 7px;
    text-align: left;
}

.alchemy-source-pop__title {
    color: #5bbcff;
    font-weight: 700;
    text-align: center;
}

.alchemy-source-pop__row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.alchemy-source-pop__boss {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    object-fit: cover;
    border-radius: 50%;
    background: #081018;
}

.alchemy-source-pop__text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.alchemy-source-pop__text b {
    color: #f2f2f2;
    font-weight: 700;
}

.alchemy-source-pop__text small {
    color: #b7c1ca;
    font-size: 11px;
}

.alchemy-fly {
    position: fixed;
    z-index: 10000;
    object-fit: contain;
    pointer-events: none;
    transform-origin: 50% 70%;
    filter:
        drop-shadow(0 2px 1px rgba(0, 0, 0, 0.48))
        drop-shadow(0 0 5px rgba(91, 188, 255, 0.48));
    animation: alchemyFly 0.92s cubic-bezier(0.22, 0.7, 0.18, 1) forwards;
}

.alchemy-fly--guild-gift {
    animation-duration: 1.65s;
    animation-timing-function: cubic-bezier(0.18, 0.68, 0.16, 1);
}

.alchemy-splash {
    position: fixed;
    z-index: 9999;
    width: 18px;
    height: 10px;
    pointer-events: none;
    border: 1px solid rgba(171, 242, 255, 0.62);
    border-radius: 50%;
    background:
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.42), rgba(91, 188, 255, 0.18) 48%, transparent 72%);
    box-shadow: 0 0 8px rgba(91, 188, 255, 0.36);
    animation: alchemySplash 0.34s ease-out forwards;
}

@keyframes alchemyLiquidWave {
    0%, 100% {
        transform: translateX(-5px) translateY(0) scaleX(1.02);
        opacity: 0.58;
    }
    50% {
        transform: translateX(5px) translateY(2px) scaleX(0.96);
        opacity: 0.9;
    }
}

@keyframes alchemyLiquidGlow {
    from {
        transform: translateX(-3px) scale(0.94);
        opacity: 0.32;
    }
    to {
        transform: translateX(4px) scale(1.04);
        opacity: 0.56;
    }
}

@keyframes alchemyFlame {
    from {
        transform: scaleY(0.9);
        opacity: 0.72;
    }
    to {
        transform: scaleY(1.08);
        opacity: 0.98;
    }
}

@keyframes alchemyBubble {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(-54px) scale(1.25);
        opacity: 0;
    }
}

@keyframes alchemySteam {
    0% {
        transform: translateY(8px) rotate(10deg) scale(0.7);
        opacity: 0;
    }
    35% {
        opacity: 0.55;
    }
    100% {
        transform: translateY(-22px) rotate(-8deg) scale(1.08);
        opacity: 0;
    }
}

@keyframes alchemySpark {
    0% {
        transform: translateY(0) scale(0.6);
        opacity: 0;
    }
    16% {
        opacity: 0.95;
    }
    100% {
        transform: translateY(-34px) translateX(8px) scale(0.2);
        opacity: 0;
    }
}

@keyframes alchemyFly {
    0% {
        transform: translate3d(0, -8px, 0) scale(0.68) rotate(var(--alchemy-fly-rotate-start));
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    54% {
        transform: translate3d(calc(var(--alchemy-fly-x) * 0.34 + var(--alchemy-fly-arc)), calc(var(--alchemy-fly-y) * 0.48), 0) scale(1) rotate(calc(var(--alchemy-fly-rotate-start) * -0.35));
        opacity: 1;
    }
    82% {
        transform: translate3d(calc(var(--alchemy-fly-x) * 0.88), calc(var(--alchemy-fly-y) - 10px), 0) scale(0.92) rotate(var(--alchemy-fly-rotate-end));
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--alchemy-fly-x), var(--alchemy-fly-y), 0) scale(0.38) rotate(var(--alchemy-fly-rotate-end));
        opacity: 0;
    }
}

@keyframes alchemySplash {
    0% {
        transform: scale(0.4);
        opacity: 0.85;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

@keyframes alchemyInventoryItemUpdated {
    0% {
        background: rgba(91, 188, 255, 0);
        box-shadow: inset 0 0 0 0 rgba(91, 188, 255, 0);
    }
    35% {
        background: rgba(91, 188, 255, 0.12);
        box-shadow: inset 0 0 0 1px rgba(91, 188, 255, 0.42);
    }
    100% {
        background: rgba(91, 188, 255, 0);
        box-shadow: inset 0 0 0 0 rgba(91, 188, 255, 0);
    }
}

@keyframes alchemyInventoryCountUpdated {
    0% {
        transform: scale(1);
    }
    35% {
        color: #2efb33;
        transform: scale(1.45);
        text-shadow: 0 0 9px rgba(46, 251, 51, 0.7);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes alchemyGuildGiftClose {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(16px);
        opacity: 0;
    }
}

@keyframes alchemyResult {
    0% {
        transform: translateY(28px) scale(0.45);
        opacity: 0;
    }
    28% {
        transform: translateY(-8px) scale(1.12);
        opacity: 1;
    }
    68% {
        transform: translateY(-18px) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-28px) scale(0.9);
        opacity: 0;
    }
}

@keyframes alchemyReadyTabPulse {
    0% {
        color: #d9e2ea;
        border-color: #292931;
        box-shadow: inset 0 0 0 1px rgba(91, 188, 255, 0);
    }
    18% {
        color: #2efb33;
        border-color: #2efb33;
        box-shadow:
            inset 0 0 0 1px rgba(46, 251, 51, 0.28),
            0 0 16px rgba(46, 251, 51, 0.4);
    }
    58% {
        color: #2efb33;
        border-color: #2efb33;
        box-shadow:
            inset 0 0 0 1px rgba(46, 251, 51, 0.22),
            0 0 12px rgba(46, 251, 51, 0.3);
    }
    100% {
        color: #d9e2ea;
        border-color: #292931;
        box-shadow: inset 0 0 0 1px rgba(91, 188, 255, 0);
    }
}

@keyframes alchemySkillSealUp {
    0% {
        transform: scale(1);
        border-color: rgba(91, 188, 255, 0.38);
        box-shadow:
            inset 0 0 18px rgba(91, 188, 255, 0.14),
            0 0 22px rgba(91, 188, 255, 0.13);
    }
    42% {
        transform: scale(1.08);
        border-color: rgba(46, 251, 51, 0.82);
        box-shadow:
            inset 0 0 24px rgba(46, 251, 51, 0.22),
            0 0 24px rgba(46, 251, 51, 0.34),
            0 0 44px rgba(91, 188, 255, 0.28);
    }
    100% {
        transform: scale(1);
        border-color: rgba(91, 188, 255, 0.38);
        box-shadow:
            inset 0 0 18px rgba(91, 188, 255, 0.14),
            0 0 22px rgba(91, 188, 255, 0.13);
    }
}

@keyframes alchemySkillIconUp {
    0% {
        transform: translateX(0) rotate3d(0, 1, 0, 0deg) scale(1);
        filter: drop-shadow(0 0 8px rgba(91, 188, 255, 0.42));
    }
    40% {
        transform: translateX(-3px) rotate3d(0, 1, 0, 210deg) scale(1.12);
        filter:
            drop-shadow(0 0 10px rgba(46, 251, 51, 0.65))
            drop-shadow(0 0 18px rgba(91, 188, 255, 0.42));
    }
    100% {
        transform: translateX(0) rotate3d(0, 1, 0, 360deg) scale(1);
        filter: drop-shadow(0 0 8px rgba(91, 188, 255, 0.42));
    }
}

@keyframes alchemySkillLevelGlow {
    0% {
        color: #d7efff;
        border-color: rgba(91, 188, 255, 0.42);
    }
    46% {
        color: #fff;
        border-color: rgba(46, 251, 51, 0.88);
        box-shadow: 0 0 16px rgba(46, 251, 51, 0.34);
    }
    100% {
        color: #d7efff;
        border-color: rgba(91, 188, 255, 0.42);
        box-shadow: none;
    }
}

@keyframes alchemySkillLevelPop {
    0% {
        transform: translateY(5px) scale(0.72);
        opacity: 0;
    }
    70% {
        transform: translateY(-1px) scale(1.18);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes alchemySkillCardUp {
    0% {
        border-color: #292931;
        background: rgba(19, 20, 21, 0.72);
        box-shadow: none;
    }
    38% {
        border-color: rgba(46, 251, 51, 0.78);
        background:
            radial-gradient(circle at 50% 18%, rgba(46, 251, 51, 0.16), transparent 48%),
            rgba(19, 28, 21, 0.92);
        box-shadow:
            inset 0 0 18px rgba(46, 251, 51, 0.12),
            0 0 18px rgba(46, 251, 51, 0.24);
    }
    100% {
        border-color: #292931;
        background: rgba(19, 20, 21, 0.72);
        box-shadow: none;
    }
}

@keyframes alchemySkillCardIconUp {
    0% {
        transform: translateY(0) scale(1);
        filter: none;
    }
    35% {
        transform: translateY(-5px) scale(1.16);
        filter:
            drop-shadow(0 0 9px rgba(46, 251, 51, 0.58))
            drop-shadow(0 0 16px rgba(91, 188, 255, 0.36));
    }
    100% {
        transform: translateY(0) scale(1);
        filter: none;
    }
}

@keyframes alchemySkillCardValueUp {
    0% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.12);
        border-color: rgba(46, 251, 51, 0.72);
        box-shadow: 0 0 12px rgba(46, 251, 51, 0.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes alchemyRowBusy {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 500px) {
    #alchemySkill .alchemy-skill__body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 340px) {
    .alchemy-tabs {
        grid-template-columns: 1fr;
    }

    .alchemy-skill__body {
        grid-template-columns: 1fr;
    }

    .alchemy-skill__cards {
        grid-template-columns: 1fr;
    }

    .alchemy__scene {
        grid-template-columns: 132px minmax(0, 1fr);
        padding-left: 6px;
        padding-right: 6px;
    }

    .alchemy__workbench {
        transform: translateX(-5px) scale(0.92);
        transform-origin: left bottom;
    }

    .alchemy__scene-text {
        padding-left: 6px;
        padding-right: 6px;
    }

    .alchemy__scene-text > .gems {
        font-size: 21px;
    }

    .alchemy-current__body {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 6px;
    }

    .alchemy-current__img {
        width: 44px;
        height: 44px;
    }

    .alchemy-current__title {
        font-size: 15px;
    }

    .alchemy-current__name {
        font-size: 14px;
    }

    .alchemy-current__actions {
        gap: 6px;
    }

    .alchemy-current__actions .btn {
        height: 32px;
        font-size: 13px;
    }

    .alchemy-recipe {
        gap: 7px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .alchemy-recipe__view {
        flex-basis: 60px;
    }

    .alchemy-recipe__actions .btn {
        min-width: 92px;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .alchemy *,
    .alchemy-fly {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
