.tip-goal-widget {
    background: rgba(12, 12, 16, 0.75);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

body.livechat-tip-goals-launcher-active #tipGoalWidget {
    position: fixed;
    left: 18px;
    bottom: 64px;
    right: auto;
    top: auto;
    width: min(300px, calc(100vw - 84px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    z-index: 10017;
    margin-top: 0;
}

body.livechat-tip-goals-launcher-active #tipGoalWidget:not(.tip-goal-widget--launcher-open) {
    display: none !important;
}

body.livechat-tip-goals-launcher-active #tipGoalWidget.tip-goal-widget--launcher-open {
    display: block !important;
}

body.is-livechat-fullscreen #tipGoalWidget .tip-goal-widget__header {
    cursor: move;
}

.tip-goal-widget__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tip-goal-widget__title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
}

.tip-goal-widget__list,
.tip-goal-widget__recent {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tip-goal-widget__recent-title {
    margin-top: 18px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

.tip-goal-widget__empty {
    font-size: 0.9rem;
    opacity: 0.65;
    padding: 12px 0;
}

.tip-goal-card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tip-goal-card--actionable {
    cursor: pointer;
    touch-action: manipulation;
}

.tip-goal-card--actionable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.tip-goal-card--actionable:focus-visible {
    outline: 3px solid var(--systemLogoColor, #ffca3a);
    outline-offset: 2px;
}

.tip-goal-card--display-only {
    cursor: default;
}

.tip-goal-card__mode {
    display: inline-flex;
    margin-top: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tip-goal-card__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.tip-goal-card__title {
    font-weight: 600;
    font-size: 1rem;
}

.tip-goal-card__value {
    font-size: 0.85rem;
    opacity: 0.8;
}

.tip-goal-card__progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.tip-goal-card__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff7a18, #ffca3a);
    transition: width 0.8s ease;
}

.tip-goal-card__meta {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 6px;
}

.tip-goal-card--flash {
    animation: tipGoalPulse 1.2s ease;
}

.tip-goal-card--complete {
    box-shadow: 0 0 12px rgba(255, 202, 58, 0.6);
    border-color: rgba(255, 202, 58, 0.8);
}

@keyframes tipGoalPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.tip-goal-widget--girlinfo {
    background: #111;
    border-color: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .tip-goal-widget {
        padding: 12px;
    }

    #tipGoalWidget:not(.tip-goal-widget--launcher-open) {
        display: none !important;
    }

    #tipGoalWidget.tip-goal-widget--launcher-open,
    body.is-livechat-fullscreen #tipGoalWidget.tip-goal-widget--launcher-open {
        display: block !important;
        position: fixed;
        left: max(8px, env(safe-area-inset-left));
        right: auto;
        top: auto;
        bottom: max(72px, calc(64px + env(safe-area-inset-bottom)));
        width: min(300px, calc(100vw - 84px - env(safe-area-inset-left) - env(safe-area-inset-right)));
        max-height: min(38vh, 320px);
        padding: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        z-index: 10017;
        margin-top: 0;
    }

    .tip-goal-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    #tipGoalWidget.tip-goal-widget--launcher-open .tip-goal-card__header {
        flex-direction: row;
        align-items: baseline;
    }
}

@supports (height: 100dvh) {
    @media (max-width: 768px), (hover: none) and (pointer: coarse) {
        #tipGoalWidget.tip-goal-widget--launcher-open {
            max-height: min(38dvh, 320px);
        }
    }
}

#tipgoalmodal.tipgoalmodal--compact {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    max-width: 420px;
    max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: none;
    animation: none;
    -webkit-overflow-scrolling: touch;
    z-index: 10017;
}

body.is-livechat-fullscreen #tipgoalmodal.tipgoalmodal--compact {
    bottom: max(72px, calc(64px + env(safe-area-inset-bottom)));
}

#tipgoalmodal.tipgoalmodal--compact:focus {
    outline: none;
}

@supports (height: 100dvh) {
    #tipgoalmodal.tipgoalmodal--compact {
        max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
}

/* Konfetti */
.goal-confetti {
    position: fixed;
    top: -20px;
    width: 10px;
    height: 14px;
    opacity: 0.9;
    border-radius: 2px;
    pointer-events: none;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0.3;
    }
}

/* Feuerwerk-Burst */
.goal-firework {
    position: fixed;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #fff, #ffd700);
    border-radius: 50%;
    pointer-events: none;
    animation: fireworkMove 0.8s ease-out forwards, fireworkFade 0.8s linear forwards;
}

@keyframes fireworkMove {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0.3);
    }
}

@keyframes fireworkFade {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}


/* --- Mega-Konfetti (dein Stil, aber erweitert) --- */
.confetti-piece {
    position: fixed;
    width: var(--size);
    height: var(--size);
    border-radius: var(--rounding);
    background: var(--color);
    left: var(--startX);
    top: var(--startY);
    pointer-events: none;
    animation: confetti-fall var(--duration) ease-out forwards;
}

@keyframes confetti-fall {
    to {
        transform: translate(var(--xMove), var(--yMove)) rotateX(var(--xRot)) rotateY(var(--yRot)) rotateZ(var(--zRot));
        opacity: 0.3;
    }
}

/* --- Stream Confetti (senkrechte Regen-Streifen) --- */
.confetti-stream {
    position: fixed;
    top: -5vh;
    width: 6px;
    height: 24px;
    border-radius: 3px;
    opacity: 0.9;
    pointer-events: none;
    animation: streamFall linear forwards;
}

@keyframes streamFall {
    to {
        transform: translateY(110vh);
        opacity: 0.2;
    }
}

/* --- Burst-Partikel (Feuerwerk-Kreis) --- */
.confetti-burst {
    position: fixed;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    animation: burstMove 0.8s ease-out forwards, burstFade 0.8s linear forwards;
}

@keyframes burstMove {
    to {
        transform: translate(var(--tx), var(--ty)) scale(0.3);
    }
}

@keyframes burstFade {
    to {
        opacity: 0;
    }
}

/* --- Ribbon-Konfetti (Flatternde Streifen) --- */
.confetti-ribbon {
    position: fixed;
    top: -10vh;
    width: 12px;
    height: 40px;
    border-radius: 4px;
    opacity: 0.9;
    pointer-events: none;
    animation: ribbonFall ease-in-out forwards;
}

@keyframes ribbonFall {
    0% {
        transform: rotate(0deg) translateY(0);
    }

    50% {
        transform: rotate(180deg) translateY(60vh);
    }

    100% {
        transform: rotate(360deg) translateY(110vh);
        opacity: 0.2;
    }
}
