/* Buffs grid */
.buffs-container {
    width: 100%;
    max-width: 800px;
    min-height: 120px;
    margin-bottom: 40px;
}

.buffs-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(26, 26, 36, 0.9), rgba(10, 10, 18, 0.95));
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 8px;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.5),
        0 4px 20px rgba(0,0,0,0.5);
}

.no-buffs {
    color: var(--text-dim);
    font-style: italic;
    font-size: 1.1rem;
    padding: 20px;
    text-align: center;
    width: 100%;
}

/* Individual buff */
.buff {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.buff.new-buff {
    animation: buff-appear 0.5s ease-out;
}

.buff.new-buff.focused {
    animation: buff-appear-focused 0.5s ease-out;
}

@keyframes buff-appear {
    0% { transform: scale(2); opacity: 0; }
    25% { transform: scale(0.88); opacity: 1; }
    42% { transform: scale(1.08); }
    58% { transform: scale(0.97); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes buff-appear-focused {
    0% { transform: scale(2); opacity: 0; }
    25% { transform: scale(1.01); opacity: 1; }
    42% { transform: scale(1.24); }
    58% { transform: scale(1.12); }
    100% { transform: scale(1.15); opacity: 1; }
}

.buff:hover {
    transform: scale(1.1);
}

.buff.focused {
    transform: scale(1.15);
}

.buff.focused .buff-icon::before {
    will-change: box-shadow;
}
.buff.focused.common .buff-icon::before {
    animation: buff-focus-pulse-common 2s ease-in-out infinite;
}
.buff.focused.uncommon .buff-icon::before {
    animation: buff-focus-pulse-uncommon 2s ease-in-out infinite;
}
.buff.focused.rare .buff-icon::before {
    animation: buff-focus-pulse-rare 2s ease-in-out infinite;
}
.buff.focused.epic .buff-icon::before {
    animation: buff-focus-pulse-epic 2s ease-in-out infinite;
}
.buff.focused.legendary .buff-icon::before {
    animation: buff-focus-pulse-legendary 2s ease-in-out infinite;
}

@keyframes buff-focus-pulse-common {
    0%, 100% { box-shadow: 0 0 10px var(--common); }
    50% { box-shadow: 0 0 20px var(--common), 0 0 30px var(--common); }
}
@keyframes buff-focus-pulse-uncommon {
    0%, 100% { box-shadow: 0 0 10px rgba(30, 255, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(30, 255, 0, 0.6), 0 0 30px rgba(30, 255, 0, 0.3); }
}
@keyframes buff-focus-pulse-rare {
    0%, 100% { box-shadow: 0 0 10px rgba(26, 136, 238, 0.5); }
    50% { box-shadow: 0 0 20px rgba(26, 136, 238, 0.6), 0 0 30px rgba(26, 136, 238, 0.3); }
}
@keyframes buff-focus-pulse-epic {
    0%, 100% { box-shadow: 0 0 10px rgba(179, 92, 245, 0.5); }
    50% { box-shadow: 0 0 20px rgba(179, 92, 245, 0.6), 0 0 30px rgba(179, 92, 245, 0.3); }
}
@keyframes buff-focus-pulse-legendary {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 128, 0, 0.5); }
    50% { box-shadow: 0 0 22px rgba(255, 128, 0, 0.6), 0 0 35px rgba(255, 128, 0, 0.3); }
}

.buff-icon {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    background: linear-gradient(145deg, #2a2a3a, #1a1a24);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 2px 8px rgba(0,0,0,0.5);
}

.buff-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
    position: relative;
    z-index: 1;
}

/* Small whisp icon indicator */
.buff-icon .whisp-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(136, 221, 255, 0.9), rgba(100, 180, 220, 0.7));
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(136, 221, 255, 0.8);
    z-index: 3;
}

.buff-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    border: 2px solid;
    pointer-events: none;
}

.buff.common .buff-icon::before { border-color: var(--common); }
.buff.uncommon .buff-icon::before { border-color: var(--uncommon); box-shadow: 0 0 10px rgba(30, 255, 0, 0.3); }
.buff.rare .buff-icon::before { border-color: var(--rare); box-shadow: 0 0 10px rgba(26, 136, 238, 0.3); }
.buff.epic .buff-icon::before { border-color: var(--epic); box-shadow: 0 0 10px rgba(179, 92, 245, 0.3); }
.buff.legendary .buff-icon::before { border-color: var(--legendary); box-shadow: 0 0 15px rgba(255, 128, 0, 0.4); }


