/* wuerfel-styles.css */

/* Styling für den Würfel */
#dice-container {
    perspective: 800px;
    width: 100px;
    height: 100px;
    margin: 20px auto; /* Zentriert den Würfel */
    position: relative; /* Hinzugefügt für stabilere Positionierung */
}

#dice {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d; /* VERY IMPORTANT for 3D effect */
    /* transition is now controlled dynamically in JS */
    box-shadow: 10px 10px 20px #aaa;
    transform-origin: 50% 50%; /* Important for rotation */
}

.face {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: transparent; /* Ensure background is transparent */
    border: 2px solid #000;
    line-height: 100%;
    text-align: center;
    font-size: 20px;
    user-select: none;
    background-size: cover;
    background-position: center;
    box-sizing: border-box;
    backface-visibility: hidden; /* VERY IMPORTANT to show all faces */
    display: flex; /* Added to center images */
    justify-content: center; /* Added to center images */
    align-items: center; /* Added to center images */
}

/* Correct positioning of the faces - these values are crucial for 3D effect */
.front  { transform: rotateX(   0deg) rotateY(   0deg) translateZ(50px); }
.back   { transform: rotateX(   0deg) rotateY(180deg) translateZ(50px); }
.right  { transform: rotateX(   0deg) rotateY(  90deg) translateZ(50px); }
.left   { transform: rotateX(   0deg) rotateY( -90deg) translateZ(50px); }
.top    { transform: rotateX(  90deg) rotateY(   0deg) translateZ(50px); }
.bottom { transform: rotateX( -90deg) rotateY(   0deg) translateZ(50px); }

.face img {
    width: 100%;
    height: 100%;
}

/* Magisches Overlay und Ergebnis-Anzeige */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.overlay.active {
    opacity: 1;
}

/* Elementare Magie Animationen für verschiedene Würfeltypen */
.overlay.farben-magic {
    clip-path: circle(0% at center);
    transition: opacity 0.8s ease-out, clip-path 0.8s ease-out;
}

.overlay.farben-magic.active {
    clip-path: circle(100% at center);
}

.overlay.zahlen-magic {
    clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%);
    transition: opacity 0.8s ease-out, clip-path 0.8s ease-out;
}

.overlay.zahlen-magic.active {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation: number-expand 0.8s forwards;
}

@keyframes number-expand {
    0% {
        clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    }
    100% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
}

.overlay.favoriten-magic {
    clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%);
    transition: opacity 0.8s ease-out;
    transform: rotate(0deg);
}

.overlay.favoriten-magic.active {
    animation: star-expand 0.8s forwards;
}

@keyframes star-expand {
    0% {
        clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    }
    50% {
        clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    }
    100% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
}

/* Magischer Sternenhimmel-Hintergrund */
.overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 3px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 2px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 3px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    z-index: -1;
    animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 0.3;
    }
}

.result-display {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.95), rgba(41, 128, 185, 0.95)); /* Dunkleres Blau für besseren Kontrast */
    color: white;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(142, 68, 173, 0.4), 0 0 20px rgba(52, 152, 219, 0.3);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 1; /* Geändert zu 1, da die Opacity jetzt vom Overlay gesteuert wird */
    transform: scale(1);
    transform-origin: center center;
    transform-style: preserve-3d;
    perspective: 1000px;
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    line-height: 1.6;
}

/* Das Overlay selbst */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.overlay.active {
    opacity: 1;
}

/* Spezielle Animationen für die Ergebnisanzeige je nach Würfeltyp */
.overlay.farben-magic .result-display {
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.4), 0 0 20px rgba(0, 255, 0, 0.3), 0 0 40px rgba(0, 0, 255, 0.2);
    animation: color-pulse 3s infinite alternate;
}

.overlay.zahlen-magic .result-display {
    box-shadow: 0 10px 30px rgba(100, 100, 100, 0.5), 0 0 20px rgba(200, 200, 200, 0.4);
    animation: number-pulse 2s infinite alternate;
}

