/* === Grundlayout === */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('img/karte_hintergrund.png') center center / cover no-repeat;
    filter: blur(5px); /* Stärke des Blur → kannst du anpassen */
    z-index: -1; /* GANZ hinten! */
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Arial', sans-serif;
    /* background-color: #f2e6d9;*/ /* warm-beiger Hintergrund */
    color: #333;
    overflow: auto;
}

/* === Startseite: Container mit Pfaden === */
.container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.path {
    position: relative;
    flex: 1;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.path img {
    width: 50%;
    height: 50%;
    object-fit: cover;
    display: block;
}

.path .label {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px 20px;
    font-size: 1.5em;
    border-radius: 5px;
}

.path:hover {
    transform: scale(1.02);
    z-index: 1;
}

.path.clicked {
    transform: scale(1.08);
    transition: transform 0.15s ease;
}

/*.separator {
    width: 40px;
    background: url('img/blitz.png') center center no-repeat;
    background-size: contain;
    z-index: 2;
} */

/* === Top-Row: narrator + main nebeneinander === */
#top-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
    margin: 20px;
}

#route-box {
    width: 100%;
    max-width: 800px;
    background-color: #fff8e1;
    border: 2px solid #555;
    border-radius: 10px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    padding: 15px;
    transition: all 0.3s ease;
}

/* === Narrator === */
#narrator {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

#narrator-img {
    width: 180px;
    border-radius: 5px;
}

#narrator-speech {
    width: 300px;
}

/* === Main Bereich (Route-Box) === */
#main {
    flex: 1;
    padding: 20px;
}

/* === Route-Box === */
#route-box {
    width: 100%;
    max-width: 800px;
    background-color: #fff8e1;
    border: 2px solid #555;
    border-radius: 10px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    padding: 15px;
    transition: all 0.3s ease;
}

/* Zeile 2 → Route + Karte Icons */
#route-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

/* Zeile 4 → Hinweise Icons */
#hint-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

/* #confirm-button {
    margin-top: 10px;
    padding: 8px 15px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#confirm-button:hover {
    background-color: #45a049;
} */

.confirm-button {
    margin-top: 10px;
    padding: 8px 15px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.confirm-button:hover {
    background-color: #45a049;
}

#code {
    font-size: 32px;
    font-weight: bold;
    color: #d32f2f;
    margin-top: 10px;
}

/* === Modal-Stil === */
.modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    padding-top: 60px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.6); 
}

.modal-content {
    background-color: #fff8e1;
    margin: auto;
    padding: 20px;
    border: 2px solid #555;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    position: relative;
}

.close {
    color: #333;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* === Hinweis-Icons === */
.hint-icon {
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hint-icon:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.8);
}

.hint-icon.active {
    border: 2px solid #d32f2f;
    border-radius: 10px;
    padding: 5px;
}

/* === Route-Icons === */
.route-icon {
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 10px;
}

.route-icon:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(100, 100, 255, 0.8);
}

.route-icon.active {
    border: 3px solid #d32f2f;
    border-radius: 10px;
    padding: 5px;
}

/* === Karten-Icon === */
.map-icon {
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 10px;
}

.map-icon:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.8);
}

/* Home-Button Hover */
#back-to-start-button {
    transition: transform 0.2s, box-shadow 0.2s;
}

#back-to-start-button:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.8);
}

/* Refresh Hover */
#refresh-button {
    transition: transform 0.2s, box-shadow 0.2s;
}

#refresh-button:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.8);
}

/* Safe-Icon Hover */
#open-safe-icon {
    transition: transform 0.2s, box-shadow 0.2s;
}

#open-safe-icon:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(100, 255, 100, 0.8); /* grünlicher Glow → passend zu Erfolg */
}

/* === Spezielles Styling für Fehler-Modal === */
#modal-fail .modal-content {
    border: 3px solid #d32f2f;
    animation: shake 0.5s;
    background-color: #ffeaea;
}

@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
    100% { transform: translateX(0); }
}

/* === Spezielles Styling für Erfolgs-Modal === */
#modal-success .modal-content {
    border: 3px solid #2e7d32;
    animation: pop 0.5s;
    background-color: #e8f5e9;
}

@keyframes pop {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.drag-item {
    padding: 8px 12px;
    background-color: #dcefff;
    border: 1px solid #333;
    border-radius: 5px;
    cursor: grab;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.drag-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.8);
}

