/* CONTAINER */
#hasel-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    
    /* Fallback Variable */
    --tile-opacity: 0.9;
}

#hasel-overlay {
    width: 100%;
    min-height: 600px; /* Etwas höher für mehr Platz */
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    position: relative;
}

/* SPIELFELD */
#hasel-board-container {
    margin-bottom: 20px; 
}

.hasel-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px;
}

.hasel-tile {
    width: 52px;
    height: 52px;
    border: 2px solid #333; /* Etwas dunklerer Rand für besseren Kontrast */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(255,255,255, var(--tile-opacity));
    user-select: none;
    border-radius: 8px; 
}

/* FARBEN */
.tile-correct {
    background-color: #00679e !important; 
    color: white !important;
    border-color: #00679e !important;
}

.tile-present {
    background-color: #ff8800 !important; 
    color: white !important;
    border-color: #ff8800 !important;
}

.tile-absent {
    background-color: #787c7e !important;
    color: white !important;
    border-color: #787c7e !important;
}

.row-error .hasel-tile {
    background-color: #ffcccc !important;
    border-color: red !important;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}
.shake { animation: shake 0.3s; }

/* KEYBOARD */
#hasel-keyboard {
    width: 100%;
    padding: 0 4px; /* Minimaler Abstand zum Rand */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 4px; /* Abstand zwischen Tasten */
}

.key-btn {
    font-weight: bold;
    padding: 0;
    
    /* Layout: Flexbox damit sie die Breite füllen */
    flex: 1; 
    height: 54px; /* Höhere Tasten für Touch */
    
    border-radius: 6px;
    cursor: pointer;
    
    /* Design Anpassungen */
    background: #e8e8e8; /* Helles Grau */
    color: #000;
    border: 1px solid #000; /* Schwarze Kontur */
    
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* iOS Zoom Fixes */
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.key-wide { 
    flex: 1.5; /* Enter und Backspace 50% breiter */
    font-size: 12px;
}

/* Rote Tasten: Enter & Backspace */
.key-enter, .key-back-btn { 
    background: #d32f2f !important; 
    color: white !important; 
    border-color: #b71c1c !important;
}

.key-back-btn { font-size: 20px; }

/* TOAST */
#hasel-toast {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 100;
}
#hasel-toast.show { opacity: 1; }

/* RESULT */
#hasel-result-msg {
    width: 90%;
    padding: 15px;
    text-align: center;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    margin-bottom: 15px;
    display: none;
}
.res-win { background-color: #4CAF50; }
.res-loss { background-color: #d32f2f; }

/* MOBILE Optimierung */
@media (max-width: 400px) {
    .hasel-tile { width: 42px; height: 42px; font-size: 22px; }
    .key-btn { height: 48px; font-size: 13px; }
    .hasel-row { gap: 3px; }
    .keyboard-row { gap: 3px; }
}