.overlay.favoriten-magic .result-display {
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
    animation: golden-pulse 2.5s infinite alternate;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

/* Saisonale Variationen für das Modal - subtilere Version */
.overlay.season-fruehling::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    background-image: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="3" fill="rgba(255,192,203,0.15)"/></svg>');
    background-size: 120px 120px;
    animation: gentle-float 40s linear infinite;
    opacity: 0.3;
}

.overlay.season-sommer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(255,215,0,0.05) 0%, transparent 70%);
    background-size: 200px 200px;
    animation: gentle-pulse 15s ease-in-out infinite;
    opacity: 0.2;
}

.overlay.season-herbst::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    background-image: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M10,5 L12,8 L10,11 L8,8 Z" fill="rgba(210,105,30,0.1)"/></svg>');
    background-size: 150px 150px;
    animation: gentle-drift 50s linear infinite;
    opacity: 0.2;
}

.overlay.season-winter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    background-image: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10"><circle cx="5" cy="5" r="1" fill="rgba(255,255,255,0.15)"/></svg>');
    background-size: 100px 100px;
    animation: gentle-snow 60s linear infinite;
    opacity: 0.2;
}

@keyframes color-pulse {
    0% {
        box-shadow: 0 10px 30px rgba(255, 0, 0, 0.4), 0 0 20px rgba(0, 255, 0, 0.3);
    }
    33% {
        box-shadow: 0 10px 30px rgba(0, 255, 0, 0.4), 0 0 20px rgba(0, 0, 255, 0.3);
    }
    66% {
        box-shadow: 0 10px 30px rgba(0, 0, 255, 0.4), 0 0 20px rgba(255, 0, 0, 0.3);
    }
    100% {
        box-shadow: 0 10px 30px rgba(255, 0, 0, 0.4), 0 0 20px rgba(0, 255, 0, 0.3);
    }
}

@keyframes number-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes golden-pulse {
    0% {
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.7), 0 0 60px rgba(255, 215, 0, 0.5);
    }
    100% {
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
    }
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #0066CC, #004C99);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.4);
    transition: all 0.2s ease;
}

.close-button:hover {
    transform: rotate(90deg);
    background: linear-gradient(135deg, #0052a3, #003d7a);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.6);
}

/* Favoriten-Button Styling */
.favorite-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1001;
}

.favorite-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
    outline: none;
}

/* .favorite-button:hover { Hover-Effekt entfernt } */

.favorite-button svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.favorite-button #heart-path {
    transition: fill 0.3s ease, stroke 0.3s ease;
    stroke: white;
}

.favorite-button.active #heart-path {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* Magischer Inhalt */





.magic-content {
    position: relative;
    padding: 10px;
    animation: fade-in 1s ease-out;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
}

/* Spezielle Animationen für den Inhalt je nach Würfeltyp */
.overlay.farben-magic .magic-content {
    animation: fade-in 1s ease-out;
    position: relative;
}

/* Farbige Partikel für den Farbwürfel - subtilere Version */
.overlay.farben-magic .magic-content::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255,0,0,0.1) 2px, transparent 8px),
        radial-gradient(circle at 70% 20%, rgba(0,255,0,0.1) 2px, transparent 8px),
        radial-gradient(circle at 40% 80%, rgba(0,0,255,0.1) 2px, transparent 8px);
    background-size: 200px 200px;
    animation: gentle-color-shift 20s linear infinite;
    opacity: 0.4;
}

.overlay.zahlen-magic .magic-content {
    animation: fade-in 1s ease-out;
    position: relative;
}

/* Schwebende Zahlen für den Zahlenwürfel - subtilere Version */
.overlay.zahlen-magic .magic-content::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"><text x="20" y="50" font-family="Arial" font-size="20" fill="rgba(255,255,255,0.1)">1</text><text x="80" y="120" font-family="Arial" font-size="30" fill="rgba(255,255,255,0.1)">2</text><text x="150" y="80" font-family="Arial" font-size="25" fill="rgba(255,255,255,0.1)">3</text><text x="200" y="180" font-family="Arial" font-size="35" fill="rgba(255,255,255,0.1)">4</text><text x="60" y="220" font-family="Arial" font-size="28" fill="rgba(255,255,255,0.1)">5</text><text x="230" y="70" font-family="Arial" font-size="22" fill="rgba(255,255,255,0.1)">6</text></svg>');
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
}