.drop-zone {
    padding: 12px;
    background-color: #fff8e1;
    border: 2px dashed #777;
    border-radius: 5px;
    min-height: 50px;
    user-select: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.drop-zone:hover {
    background-color: #fffff0;
    border-color: #555;
}

.order-item {
    padding: 10px;
    background-color: #fff8e1;
    border: 1px solid #555;
    border-radius: 5px;
    cursor: grab;
    margin-bottom: 5px;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.order-item:hover {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(100, 255, 100, 0.8);
}

.feedback-box.success {
    border: 3px solid #2e7d32;
    animation: pop 0.5s;
    background-color: #e8f5e9;
}

.feedback-box.success img {
    width: 100px;
    margin-bottom: 15px;
}

.feedback-box.fail {
    border: 3px solid #d32f2f;
    animation: shake 0.5s;
    background-color: #ffeaea;
}

.feedback-box.fail img {
    width: 100px;
    margin-bottom: 15px;
}

.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* halbtransparent schwarz */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* höher als der Modal-Inhalt */
}

/* Modal-Look exakt wie modal-success/fail */
.feedback-overlay .modal-content {
    background-color: #fff8e1;
    margin: auto;
    padding: 20px;
    border: 3px solid #555;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    position: relative;
    animation: pop 0.5s;
}

/* Erfolgs-Feedback */
.feedback-overlay.success .modal-content {
    border: 3px solid #2e7d32;
    background-color: #e8f5e9;
}

/* Fehler-Feedback */
.feedback-overlay.fail .modal-content {
    border: 3px solid #d32f2f;
    background-color: #ffeaea;
}

/* Animationen */
@keyframes pop {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
    100% { transform: translateX(0); }
}

/* X-Button */
.feedback-overlay .close {
    color: #333;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.feedback-overlay .close:hover {
    color: #000;
}


/* .feedback-box {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.5);
} */

.hint-icon-wrapper {
    display: inline-block;
    cursor: pointer;
    position: relative;
    width: 80px;
    height: 80px;
}

.hint-icon-wrapper img.hint-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hint-icon-wrapper.done {
    opacity: 0.5; /* leicht ausgegraut */
    display: inline-block;
    position: relative;
}

.hint-icon-wrapper.done::after {
    content: '✔';
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #2e7d32;
    color: white;
    border-radius: 50%;
    padding: 3px 5px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
}

/* === Route-Icons Zeilen-Layout (z.B. für modul1 und modul3) === */
.route-icons-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.bild-mit-button {
    position: relative;
    display: block;
    /* display: inline-block; */
    width: 80%; /* anpassbar */
    margin: auto;
}

.bild-mit-button img {
    width: 100%;
    height: auto;
    display: block;
}

.overlay-icon {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px; /* Icongröße */
    height: 80px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.overlay-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.overlay-icon:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.8);
}

/* === Memory-Grid === */
/* .memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 100px);
    grid-gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.memory-card {
    width: 100px;
    height: 100px;
    perspective: 1000px;
    cursor: pointer;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front, .memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 2px solid #555;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff8e1;
    font-size: 1em;
    padding: 5px;
    text-align: center;
}

.memory-card-back {
    background-color: #4CAF50;
    color: white;
    font-size: 2em;
}

.memory-card-front {
    transform: rotateY(180deg);
}

.memory-card img {
    max-width: 80px;
    max-height: 80px;
} */

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 150px);
    grid-gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.memory-card {
    width: 150px;
    height: 150px;
    perspective: 1000px;
    cursor: pointer;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front, .memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 2px solid #555;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff8e1;
    font-size: 1em;
    padding: 0;
    text-align: center;
}

.memory-card-back {
    background-color: #4CAF50;
    color: white;
    font-size: 2em;
}

.memory-card-front {
    transform: rotateY(180deg);
}

.memory-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.modul4 .hint-icon-wrapper {
    position: absolute;
    top: 30%;
    left: 50%;
}

body.modul4 .hint-icon-wrapper.done::after {
    content: '✔';
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #2e7d32;
    color: white;
    border-radius: 50%;
    padding: 3px 5px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
    z-index: 10;
}



.map-icon {
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 10px;
}

.map-icon:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.8);
}

input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
    cursor: pointer;
}

.audio-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.audio-icon {
    width: 30px;
    height: 30px;
    cursor: pointer;
}

@media screen and (max-width: 1024px) {
    #top-row {
        flex-direction: column;
        align-items: center;
    }

    #narrator {
        flex-direction: row;
        justify-content: center;
    }

    #narrator-img {
        width: 140px;
    }

    #narrator-speech {
        width: 220px;
    }

    .hint-icon, .route-icon, .map-icon {
        width: 64px;
        height: 64px;
    }

    .modal-content {
        width: 95%;
        max-width: 95vw;
    }
}

/* optional --> Hint-Icon Größe */
.hint-icon,
.route-icon,
.map-icon {
    min-width: 80px;
    min-height: 80px;
}

/* optional --> Schriftgröße */
@media screen and (max-width: 1024px) {
    body {
        font-size: 18px;
    }

    h2, h3 {
        font-size: 1.6em;
    }

    p, label {
        font-size: 1.2em;
    }
}

.drag-item {
    touch-action: none; /* verhindert Scrollen beim Draggen */
}

#wortwolke {
  position: relative;
  width: 100%;
  height: 300px;
  background-color: #fff8e1;
  border: 2px solid #555;
  border-radius: 10px;
  margin-top: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

#wortwolke span {
  position: absolute;
  font-size: 2rem;
  font-weight: bold;
  color: #111;
  transform: rotate(-5deg);
}

#wortwolke-chaotisch-medhi {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 30px;
  padding: 20px;
  background-color: #fff8e1;
  border: 2px solid #555;
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

#wortwolke-chaotisch-medhi span {
  font-size: 2rem;
  font-weight: bold;
  color: #111;
  transform: rotate(var(--rotation, 0deg));
  display: inline-block;
  padding: 4px 8px;
}

#wortwolke-chaotisch-magda {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 30px;
  padding: 20px;
  background-color: #fff8e1;
  border: 2px solid #555;
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

#wortwolke-chaotisch-magda span {
  font-size: 2rem;
  font-weight: bold;
  color: #111;
  transform: rotate(var(--rotation, 0deg));
  display: inline-block;
  padding: 4px 8px;
}

