.wordle-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
        max-width: 300px;
        margin: 0 auto;
    }
    .wordle-row {
        display: contents;
    }
    .wordle-cell {
        width: 50px;
        height: 50px;
        border: 2px solid #ccc;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        font-weight: bold;
        text-transform: uppercase;
        position: relative;
        transform-style: preserve-3d;
        transition: transform 0.6s;
    }

    .keyboard {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        max-width: 500px;
        margin: 20px auto;
    }
    .keyboard-row {
        display: flex;
        gap: 5px;
    }
    .key {
        min-width: 35px;
        height: 50px;
        border: 1px solid #ccc;
        border-radius: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        cursor: pointer;
        background-color: #f0f0f0;
        transition: background-color 0.2s;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    .key:hover {
        background-color: #e0e0e0;
    }
    .key.wide {
        min-width: 77px;
    }
    .key svg {
        display: block;
    }
    .key-backspace-icon {
        width: 22px;
        height: 22px;
    }
    .key.correct { background-color: #6aaa64; color: white; }
    .key.present { background-color: #c9b458; color: white; }
    .key.absent { background-color: #787c7e; color: white; }
    .restart-btn {
        display: block;
        margin: 0px auto 10px auto;
        padding: 10px 20px;
        background-color: #2E7D32;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
    }
    .restart-btn:hover {
        background-color: #1B5E20;
    }
    .message {
        text-align: center;
        margin: 20px 20px 8px 20px;
        font-size: 18px;
        min-height: 2.2em;   /* reserviert Platz für 1 Zeile */
        /* alternativ: min-height: 4.4em; für 2 Zeilen */
    }
    @keyframes shakeX {
        0%, 100% { transform: translateX(0); }
        20% { transform: translateX(-8px); }
        40% { transform: translateX(8px); }
        60% { transform: translateX(-6px); }
        80% { transform: translateX(6px); }
    }
    @keyframes bounceRow {
        0% { transform: translateY(0); }
        30% { transform: translateY(-9px); }
        55% { transform: translateY(0); }
        72% { transform: translateY(-3px); }
        100% { transform: translateY(0); }
    }
    .wordle-cell.shake {
        animation: shakeX 0.35s ease;
    }
    .wordle-cell.bounce {
        animation: bounceRow 0.55s ease;
    }
    .wordle-cell.flip {
        transform: rotateY(360deg);
    }
    .wordle-cell.reveal-correct,
    .wordle-cell.reveal-present,
    .wordle-cell.reveal-absent {
        color: white;
        border-color: transparent;
    }
    .wordle-cell.reveal-correct { background-color: #6aaa64; }
    .wordle-cell.reveal-present { background-color: #c9b458; }
    .wordle-cell.reveal-absent  { background-color: #787c7e; }
    .stats-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 1000;
        align-items: center;
        justify-content: center;
    }
    .stats-modal.show {
        display: flex;
    }
    .stats-modal-content {
        background-color: white;
        border-radius: 10px;
        padding: 30px;
        max-width: 600px;
        width: 90%;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        text-align: center;
    }
    .stats-modal-content h2 {
        margin-top: 0;
        color: #333;
    }
    .stats-modal-content canvas {
        max-height: 300px;
        margin: 20px 0;
    }
    .stats-modal-actions {
        display: flex;
        gap: 10px;
        justify-content: center;
        margin-top: 20px;
    }
    .stats-modal-actions button {
        flex: 1;
        padding: 10px 20px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
    }
    .stats-modal-actions .new-game-btn {
        background-color: #2E7D32;
        color: white;
    }
    .stats-modal-actions .new-game-btn:hover {
        background-color: #1B5E20;
    }
    .stats-modal-actions .close-btn {
        background-color: #dbd9d9;
        color: #333;
    }
    .stats-modal-actions .close-btn:hover {
        background-color: #989898;
    }
    .stats-info {
        margin: 15px 0;
        font-size: 14px;
        color: #666;
    }

    
    .dark-mode {
        background-color: #121212;
        color: #f1f1f1;
    }
    .dark-mode h1,
    .dark-mode p,
    .dark-mode .message,
    .dark-mode .stats-info,
    .dark-mode .stats-modal-content h2 {
        color: #f1f1f1;
    }
    .dark-mode .restart-btn:hover {
        background-color: #1B5E20;
    }
    .dark-mode .stats-modal-actions .new-game-btn:hover {
        background-color: #1B5E20;
    }
    .dark-mode .stats-modal-actions .close-btn:hover {
        background-color: #555;
    }
    .dark-mode .wordle-grid {
        background: transparent;
    }
    .dark-mode .wordle-cell {
        border-color: #444;
        background-color: #1f1f1f;
        color: #fff;
    }
    .dark-mode .wordle-cell.reveal-correct { background-color: #6aaa64; color: white; }
    .dark-mode .wordle-cell.reveal-present { background-color: #c9b458; color: white; }
    .dark-mode .wordle-cell.reveal-absent  { background-color: #787c7e; color: white; }
    .dark-mode .key {
        background-color: #272727;
        border-color: #444;
        color: #eee;
    }
    .dark-mode .key:hover {
        background-color: #333;
    }
    .dark-mode .key.correct {
        background-color: #6aaa64;
        color: white;
    }
    .dark-mode .key.present {
        background-color: #c9b458;
        color: white;
    }
    .dark-mode .key.absent {
        background-color: #787c7e;
        color: white;
    }
    
    .dark-mode .restart-btn,
    .dark-mode .stats-modal-actions .new-game-btn{
        background-color: #2E7D32;
        color: white;
    }
    .dark-mode .stats-modal-actions .close-btn {
        background-color: #444;
        color: #f1f1f1;
    }
    .dark-mode .stats-modal-content {
        background-color: #1f1f1f;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
        color: #f1f1f1;
    }
    .dark-mode .stats-modal {
        background-color: rgba(0, 0, 0, 0.85);
    }

    .footer-darkmode-toggle {
        width: 18px;
        height: 18px;
        border: none;
        border-radius: 999px;
        background-color: #9b9999;
        color: white;
        font-size: 12px;
        cursor: pointer;
        line-height: 1;
        padding: 0;
    }

    .footer-darkmode-toggle:hover {
        background-color: #646464;
    }

    /* Darkmode */
    .dark-mode .footer-darkmode-toggle {
        background-color: #3a3939;
        color: #fff;
    }
    .dark-mode .footer-darkmode-toggle:hover {
        background-color: #646464;
    }


.footer-links {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 16px;
    background: rgba(218, 217, 217, 0.733);
    border-top: 1px solid #ddd;
    text-align: center;
    z-index: 1200;
    font-size: 13px; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.footer-links a {
    color: inherit;
    text-decoration: none;
    margin: 0 4px;
    font-size: inherit;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links .sep {
    opacity: 0.6;
    font-size: inherit;
}


/* damit der Footer nicht Inhalte überdeckt */
body {     
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;        
    padding-bottom: 40px; 
}


/* Darkmode */
.dark-mode .footer-links {
    background: rgba(66, 66, 66, 0.95);
    border-top-color: #333;
}

.page-title {
    text-align: center;
    font-size: 28px;
}



.share-btn {
display: block;
align-items: center;
justify-content: center;


margin: 10px auto;
padding: 10px 20px;
border: none;
border-radius: 5px;

background: #2E7D32;
color: white;

font-size: 16px;
line-height: 1;
cursor: pointer;

box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.share-btn:hover {
background-color: #1B5E20;
}
.dark-mode .share-btn:hover {
background-color: #1B5E20;
}

.share-btn__text {
display: inline-flex;
align-items: center;
justify-content: center;
line-height: 1;
transform: translateY(-3px);
}

.share-btn__icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
flex: 0 0 20px;
line-height: 0;
transform: translateY(1px);
}

.share-btn__icon svg {
display: block;
width: 20px;
height: 20px;
}

.dark-mode .share-btn {
background: #2E7D32;
}

#daily-modal-close-btn {
display: block;
margin: 10px auto;
padding: 10px 20px;
border: none;
border-radius: 5px;
font-size: 16px;
line-height: 1;
cursor: pointer;
background-color: #dbd9d9;
color: #333;
}

#daily-modal-close-btn:hover {
background-color: #989898;
}

.dark-mode #daily-modal-close-btn {
background-color: #444;
color: #f1f1f1;
}

.dark-mode #daily-modal-close-btn:hover {
background-color: #555;
}

.wordle-cell.correct,
.wordle-cell.reveal-correct {
    background-color: #6aaa64;
    color: white;
    border-color: transparent;
}

.wordle-cell.present,
.wordle-cell.reveal-present {
    background-color: #c9b458;
    color: white;
    border-color: transparent;
}

.wordle-cell.absent,
.wordle-cell.reveal-absent {
    background-color: #787c7e;
    color: white;
    border-color: transparent;
}

.dark-mode .wordle-cell.correct,
.dark-mode .wordle-cell.reveal-correct {
    background-color: #6aaa64;
    color: white;
    border-color: transparent;
}

.dark-mode .wordle-cell.present,
.dark-mode .wordle-cell.reveal-present {
    background-color: #c9b458;
    color: white;
    border-color: transparent;
}

.dark-mode .wordle-cell.absent,
.dark-mode .wordle-cell.reveal-absent {
    background-color: #787c7e;
    color: white;
    border-color: transparent;
}
.cookie-banner {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(20, 20, 20, 0.95);
    color: white;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
}

.cookie-banner-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.cookie-banner p {
    margin: 0;
    line-height: 1.4;
}

.cookie-banner a {
    color: white;
    text-decoration: underline;
}

.cookie-btn {
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    white-space: nowrap;
    background: #ffffff;
    color: #111111;
    font-weight: 600;
}

.cookie-btn:hover {
    background: #e6e6e6;
}

@media (max-width: 600px) {
    .wordle-grid {
        display: grid;
        grid-template-columns: repeat(5, 50px);
        justify-content: center;
        gap: 6px;
        padding: 0 8px;
        width: max-content;
        margin: 0 auto;
    }
    .wordle-cell {
        width: 50px;
        height: 50px;
        font-size: 24px;
        border-width: 1px;
    }
    .keyboard {
        width: 100%;
        padding: 0;
        margin: 18px auto;
        box-sizing: border-box;
    }
    .keyboard-row {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 5px;
        overflow-x: hidden;
        padding-bottom: 6px;
        box-sizing: border-box;
    }
    .keyboard-row.last-row {
        justify-content: center;
    }
    .key {
        flex: 1 1 0;
        min-width: 0px; /* wichtig, damit flex wirklich schrumpfen darf */
        height: 45px;
        font-size: 15px;
        padding: 0 3px;
    }
    .key.wide {
        flex: 0 0 55px;
        min-width: 20px;
    }
    .key.wide[data-key="BACKSPACE"] {
        padding: 0;
    }
    .key.wide[data-key="BACKSPACE"] .key-backspace-icon {
        width: 20px;
        height: 20px;
    }
    .restart-btn {
        width: calc(100% - 16px);
        max-width: 360px;
    }
    .stats-modal-content {
        padding: 18px;
        width: 96%;
        max-width: 520px;
    }
    .stats-modal-actions {
        flex-direction: column;
    }
    .stats-modal-actions button {
        width: 100%;
    }
    .page-title {
        font-size: 22px;
    }
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* iPad im Hochformat */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .wordle-grid{
        grid-template-columns: repeat(5, 62px);
        gap: 8px;
        max-width: none;
        width: fit-content;      
        margin: 0 auto;          
        justify-content: center; 
    }
    .wordle-cell{
        width: 62px;
        height: 62px;
        font-size: 28px;
        border-width: 2px;
    }

    .keyboard{
        width: 100%;
        max-width: 900px;
        margin: 18px auto;       
        padding: 0 14px;
        box-sizing: border-box;  
    }
    .keyboard-row{
        width: 100%;
        gap: 6px;
        justify-content: center; 
        box-sizing: border-box;
    }
    .key{
        flex: 1 1 0;
        min-width: 0;      
        height: 56px;
        font-size: 18px;
    }
    .key.wide{
        flex: 1.5 1 0;    
        min-width: 0;
    }
}