/* =====================================================================
   style.css – das Aussehen von Patchis
   =====================================================================

   Zuerst fürs Handy gebaut, dann für den grossen Bildschirm erweitert. Das ist
   nicht Mode, sondern die Reihenfolge, in der es wirklich benutzt wird: die
   Frage „hat sie am Freitag Zeit?" wird unterwegs gestellt.

   Farben: ein Papierton als Grund, ein ruhiges Violett fürs Haus, und ein
   sichtbar anderes Grau für alles Verdeckte. Ein verdeckter Termin darf nie
   aussehen wie ein normaler – man muss auf einen Blick sehen: hier ist Zeit
   vergeben, und mehr ist nicht zu erfahren.
   ===================================================================== */

:root {
    --grund:      #F4F2EE;
    --papier:     #FFFFFF;
    --haus:       #514B8E;
    --haus-hell:  #E7E5F2;
    --schrift:    #26242E;
    --leise:      #6B6875;
    --linie:      #DDD9D2;
    --verdeckt:   #8A8FA3;
    --gut:        #2E7D5B;
    --warn:       #B4531B;
    --rund:       10px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--grund);
    color: var(--schrift);
    font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    /* Auf dem iPhone im App-Betrieb reicht der Bildschirm bis in die Ecken. */
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* --------------------------------------------------- Kopf und Navigation */

.kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding: 10px 14px;
    background: var(--haus);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}
.haus {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 19px;
    text-decoration: none;
}
.haus img { border-radius: 6px; display: block; }
.wege { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.wege a {
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 15px;
}
.wege a.hier, .wege a:hover { background: rgba(255, 255, 255, .22); }

main { padding: 14px; max-width: 1100px; margin: 0 auto; }

.fuss {
    padding: 18px 14px 30px;
    color: var(--leise);
    font-size: 14px;
    text-align: center;
}

/* --------------------------------------------------- Allgemeines */

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 22px 0 8px; }
p  { margin: 0 0 10px; }
a  { color: var(--haus); }

.meldung {
    padding: 10px 12px;
    border-radius: var(--rund);
    border-left: 4px solid var(--gut);
    background: var(--papier);
}
.meldung.warn { border-left-color: var(--warn); }

.hinweis-blick {
    background: var(--haus-hell);
    border-radius: var(--rund);
    padding: 9px 12px;
    font-size: 15px;
    color: #3B3767;
}

.leise { color: var(--leise); font-size: 15px; }

.karte {
    background: var(--papier);
    border: 1px solid var(--linie);
    border-radius: var(--rund);
    padding: 12px 14px;
    margin: 0 0 12px;
}

.knopf, button, input[type="submit"] {
    display: inline-block;
    background: var(--haus);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    font: inherit;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
}
.knopf.leiser, button.leiser {
    background: var(--papier);
    color: var(--haus);
    border: 1px solid var(--haus);
}
.knopf.gefahr, button.gefahr { background: #A33; }
.knopf:active, button:active { transform: translateY(1px); }

/* Auf dem Handy sollen Knöpfe gross genug für einen Daumen sein. */
@media (max-width: 700px) {
    .knopf, button, input[type="submit"] { padding: 12px 18px; }
}

/* --------------------------------------------------- Formulare */

form.satz { display: grid; gap: 12px; }
label { display: block; font-size: 15px; color: var(--leise); margin-bottom: 3px; }
input[type="text"], input[type="date"], input[type="time"], input[type="password"],
input[type="number"], select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--linie);
    border-radius: var(--rund);
    background: var(--papier);
    font: inherit;
    color: inherit;
}
textarea { min-height: 80px; resize: vertical; }
/* Das Farbfeld bleibt klein: eine Farbe über die ganze Breite sieht aus wie ein
   Fehler, nicht wie ein Knopf. */
input[type="color"] {
    width: 56px; height: 42px; padding: 2px;
    border: 1px solid var(--linie); border-radius: var(--rund);
    background: var(--papier);
}
.zeile { display: flex; flex-wrap: wrap; gap: 12px; }
.zeile > * { flex: 1 1 140px; }
fieldset {
    border: 1px solid var(--linie);
    border-radius: var(--rund);
    background: var(--papier);
    margin: 0;
    padding: 12px 14px;
}
legend { font-size: 15px; color: var(--leise); padding: 0 4px; }
.haken { display: flex; align-items: center; gap: 8px; }
.haken input { width: auto; }
.haken label { margin: 0; color: var(--schrift); font-size: 17px; }