.overlay.favoriten-magic .magic-content {
    animation: fade-in 1s ease-out, golden-glow 3s infinite alternate;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    position: relative;
}

/* Goldene Sterne für den Favoritenwürfel - subtilere Version */
.overlay.favoriten-magic .magic-content::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M10 1 L12 7 L18 7 L13 10 L15 16 L10 13 L5 16 L7 10 L2 7 L8 7 Z" fill="rgba(255,215,0,0.15)"/></svg>');
    background-repeat: space;
    background-size: 150px 150px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.2;
    animation: gentle-star-twinkle 15s ease-in-out infinite;
}

@keyframes color-text-change {
    0% {
        color: white;
    }
    20% {
        color: #ffcccc; /* Leichtes Rot */
    }
    40% {
        color: #ccffcc; /* Leichtes Grün */
    }
    60% {
        color: #ccccff; /* Leichtes Blau */
    }
    80% {
        color: #ffffcc; /* Leichtes Gelb */
    }
    100% {
        color: white;
    }
}

/* Animation number-float wurde entfernt */

@keyframes golden-glow {
    0% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    100% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5);
    }
}

/* Animation für farbige Partikel */
@keyframes color-particles {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

/* Animation für schwebende Zahlen */
@keyframes floating-numbers {
    0% {
        background-position: 0px 0px;
        opacity: 0.2;
    }
    25% {
        opacity: 0.3;
    }
    50% {
        background-position: 20px 10px;
        opacity: 0.4;
    }
    75% {
        opacity: 0.3;
    }
    100% {
        background-position: 0px 0px;
        opacity: 0.2;
    }
}

/* Animation für blinkende Sterne */
@keyframes star-twinkle {
    0%, 100% {
        opacity: 0;
    }
    25%, 75% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.5;
    }
}

/* Sanftere Animationen */
@keyframes gentle-float {
    0% {
        background-position: 0px 0px;
    }
    100% {
        background-position: 50px 50px;
    }
}

@keyframes gentle-pulse {
    0% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.2;
    }
    100% {
        opacity: 0.1;
    }
}

@keyframes gentle-drift {
    0% {
        background-position: 0px 0px;
    }
    100% {
        background-position: 30px 30px;
    }
}

@keyframes gentle-snow {
    0% {
        background-position: 0px 0px;
    }
    100% {
        background-position: 20px 20px;
    }
}

@keyframes gentle-color-shift {
    0% {
        background-position: 0% 0%;
        opacity: 0.1;
    }
    50% {
        opacity: 0.2;
    }
    100% {
        background-position: 100% 100%;
        opacity: 0.1;
    }
}

/* Animation gentle-number-float wurde entfernt */

@keyframes gentle-star-twinkle {
    0%, 100% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.2;
    }
}



@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gewinner-Styling */

.winner-header {
    margin-bottom: 20px;
}

.winner-header h2 {
    color: #4a69bd;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    margin: 0;
    letter-spacing: 1px;
}

.winner-subtitle {
    font-size: 18px;
    color: #636e72;
    margin-top: 10px;
    font-style: italic;
}

.winner-content {
    padding: 15px;
}

.winner-content p {
    font-size: 18px;
    color: #333;
    margin: 10px 0;
}

.winner-announcement {
    font-size: 20px;
    color: #2d3436;
    font-weight: 500;
}

.winner-name {
    font-size: 32px;
    font-weight: bold;
    color: #e84118;
    background-color: #ffeaa7;
    padding: 15px 25px;
    margin: 20px auto;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px dashed #e84118;
    animation: pulse 2s infinite;
}

.winner-decoration {
    font-size: 24px;
    margin: 15px 0;
    letter-spacing: 10px;
}

.winner-congrats {
    font-style: italic;
    color: #6c5ce7;
    font-weight: 500;
    font-size: 19px;
}

