*,
::after,
::before {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
html {
	font-size: 110%;
}
html,
body {
	height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: #fff; /* Hauptseiten-Hintergrund jetzt weiß */
    color: #111;
    min-height: 100vh;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
}

main#profile-page {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

#story-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100vw;
    min-height: 100vh;
    background: #111; /* Optional: Story-Seite weiterhin dunkel */
}

#story-container {
    width: 100vw;
    height: 100vh;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    margin-bottom: 1rem;
    touch-action: manipulation;
    position: relative;
    margin-left: auto;
    margin-right: auto;
}

#story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    display: block;
}

/* Panel captions ausblenden */
#caption {
    display: none;
}

h1 {
    font-size: 1.3rem;
    margin: 1rem 0 0.5rem 0;
    letter-spacing: 0.05em;
}

/* Instagram-Story Kreis-Styling */
#profile-stories {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 1rem;
    justify-content: center;
}

#story-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    margin-right: 2rem;
    margin-left: 0; /* kein zusätzlicher linker Abstand */
}

.story-ring {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border: 4px solid transparent;
    box-sizing: border-box;
    position: relative;
    overflow: hidden; /* Bild bleibt im Kreis */
}

.story-thumb {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: url('https://hbk-bs.github.io/a-generative-graphic-novel-team-anna-luca-pauline/Spaghettiapokalypse.png') center/cover no-repeat;
    position: absolute; /* Absolut im Ring platzieren */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 2px solid #fff;
    margin: 0; /* Kein margin-top mehr */
    pointer-events: none;
}

#profile-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin: 1rem 0 0.2rem 0; /* mehr Abstand nach oben */
    gap: 0.2rem;
    width: 100vw;
}

#profile-header-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem; /* Weniger Abstand zwischen Kugel und Texten */
    width: 100%;
    margin-top: 1.5rem; /* zusätzlicher Abstand zwischen Story-Kugel und Texten */
}

#profile-header > div:not(#story-bubble),
#profile-header-row > div:not(#story-bubble) {
    min-width: 0;
    max-width: 55vw;
}

#profile-header h2 {
    margin: 0 0 0.1rem 0;
    font-size: 1rem; /* deutlich kleiner */
    font-weight: 600;
    letter-spacing: 0.01em;
}
#profile-header p {
    margin: 0 0 0.4rem 0;
    color: #888;
    font-size: 0.85rem; /* deutlich kleiner */
}

#profile-stats {
    display: flex;
    gap: 2.5rem; /* mehr Abstand zwischen den Zahlen */
    margin-bottom: 0.4rem;
    margin-top: 0.1rem;
}
#profile-stats div {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.stat-number {
    font-weight: bold;
    font-size: 0.9rem; /* kleiner */
    color: #111;
}
.stat-label {
    font-size: 0.7rem; /* kleiner */
    color: #888;
    margin-top: -2px;
}

#profile-bio {
    max-width: 98vw;
    font-size: 0.6rem;
    margin-top: 2rem; /* mehr Abstand nach oben zur Bio */
    margin-bottom: 0.2rem;
    padding-right: 0.1rem;
    word-break: break-word;
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    text-align: left;
}

#profile-bio a {
    color: #3897f0;
    text-decoration: none;
    font-size: 0.95rem;
}
#profile-bio a:hover {
    text-decoration: underline;
}

#story-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    padding: 0.7rem 0.7rem 0 0.7rem;
    box-sizing: border-box;
    pointer-events: none; /* damit Klicks aufs Bild durchgehen */
}

#progress-bar {
    display: flex;
    width: 100%;
    height: 4px;
    margin-top: 0;
    margin-bottom: 0.3rem;
    background: transparent;
    gap: 2px;
    position: relative;
    z-index: 2;
}

.progress-segment {
    flex: 1;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    transition: background 0.3s;
}

.progress-segment.active {
    background: #fff;
}

.story-ring-small {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    margin-bottom: 0.2rem;
    margin-top: 0.2rem;
    margin-left: 0.1rem;
    position: relative;
    z-index: 3;
}

.story-thumb-small {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    margin-top: 0;
    background: url('https://hbk-bs.github.io/a-generative-graphic-novel-team-anna-luca-pauline/Spaghettiapokalypse.png') center/cover no-repeat;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 50%;
    position: relative;
    z-index: 4;
}

/* Panels sollen nicht mehr extra nach unten verschoben werden */
#story-container {
    margin-top: 0;
}

#story-page .story-ring-small {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border: 2.5px solid #e53935; /* kräftiger roter Rand */
    background: #fff;             /* weißes Zentrum */
    box-sizing: border-box;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Bild in der Story-Kugel in der Story-Ansicht ausblenden */
#story-page .story-thumb-small {
    display: none !important;
}

@media (max-width: 600px) {
    html {
        font-size: 110%; /* gleiche Größe wie Desktop */
    }
    main#profile-page {
        align-items: flex-start;
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100vw;
        min-height: 100vh;
    }

    #profile-header {
        margin: 0.4rem 0 0.2rem 0;
        gap: 0.2rem;
        width: 100vw;
    }

    #profile-header-row {
        gap: 0.2rem;
    }

    #story-bubble {
        align-items: center;
        margin-right: 2rem;
        margin-left: 0;
    }

    .story-ring {
        width: 90px;
        height: 90px;
    }
    .story-thumb {
        width: 76px;
        height: 76px;
        margin-top: 0;
    }

    #profile-header > div:not(#story-bubble) {
        min-width: 0;
        max-width: 55vw;
    }

    #profile-header h2,
    #profile-header p {
        font-size: 0.85rem;
        margin-bottom: 0.1rem;
        white-space: nowrap;
    }
    #profile-stats {
        gap: 1rem;
        margin-bottom: 0.4rem;
    }
    .stat-number {
        font-size: 0.75rem;
    }
    .stat-label {
        font-size: 0.6rem;
    }
    #profile-bio {
        font-size: 0.6rem;
        margin-top: 1.5rem; /* Abstand nach oben auch mobil */
        margin-bottom: 0.1rem;
        padding-right: 0.1rem;
    }
}

@media (min-width: 601px) {
    #story-page {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100vw;
        min-height: 100vh;
    }
    #story-container {
        width: 500px;
        height: 90vh;
        max-width: 500px;
        max-height: 90vh;
        margin: 0 auto 1rem auto;
        border-radius: 16px;
        box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    }
}

@keyframes story-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(240,148,51,0.7), 0 0 16px 8px rgba(204,35,102,0.2);
        border-color: #f09433;
    }
    25% {
        box-shadow: 0 0 16px 8px rgba(230,104,60,0.7), 0 0 32px 16px rgba(220,39,67,0.2);
        border-color: #e6683c;
    }
    50% {
        box-shadow: 0 0 24px 12px rgba(220,39,67,0.7), 0 0 40px 20px rgba(188,24,136,0.2);
        border-color: #dc2743;
    }
    75% {
        box-shadow: 0 0 16px 8px rgba(204,35,102,0.7), 0 0 32px 16px rgba(240,148,51,0.2);
        border-color: #cc2366;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(240,148,51,0.7), 0 0 16px 8px rgba(204,35,102,0.2);
        border-color: #f09433;
    }
}

#story-bubble .story-ring {
    animation: story-glow 2s infinite;
    transition: box-shadow 0.3s, border-color 0.3s;
    cursor: pointer;
}
