/* ============================================================
   Creatorhunt Easter Event — Global Styles
   Egg hotspots, reveal animations, collection toast
   ============================================================ */

/* ── Egg layer — fixed full-viewport overlay ─────────────────── */
#ch-egg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* pass clicks through to content */
    z-index: 9000;
    overflow: visible;
}

/* ── Egg Hotspot ────────────────────────────────────────────── */
.creatorhunt-egg {
    position: fixed;      /* viewport-fixed so they never stack on content */
    width: 44px;
    height: 52px;
    cursor: pointer;
    z-index: 9000;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 1;
    pointer-events: auto; /* re-enable clicks on eggs inside the no-pointer layer */
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
    animation: ch-egg-float 3s ease-in-out infinite;
    transition: transform 0.2s ease, filter 0.2s ease;
}

@keyframes ch-egg-float {
    0%, 100% { transform: translateY(0px);  }
    50%       { transform: translateY(-7px); }
}

.creatorhunt-egg:hover {
    filter: drop-shadow(0 6px 14px rgba(255,200,0,0.7)) drop-shadow(0 4px 8px rgba(0,0,0,0.4));
    animation: ch-egg-wobble 0.5s ease;
}

@keyframes ch-egg-wobble {
    0%   { transform: scale(1.1) rotate(-6deg); }
    30%  { transform: scale(1.1) rotate(6deg); }
    60%  { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1.1) rotate(0deg); }
}

/* Collect burst animation */
.creatorhunt-egg.collecting {
    animation: ch-egg-collect 0.4s ease forwards;
}
@keyframes ch-egg-collect {
    0%   { transform: scale(1.1); opacity: 1; }
    60%  { transform: scale(1.6); opacity: 0.6; }
    100% { transform: scale(0);   opacity: 0; }
}

/* ── Egg Type CSS Gradients (placeholder until art is designed) ── */
.ch-egg-golden  { background: radial-gradient(circle at 35% 30%, #fff4a3, #ffd700 50%, #ff8c00); }
.ch-egg-sky     { background: radial-gradient(circle at 35% 30%, #dff4ff, #87ceeb 50%, #1e90ff); }
.ch-egg-meadow  { background: radial-gradient(circle at 35% 30%, #c8f7c5, #90ee90 50%, #228b22); }
.ch-egg-blossom { background: radial-gradient(circle at 35% 30%, #ffe8ef, #ffb6c1 50%, #ff69b4); }
.ch-egg-twilight{ background: radial-gradient(circle at 35% 30%, #f0d8f0, #dda0dd 50%, #8b008b); }
.ch-egg-custom  { background: radial-gradient(circle at 35% 30%, #fff, #ccc 50%, #888); }

/* ── Rarity glow effects ─────────────────────────────────────── */
.creatorhunt-egg.ch-egg-rarity-rare:hover,
.creatorhunt-egg.ch-egg-rarity-rare.revealed {
    box-shadow: 0 0 20px rgba(100, 160, 255, 0.9), 0 4px 12px rgba(0,0,0,0.35);
}

.creatorhunt-egg.ch-egg-rarity-legendary:hover,
.creatorhunt-egg.ch-egg-rarity-legendary.revealed {
    box-shadow: 0 0 24px rgba(255, 200, 0, 1), 0 0 40px rgba(255, 165, 0, 0.6), 0 4px 12px rgba(0,0,0,0.4);
    animation: ch-egg-wobble 0.5s ease, ch-legendary-pulse 1.5s ease infinite;
}

@keyframes ch-legendary-pulse {
    0%, 100% { box-shadow: 0 0 24px rgba(255,200,0,1), 0 0 40px rgba(255,165,0,0.6), 0 4px 12px rgba(0,0,0,0.4); }
    50%       { box-shadow: 0 0 36px rgba(255,220,0,1), 0 0 60px rgba(255,165,0,0.9), 0 4px 12px rgba(0,0,0,0.4); }
}

/* Rarity badge shown on hover */
.ch-egg-rarity-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.75rem;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.creatorhunt-egg:hover .ch-egg-rarity-badge,
.creatorhunt-egg.revealed .ch-egg-rarity-badge {
    opacity: 1;
}

/* Egg image (when image_path is set) */
.creatorhunt-egg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    display: block;
}

/* ── Collection Toast ────────────────────────────────────────── */
.ch-toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    background: linear-gradient(135deg, #fffbe6, #fff3b0);
    border: 2px solid #f0c040;
    border-radius: 14px;
    padding: 14px 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.9);
    z-index: 10001;
    max-width: 300px;
    font-family: inherit;
    transform: translateX(360px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.ch-toast.ch-toast-show {
    transform: translateX(0);
}

.ch-toast.ch-toast-hide {
    transform: translateX(360px);
    transition: transform 0.3s ease;
}

.ch-toast-icon {
    font-size: 1.6rem;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.ch-toast-text {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.95rem;
    font-weight: 600;
    color: #5c3d00;
    line-height: 1.3;
}

/* Badge unlock toast — more celebratory */
.ch-toast.ch-badge-toast {
    background: linear-gradient(135deg, #fdf0ff, #e8c4f8);
    border-color: #9b59b6;
    box-shadow: 0 6px 24px rgba(155, 89, 182, 0.4), inset 0 1px 0 rgba(255,255,255,0.9);
}

.ch-toast.ch-badge-toast .ch-toast-text {
    color: #4a0070;
}

/* ── Egg Count Indicator (tiny floating counter) ─────────────── */
.ch-egg-counter {
    position: fixed;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #fff9e6, #ffefc0);
    border: 2px solid #e8b84b;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #7a4f00;
    z-index: 9100;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    display: none; /* shown by JS when event active */
    cursor: pointer;
    text-decoration: none;
}

.ch-egg-counter:hover {
    background: linear-gradient(135deg, #ffefc0, #ffd966);
    text-decoration: none;
    color: #7a4f00;
}

/* ── Profile Badge Grid ──────────────────────────────────────── */
.ch-badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
}

.ch-badge-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 80px;
    cursor: default;
}

.ch-badge-egg {
    width: 56px;
    height: 66px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    overflow: hidden;         /* keep image inside egg shape */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ch-badge-item:hover .ch-badge-egg {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Rarity glow on hover */
.ch-badge-item:has([class*="legendary"]):hover .ch-badge-egg,
.ch-badge-egg.ch-egg-golden:hover {
    box-shadow: 0 0 18px rgba(255,200,0,0.9), 0 4px 12px rgba(0,0,0,0.3);
}

.ch-badge-rarity-star {
    position: absolute;
    top: -6px;
    right: 4px;
    font-size: 0.9rem;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
    pointer-events: none;
}

.ch-badge-label {
    font-size: 0.68rem;
    text-align: center;
    color: #444;
    font-weight: 700;
    word-break: break-word;
    line-height: 1.2;
    max-width: 80px;
}

/* ── Accessibility: reduce motion ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .creatorhunt-egg,
    .creatorhunt-egg:hover,
    .ch-toast {
        transition: none;
        animation: none;
    }
}