.buff-timer {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.buff-timer.expiring {
    color: #ff4444;
}

/* Buff reveal animation */
.buff-reveal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    text-align: center;
    pointer-events: none;
}

.buff-reveal-content {
    animation: reveal-pop 2s ease-out forwards;
}

@keyframes reveal-pop {
    0% { transform: scale(0); opacity: 0; }
    20% { transform: scale(1.5); opacity: 1; }
    40% { transform: scale(1.2); }
    60% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

.reveal-icon {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    image-rendering: pixelated;
}

.reveal-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 10px;
    text-shadow: 0 0 20px currentColor, 0 2px 4px rgba(0,0,0,0.8);
}

/* Buff choice overlay for subscribers */
.buff-choice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 10, 0.85);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: overlay-fade-in 0.3s ease-out;
}

@keyframes overlay-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.buff-choice-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(201, 162, 39, 0.5), 0 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 40px;
    letter-spacing: 0.1em;
    animation: choice-title-in 0.5s ease-out;
}

@keyframes choice-title-in {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.buff-choice-cards {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 20px;
}

.buff-choice-card {
    width: 180px;
    background: linear-gradient(135deg, rgba(26, 26, 36, 0.95), rgba(10, 10, 18, 0.98));
    border: 2px solid rgba(201, 162, 39, 0.4);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: card-appear 0.5s ease-out backwards;
}

.buff-choice-card:nth-child(1) { animation-delay: 0.1s; }
.buff-choice-card:nth-child(2) { animation-delay: 0.25s; }
.buff-choice-card:nth-child(3) { animation-delay: 0.4s; }

@keyframes card-appear {
    from { transform: scale(0.5) translateY(30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.buff-choice-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(201, 162, 39, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.buff-choice-card:hover::before {
    transform: translateX(100%);
}

.buff-choice-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px rgba(201, 162, 39, 0.2);
}

.buff-choice-card.common { border-color: var(--common); }
.buff-choice-card.uncommon { border-color: var(--uncommon); box-shadow: 0 0 10px rgba(30, 255, 0, 0.15); }
.buff-choice-card.rare { border-color: var(--rare); box-shadow: 0 0 10px rgba(26, 136, 238, 0.15); }
.buff-choice-card.epic { border-color: var(--epic); box-shadow: 0 0 10px rgba(179, 92, 245, 0.15); }
.buff-choice-card.legendary { border-color: var(--legendary); box-shadow: 0 0 15px rgba(255, 128, 0, 0.2); }

.buff-choice-card:hover.common { box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 15px rgba(157, 157, 157, 0.3); }
.buff-choice-card:hover.uncommon { box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px rgba(30, 255, 0, 0.3); }
.buff-choice-card:hover.rare { box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px rgba(26, 136, 238, 0.3); }
.buff-choice-card:hover.epic { box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px rgba(179, 92, 245, 0.3); }
.buff-choice-card:hover.legendary { box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 25px rgba(255, 128, 0, 0.4); }

.buff-choice-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
    margin: 0 auto 12px;
}

.buff-choice-name {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.buff-choice-name.common { color: var(--common); }
.buff-choice-name.uncommon { color: var(--uncommon); }
.buff-choice-name.rare { color: var(--rare); }
.buff-choice-name.epic { color: var(--epic); }
.buff-choice-name.legendary { color: var(--legendary); }

.buff-choice-effect {
    font-size: 0.8rem;
    color: #1eff00;
    line-height: 1.4;
    margin-bottom: 8px;
}

.buff-choice-rarity {
    font-size: 0.75rem;
    text-transform: capitalize;
}

.buff-choice-rarity.common { color: var(--common); }
.buff-choice-rarity.uncommon { color: var(--uncommon); }
.buff-choice-rarity.rare { color: var(--rare); }
.buff-choice-rarity.epic { color: var(--epic); }
.buff-choice-rarity.legendary { color: var(--legendary); }

/* Responsive */
@media (max-width: 600px) {
    .buff-icon {
        width: 44px;
        height: 44px;
    }

    .buff-choice-cards {
        gap: 15px;
    }

    .buff-choice-card {
        width: 140px;
        padding: 15px;
    }

    .buff-choice-icon {
        width: 48px;
        height: 48px;
    }
}
