body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
    margin-bottom: 20px;
}

h1 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #1c1e21;
    font-size: 1.8em;
}

.counters-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.counter-display {
    font-size: 1.3em;
    font-weight: bold;
    color: #495057;
    text-align: center;
}

.counter-display span {
    color: #007bff;
    display: block;
    font-size: 1.5em;
    margin-top: 5px;
}

.timestamp-display {
    font-size: 0.9em;
    color: #606770;
    margin-bottom: 25px;
    min-height: 1.2em;
}

.add-buttons-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.reset-button-container {
    margin-bottom: 30px;
    display: flex;
}

button {
    padding: 12px 15px;
    font-size: 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    color: white;
    box-sizing: border-box;
    text-align: center;
    width: 100%;
}

button:active {
    transform: scale(0.98);
}

.add-button {
    background-color: #28a745;
    color: white;
}

.add-button:hover {
    background-color: #218838;
}

#reset-button {
    background-color: #dc3545;
}

#reset-button:hover {
    background-color: #c82333;
}

.history-section {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.history-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
    color: #333;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

#history-list li {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    color: #495057;
}

#history-list li:last-child {
    border-bottom: none;
}

#history-list .history-placeholder {
    font-style: italic;
    color: #888;
    justify-content: center;
    background-color: transparent;
    border-bottom: none;
}

.delete-button {
    background-color: #ff4d4d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8em;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    width: 70px;
    min-width: 70px;
    text-align: center;
    box-sizing: border-box;
}

.delete-button:hover {
    background-color: #e60000;
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.6em;
    }

    /* --- Änderung hier --- */
    /* Behalte Grid-Layout für Zähler auch auf Mobilgeräten bei */
    .counters-container {
        /* display: grid; */ /* Ist schon im Standard definiert */
        /* grid-template-columns: repeat(2, 1fr); */ /* Ist schon im Standard definiert */
        gap: 10px; /* Optional: Abstand für Mobile anpassen */
        padding: 5px; /* Optional: Innenabstand für Mobile anpassen */
    }

    .counter-display {
        font-size: 1.2em;
        /* width: 80%;  -> Entfernt, da Grid die Breite steuert */
    }

    .counter-display span {
        font-size: 1.4em;
    }
    /* --- Ende der Änderung --- */


    /* Buttons untereinander auf Mobile */
    .add-buttons-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        /* grid-template-columns wird ignoriert */
    }

    button {
         width: 100%;
    }
}
