<style>
html {
    -webkit-text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Open Sans", Arial, sans-serif;
    font-weight: 300; /* Light */
    background: #fff;
    margin: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #313B2F;
}

#logo {
    max-width: 180px;
    width: 100%;
    height: auto;
    margin: 10px auto 6px;
    display: block;
}

h1 {
    margin: 10px 0 18px;
    text-align: center;
    font-size: 2rem;
    font-weight: 400;
}

#title {
    color: #b52706;
    text-transform: uppercase;
    margin-top: 1em;
}

/* ---------- Controls ---------- */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

button, select {
    padding: 8px 12px;
    font-size: 1rem;
}

/* ---------- Calendar Grid ---------- */
.calendar {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 1100px;
    justify-content: center;
}

/* Tablet layout */
@media (max-width: 1024px) {
    .calendar {
        grid-template-columns: repeat(1, minmax(280px, 1fr));
        width: 70%;
    }
}

/* Mobile layout */
@media (max-width: 640px) {
    .calendar {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

/* ---------- Month ---------- */
.month {
    background: #fff;
    border: 0px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    width: 100%;
}

.month h3 {
    text-align: center;
    margin: 6px 0 20px;
    font-weight: 400;
    font-size: 1.5rem;
}

/* ---------- Weekdays ---------- */
.weekdays, .days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.weekdays div {
    font-size: 1rem;
    padding-bottom: 4px;
}

/* ---------- Days ---------- */
.day {
    padding: 6px 0;
    margin: 1px;
    font-size: 1.3rem;
    border-radius: 4px;
    background: #fff;
}

/* ---------- Color Codes ---------- */
.orange { background: orange; }
.yellow { background: #ffe600; }
.green { background: #7dd87d; }
.darkred { background: #8b0000; color: white; }
.blue { background: #5bc0de; }
.gold { background: gold; font-weight: bold; }

/* ---------- Legend ---------- */
.legend {
    margin: 20px auto 0px auto;
    background: #ffffff;
    border-radius: 10px;
    max-width: 520px;

    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Spalten */
    column-gap: 20px;
}

.note {
    max-width: 720px;
    margin: 28px auto 40px;
    padding: 18px 20px;

    background: #faf9f6;
    border-left: 5px solid #b52706;
    border-radius: 8px;

    font-size: 1.05rem;
    line-height: 1.6;
    color: #2f2f2f;

    text-align: left;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.legend-text {
    font-size: 0.9rem;
    line-height: 1.3;
}

/* Small devices */
@media (max-width: 640px) {
    .legend-text {
        font-size: 1.1rem;
    }
    .note {
        width: 100%;
        font-size: 1.1rem;
        padding: 0 8px;
    }
    
    /* Monatsüberschrift */
    .month h3 {
        margin: 10px 0 16px;
    }

    /* Wochentage */
   

    /* Tageszellen */
    .day {
        font-size: 1.5rem;
        padding: 8px 0;
    }

    /* Kalenderbreite */
    .calendar {
        width: 100%;
        gap: 14px;
    }
}

/* iPhone / small mobile optimization */
@media (max-width: 430px) {

    body {
        padding: 10px;
    }

    h1 {
        font-size: 2.1rem;
        line-height: 1.2;
    }

    /* Kalender nur 1 Spalte */
    .calendar {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    /* Monatsüberschrift */
    .month h3 {
        font-size: 1.8rem;
        margin-bottom: 14px;
    }

    /* Wochentage */
    .weekdays div {
        font-size: 1.2rem;
    }

    /* Tageszellen */
    .day {
        font-size: 1.8rem;
        padding: 12px 0;
        min-height: 48px;
    }

    /* Legende */
    .legend {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .legend-text {
        font-size: 1.2rem;
    }

    /* Hinweistext */
    .note {
        font-size: 1.2rem;
        line-height: 1.7;
        padding: 16px 16px;
        margin: 22px auto 32px;
    }
}

</style>