/* ============================================
   POTION BREWING - Styles
   ============================================ */

/* Variables */
:root {
    --wood-dark: #2a1810;
    --wood-medium: #4a3020;
    --wood-light: #6b4a35;
    --wood-highlight: #8b6a50;
    --copper: #b87333;
    --copper-dark: #8b5a2b;
    --copper-highlight: #cd853f;
    --flame-orange: #ff6600;
    --flame-yellow: #ffcc00;
    --flame-red: #ff3300;
    --text-light: #e8dcc8;
    --text-muted: #a89888;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Metamorphous', cursive;
    background: var(--wood-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Layers */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(139, 69, 19, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(255, 102, 0, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 102, 0, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, #1a0c06 0%, #2a1810 50%, #1a0c06 100%);
    z-index: -2;
}

.wood-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(0, 0, 0, 0.03) 1px,
            transparent 2px,
            transparent 20px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            rgba(139, 69, 19, 0.05) 100px,
            transparent 200px
        );
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9em;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.back-link:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.back-link .arrow {
    font-size: 1.2em;
}

/* Header Banner */
.header-banner {
    text-align: center;
    margin-bottom: 30px;
}

.wood-plate {
    display: inline-block;
    padding: 20px 60px;
    background:
        linear-gradient(180deg, var(--wood-light) 0%, var(--wood-medium) 50%, var(--wood-dark) 100%);
    border-radius: 8px;
    border: 3px solid var(--wood-highlight);
    box-shadow:
        0 4px 20px var(--shadow-color),
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.wood-plate h1 {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(180deg, var(--flame-yellow) 0%, var(--flame-orange) 50%, var(--flame-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(255, 102, 0, 0.5));
}

.subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    color: var(--text-muted);
    margin-top: 8px;
    letter-spacing: 2px;
}

/* Main Workshop Layout */
.workshop {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1000px) {
    .workshop {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .bottle-rack,
    .ingredient-shelves {
        display: flex;
        flex-direction: column;
    }

    .bottle-shelf,
    .ingredient-containers {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
}

/* Bottle Rack */
.bottle-rack {
    background:
        linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid var(--wood-light);
    box-shadow:
        0 4px 15px var(--shadow-color),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.rack-header,
.shelf-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--wood-light);
}

.rack-header h2,
.shelf-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.3em;
    color: var(--copper-highlight);
}

.rack-subtitle,
.shelf-subtitle {
    font-size: 0.8em;
    color: var(--text-muted);
}

.bottle-shelf {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bottle-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bottle-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--copper);
}

.bottle-option.selected {
    background: rgba(184, 115, 51, 0.2);
    border-color: var(--copper-highlight);
    box-shadow: 0 0 15px rgba(184, 115, 51, 0.3);
}

.bottle-option.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.bottle-visual {
    width: 40px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottle-svg {
    width: 100%;
    height: 100%;
}

.bottle-info {
    flex: 1;
}

.bottle-name {
    font-size: 0.9em;
    color: var(--text-light);
}

.bottle-doses {
    font-size: 0.75em;
    color: var(--text-muted);
}

/* Brewing Station */
.brewing-station {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Cauldron Area */
.cauldron-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cauldron-label {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.cauldron {
    position: relative;
    width: 300px;
    height: 200px;
    transition: all 0.3s ease;
}

.cauldron.can-drop {
    filter: drop-shadow(0 0 20px rgba(255, 200, 100, 0.4));
}

.cauldron.drag-over {
    filter: drop-shadow(0 0 30px rgba(255, 200, 100, 0.6));
    transform: scale(1.02);
}

.cauldron-interior {
    position: absolute;
    top: 20px;
    left: 30px;
    right: 30px;
    bottom: 30px;
    background:
        radial-gradient(ellipse at 50% 100%, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 0 0 50% 50%;
    overflow: hidden;
    box-shadow:
        inset 0 10px 30px rgba(0, 0, 0, 0.8),
        inset 0 -5px 15px rgba(50, 50, 50, 0.3);
}

.cauldron-liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    border-radius: 0 0 50% 50%;
    opacity: 0;
    transition: all 0.5s ease;
}

.cauldron-liquid.brewing {
    animation: bubble 0.5s ease-in-out infinite;
}

@keyframes bubble {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.ingredient-slots {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    z-index: 2;
}

.ingredient-slot {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ingredient-slot.filled {
    background: rgba(255, 255, 255, 0.1);
    border-style: solid;
    border-color: var(--copper);
    cursor: pointer;
}

.ingredient-slot.filled:hover {
    transform: scale(1.1);
    border-color: var(--copper-highlight);
}

.slot-icon {
    font-size: 1.5em;
}

.cauldron-rim {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background:
        linear-gradient(180deg,
            var(--copper-highlight) 0%,
            var(--copper) 30%,
            var(--copper-dark) 70%,
            #5a3a1a 100%
        );
    border-radius: 50%;
    box-shadow:
        0 5px 15px var(--shadow-color),
        inset 0 -5px 10px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.cauldron-rim::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 10%;
    right: 10%;
    height: 30px;
    background:
        radial-gradient(ellipse at 50% 50%, #0a0a0a 60%, transparent 100%);
    border-radius: 50%;
}

/* Recipe Preview */
.recipe-preview {
    margin-top: 15px;
    text-align: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--wood-light);
}

.preview-label {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-right: 8px;
}

.preview-name {
    color: var(--text-muted);
    font-style: italic;
}

.preview-name.has-recipe {
    color: var(--copper-highlight);
    font-style: normal;
    font-weight: bold;
}

.preview-name.unknown {
    color: #ff6b6b;
}

/* Fire Area */
.fire-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 400px;
}

.fire-pit {
    position: relative;
    width: 200px;
    height: 80px;
}

.logs {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 30px;
    background:
        linear-gradient(90deg,
            var(--wood-dark) 0%,
            var(--wood-medium) 50%,
            var(--wood-dark) 100%
        );
    border-radius: 5px;
    box-shadow:
        -30px 5px 0 -5px var(--wood-medium),
        30px 5px 0 -5px var(--wood-medium),
        0 5px 15px rgba(0, 0, 0, 0.5);
}

.logs::before,
.logs::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 20px;
    background: var(--wood-medium);
    border-radius: 10px;
    top: -10px;
}

.logs::before {
    left: -20px;
    transform: rotate(-15deg);
}

.logs::after {
    right: -20px;
    transform: rotate(15deg);
}

.flames {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 80px;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(255, 100, 0, 0.5));
}

.flames.burning {
    opacity: 1;
}

/* Main center flame */
.flames::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 65px;
    background: linear-gradient(180deg,
        #fff8e1 0%,
        var(--flame-yellow) 20%,
        var(--flame-orange) 50%,
        var(--flame-red) 80%,
        #8b0000 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker-main 0.15s ease-in-out infinite alternate;
    box-shadow:
        0 0 20px var(--flame-orange),
        0 0 40px rgba(255, 100, 0, 0.5);
}

/* Secondary flame left */
.flames::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    width: 30px;
    height: 45px;
    background: linear-gradient(180deg,
        var(--flame-yellow) 0%,
        var(--flame-orange) 60%,
        var(--flame-red) 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker-left 0.2s ease-in-out infinite alternate-reverse;
}

/* Additional flame elements via the inner div */
.flame-1, .flame-2, .flame-3, .flame-4, .flame-5 {
    position: absolute;
    bottom: 0;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame-1 {
    right: 15%;
    width: 28px;
    height: 42px;
    background: linear-gradient(180deg, var(--flame-yellow) 0%, var(--flame-orange) 70%, var(--flame-red) 100%);
    animation: flicker-right 0.18s ease-in-out infinite alternate;
}

.flame-2 {
    left: 30%;
    width: 20px;
    height: 35px;
    background: linear-gradient(180deg, #fff8e1 0%, var(--flame-yellow) 40%, var(--flame-orange) 100%);
    animation: flicker-small 0.25s ease-in-out infinite alternate-reverse;
}

.flame-3 {
    right: 30%;
    width: 22px;
    height: 38px;
    background: linear-gradient(180deg, var(--flame-yellow) 0%, var(--flame-orange) 50%, var(--flame-red) 100%);
    animation: flicker-small 0.22s ease-in-out infinite alternate;
}

.flame-4 {
    left: 5%;
    width: 18px;
    height: 28px;
    background: linear-gradient(180deg, var(--flame-orange) 0%, var(--flame-red) 100%);
    animation: flicker-outer 0.3s ease-in-out infinite alternate;
}

.flame-5 {
    right: 5%;
    width: 16px;
    height: 25px;
    background: linear-gradient(180deg, var(--flame-orange) 0%, var(--flame-red) 100%);
    animation: flicker-outer 0.28s ease-in-out infinite alternate-reverse;
}

/* Inner white-hot core */
.flame-core {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 30px;
    background: linear-gradient(180deg, #ffffff 0%, #fff8e1 50%, var(--flame-yellow) 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker-core 0.12s ease-in-out infinite alternate;
    filter: blur(1px);
}

@keyframes flicker-main {
    0% { transform: translateX(-50%) scaleY(1) scaleX(1); }
    50% { transform: translateX(-50%) scaleY(1.05) scaleX(0.95); }
    100% { transform: translateX(-50%) scaleY(0.95) scaleX(1.05); }
}

@keyframes flicker-left {
    0% { transform: scaleY(1) scaleX(1) rotate(-3deg); }
    100% { transform: scaleY(1.1) scaleX(0.9) rotate(3deg); }
}

@keyframes flicker-right {
    0% { transform: scaleY(1) scaleX(1) rotate(3deg); }
    100% { transform: scaleY(1.08) scaleX(0.92) rotate(-3deg); }
}

@keyframes flicker-small {
    0% { transform: scaleY(1) scaleX(1); height: 35px; }
    100% { transform: scaleY(1.15) scaleX(0.85); height: 40px; }
}

@keyframes flicker-outer {
    0% { transform: scaleY(1) scaleX(1) rotate(-5deg); opacity: 0.8; }
    100% { transform: scaleY(1.2) scaleX(0.8) rotate(5deg); opacity: 1; }
}

@keyframes flicker-core {
    0% { transform: translateX(-50%) scaleY(1) scaleX(1); opacity: 0.9; }
    100% { transform: translateX(-50%) scaleY(1.1) scaleX(0.9); opacity: 1; }
}

/* Embers and Sparks */
.embers {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 100px;
    opacity: 0;
    pointer-events: none;
}

.embers.active {
    opacity: 1;
}

/* Multiple ember particles using box-shadow trick */
.embers::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--flame-yellow);
    border-radius: 50%;
    left: 40px;
    bottom: 20px;
    box-shadow:
        0 0 6px var(--flame-orange),
        0 0 12px var(--flame-yellow);
    animation: ember-rise-1 1.2s ease-out infinite;
}

.embers::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--flame-orange);
    border-radius: 50%;
    left: 100px;
    bottom: 15px;
    box-shadow:
        0 0 4px var(--flame-orange),
        0 0 8px var(--flame-yellow);
    animation: ember-rise-2 1.4s ease-out infinite;
}

.spark {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.spark-1 {
    width: 3px;
    height: 3px;
    background: #fff;
    left: 60px;
    bottom: 25px;
    box-shadow: 0 0 4px #fff, 0 0 8px var(--flame-yellow);
    animation: spark-fly-1 0.8s ease-out infinite;
}

.spark-2 {
    width: 2px;
    height: 2px;
    background: var(--flame-yellow);
    left: 85px;
    bottom: 20px;
    box-shadow: 0 0 3px var(--flame-yellow);
    animation: spark-fly-2 1s ease-out infinite;
}

.spark-3 {
    width: 3px;
    height: 3px;
    background: var(--flame-orange);
    left: 50px;
    bottom: 30px;
    box-shadow: 0 0 5px var(--flame-orange);
    animation: spark-fly-3 0.9s ease-out infinite;
}

.spark-4 {
    width: 2px;
    height: 2px;
    background: #fff;
    left: 110px;
    bottom: 25px;
    box-shadow: 0 0 4px #fff, 0 0 6px var(--flame-yellow);
    animation: spark-fly-4 1.1s ease-out infinite;
}

.spark-5 {
    width: 4px;
    height: 4px;
    background: var(--flame-yellow);
    left: 70px;
    bottom: 15px;
    box-shadow: 0 0 6px var(--flame-yellow), 0 0 12px var(--flame-orange);
    animation: ember-rise-3 1.6s ease-out infinite;
}

.spark-6 {
    width: 2px;
    height: 2px;
    background: #fff;
    left: 90px;
    bottom: 28px;
    box-shadow: 0 0 3px #fff;
    animation: spark-fly-5 0.7s ease-out infinite;
}

@keyframes ember-rise-1 {
    0% { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-70px) translateX(-15px) scale(0.3); }
}

@keyframes ember-rise-2 {
    0% { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) translateX(10px) scale(0.2); }
}

@keyframes ember-rise-3 {
    0% { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-90px) translateX(5px) scale(0.4); }
}

@keyframes spark-fly-1 {
    0% { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-50px) translateX(-25px) scale(0); }
}

