.clicker-widget {
    position: relative;
    padding: 8px 0 4px;
    margin-bottom: 12px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.clicker-widget--hero {
    padding: 40px 24px;
    max-width: 360px;
    margin: 24px auto;
}

.clicker-orb {
    position: relative;
    display: block;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    width: 96px;
    height: 96px;
    -webkit-tap-highlight-color: transparent;
}

.clicker-widget--hero .clicker-orb {
    width: 220px;
    height: 220px;
}

.clicker-orb-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

/* Rising liquid — controlled by --fill-level (0..1) set via JS.
   Opacity ramps from subtle to near-solid so a full star reads as lit. */
.clicker-liquid-fill {
    transform: translateY(calc((1 - var(--fill-level, 0)) * 120px));
    opacity: calc(0.35 + var(--fill-level, 0) * 0.6);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.55s ease;
}

/* Aura behind the star — invisible when empty, blazing when full */
.clicker-aura {
    opacity: calc(var(--fill-level, 0) * 0.85);
    transition: opacity 0.55s ease;
    transform-origin: 60px 60px;
}

/* Near-full (>= 0.75): bloom + pulse so it's obvious the orb is "full of light"
   and about to flush a star to the wallet. */
.clicker-orb.full .clicker-orb-svg {
    filter: drop-shadow(0 0 16px rgba(255, 216, 95, 0.85))
            drop-shadow(0 0 36px rgba(255, 122, 182, 0.55))
            drop-shadow(0 0 60px rgba(194, 159, 255, 0.35));
}

.clicker-orb.full .clicker-aura {
    animation: clicker-aura-pulse 1.2s ease-in-out infinite;
}

@keyframes clicker-aura-pulse {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.14); }
}

/* 5-star boost: the pending bar just flushed a whole star to the wallet.
   Brief burst so the boost is unmistakable, then state returns to the low
   fill-level of the next cycle. */
.clicker-orb.flushed .clicker-orb-svg {
    animation: clicker-flush-burst 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1;
}

@keyframes clicker-flush-burst {
    0%   { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1))
                    drop-shadow(0 0 40px rgba(255, 216, 95, 0.9));
           transform: scale(1.12); }
    35%  { filter: drop-shadow(0 0 12px rgba(255, 216, 95, 0.7))
                    drop-shadow(0 0 28px rgba(255, 122, 182, 0.5));
           transform: scale(0.98); }
    100% { filter: none; transform: scale(1); }
}

.clicker-orb.flushed .clicker-ripple {
    opacity: 1;
    animation: clicker-flush-ring 0.95s ease-out;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(255, 216, 95, 0.55) 35%,
        rgba(255, 122, 182, 0.3) 65%,
        transparent 100%);
}

