/* Gemeinsames Design für index.html und quiz.html */

html {
    /* Verhindert schwarze Flächen beim Scrollen / auf grossen Bildschirmen */
    background-color: #f4f4f9;
    color-scheme: light;
    overscroll-behavior: none;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f9;
    color: #333;

    /* Abgerundeter Rahmen um die gesamte Seite */
    border: 6px solid #2c3e50;
    border-radius: 24px;
    min-height: 100vh;
    box-sizing: border-box;
}

main {
    max-width: 800px;
    margin: 20px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.items-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.corner-item {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

h1 {
    color: #2c3e50;
    margin-top: 10px;
}

.intro {
    font-size: 1.1em;
    margin-bottom: 25px;
    color: #555;
}

.button-wrapper {
    width: 100%;
    margin: 30px 0;
}

/* Der Button ist ein Link zur Quiz-Seite */
.game-button {
    position: relative;
    width: 100%;
    background-color: #ff6b6b;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    line-height: normal;
    text-decoration: none;
    padding: 20px;
    border: none;
    border-radius: 40px; /* Abgerundeter Button */
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    box-sizing: border-box;
    overflow: hidden;
    isolation: isolate;
}

/* Dunkelrote Wellen: zwei Ebenen, die beim Hover von unten hochkommen */
.game-button::before,
.game-button::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat-x;
    background-size: 100px 100%;
    transform: translateY(105%);
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

/* hintere Welle (heller, langsamer, gegenläufig) */
.game-button::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M0 14 Q25 0 50 14 T100 14 V100 H0 Z' fill='%23a31515'/></svg>");
    z-index: 1;
    animation: waveBack 2.6s linear infinite;
    transition-delay: 0s;
}

/* vordere Welle (dunkelrot) */
.game-button::after {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M0 14 Q25 0 50 14 T100 14 V100 H0 Z' fill='%238b0000'/></svg>");
    z-index: 1;
    animation: waveFront 1.6s linear infinite;
    transition-delay: 0.12s;
}

.game-button:hover::before {
    transform: translateY(30%);
}

.game-button:hover::after {
    transform: translateY(42%);
}

@keyframes waveFront {
    from { background-position-x: 0; }
    to { background-position-x: 100px; }
}

@keyframes waveBack {
    from { background-position-x: 100px; }
    to { background-position-x: 0; }
}

.button-character-container, .button-text {
    position: relative;
    z-index: 2;
}

/* Figur + Sprechblase sitzen links im Button */
.button-character-container {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    perspective: 300px;
}

/* Dreh-Animation: volle 360°-Drehung um die eigene Achse */
@keyframes turnAround {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.character {
    width: 40px;
    height: 70px;
    object-fit: contain;
    animation: turnAround 3s infinite linear;
    transform-style: preserve-3d;
}

.speech-bubble {
    position: absolute;
    left: 55px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    color: #333;
    border: 2px solid #333;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px 8px 5px 0;
    border-style: solid;
    border-color: transparent #333 transparent transparent;
}

.videos-section {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.video-box {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.video-box p {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 0.95em;
}

/* Hochformat-Videoplayer im Shorts-Stil */
.video-player {
    width: 100%;
    max-width: 260px;
    height: 420px;
    border-radius: 12px;
    background: #000;
    object-fit: cover;
    margin: 0 auto;
    display: block;
}

/* ---------- Quiz-Seite ---------- */
.back-link {
    display: inline-block;
    margin-bottom: 10px;
    padding: 8px 18px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #2c3e50;
    font-weight: bold;
    font-size: 0.95em;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.back-link:hover {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

.quiz-wrapper {
    position: relative;
    margin-top: 30px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background-color: #f8fafc;
    overflow: hidden;
}

.quiz-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

.quiz-frame {
    position: relative;
    display: block;
    width: 100%;
    height: 700px;
    border: 0;
    background: transparent;
}

.footer-note {
    margin-top: 40px;
    text-align: center;
    font-size: 0.9em;
    color: #718096;
    border-top: 1px solid #edf2f7;
    padding-top: 15px;
}

@media (max-width: 600px) {
    .videos-section {
        grid-template-columns: 1fr;
    }
    .speech-bubble {
        display: none;
    }
    .button-character-container {
        left: 15px;
    }
    .quiz-frame {
        height: 600px;
    }
}