@keyframes spark-fly-2 {
    0% { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-45px) translateX(20px) scale(0); }
}

@keyframes spark-fly-3 {
    0% { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) translateX(-30px) scale(0); }
}

@keyframes spark-fly-4 {
    0% { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-55px) translateX(15px) scale(0); }
}

@keyframes spark-fly-5 {
    0% { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
    100% { opacity: 0; transform: translateY(-40px) translateX(-10px) scale(0); }
}

/* Fire glow on the ground */
.fire-pit::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 30px;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 100, 0, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.flames.burning ~ .fire-pit::after,
.fire-pit:has(~ .flames.burning)::after {
    opacity: 1;
}

/* Ensure fire glow shows when burning */
.fire-area:has(.flames.burning) .fire-pit::after {
    opacity: 1;
    animation: glow-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% { opacity: 0.6; transform: translateX(-50%) scaleX(1); }
    100% { opacity: 0.9; transform: translateX(-50%) scaleX(1.1); }
}

/* Heat Gauge */
.heat-gauge {
    width: 100%;
}

.gauge-label {
    text-align: center;
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.gauge-bar {
    position: relative;
    height: 30px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    border: 2px solid var(--wood-light);
    overflow: hidden;
}

.gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4fc3f7, #ffb74d);
    border-radius: 15px;
    transition: width 0.1s linear, background 0.3s ease;
}

.gauge-zones {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.4);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.zone:last-child {
    border-right: none;
}

.optimal-marker {
    position: absolute;
    top: -8px;
    width: 20px;
    height: 46px;
    background: transparent;
    border: 2px solid var(--flame-yellow);
    border-radius: 4px;
    transform: translateX(-50%);
    display: none;
    box-shadow: 0 0 10px var(--flame-yellow);
    animation: pulse-marker 1s ease-in-out infinite;
}

.optimal-marker::after {
    content: '★';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--flame-yellow);
    font-size: 0.9em;
}

