#story-button {
    position: fixed; bottom:80px; right:15px;
    background-color:#25D366; color:white; border-radius:50%;
    width:60px; height:60px; display:flex; align-items:center; justify-content:center;
    font-size:30px; background: url('icon.png') no-repeat center center;
    background-size: contain; /* Icon proportional */ cursor:pointer; box-shadow:0 4px 10px rgba(0,0,0,0.3); z-index:9999;
}

/* Popup halbtransparent schwarzer Hintergrund */
#story-popup {
    display:none; 
    position:fixed; 
    top:0; left:0; 
    width:100%; height:100%;
    background: rgba(0,0,0,0.8);
    display:flex; 
    justify-content:center; 
    align-items:center; 
    flex-direction:column;
    z-index:10000; 
    overflow:hidden;
}

/* Bild mittig, angepasst */
#story-container {
    position: relative;
    max-width:90%;
    max-height:80%;
    display:flex;
    justify-content:center;
    align-items:center;
}

#story-image {
    max-width:100%;
    max-height:100%;
    object-fit:contain;
    border-radius:10px;
    opacity:0;
    transition: opacity 0.5s ease-in-out;
}

/* Story-Text unter dem Bild */
#story-text {
    margin-top: 10px;
    color: white;
    font-size: 18px;
    text-align: center;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
    white-space: pre-line; /* Zeilenumbrüche aus JSON werden angezeigt */
}


/* X oben rechts */
#story-close {
    position:absolute; top:20px; right:20px;
    font-size:30px; color:white; cursor:pointer; z-index:10;
}

/* Fortschrittsbalken oben */
#story-bars {
    position:absolute; top:20px; left:20px; right:20px; display:flex; gap:5px; z-index:10;
}
.story-bar { flex:1; height:4px; background:rgba(255,255,255,0.3); border-radius:2px; overflow:hidden; }
.story-bar-inner { height:100%; width:0%; background:white; transition: width linear; }

/* Klick-Zonen links/rechts auf Bild */
#story-left, #story-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    z-index: 20; /* über Bild */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3); /* leicht sichtbar */
    border-radius: 50%;
}

/* Links/Rechts innerhalb des Containers */
#story-left { left: 10px; }   /* 10px vom linken Rand des Bildes */
#story-right { right: 10px; } /* 10px vom rechten Rand des Bildes */

/* Pfeile sichtbar */
#story-left::before, #story-right::before {
    content:'';
    display:block;
    width:0;
    height:0;
    border-style: solid;
    opacity:0.9;
}

#story-left::before {
    border-width: 20px 25px 20px 0;
    border-color: transparent white transparent transparent;
}

#story-right::before {
    border-width: 20px 0 20px 25px;
    border-color: transparent transparent transparent white;
}

/* Mobile Anpassung */
@media screen and (max-width:768px){
    #story-left, #story-right {
        width: 40px; height: 40px;
    }
    #story-left { left: 5px; }
    #story-right { right: 5px; }
    #story-left::before { border-width: 15px 20px 15px 0; }
    #story-right::before { border-width: 15px 0 15px 20px; }
}