.winner-message {
    margin-top: 15px;
    color: #00b894;
    font-weight: 500;
    font-size: 17px;
}

/* Media Queries für mobile Geräte */
@media screen and (max-width: 768px) {
    .result-display {
        width: 95%;
        padding: 15px;
        max-height: 85vh;
    }
    
    .winner-header h2 {
        font-size: 24px;
    }
    
    .winner-subtitle {
        font-size: 16px;
    }
    
    .winner-content p {
        font-size: 16px;
    }
    
    .winner-announcement {
        font-size: 18px;
    }
    
    .winner-name {
        font-size: 26px;
        padding: 12px 20px;
        margin: 15px auto;
    }
    
    .winner-decoration {
        font-size: 22px;
        letter-spacing: 8px;
    }
    
    .winner-congrats {
        font-size: 17px;
    }
    
    .winner-message {
        font-size: 16px;
    }
    
    .close-button {
        top: 5px;
        right: 5px;
    }
    
    /* Optimierungen für Touch-Geräte */
    .close-button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    /* Reduzierte Animationen für bessere Performance */
    .overlay.farben-magic .magic-content::before,
    .overlay.farben-magic .magic-content::after,
    .overlay.zahlen-magic .magic-content::before,
    .overlay.favoriten-magic .magic-content::before,
    .overlay.favoriten-magic .magic-content::after {
        animation-duration: 20s; /* Langsamere Animationen für bessere Performance */
    }
    
    /* Reduzierte saisonale Effekte */
    .overlay.season-fruehling::before,
    .overlay.season-sommer::before,
    .overlay.season-herbst::before,
    .overlay.season-winter::before {
        opacity: 0.4;
        background-size: 80px 80px, 40px 40px; /* Größere, aber weniger Partikel */
    }
}

/* Extra kleine Geräte */
@media screen and (max-width: 480px) {
    .result-display {
        width: 98%;
        padding: 12px;
    }
    
    .winner-header h2 {
        font-size: 22px;
    }
    
    .winner-subtitle {
        font-size: 15px;
    }
    
    .winner-content p {
        font-size: 15px;
    }
    
    .winner-announcement {
        font-size: 16px;
    }
    
    .winner-name {
        font-size: 24px;
        padding: 10px 15px;
    }
    
    .winner-decoration {
        font-size: 20px;
        letter-spacing: 6px;
    }
    
    .winner-congrats {
        font-size: 16px;
    }
    
    .winner-message {
        font-size: 15px;
    }
    
    /* Noch stärkere Optimierungen für sehr kleine Geräte */
    .overlay.farben-magic .magic-content::before,
    .overlay.farben-magic .magic-content::after,
    .overlay.zahlen-magic .magic-content::before,
    .overlay.favoriten-magic .magic-content::before,
    .overlay.favoriten-magic .magic-content::after {
        display: none; /* Deaktiviere komplexe Hintergrundanimationen */
    }
    
    /* Vereinfachte saisonale Effekte */
    .overlay.season-fruehling::before,
    .overlay.season-sommer::before,
    .overlay.season-herbst::before,
    .overlay.season-winter::before {
        opacity: 0.2;
        animation-duration: 30s; /* Noch langsamere Animationen */
    }
    
    /* Vereinfachte Transformationseffekte */
    .result-display {
        transform: scale(0.5);
        transition: transform 0.4s ease-out, opacity 0.4s ease-out;
    }
    
    .overlay.active .result-display {
        transform: scale(1);
    }
}

/* Klasse für reduzierte Animationen (wird per JavaScript hinzugefügt) */
.reduced-animations .overlay::before,
.reduced-animations .overlay.farben-magic::before,
.reduced-animations .overlay.zahlen-magic::before,
.reduced-animations .overlay.favoriten-magic::before,
.reduced-animations .overlay.season-fruehling::before,
.reduced-animations .overlay.season-sommer::before,
.reduced-animations .overlay.season-herbst::before,
.reduced-animations .overlay.season-winter::before {
    animation-duration: 30s;
    opacity: 0.3;
}

.reduced-animations .magic-content {
    animation-duration: 10s;
}