@keyframes clicker-flush-ring {
    0%   { transform: scale(0.4); opacity: 0.95; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* Flush particle (the "+⭐ N" drop-into-wallet call-out) */
.clicker-particle.clicker-particle--flush {
    font-size: 1.5em;
    font-weight: 800;
    filter: drop-shadow(0 0 8px rgba(255, 216, 95, 0.9));
    animation: clicker-flush-rise 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes clicker-flush-rise {
    0%   { opacity: 0; transform: translateY(-4px) scale(0.7) rotate(-6deg); }
    20%  { opacity: 1; transform: translateY(-14px) scale(1.2) rotate(3deg); }
    100% { opacity: 0; transform: translateY(-72px) scale(0.9) rotate(10deg); }
}

/* Click: brief liveliness (bounce + subtle bob for ~2s), then static */
.clicker-orb.bounce .clicker-orb-svg {
    animation: clicker-click-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1,
               clicker-post-click-bob 2.2s ease-in-out 0.5s 1;
}

@keyframes clicker-click-bounce {
    0%   { transform: scale(1) rotate(0); }
    30%  { transform: scale(0.84) rotate(-7deg); }
    55%  { transform: scale(1.22) rotate(5deg); }
    78%  { transform: scale(0.96) rotate(-2deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes clicker-post-click-bob {
    0%, 100% { transform: translateY(0) rotate(0); }
    25%      { transform: translateY(-2px) rotate(1.5deg); }
    60%      { transform: translateY(-1px) rotate(-1deg); }
}

/* Hourly refill flourish — full spin + fill wash */
.clicker-orb.refilling .clicker-orb-svg {
    animation: clicker-refill-spin 1.6s cubic-bezier(0.68, -0.3, 0.32, 1.3) 1;
}

@keyframes clicker-refill-spin {
    0%   { transform: rotate(0) scale(1); }
    35%  { transform: rotate(200deg) scale(1.18); }
    65%  { transform: rotate(340deg) scale(0.94); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Ripples */
.clicker-ripple, .clicker-ripple-2 {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.clicker-orb.ripple .clicker-ripple {
    opacity: 1;
    animation: clicker-ripple-out 0.85s ease-out;
    background: radial-gradient(circle,
        rgba(255, 216, 95, 0.5) 0%,
        rgba(255, 122, 182, 0.25) 40%,
        transparent 70%);
}

.clicker-orb.refilling .clicker-ripple,
.clicker-orb.refilling .clicker-ripple-2 {
    opacity: 1;
    animation: clicker-refill-wave 1.8s ease-out;
    background: radial-gradient(circle,
        rgba(255, 216, 95, 0.7) 0%,
        rgba(111, 225, 165, 0.5) 35%,
        rgba(194, 159, 255, 0.35) 65%,
        transparent 100%);
}
.clicker-orb.refilling .clicker-ripple-2 {
    animation-delay: 0.3s;
}

@keyframes clicker-ripple-out {
    0%   { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(2.0); opacity: 0; }
}

@keyframes clicker-refill-wave {
    0%   { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(3.0); opacity: 0; }
}

/* Floating drip number on click */
.clicker-particle {
    position: absolute;
    font-family: 'Crimson Text', serif;
    font-size: 0.95em;
    font-weight: 700;
    pointer-events: none;
    z-index: 10;
    animation: clicker-drip-rise 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    background: linear-gradient(90deg, var(--candy-sun), var(--candy-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes clicker-drip-rise {
    0%   { opacity: 1; transform: translateY(0) scale(1) rotate(-4deg); }
    60%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-52px) scale(0.8) rotate(7deg); }
}

/* Word stream — stacked chips below the orb */
.clicker-stream {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 4px 6px;
    margin: 8px 4px 6px;
    max-height: 88px;
    overflow: hidden;
    line-height: 1.15;
    mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}

.clicker-widget--hero .clicker-stream {
    max-height: 160px;
    gap: 6px 10px;
    margin: 16px 8px 12px;
}

.clicker-word {
    display: inline-block;
    font-family: 'Crimson Text', serif;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 1px 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid currentColor;
    text-shadow: 0 0 6px currentColor;
    opacity: 0;
    transform: translateY(-4px) scale(0.85);
    animation: clicker-word-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: opacity 0.6s ease;
    user-select: none;
    white-space: nowrap;
}

.clicker-word--mine {
    background: rgba(255, 255, 255, 0.09);
    border-style: dashed;
}

@keyframes clicker-word-in {
    0%   { opacity: 0; transform: translateY(-6px) scale(0.7) rotate(-3deg); }
    60%  { opacity: 1; transform: translateY(0) scale(1.08) rotate(1.5deg); }
    100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

/* Word input */
.clicker-wordform {
    width: 100%;
    margin: 0 6px;
    display: flex;
    box-sizing: border-box;
}

.clicker-wordinput {
    flex: 1;
    width: 100%;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(194, 159, 255, 0.35);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--text-color, #e8e8e8);
    font-family: 'Crimson Text', serif;
    font-size: 0.95em;
    text-align: center;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.clicker-wordinput::placeholder {
    color: var(--text-muted, #777);
    font-style: italic;
    letter-spacing: 0.5px;
}

.clicker-wordinput:focus {
    border-color: var(--candy-pink);
    box-shadow: 0 0 0 2px rgba(255, 122, 182, 0.18),
                0 0 12px rgba(255, 122, 182, 0.25);
    background: rgba(0, 0, 0, 0.28);
}

.clicker-wordinput.flash {
    animation: clicker-input-flash 0.35s ease-out;
}

@keyframes clicker-input-flash {
    0%   { background: rgba(255, 216, 95, 0.22); }
    100% { background: rgba(0, 0, 0, 0.28); }
}
