body {
    font: 1em sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

#app-container {
    width: 95%;
    max-width: 1000px;
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Nav Header */
#nav-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}
.nav-btn {
    padding: 10px 20px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.3s, border-color 0.3s;
}
.nav-btn:hover:not(:disabled) {
    background-color: #f0f0f0;
}
.nav-btn.active {
    background-color: #E8F5E9;
    border-color: #4CAF50;
    color: #388E3C;
}
.nav-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Main Wrapper & Disabled Overlay */
#main-wrapper {
    position: relative;
}
#disabled-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #666;
    text-align: center;
    border-radius: 8px;
    pointer-events: none;
}
#main-wrapper.active #disabled-overlay {
    display: none;
}

/* Header */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1.2em;
}
.header-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}
.main-title {
    font-size: 1.5em;
    font-weight: bold;
}
#titelFeld {
    text-align: center;
    font-weight: bold;
    color: #333;
    padding-top: 10px;
}
/* New Feedback Box Style */
#feedback-box {
    text-align: center;
    min-height: 1.5em;
    padding: 5px;
    font-weight: bold;
    color: #d32f2f; /* Red for errors */
    transition: opacity 0.5s ease-out;
}

/* Main Content */
#main-content {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 5px;
}
.ion-panel {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}
#canvas-container {
    flex: 2;
    display: flex;
    justify-content: center;
}
canvas {
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 400px;
}

/* Controls */
#controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}
#beschriftung {
    font-size: 0.9em;
    color: #666;
}
#formula-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
    padding: 10px;
    background-color: #f7f7f7;
    border-radius: 6px;
    border: 1px solid #ddd;
}
#tippFeld {
    flex-grow: 1;
    text-align: center;
    font: 2em sans-serif;
    min-height: 1.5em;
    
}
#btn-skip {
    display: none; /* Hidden by default */
    background-color: #ffeb3b;
    border-color: #fbc02d;
    color: #f57f17;
}

/* Buttons */
button {
    border: 2px solid #4CAF50;
    background-color: #E8F5E9;
    color: #388E3C;
    cursor: pointer;
    font-size: 1em;
    border-radius: 5px;
    padding: 10px 15px;
    transition: background-color 0.3s, transform 0.1s;
}
button:hover:not(:disabled) {
    background-color: #C8E6C9;
}
button:active {
    transform: scale(0.95);
}
.ion-panel button {
    width: 100%;
    height: 50px;
}

/* Footer */
#footer {
    text-align: center;
    font-size: 0.8em;
    color: #999;
    margin-top: 10px;
}

/* Modal Styles */
#modal-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
#modal-container.hidden {
    display: none;
}
#modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    min-width: 400px;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
#modal-title {
    margin-top: 0;
}
#modal-content p {
    white-space: pre-wrap; /* To respect newlines in instruction text */
}
#modal-close {
    margin-top: 20px;
    padding: 10px 30px;
    font-size: 1.1em;
}
#modal-content.correct #modal-title { color: #4CAF50; }
#modal-content.incorrect #modal-title { color: #f44336; }