/* Einfachere Würfelanimation für leistungsschwache Geräte */
.simple-animation {
    transition-timing-function: ease-in-out !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 5px 20px rgba(232, 65, 24, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
}

/* Farbwürfel Animation: Farbexplosion */
@keyframes color-explosion {
    0% {
        opacity: 0;
        background: radial-gradient(circle at center, transparent 100%, rgba(0,0,0,0.8) 100%);
    }
    25% {
        opacity: 1;
        background: radial-gradient(circle at center, 
            rgba(255,0,0,0.7) 10%, 
            rgba(0,255,0,0.7) 20%, 
            rgba(0,0,255,0.7) 30%, 
            rgba(255,255,0,0.7) 40%, 
            rgba(255,0,255,0.7) 50%, 
            rgba(0,255,255,0.7) 60%, 
            rgba(0,0,0,0.8) 100%);
    }
    75% {
        opacity: 0.8;
        background: radial-gradient(circle at center, 
            rgba(255,0,0,0.3) 20%, 
            rgba(0,255,0,0.3) 30%, 
            rgba(0,0,255,0.3) 40%, 
            rgba(255,255,0,0.3) 50%, 
            rgba(255,0,255,0.3) 60%, 
            rgba(0,255,255,0.3) 70%, 
            rgba(0,0,0,0.8) 100%);
    }
    100% {
        opacity: 0;
    }
}

/* Zahlenwürfel Animation: Zahlen fliegen zusammen */
@keyframes number-formation {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 100 100"><text x="10" y="30" font-family="Arial" font-size="10" fill="white">1</text><text x="80" y="20" font-family="Arial" font-size="15" fill="white">2</text><text x="40" y="50" font-family="Arial" font-size="20" fill="white">3</text><text x="70" y="70" font-family="Arial" font-size="12" fill="white">4</text><text x="20" y="80" font-family="Arial" font-size="18" fill="white">5</text><text x="50" y="90" font-family="Arial" font-size="14" fill="white">6</text></svg>');
    }
    60% {
        opacity: 0.8;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 100 100"><text x="20" y="35" font-family="Arial" font-size="12" fill="white">1</text><text x="70" y="30" font-family="Arial" font-size="17" fill="white">2</text><text x="45" y="50" font-family="Arial" font-size="22" fill="white">3</text><text x="65" y="65" font-family="Arial" font-size="14" fill="white">4</text><text x="30" y="75" font-family="Arial" font-size="20" fill="white">5</text><text x="50" y="85" font-family="Arial" font-size="16" fill="white">6</text></svg>');
    }
    100% {
        opacity: 0;
    }
}

/* Favoritenwürfel Animation: Goldene Funken */
@keyframes golden-sparkle {
    0% {
        opacity: 0;
        background-image: radial-gradient(circle at 30% 30%, rgba(255,215,0,0.8) 1px, transparent 1px),
                          radial-gradient(circle at 70% 40%, rgba(255,215,0,0.8) 1px, transparent 1px),
                          radial-gradient(circle at 40% 60%, rgba(255,215,0,0.8) 1px, transparent 1px),
                          radial-gradient(circle at 60% 70%, rgba(255,215,0,0.8) 1px, transparent 1px);
        background-size: 100px 100px;
    }
    25% {
        opacity: 1;
        background-image: radial-gradient(circle at 30% 30%, rgba(255,215,0,0.8) 3px, transparent 3px),
                          radial-gradient(circle at 70% 40%, rgba(255,215,0,0.8) 4px, transparent 4px),
                          radial-gradient(circle at 40% 60%, rgba(255,215,0,0.8) 5px, transparent 5px),
                          radial-gradient(circle at 60% 70%, rgba(255,215,0,0.8) 4px, transparent 4px),
                          radial-gradient(circle at 20% 20%, rgba(255,215,0,0.8) 2px, transparent 2px),
                          radial-gradient(circle at 80% 50%, rgba(255,215,0,0.8) 3px, transparent 3px),
                          radial-gradient(circle at 50% 80%, rgba(255,215,0,0.8) 4px, transparent 4px);
        background-size: 150px 150px;
    }
    75% {
        opacity: 0.7;
        background-image: radial-gradient(circle at 30% 30%, rgba(255,215,0,0.5) 5px, transparent 5px),
                          radial-gradient(circle at 70% 40%, rgba(255,215,0,0.5) 6px, transparent 6px),
                          radial-gradient(circle at 40% 60%, rgba(255,215,0,0.5) 7px, transparent 7px),
                          radial-gradient(circle at 60% 70%, rgba(255,215,0,0.5) 6px, transparent 6px),
                          radial-gradient(circle at 20% 20%, rgba(255,215,0,0.5) 4px, transparent 4px),
                          radial-gradient(circle at 80% 50%, rgba(255,215,0,0.5) 5px, transparent 5px),
                          radial-gradient(circle at 50% 80%, rgba(255,215,0,0.5) 6px, transparent 6px);
        background-size: 200px 200px;
    }
    100% {
        opacity: 0;
    }
}

