/* ==========================================================================
   GRA TERENOWA 2: TAJEMNICA ZAGINIONEGO ELIKSIRU (POTION MYSTERY)
   Style dla Radaru Kociołka, Torby Alchemika, Animacji Warzenia i Dyplomu
   ========================================================================== */

/* --- PŁYWAJĄCY RADAR KOCIOŁKA (HUD) --- */
.potion-radar-hud {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 32px);
    max-width: 580px;
    background: rgba(27, 13, 38, 0.95);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 2px solid #a33cf2;
    border-radius: 24px;
    padding: 12px 18px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(163, 60, 242, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
    font-family: inherit;
    animation: slideUpPotionHud 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slideUpPotionHud {
    from { transform: translate(-50%, 60px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.potion-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.potion-blip-box {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle, #a33cf2 0%, #3d1059 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(163, 60, 242, 0.7);
}

.potion-blip-box::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid rgba(210, 130, 255, 0.75);
    animation: potionRadarPulse 2s infinite ease-out;
}

@keyframes potionRadarPulse {
    0% { transform: scale(0.85); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.potion-info-box {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.potion-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: #e3a9ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.potion-status-text {
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.potion-status-text .badge-cold { color: #8bb2ff; }
.potion-status-text .badge-warm { color: #ffd166; }
.potion-status-text .badge-hot { color: #ff5e7e; text-shadow: 0 0 8px rgba(255, 94, 126, 0.6); }
.potion-status-text .badge-near { color: #06d6a0; text-shadow: 0 0 10px rgba(6, 214, 160, 0.8); animation: pulseNearPotion 1.2s infinite; }

@keyframes pulseNearPotion {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.potion-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-radar-pouch {
    background: linear-gradient(135deg, #a33cf2 0%, #6815a8 100%);
    border: 1px solid #d282ff;
    color: #fff;
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(163, 60, 242, 0.45);
    transition: transform 0.18s, filter 0.18s;
}

.btn-radar-pouch:hover {
    transform: scale(1.05);
    filter: brightness(1.15);
}

.btn-potion-radar-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e4d7f0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.18s;
}

.btn-potion-radar-close:hover {
    background: rgba(231, 76, 60, 0.8);
    color: #fff;
    border-color: #e74c3c;
}

/* --- MODAL ODKRYCIA SKŁADNIKA --- */
.potion-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 7, 20, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.potion-modal-backdrop.active {
    display: flex;
}

.ingredient-card-modal {
    background: linear-gradient(145deg, #28163b 0%, #150b22 100%);
    border: 2px solid #a33cf2;
    border-radius: 28px;
    width: 100%;
    max-width: 440px;
    padding: 30px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(163, 60, 242, 0.4);
    text-align: center;
    animation: popInIngredient 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes popInIngredient {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.ingredient-avatar-big {
    font-size: 64px;
    margin-bottom: 12px;
    display: inline-block;
    filter: drop-shadow(0 0 16px rgba(163, 60, 242, 0.8));
    animation: floatIngredient 2.5s ease-in-out infinite;
}

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

.ingredient-title {
    font-size: 23px;
    color: #fff;
    margin: 0 0 6px;
    font-weight: 900;
}

.ingredient-recipe-tag {
    display: inline-block;
    background: #461f6b;
    border: 1px solid #7a31b8;
    color: #ffd074;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 16px;
}

.ingredient-quote {
    background: rgba(43, 22, 63, 0.7);
    border-left: 3px solid #ffd074;
    padding: 12px 14px;
    border-radius: 12px;
    color: #e2d4f0;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 22px;
    text-align: left;
}

.btn-ingredient-collect {
    width: 100%;
    padding: 14px 20px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, #06d6a0 0%, #05a077 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(6, 214, 160, 0.45);
    transition: transform 0.18s, box-shadow 0.18s;
}

.btn-ingredient-collect:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 214, 160, 0.6);
}

/* --- MODAL TORBY ALCHEMIKA I KOCIOŁKA --- */
.alchemy-bag-card {
    background: #1c0e29;
    border: 2px solid #6b269b;
    border-radius: 28px;
    width: 100%;
    max-width: 640px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    color: #fff;
}

.alchemy-bag-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid #3d1c5a;
    padding-bottom: 14px;
}

.alchemy-bag-header h3 {
    margin: 0;
    font-size: 22px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipe-selector-bar {
    background: #2b153f;
    border: 1px solid #57257e;
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.recipe-selector-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #e3a9ff;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.recipe-select-dropdown {
    width: 100%;
    background: #160a22;
    border: 1.5px solid #a33cf2;
    border-radius: 12px;
    color: #ffd074;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}

.ingredients-grid-pouch {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.ingredient-slot {
    background: #251336;
    border: 1.5px solid #4a216e;
    border-radius: 16px;
    padding: 12px 6px;
    text-align: center;
    transition: transform 0.2s;
}

.ingredient-slot.collected {
    border-color: #06d6a0;
    background: #172c2b;
    box-shadow: 0 0 12px rgba(6, 214, 160, 0.3);
}

.ingredient-slot-icon {
    font-size: 32px;
    margin-bottom: 6px;
    display: block;
}

.ingredient-slot-name {
    font-size: 11px;
    font-weight: 700;
    color: #e4d7f0;
    line-height: 1.25;
}

.ingredient-slot-status {
    font-size: 10px;
    font-weight: 800;
    color: #06d6a0;
    margin-top: 4px;
}

.ingredient-slot.locked .ingredient-slot-status {
    color: #8b75a3;
}

/* --- ANIMACJA KOCIOŁKA I WARZENIA ELIKSIRÓW --- */
.cauldron-brew-box {
    background: linear-gradient(135deg, #2b1342 0%, #160723 100%);
    border: 2px dashed #a33cf2;
    border-radius: 22px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.cauldron-graphic-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.cauldron-emoji {
    font-size: 72px;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 0 16px rgba(163, 60, 242, 0.8));
}

.cauldron-bubbles {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    opacity: 0;
}

.cauldron-brew-box.brewing .cauldron-bubbles {
    opacity: 1;
    animation: bubblesBoil 1.2s infinite;
}

@keyframes bubblesBoil {
    0% { transform: translate(-50%, 10px) scale(0.6); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translate(-50%, -25px) scale(1.3); opacity: 0; }
}

.cauldron-brew-box.brewing .cauldron-emoji {
    animation: cauldronShake 0.4s infinite alternate;
}

@keyframes cauldronShake {
    0% { transform: translateX(-50%) rotate(-4deg); }
    100% { transform: translateX(-50%) rotate(4deg); }
}

.btn-brew-potion {
    background: linear-gradient(135deg, #ff7518 0%, #a33cf2 100%);
    border: 2px solid #ffd074;
    color: #fff;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(163, 60, 242, 0.6);
    transition: all 0.22s;
}

.btn-brew-potion:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 30px rgba(255, 117, 24, 0.7);
}

.btn-brew-potion:disabled {
    background: #392452;
    border-color: #5d3f7e;
    color: #9d8db3;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ==========================================================================
   OFICJALNY DYPLOM Z LOGO (DLA WSZYSTKICH GIER TERENOWYCH)
   ========================================================================== */
.official-certificate-container {
    background: #fff;
    color: #1a1a1a;
    border: 8px double #a33cf2;
    border-radius: 20px;
    padding: 32px 28px;
    text-align: center;
    margin-top: 24px;
    position: relative;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.cert-logo-wrap {
    margin-bottom: 14px;
}

.cert-logo-img {
    max-width: 180px;
    height: auto;
    display: inline-block;
}

.cert-title {
    font-size: 26px;
    font-weight: 900;
    color: #6815a8;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cert-subtitle {
    font-size: 14px;
    color: #555;
    margin: 0 0 16px;
    font-weight: 700;
}

.cert-recipient {
    font-size: 26px;
    font-weight: 900;
    color: #ff7518;
    border-bottom: 2px dashed #a33cf2;
    display: inline-block;
    padding: 0 24px 6px;
    margin-bottom: 16px;
}

.cert-desc {
    font-size: 14px;
    line-height: 1.55;
    color: #333;
    max-width: 480px;
    margin: 0 auto 20px;
}

.cert-seal-badge {
    font-size: 44px;
    margin-bottom: 8px;
}

.cert-footer-row {
    font-size: 12px;
    color: #777;
    border-top: 1px solid #e0d0f0;
    padding-top: 12px;
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   GRAFIKA POST NA SOCIAL MEDIA (SM)
   ========================================================================== */
.sm-post-export-card {
    background: linear-gradient(135deg, #24133b 0%, #12091f 100%);
    border: 1.5px solid #a33cf2;
    border-radius: 20px;
    padding: 22px;
    margin-top: 20px;
    text-align: center;
    color: #fff;
}

.sm-post-title {
    font-size: 17px;
    font-weight: 800;
    color: #ffd074;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sm-post-desc {
    font-size: 13px;
    color: #d1bddf;
    margin: 0 0 16px;
}

.sm-preview-canvas-wrap {
    position: relative;
    max-width: 320px;
    margin: 0 auto 16px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
    border: 2px solid #ff7518;
}

.sm-preview-canvas {
    width: 100%;
    height: auto;
    display: block;
}

.sm-actions-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-sm-download {
    background: linear-gradient(135deg, #ff7518 0%, #d35400 100%);
    border: none;
    color: #fff;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(255, 117, 24, 0.45);
    transition: transform 0.18s;
}

.btn-sm-download:hover {
    transform: translateY(-2px);
}

.btn-sm-share {
    background: #8e44ad;
    border: 1px solid #b268d4;
    color: #fff;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.18s;
}

.btn-sm-share:hover {
    background: #9b59b6;
    transform: translateY(-2px);
}

/* Styl druku A4 */
@media print {
    body * {
        visibility: hidden !important;
    }
    .official-certificate-container, .official-certificate-container * {
        visibility: visible !important;
    }
    .official-certificate-container {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
        border: 4px solid #000 !important;
    }
    .diploma-actions, .sm-post-export-card {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .potion-radar-hud {
        bottom: 16px;
        padding: 10px 14px;
    }
    .potion-blip-box {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .ingredients-grid-pouch {
        grid-template-columns: repeat(3, 1fr);
    }
}