@keyframes pulse-marker {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.current-zone {
    text-align: center;
    margin-top: 10px;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.current-zone.zone-cold { color: #4fc3f7; }
.current-zone.zone-simmer { color: #ffb74d; }
.current-zone.zone-boil { color: #ff8a65; }
.current-zone.zone-intense { color: #ef5350; }

/* Fire Controls */
.fire-controls {
    display: flex;
    gap: 15px;
}

.fire-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    color: var(--text-light);
    background:
        linear-gradient(180deg, var(--copper) 0%, var(--copper-dark) 100%);
    border: 2px solid var(--copper-highlight);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.fire-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(184, 115, 51, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.fire-btn:active:not(:disabled) {
    transform: translateY(0);
}

.fire-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fire-btn .btn-icon {
    font-size: 1.3em;
}

.fire-btn.remove-btn {
    background:
        linear-gradient(180deg, #4caf50 0%, #388e3c 100%);
    border-color: #66bb6a;
}

.fire-btn.remove-btn:hover:not(:disabled) {
    box-shadow:
        0 6px 20px rgba(76, 175, 80, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.clear-btn {
    padding: 8px 20px;
    font-family: 'Metamorphous', cursive;
    font-size: 0.9em;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--wood-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn:hover:not(:disabled) {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.1);
}

.clear-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Ingredient Shelves */
.ingredient-shelves {
    background:
        linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid var(--wood-light);
    box-shadow:
        0 4px 15px var(--shadow-color),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.ingredient-containers {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ingredient-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ingredient-container:hover {
    background: rgba(255, 255, 255, 0.05);
}

.container-visual {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container-body {
    width: 45px;
    height: 45px;
    background:
        radial-gradient(ellipse at 30% 30%, var(--ingredient-primary), rgba(0, 0, 0, 0.5));
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 2px 8px var(--shadow-color),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.ingredient-item {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.ingredient-item:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px var(--ingredient-glow));
}

.ingredient-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.ingredient-icon {
    font-size: 1.5em;
    pointer-events: none;
}

.container-label {
    flex: 1;
    font-size: 0.9em;
    color: var(--text-light);
}

/* Result Display */
.result-display {
    text-align: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 2px dashed var(--wood-light);
    margin-bottom: 30px;
}

.placeholder-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 1.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.placeholder-hint {
    font-size: 0.85em;
    color: rgba(168, 152, 136, 0.6);
}

/* Potion Cards - New Tag-on-Bottle Design */
.potion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(550px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.potion-card {
    background:
        linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border-radius: 16px;
    border: 2px solid var(--wood-light);
    padding: 25px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    box-shadow:
        0 6px 30px var(--shadow-color),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.potion-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.potion-card.perfect {
    border-color: var(--copper-highlight);
    box-shadow:
        0 6px 30px var(--shadow-color),
        0 0 40px rgba(255, 200, 100, 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

/* Potion Display - Bottle + Tag Layout */
.potion-display {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Large Bottle */
.large-bottle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.large-potion-bottle-svg {
    width: 280px;
    height: 400px;
    filter: drop-shadow(0 0 35px var(--potion-glow));
}

.potion-liquid-large {
    animation: liquid-swirl 4s ease-in-out infinite;
}

@keyframes liquid-swirl {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* Potion Tag - Attached to bottle */
.potion-tag {
    flex: 1;
    position: relative;
    background:
        linear-gradient(180deg, #f8f0e3 0%, #efe4d4 100%);
    border-radius: 8px;
    padding: 15px 15px 15px 20px;
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    border: 1px solid #d4c4a8;
    margin-left: 5px;
}

.potion-tag.perfect {
    background:
        linear-gradient(180deg, #fff8e1 0%, #ffecb3 100%);
    border-color: #ffd54f;
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 200, 100, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Tag hole and string */
.tag-hole {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--wood-dark);
    border-radius: 50%;
    border: 1px solid #a89070;
}

.tag-string {
    position: absolute;
    left: -20px;
    top: 50%;
    width: 25px;
    height: 2px;
    background:
        linear-gradient(90deg,
            #8b7355 0%,
            #a89070 50%,
            #8b7355 100%
        );
    transform-origin: right center;
    transform: translateY(-50%) rotate(-5deg);
}

.tag-string::before {
    content: '';
    position: absolute;
    left: 0;
    top: -3px;
    width: 8px;
    height: 8px;
    border: 2px solid #8b7355;
    border-radius: 50%;
    background: transparent;
}

/* Tag Content */
.tag-content {
    color: #3e2723;
    font-family: 'Metamorphous', cursive;
}

.tag-header {
    margin-bottom: 8px;
}

.tag-name {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1.1em;
    color: #5d4037;
    margin: 0 0 4px 0;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.tag-meta {
    display: flex;
    gap: 10px;
    font-size: 0.75em;
    color: #8d6e63;
}

.tag-ingredients {
    font-size: 1.1em;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.tag-divider {
    height: 1px;
    background:
        linear-gradient(90deg,
            transparent 0%,
            #c4b4a4 20%,
            #c4b4a4 80%,
            transparent 100%
        );
    margin: 10px 0;
}

.tag-effect {
    margin-bottom: 10px;
}

.tag-effect-label,
.tag-bonus-label {
    font-family: 'Cinzel', serif;
    font-size: 0.7em;
    color: #8d6e63;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.tag-effect-text,
.tag-bonus-text {
    font-size: 0.85em;
    line-height: 1.4;
    color: #4e342e;
}

.tag-bonus {
    background: rgba(255, 200, 100, 0.2);
    border-left: 3px solid #ffc107;
    padding: 8px 10px;
    margin: 10px 0;
    border-radius: 0 4px 4px 0;
}

.tag-bonus-label {
    color: #f57c00;
}

.tag-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #c4b4a4;
}

.tag-brew-zone {
    font-size: 0.7em;
    color: #8d6e63;
    text-transform: capitalize;
    font-style: italic;
}

.tag-perfect-badge {
    font-size: 1em;
    color: #ffc107;
    text-shadow: 0 0 5px rgba(255, 200, 100, 0.5);
}

/* Share Button */
.share-potions-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px auto;
    padding: 15px 30px;
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    color: var(--text-light);
    background:
        linear-gradient(180deg, #5d4037 0%, #3e2723 100%);
    border: 2px solid #8d6e63;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.share-potions-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(93, 64, 55, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    border-color: #a1887f;
}

.share-potions-btn:active {
    transform: translateY(0);
}

.share-icon {
    font-size: 1.2em;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-modal.open {
    opacity: 1;
    visibility: visible;
}

.share-modal-content {
    background:
        linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border-radius: 12px;
    border: 2px solid var(--wood-light);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.share-modal.open .share-modal-content {
    transform: scale(1);
}

.share-modal-content h2 {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1.5em;
    color: var(--copper-highlight);
    margin-bottom: 15px;
}

.share-description {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9em;
}

.share-url-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--wood-light);
    border-radius: 8px;
    padding: 15px;
    font-family: monospace;
    font-size: 0.8em;
    color: var(--text-light);
    word-break: break-all;
    text-align: left;
    max-height: 100px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.copy-success {
    color: #4caf50;
    font-size: 0.9em;
    margin-bottom: 15px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.copy-success.show {
    opacity: 1;
    transform: translateY(0);
}

.share-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.share-modal-btn {
    padding: 12px 25px;
    font-family: 'Cinzel', serif;
    font-size: 1em;
    color: var(--text-light);
    background:
        linear-gradient(180deg, var(--wood-light) 0%, var(--wood-medium) 100%);
    border: 1px solid var(--wood-highlight);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-modal-btn:hover {
    background:
        linear-gradient(180deg, var(--wood-highlight) 0%, var(--wood-light) 100%);
}

.share-modal-btn.primary {
    background:
        linear-gradient(180deg, var(--copper) 0%, var(--copper-dark) 100%);
    border-color: var(--copper-highlight);
}

.share-modal-btn.primary:hover {
    background:
        linear-gradient(180deg, var(--copper-highlight) 0%, var(--copper) 100%);
}

/* View-Only Mode */
.view-only-header {
    display: none;
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 30px;
    background:
        linear-gradient(180deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border-radius: 12px;
    border: 2px solid var(--wood-light);
}

.view-only-header h1 {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 2em;
    background: linear-gradient(180deg, var(--flame-yellow) 0%, var(--flame-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.view-only-subtitle {
    color: var(--text-muted);
    font-size: 1em;
    margin-bottom: 20px;
}

.create-own-btn {
    display: inline-block;
    padding: 12px 25px;
    font-family: 'Cinzel', serif;
    font-size: 1em;
    color: var(--text-light);
    background:
        linear-gradient(180deg, var(--copper) 0%, var(--copper-dark) 100%);
    border: 2px solid var(--copper-highlight);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.create-own-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 115, 51, 0.4);
}

.view-only-mode .back-link {
    display: none;
}

.view-only-mode .header-banner {
    display: none;
}

/* Particle Container */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-move var(--duration, 0.5s) ease-out forwards;
}

.particle-sparkle {
    width: 6px;
    height: 6px;
    background: var(--flame-yellow);
    box-shadow: 0 0 6px var(--flame-orange);
}

.particle-bubble {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.particle-steam {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    filter: blur(2px);
}

.particle-magic {
    width: 8px;
    height: 8px;
    background: var(--flame-yellow);
    box-shadow:
        0 0 10px var(--flame-yellow),
        0 0 20px var(--flame-orange);
}

/* Dynamic fire sparks */
.fire-spark {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
}

.fire-spark-white {
    background: #ffffff;
}

.fire-spark-yellow {
    background: var(--flame-yellow);
}

.fire-spark-orange {
    background: var(--flame-orange);
}

@keyframes fire-spark-rise {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.2);
    }
}

@keyframes particle-move {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.5);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .wood-plate h1 {
        font-size: 1.8em;
    }

    .wood-plate {
        padding: 15px 30px;
    }

    .cauldron {
        width: 250px;
        height: 170px;
    }

    .fire-btn {
        padding: 12px 20px;
        font-size: 1em;
    }

    .potion-cards {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Flying Ingredient Animation
   ============================================ */

.flying-ingredient {
    transition: none;
}

.flying-ingredient.flying {
    animation: fly-to-cauldron 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.flying-icon {
    display: block;
    filter: drop-shadow(0 0 10px rgba(255, 200, 100, 0.8));
}

@keyframes fly-to-cauldron {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(calc(-50% + var(--end-x) * 0.5), calc(-50% + var(--end-y) * 0.5 - 40px)) scale(1.3);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--end-x)), calc(-50% + var(--end-y))) scale(0.5);
        opacity: 0;
    }
}

/* Clickable ingredient styling */
.ingredient-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ingredient-item:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 12px var(--ingredient-glow));
}

.ingredient-item:active {
    transform: scale(0.95);
}

/* ============================================
   Recipe Book Button
   ============================================ */

.recipe-book-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 20px;
    padding: 12px 20px;
    font-family: 'Cinzel', serif;
    font-size: 1em;
    color: var(--text-light);
    background:
        linear-gradient(180deg, #5d4037 0%, #3e2723 100%);
    border: 2px solid #8d6e63;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.recipe-book-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(93, 64, 55, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    border-color: #a1887f;
}

.recipe-book-btn:active {
    transform: translateY(0);
}

.book-icon {
    font-size: 1.3em;
}

/* ============================================
   Recipe Book Modal
   ============================================ */

.recipe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.recipe-modal.open {
    opacity: 1;
    visibility: visible;
}

.recipe-book {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 80vh;
    max-height: 600px;
    background:
        linear-gradient(135deg, #8b7355 0%, #6b5344 50%, #5a4636 100%);
    border-radius: 8px 20px 20px 8px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(0, 0, 0, 0.3),
        -5px 0 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) rotateY(-5deg);
    transition: transform 0.3s ease;
}

.recipe-modal.open .recipe-book {
    transform: scale(1) rotateY(0deg);
}

.close-book-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 36px;
    height: 36px;
    font-size: 24px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.close-book-btn:hover {
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.5);
}

.book-title {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1.4em;
    color: #d4c4a8;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.book-spine {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background:
        linear-gradient(90deg,
            #3e2723 0%,
            #5d4037 30%,
            #4e342e 50%,
            #3e2723 100%
        );
    box-shadow:
        inset -5px 0 10px rgba(0, 0, 0, 0.3),
        2px 0 5px rgba(0, 0, 0, 0.2);
}

.book-spine::before {
    content: '';
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: 5px;
    width: 3px;
    background: linear-gradient(180deg, #8d6e63 0%, #6d4c41 50%, #8d6e63 100%);
    border-radius: 2px;
}

.book-spine::after {
    content: '';
    position: absolute;
    top: 20%;
    bottom: 20%;
    right: 5px;
    width: 3px;
    background: linear-gradient(180deg, #8d6e63 0%, #6d4c41 50%, #8d6e63 100%);
    border-radius: 2px;
}

.book-pages {
    flex: 1;
    display: flex;
    margin: 60px 20px 20px 50px;
    background: #f4e9d9;
    border-radius: 3px;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.1),
        0 2px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.book-page {
    flex: 1;
    padding: 25px;
    background:
        linear-gradient(180deg, #f8f0e3 0%, #f4e9d9 50%, #efe4d4 100%);
    overflow-y: auto;
}

.book-page::-webkit-scrollbar {
    width: 6px;
}

.book-page::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.book-page::-webkit-scrollbar-thumb {
    background: rgba(139, 110, 85, 0.3);
    border-radius: 3px;
}

.left-page {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.right-page {
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.book-binding {
    width: 20px;
    background:
        linear-gradient(90deg,
            rgba(0, 0, 0, 0.15) 0%,
            rgba(0, 0, 0, 0.05) 30%,
            rgba(0, 0, 0, 0.05) 70%,
            rgba(0, 0, 0, 0.15) 100%
        );
    position: relative;
}

.book-binding::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(0, 0, 0, 0.1);
    transform: translateX(-50%);
}

.book-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
}

.page-btn {
    padding: 8px 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    color: var(--text-light);
    background:
        linear-gradient(180deg, #5d4037 0%, #3e2723 100%);
    border: 1px solid #8d6e63;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background:
        linear-gradient(180deg, #6d4c41 0%, #4e342e 100%);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-number {
    font-family: 'Cinzel', serif;
    color: var(--text-muted);
    min-width: 80px;
    text-align: center;
}

/* Recipe Entry Styling */
.recipe-entry {
    color: #3e2723;
    font-family: 'Metamorphous', cursive;
}

.recipe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.recipe-name {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1.2em;
    color: #5d4037;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.recipe-ingredients-icons {
    display: flex;
    gap: 5px;
    font-size: 1.3em;
}

.recipe-ingredient {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.recipe-ingredients-text {
    font-size: 0.85em;
    color: #6d4c41;
    font-style: italic;
    margin-bottom: 12px;
}

.recipe-divider {
    height: 2px;
    background:
        linear-gradient(90deg,
            transparent 0%,
            #8d6e63 20%,
            #8d6e63 80%,
            transparent 100%
        );
    margin: 12px 0;
    opacity: 0.5;
}

.recipe-section {
    margin-bottom: 12px;
}

.recipe-label {
    font-family: 'Cinzel', serif;
    font-size: 0.75em;
    color: #8d6e63;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.recipe-effect {
    font-size: 0.9em;
    line-height: 1.4;
    color: #4e342e;
}

.recipe-zone {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

.recipe-zone.zone-cold {
    background: rgba(79, 195, 247, 0.2);
    color: #0288d1;
}

.recipe-zone.zone-simmer {
    background: rgba(255, 183, 77, 0.2);
    color: #f57c00;
}

.recipe-zone.zone-boil {
    background: rgba(255, 138, 101, 0.2);
    color: #e64a19;
}

.recipe-zone.zone-intense {
    background: rgba(239, 83, 80, 0.2);
    color: #c62828;
}

.recipe-bonus {
    font-size: 0.85em;
    color: #6d4c41;
    font-style: italic;
    padding-left: 10px;
    border-left: 2px solid var(--recipe-glow, #8d6e63);
}

.brew-recipe-btn {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 10px 15px;
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    color: #5d4037;
    background:
        linear-gradient(180deg, #d7ccc8 0%, #bcaaa4 100%);
    border: 1px solid #8d6e63;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.brew-recipe-btn:hover {
    background:
        linear-gradient(180deg, #efebe9 0%, #d7ccc8 100%);
    border-color: #6d4c41;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.brew-recipe-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.empty-page {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1887f;
    font-style: italic;
}

/* Responsive recipe book */
@media (max-width: 768px) {
    .recipe-book {
        height: 90vh;
        max-height: none;
        border-radius: 8px;
    }

    .book-pages {
        flex-direction: column;
        margin: 50px 15px 15px 15px;
    }

    .book-spine {
        display: none;
    }

    .book-binding {
        height: 10px;
        width: auto;
    }

    .left-page {
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .right-page {
        border-left: none;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .book-title {
        font-size: 1.1em;
    }

    .recipe-name {
        font-size: 1em;
    }
}

/* Print Styles */
@media print {
    /* Hide non-essential elements */
    .bg-layer,
    .wood-texture,
    .particle-container,
    .share-modal,
    .recipe-modal,
    .back-link,
    .header-banner,
    .workshop,
    .result-display,
    .share-potions-btn,
    .view-only-header .create-own-btn,
    .brew-recipe-btn {
        display: none !important;
    }

    /* Reset body for print */
    body {
        background: white !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    /* View-only header for print */
    .view-only-header {
        display: block !important;
        background: none !important;
        border: none !important;
        padding: 20px 0 !important;
        margin-bottom: 20px !important;
    }

    .view-only-header h1 {
        color: #333 !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        -webkit-text-fill-color: #333 !important;
        background-clip: unset !important;
        font-size: 1.8em !important;
    }

    .view-only-subtitle {
        color: #666 !important;
    }

    /* Potion cards grid for print */
    .potion-cards {
        display: block !important;
        padding: 0 !important;
    }

    .potion-card {
        background: white !important;
        border: 2px solid #ccc !important;
        box-shadow: none !important;
        opacity: 1 !important;
        transform: none !important;
        margin-bottom: 30px !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .potion-card.perfect {
        border-color: #b8860b !important;
        border-width: 3px !important;
    }

    /* Potion display layout */
    .potion-display {
        gap: 20px !important;
    }

    /* Bottle sizing for print */
    .large-potion-bottle-svg {
        width: 180px !important;
        height: 260px !important;
        filter: none !important;
    }

    /* Ensure bottle colors print */
    .potion-liquid-large {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Tag styling for print */
    .potion-tag {
        background: #f9f9f9 !important;
        border: 1px solid #999 !important;
        box-shadow: none !important;
    }

    .potion-tag.perfect {
        background: #fffde7 !important;
        border-color: #b8860b !important;
    }

    .tag-name {
        color: #333 !important;
        font-size: 1.2em !important;
    }

    .tag-meta {
        color: #666 !important;
    }

    .tag-effect-label,
    .tag-bonus-label {
        color: #555 !important;
    }

    .tag-effect-text,
    .tag-bonus-text {
        color: #333 !important;
    }

    .tag-bonus {
        background: #fff8e1 !important;
        border-left-color: #b8860b !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .tag-bonus-label {
        color: #b8860b !important;
    }

    .tag-footer {
        border-top-color: #ccc !important;
    }

    .tag-brew-zone {
        color: #666 !important;
    }

    .tag-perfect-badge {
        color: #b8860b !important;
    }

    .tag-divider {
        background: #ccc !important;
    }

    .tag-ingredients {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hide string decorations on print */
    .tag-hole,
    .tag-string {
        display: none !important;
    }

    /* Ensure page breaks work well */
    .potion-card:first-child {
        margin-top: 0 !important;
    }
}

/* Responsive potion cards */
@media (max-width: 768px) {
    .potion-cards {
        grid-template-columns: 1fr;
    }

    .potion-display {
        flex-direction: column;
        align-items: center;
    }

    .large-bottle {
        margin-bottom: 15px;
    }

    .potion-tag {
        margin-left: 0;
        margin-top: 10px;
        padding-left: 15px;
    }

    .tag-hole,
    .tag-string {
        display: none;
    }

    .large-potion-bottle-svg {
        width: 200px;
        height: 280px;
    }

    .view-only-header h1 {
        font-size: 1.5em;
    }
}
