:root {
    --bg-green: #1B4332;
    --pink: #FF85B3;
    --white: #FFFFFF;
    --dark-green: #0d261b;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg-green);
    font-family: 'Comic Sans MS', cursive, sans-serif;
    overflow: hidden;
}

#board-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 130px);
    height: calc(100dvh - 130px);
    overflow: hidden; /* Standard: kein Scrollen im Chaos-Modus */
}

#board-container.swept {
    overflow-y: auto; /* Scrollen im Besen-Modus */
    -webkit-overflow-scrolling: touch; /* Sanftes Scrollen auf iOS */
}

/* Die Zettel */
.note {
    position: absolute;
    width: clamp(140px, 200px, 40vw); /* Responsive Breite */
    max-width: 200px;
    padding: 12px;
    background: var(--pink);
    color: var(--white);
    box-shadow: 5px 5px 15px rgba(0,0,0,0.4);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 10;
    border-radius: 3px;
    touch-action: none; /* Wichtig für Drag & Drop später */
}

.note img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 8px;
    pointer-events: none; /* Bilder blocken keine Touchevents */
}

.note strong {
    display: block;
    margin-bottom: 4px;
    font-size: clamp(0.9rem, 1.1em, 1.2rem);
    border-bottom: 2px solid var(--white);
    word-break: break-word;
}

.note p {
    margin: 0;
    font-size: clamp(0.75rem, 0.9em, 1rem);
    line-height: 1.4;
    word-break: break-word;
}

/* Eingabe-Panel */
.input-panel {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 12px 15px;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 100;
    width: 95%;
    max-width: 600px;
    box-sizing: border-box;
}

.inputs-wrapper, .actions-wrapper {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

input[type="text"] {
    flex: 1;
    min-width: 100px;
    border: 2px solid var(--bg-green);
    padding: 10px 8px;
    border-radius: 10px;
    outline: none;
    font-size: 16px !important; /* Verhindert iOS Zoom-In bei Fokus */
    -webkit-appearance: none;
}

button, .custom-file-upload, .back-btn {
    background: var(--pink);
    color: var(--white);
    border: none;
    padding: 10px 14px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    font-size: clamp(0.8rem, 0.9em, 1rem);
    transition: transform 0.1s;
    touch-action: manipulation;
    -webkit-appearance: none;
    white-space: nowrap;
}

button:active, .custom-file-upload:active {
    transform: scale(0.93);
}

.broom-btn { 
    background: var(--bg-green); 
}
.back-btn { 
    background: var(--dark-green); 
    display: inline-block;
    text-align: center;
}
.custom-file-upload { 
    font-size: 1.3em; 
    padding: 8px 10px;
}

/* --- MOBILE SPEZIFISCH --- */
@media (max-width: 768px) {
    #board-container {
        height: calc(100vh - 160px);
        height: calc(100dvh - 160px);
    }
    
    .note {
        width: 140px;
        padding: 10px;
    }
    
    .input-panel {
        bottom: 5px;
        padding: 10px 12px;
        border-radius: 20px;
        gap: 6px;
    }
    
    .inputs-wrapper {
        gap: 5px;
    }
    
    .actions-wrapper {
        gap: 6px;
    }
    
    input[type="text"] {
        padding: 10px 6px;
        font-size: 16px;
    }
    
    button, .custom-file-upload, .back-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 375px) {
    .note {
        width: 120px;
        padding: 8px;
    }
    
    .input-panel {
        padding: 8px 10px;
        border-radius: 18px;
    }
    
    button, .custom-file-upload, .back-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .actions-wrapper {
        gap: 4px;
    }
}