.fehler { color: #A33; }

/* --------------------------------------------------- Kalender */

.monatskopf {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.monatskopf h1 { margin: 0; flex: 1 1 auto; text-align: center; }
.blatt { display: grid; gap: 8px; }
.wochentage { display: none; }

.tag {
    background: var(--papier);
    border: 1px solid var(--linie);
    border-radius: var(--rund);
    padding: 8px 10px;
    min-height: 44px;
}
.tag.heute { border-color: var(--haus); box-shadow: 0 0 0 1px var(--haus) inset; }
.tag.wochenende { background: #FAF8F4; }
.tag.leer { visibility: hidden; }
.tag > .datum {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 15px;
    color: var(--leise);
    margin-bottom: 4px;
}
.tag > .datum .zahl { font-weight: 600; color: var(--schrift); font-size: 17px; }
.tag > .datum a { text-decoration: none; font-size: 20px; line-height: 1; }

.eintrag {
    display: block;
    border-left: 4px solid var(--haus);
    background: #FBFAF8;
    border-radius: 6px;
    padding: 5px 8px;
    margin-bottom: 5px;
    text-decoration: none;
    color: inherit;
    font-size: 15px;
}
.eintrag .zeit { color: var(--leise); font-size: 13px; display: block; }
.eintrag .wer  { color: var(--leise); font-size: 13px; }
.eintrag.verdeckt {
    border-left-color: var(--verdeckt);
    /* Schraffur: dieselbe Sprache wie im Symbol – Zeit ist weg, Inhalt nicht zu haben. */
    background: repeating-linear-gradient(135deg,
        #F1F1F4 0 6px, #E7E7EC 6px 12px);
    color: #4A4A55;
    font-style: italic;
}

/* Auf dem grossen Bildschirm ein echter Monat mit sieben Spalten. */
@media (min-width: 760px) {
    .blatt { grid-template-columns: repeat(7, 1fr); }
    .wochentage {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 8px;
        margin-bottom: 4px;
        font-size: 14px;
        color: var(--leise);
        text-align: center;
    }
    .tag { min-height: 96px; }
    .tag.leer { display: block; }
}

/* --------------------------------------------------- Frei/Belegt */

.zeitschiene {
    position: relative;
    height: 30px;
    background: var(--papier);
    border: 1px solid var(--linie);
    border-radius: 6px;
    overflow: hidden;
    margin: 3px 0 10px;
}
.zeitschiene .balken {
    position: absolute;
    top: 0;
    bottom: 0;
    background: repeating-linear-gradient(135deg,
        #C9C9D4 0 6px, #B9B9C6 6px 12px);
}
.zeitschiene .balken.frei { background: #CDE8D8; }
.schienenkopf {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--leise);
}

.gemeinsam { font-weight: 600; }
.gemeinsam.keine { color: var(--warn); font-weight: normal; }

/* --------------------------------------------------- Listen */

table.liste { width: 100%; border-collapse: collapse; background: var(--papier); }
table.liste th, table.liste td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--linie);
    font-size: 15px;
}
table.liste th { color: var(--leise); font-weight: 600; }

.punkt {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 50%;
    vertical-align: -1px;
    margin-right: 6px;
}

/* Rechts in einer Zeile stehen die Knöpfe, und sie stehen NEBENEINANDER.
   Ein <form> ist von Haus aus ein Block; ohne .daneben rutschte jeder Knopf in
   eine eigene Zeile und die Tabelle würde doppelt so hoch. */
table.liste td.rechts { text-align: right; white-space: nowrap; }
.daneben { display: inline-block; margin-left: 4px; }
.daneben button { font-size: 14px; padding: 7px 11px; }
table.liste td.rechts .knopf { font-size: 14px; padding: 7px 11px; }

/* Stillgelegte Personen bleiben lesbar, treten aber zurück – sie sind da, nur
   nicht mehr im Spiel. */
tr.still td { opacity: 0.55; }
.schild {
    display: inline-block;
    font-size: 12px;
    padding: 1px 7px;
    border-radius: 9px;
    background: var(--haus);
    color: #fff;
    vertical-align: 1px;
    margin-left: 4px;
}
.schild.leiser { background: var(--leise); }
code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 14px;
    background: var(--grund);
    border: 1px solid var(--linie);
    border-radius: 5px;
    padding: 1px 5px;
}

/* Auf dem Handy werden aus Tabellenzeilen Kärtchen – sonst wird gequetscht. */
@media (max-width: 700px) {
    table.liste, table.liste tbody, table.liste tr, table.liste td { display: block; width: 100%; }
    table.liste thead { display: none; }
    table.liste tr {
        border: 1px solid var(--linie);
        border-radius: var(--rund);
        margin-bottom: 10px;
        background: var(--papier);
    }
    table.liste td { border: 0; padding: 6px 12px; }
    table.liste td:first-child { padding-top: 10px; font-weight: 600; }
    table.liste td:last-child { padding-bottom: 10px; }
}

/* --------------------------------------------------- Anmeldung, Offline */

body.leer { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.anmeldung, .hinweis {
    background: var(--papier);
    border: 1px solid var(--linie);
    border-radius: 14px;
    padding: 22px;
    width: min(420px, 92vw);
    margin: 24px auto;
}
.anmeldung img { display: block; margin: 0 auto 10px; border-radius: 10px; }
.anmeldung h1 { text-align: center; }
.hinweis { text-align: left; }