/* Blüten-Stil Animationen für die verschiedenen Würfeltypen */
@keyframes color-bloom {
    0% {
        opacity: 0;
        clip-path: circle(0% at center);
    }
    25% {
        opacity: 0.3;
        clip-path: circle(25% at center);
    }
    50% {
        opacity: 0.6;
        clip-path: circle(50% at center);
    }
    75% {
        opacity: 0.8;
        clip-path: circle(75% at center);
    }
    100% {
        opacity: 1;
        clip-path: circle(100% at center);
    }
}

@keyframes number-bloom {
    0% {
        opacity: 0;
        clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%);
    }
    20% {
        opacity: 0.2;
        clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
    }
    40% {
        opacity: 0.4;
        clip-path: polygon(40% 0%, 70% 30%, 100% 40%, 70% 70%, 40% 100%, 30% 70%, 0% 40%, 30% 30%);
    }
    60% {
        opacity: 0.6;
        clip-path: polygon(30% 0%, 80% 20%, 100% 30%, 80% 80%, 30% 100%, 20% 80%, 0% 30%, 20% 20%);
    }
    80% {
        opacity: 0.8;
        clip-path: polygon(20% 0%, 90% 10%, 100% 20%, 90% 90%, 20% 100%, 10% 90%, 0% 20%, 10% 10%);
    }
    100% {
        opacity: 1;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
}

@keyframes golden-bloom {
    0% {
        opacity: 0;
        clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%);
        transform: rotate(0deg);
    }
    20% {
        opacity: 0.2;
        clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
        transform: rotate(72deg);
    }
    40% {
        opacity: 0.4;
        clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
        transform: rotate(144deg);
    }
    60% {
        opacity: 0.6;
        clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
        transform: rotate(216deg);
    }
    80% {
        opacity: 0.8;
        clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
        transform: rotate(288deg);
    }
    100% {
        opacity: 1;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
        transform: rotate(360deg);
    }
}

/* Button-Styling */
#button-container {
    text-align: center;
    margin-top: 30px;
}

.overlay-open-button {
    background-color: #4a69bd;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Standardmäßig unsichtbar machen, um Flackern beim Laden zu vermeiden */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* .overlay-open-button:hover { Hover-Effekt entfernt } */

.overlay-open-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Link-Container und Link-Buttons */
.link-container {
    margin-top: 20px;
    text-align: center;
}

.etsy-link-btn, .external-link-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.etsy-link-btn {
    background-color: #F1641E;
    color: white;
}

.etsy-link-btn:hover {
    background-color: #e05a18;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.external-link-btn {
    background-color: #f3f4f6;
    color: #4b5563;
}

.external-link-btn:hover {
    background-color: #e5e7eb;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Audio-Container und Audio-Button */
.audio-container {
    margin-top: 30px;
    text-align: center;
}

.play-audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f3f4f6;
    color: #4b5563;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.play-audio-btn i {
    font-size: 20px;
}

.play-audio-btn:hover {
    background-color: #e5e7eb;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.play-audio-btn:active {
    transform: scale(0.95);
}
