/* General Body Styles */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #f0f8ff; /* Light blue background */
    color: #333;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    height: 100%;
    max-width: 600px; /* Max width for larger screens */
    max-height: 900px;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Common Header Style */
.header {
    padding: 10px 20px;
    background: #FFC107; /* Amber */
    color: #4E342E; /* Brown */
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 1.5em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    flex-shrink: 0; /* Prevent header from shrinking */
}

/* Map Screen Styles */
.map-screen {
    width: 100%;
    height: 100%;
    background-image: url('./map_background.png');
    background-size: cover;
    background-position: center;
    position: relative;
}

.level-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #d32f2f; /* Red */
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.level-marker.completed {
    background-color: #388E3C; /* Green */
}

.level-marker.locked {
    background-color: #757575; /* Gray */
    cursor: not-allowed;
    opacity: 0.8;
}

.level-marker:not(.locked):hover {
    transform: scale(1.15);
}

.level-marker.treasure {
    font-size: 2em;
    width: 50px;
    height: 50px;
}

/* Level Screen Styles */
.level-screen {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden; /* New */
    background-color: #81D4FA; /* Light Blue */
}

.words-container {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start; /* Changed from center */
    gap: 15px;
    padding: 20px;
    overflow-y: auto; /* New, for scrolling */
}

.word-button {
    padding: 15px 25px;
    font-size: 1.5em;
    font-family: 'Fredoka One', cursive;
    border: none;
    border-radius: 15px;
    background-color: #fff;
    color: #424242;
    cursor: pointer;
    box-shadow: 0 4px #ccc;
    transition: all 0.1s ease-in-out;
}

.word-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px #ccc;
}

.word-button.correct {
    background-color: #8BC34A; /* Light Green */
    color: white;
    cursor: not-allowed;
    animation: bounce 0.5s;
}

.word-button.incorrect {
    background-color: #EF5350; /* Light Red */
    color: white;
    animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}


/* Modal for Level Complete */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    font-family: 'Fredoka One', cursive;
    color: #333;
    animation: popup 0.3s ease-out;
}

@keyframes popup {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    font-size: 2em;
    margin-top: 0;
    color: #4CAF50;
}

.modal-button {
    margin-top: 20px;
    padding: 10px 30px;
    font-size: 1.2em;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background: #FFC107;
    color: #4E342E;
    font-family: 'Fredoka One', cursive;
    box-shadow: 0 4px #E6A000;
}

.modal-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px #E6A000;
}

/* Win Screen Styles */
.win-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    background: linear-gradient(180deg, #29B6F6 0%, #0288D1 100%);
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.win-screen h1 {
    font-family: 'Fredoka One', cursive;
    color: white;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.win-screen img {
    width: 80%;
    max-width: 300px;
    margin: 20px 0;
}

/* Level marker positions - using percentages for responsiveness */
#level-1 { top: 75%; left: 15%; }
#level-2 { top: 68%; left: 35%; }
#level-3 { top: 72%; left: 58%; }
#level-4 { top: 60%; left: 75%; }
#level-5 { top: 48%; left: 55%; }
#level-6 { top: 45%; left: 30%; }
#level-7 { top: 32%; left: 18%; }
#level-8 { top: 25%; left: 45%; }
#level-9 { top: 28%; left: 70%; }
#level-10 { top: 10%; left: 50%; transform: translateX(-50%); }