/* =====================================================================
   Jarvis Smart Display (iPhone, Querformat) – Look wie die Apple-TV-App
   ===================================================================== */
:root {
    /* 🎨 HIER KANNST DU DIE FARBE DER UHRZEIT ÄNDERN (z.B. #ff9f40 für Orange, #0a84ff für Blau) */
    --clock-color: #ff9f40;

    --accent: #ff9f40;              /* warmes Orange (Begrüßung) */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.38);
    --card-fill: rgba(255, 255, 255, 0.055);
    --card-stroke: rgba(255, 255, 255, 0.08);   /* dezent: feste helle Linien brennen am ehesten ein */
    --card-radius: 22px;
    --card-padding: 14px;
    --gap: 12px;

    /* Einheitliche Größen für alle Kacheln */
    --tile-number: 1.9rem;          /* Zahl in den schmalen Kacheln (Temperatur, Wecker, Mails) */
    --tile-text: 0.92rem;           /* Einträge, Termine */
    --tile-small: 0.75rem;          /* Beschriftungen unter Zahlen */

    --accent-red: #ff453a;
    --accent-orange: #ff9f0a;
    --accent-yellow: #ffd60a;
    --accent-blue: #0a84ff;
    --accent-green: #30d158;
    --accent-cyan: #64d2ff;

    /* Schutz vor Einbrennen: wird per Script alle paar Minuten leicht verändert */
    --shift-x: 0px;
    --shift-y: 0px;
    --night-x: 0px;
    --night-y: 0px;
}

* { box-sizing: border-box; }

/* Dunkler Untergrund für die ganze Fläche – auch die Ränder neben der Notch im Querformat
   (vorher blieben die weiß, weil nur der body eingefärbt war) */
html {
    background-color: #000;        /* Ränder komplett schwarz, damit man das Gehäuse nicht sieht */
    min-height: 100%;
}

body {
    background: transparent;   /* sonst liegt der body über den Farbflächen und man sieht sie nicht */
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Ganz schwacher Farbschimmer im Inneren (Blau links oben, Orange rechts unten).
   Läuft zu den Rändern hin in reines Schwarz aus. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 45% 55% at 28% 30%, rgba(60, 80, 200, 0.16), transparent 70%),
        radial-gradient(ellipse 40% 50% at 75% 75%, rgba(255, 150, 60, 0.07), transparent 70%);
}

.swipe-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    height: 100vh;
    width: 100vw;
    -webkit-overflow-scrolling: touch;
}
.swipe-container::-webkit-scrollbar { display: none; }

.page {
    scroll-snap-align: center;
    flex: 0 0 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Platz für Notch/Dynamic Island im Querformat */
    padding: 16px max(22px, env(safe-area-inset-right)) 28px max(22px, env(safe-area-inset-left));
    position: relative;
}

.layout-grid, .layout-ios-standby, .page-title {
    transform: translate(var(--shift-x), var(--shift-y));
    transition: transform 3s ease-in-out;
}

/* Ruhe-Dimmen (siehe BURNIN in script.js) – liegt unter Nachtmodus und Wecker */
#dim-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 9000;
    transition: opacity 4s ease-in-out;
}

/* Normales Grid für Listen etc. */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--gap);
    width: 100%;
    height: 100%;
    max-width: 900px;
    max-height: 400px;
}
.layout-grid.single-widget { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.layout-grid.two-widgets { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
/* Seiten mit Überschrift: Kacheln etwas nach unten, ohne unten über die Seitenpunkte zu ragen */
.page-title + .layout-grid, .page-title + .layout-kochen { margin-top: 26px; height: calc(100% - 26px); }

/* Hauptseite – drei unabhängige Spalten (Aufteilung in script.js, renderPages):
   | Uhr (groß)  | Uni     |           |
   | Wetter      |         |  Termine  |
   | To-dos      | Wecker  |  (rechts) |
   |             | Mails   |           |   */
.layout-ios-standby {
    display: grid;
    grid-template-columns: 1.05fr 1fr 1.05fr;   /* Mitte (Listen) 250px, Termine schmaler */
    gap: var(--gap);
    width: 100%;
    height: 100%;
    max-width: 900px;
    max-height: 400px;
}
.standby-col {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-height: 0;
    min-width: 0;
}
.standby-col > .widget { flex: 0 0 auto; }
/* Was den Rest der Höhe bekommt: links die To-dos, in der Mitte die Uni-Liste, rechts die Termine */
.standby-col-middle > .widget-list,
.standby-col-right > .widget { flex: 1 1 0; }
/* Freien Platz links gleichmäßig verteilen (Luft über dem Wetter und über den To-dos) */
.standby-col-left > .widget-weather { margin-top: auto; }
/* To-dos genau so hoch wie die Uni-Liste daneben (Spalte minus Wecker, Mails und Abstände), unten bündig */
.standby-col-left > .widget-list {
    flex: 0 0 calc(100% - 2 * 92px - 2 * var(--gap));
    margin-top: auto;
}
/* Mitte: Uni-Liste oben, Wecker und Mails darunter */
.standby-col-middle > .widget-list { order: -1; }
/* Wecker und Mails: feste, größere Höhe */
.standby-col-middle > .widget-alarm,
.standby-col-middle > .widget-mails { flex: 0 0 92px; }

/* Schmale Kacheln (Wetter, Wecker, Mails): eine Zeile, nur so hoch wie die Zahl */
.layout-ios-standby .widget-weather,
.layout-ios-standby .widget-alarm,
.layout-ios-standby .widget-mails {
    flex-direction: row;
    align-items: center;
    padding: 9px 14px;
}
.layout-ios-standby .widget-weather .widget-title,
.layout-ios-standby .widget-alarm .widget-title,
.layout-ios-standby .widget-mails .widget-title {
    font-size: 0;            /* nur das Symbol zeigen, kein Titeltext */
    margin: 0 10px 0 0;
}
.layout-ios-standby .widget-title .icon { width: 18px; height: 18px; flex-basis: 18px; }
/* Wecker und Mails: größere Zahlen (so groß wie die Temperatur) */
.layout-ios-standby .widget-alarm .alarm-time,
.layout-ios-standby .widget-mails .mail-count { font-size: 2.4rem; }
.layout-ios-standby .widget-alarm .icon,
.layout-ios-standby .widget-mails .icon { width: 22px; height: 22px; flex-basis: 22px; }
.layout-ios-standby .widget-alarm .alarm-hint,
.layout-ios-standby .widget-mails .mail-label { font-size: var(--tile-text); }
/* Wetter ohne Kachel, frei stehend unter der Uhr (wie am Apple TV) */
.layout-ios-standby .widget-weather {
    background: transparent;
    border: none;
    padding: 0 2px;
}
/* Uhr und Wetter stehen frei – kein Glas-Effekt, sonst entsteht ein sichtbarer Kasten */
.layout-ios-standby .widget-freestyle_clock,
.layout-ios-standby .widget-weather {
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
}
.layout-ios-standby .widget-weather .widget-title { display: none; }
.layout-ios-standby .widget-weather .widget-content { min-width: 0; gap: 14px; }
.layout-ios-standby .weather-text { flex: 1; min-width: 0; }
.layout-ios-standby .weather-symbol { font-size: 2.1rem; }
.layout-ios-standby .weather-temp { font-size: 2.4rem; }
.layout-ios-standby .widget-weather .weather-desc { font-size: var(--tile-text); }
.layout-ios-standby .widget-weather .weather-range { font-size: var(--tile-small); margin-top: 1px; }
.layout-ios-standby .widget-weather .widget-content,
.layout-ios-standby .widget-alarm .widget-content,
.layout-ios-standby .widget-mails .widget-content {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
/* Ältere Kacheln (falls noch in der Konfiguration) einfach mitlaufen lassen */
.layout-ios-standby .widget-jarvis,
.layout-ios-standby .widget-sunrise,
.layout-ios-standby .widget-mails_private,
.layout-ios-standby .widget-mails_uni { grid-area: auto; }

/* --- Kacheln (Glas-Look) --- */
.widget {
    background: var(--card-fill);
    border: 1px solid var(--card-stroke);
    /* Glas: Hintergrundfarben scheinen weich durch */
    -webkit-backdrop-filter: blur(18px) saturate(150%);
            backdrop-filter: blur(18px) saturate(150%);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Kachel-Überschrift: Symbol + GROSSBUCHSTABEN */
.widget-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin: 0 0 6px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
.widget-title .icon {
    width: 16px; height: 16px;
    display: inline-flex;
    flex: 0 0 16px;
}
.widget-title .icon svg { width: 100%; height: 100%; }
.widget-title .count {
    margin-left: auto;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 600;
    color: var(--text-tertiary);
}
.widget-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Farben der Symbole je Kachel */
.widget-weather .icon      { color: var(--accent-yellow); }
.widget-calendar .icon     { color: var(--accent-red); }
.widget-jarvis .icon       { color: var(--accent-cyan); }
.widget-mails_private .icon{ color: var(--accent-blue); }
.widget-mails_uni .icon    { color: var(--accent-yellow); }
.widget-sunrise .icon      { color: var(--accent-orange); }
.widget-list .icon         { color: var(--accent-green); }

.rounded {
    font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif;
    font-variant-numeric: tabular-nums;
}

/* --- Uhr (ohne Kachel) --- */
.widget-freestyle_clock {
    grid-area: clock;
    background: transparent;
    border: none;
    justify-content: flex-start;   /* oben links in der Ecke */
    padding: 0 0 4px 2px;
    overflow: visible;
}
.widget-freestyle_clock .greeting {
    font-size: var(--tile-text);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    margin-bottom: 2px;
}
.widget-freestyle_clock .time {
    font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: min(5.2rem, 9.6vw);    /* groß, aber mit Luft zur Uni-Kachel daneben */
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -2px;
    margin-left: -3px;               /* Ziffer optisch bündig mit dem Rand */
    color: var(--clock-color);
}
.widget-freestyle_clock .date {
    font-size: var(--tile-text);
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 8px;
}
.widget-clock .time { font-family: ui-rounded, -apple-system, sans-serif; font-weight: 600; }
.widget-clock .date { color: var(--text-secondary); }

/* --- Wetter --- */
.widget-weather { grid-area: weather; }
.weather-main { display: flex; align-items: center; gap: 10px; }
.weather-main { gap: 6px; }
.weather-symbol { font-size: 1.4rem; line-height: 1; }
.weather-temp { font-size: var(--tile-number); font-weight: 600; line-height: 1; }
.weather-text { min-width: 0; }
.weather-desc {
    font-size: var(--tile-small); font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.weather-desc.weather-range { font-weight: 500; color: var(--text-secondary); }

/* --- Termine --- */
.widget-calendar { grid-area: calendar; }
.cal-day {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 6px 0 6px 0;
}
.cal-day:first-child { margin-top: 0; }
.cal-event {
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    padding-left: 12px;
    margin-bottom: 12px;
}
.cal-event.next { border-left-color: var(--accent-red); }
.cal-title {
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cal-time { font-size: 0.88rem; font-weight: 500; color: var(--text-secondary); margin-top: 2px; }
.cal-event.next .cal-time { color: var(--accent-red); }

/* --- Jarvis --- */
.widget-jarvis { grid-area: jarvis; }
.jarvis-msg {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.jarvis-msg strong { font-weight: 700; }

/* --- Sonne --- */
.widget-sunrise { grid-area: sunrise; }
.sun-row { display: flex; align-items: baseline; gap: 14px; margin-top: auto; }
.sunrise-time { font-size: 1.7rem; font-weight: 600; color: var(--accent-orange); line-height: 1; }
.sunset-time { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); }
.sunrise-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 3px; }

/* --- Mails --- */
.widget-mails_private { grid-area: mail_priv; }
.widget-mails_uni { grid-area: mail_uni; }
.mail-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.mail-count { font-size: var(--tile-number); font-weight: 600; line-height: 1; color: var(--accent-blue); }
.mail-count.uni { color: var(--accent-yellow); }
.mail-count.zero { color: var(--text-tertiary); }
.mail-label { font-size: 0.82rem; color: var(--text-secondary); }

/* --- Gemeinsame Mail-Kachel --- */
.widget-mails { grid-area: mails; }
.mail-pair { display: flex; gap: 16px; align-items: baseline; }
.mail-col { display: flex; align-items: baseline; gap: 5px; }
.widget-mails .mail-label { font-size: var(--tile-small); }

/* --- Wecker-Kachel --- */
.widget-alarm { grid-area: alarm; cursor: pointer; transition: transform 0.15s ease, background-color 0.15s ease; }
.widget-alarm:active { transform: scale(0.97); background-color: rgba(255, 255, 255, 0.1); }
.widget-alarm .icon { color: var(--accent-orange); }
.alarm-time { font-size: var(--tile-number); font-weight: 600; line-height: 1; }
.alarm-time.off { color: var(--text-tertiary); }
.alarm-hint.warn { color: var(--accent-orange); }
.alarm-hint { font-size: var(--tile-small); color: var(--text-tertiary); }

/* --- Knöpfe --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: 999px;
    padding: 10px 18px;
    font: 600 0.95rem -apple-system, sans-serif;
    color: #fff; background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
    white-space: nowrap;
}
.btn .icon { width: 18px; height: 18px; display: inline-flex; }
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: 0.4; }
.btn.primary { background: #fff; color: #000; }
.btn.round { width: 44px; height: 44px; padding: 0; flex: 0 0 44px; }
.btn.round .icon { width: 22px; height: 22px; }

/* --- Uhrzeit-Rad (Wecker stellen) --- */
.sheet {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9600;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.sheet.visible { opacity: 1; pointer-events: auto; }
.sheet-card {
    background: #1c1d26;
    border: 1px solid var(--card-stroke);
    border-radius: 28px;
    padding: 16px 26px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.sheet-card .widget-title { align-self: flex-start; color: var(--accent-orange); }
/* Zwei Drehräder wie in Apples Wecker-App */
.wheel-picker {
    --item-h: 40px;
    position: relative;
    display: flex; align-items: center; gap: 4px;
    height: calc(var(--item-h) * 5);
}
.wheel-highlight {
    position: absolute; left: -10px; right: -10px;
    top: calc(50% - var(--item-h) / 2); height: var(--item-h);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    pointer-events: none;
}
.wheel {
    position: relative; z-index: 1;
    width: 84px; height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    /* oben und unten sanft ausblenden */
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
            mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel-spacer { height: calc(var(--item-h) * 2); }
.wheel-item {
    height: var(--item-h);
    display: flex; align-items: center; justify-content: center;
    scroll-snap-align: center;
    font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 1.9rem; font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.15s ease, transform 0.15s ease;
}
.wheel-item.selected { color: #fff; font-weight: 600; transform: scale(1.08); }
.wheel-colon { position: relative; z-index: 1; font-size: 1.9rem; font-weight: 600; padding-bottom: 4px; }
.sheet-buttons { display: flex; gap: 10px; }
.sheet-msg { font-size: 0.85rem; color: var(--accent-red); min-height: 1em; }

/* --- Seite "Kochen" --- */
.layout-kochen {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: var(--gap);
    width: 100%; height: 100%;
    max-width: 900px; max-height: 400px;
    transform: translate(var(--shift-x), var(--shift-y));
    transition: transform 3s ease-in-out;
}
.kochen-empty {
    grid-column: 1 / -1;
    align-self: center; text-align: center;
    color: var(--text-secondary); font-size: 1rem; padding: 0 40px;
}
.recipe-card { cursor: pointer; transition: transform 0.15s ease, background-color 0.15s ease; }
.recipe-card:active { transform: scale(0.97); background-color: rgba(255, 255, 255, 0.1); }
.recipe-title {
    font-size: 1.05rem; font-weight: 600; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.recipe-meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: auto; padding-top: 6px; }
.veggie { color: var(--accent-green); }

/* --- Rezeptansicht (Vollbild, kompakt) --- */
#recipe-view {
    position: fixed; inset: 0;
    background: linear-gradient(to bottom, #0d0f1c, #000);
    z-index: 9500;
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px max(22px, env(safe-area-inset-right)) 16px max(22px, env(safe-area-inset-left));
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
#recipe-view.visible { opacity: 1; pointer-events: auto; }
.recipe-head { display: flex; align-items: center; gap: 10px; }
.recipe-head-text { flex: 1; min-width: 0; }
.recipe-view-title {
    font-size: 1.5rem; font-weight: 700; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recipe-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: var(--gap); }
.recipe-ingredients ul {
    list-style: none; margin: 0; padding: 0;
    overflow-y: auto; flex: 1;
    display: flex; flex-direction: column; gap: 7px;
}
.recipe-ingredients ul::-webkit-scrollbar { display: none; }
.recipe-ingredients li { display: flex; gap: 10px; font-size: 0.92rem; line-height: 1.25; }
.recipe-ingredients .menge { flex: 0 0 82px; font-weight: 700; }
.recipe-step .icon { color: var(--accent-orange); }
.step-text {
    flex: 1; min-height: 0; overflow-y: auto;
    font-size: 1.35rem; line-height: 1.4; font-weight: 500;
    padding: 4px 2px;
}
.step-nav { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.step-dots { flex: 1; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.step-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.step-dots span.active { background: var(--accent-orange); }

/* --- Listen --- */
.widget-list ul {
    list-style: none;
    padding: 0;
    margin: 0 -8px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.widget-list ul::-webkit-scrollbar { display: none; }
.widget-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.15rem;
    font-weight: 500;
    padding: 9px 8px;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, opacity 0.3s ease;
}
.widget-list li .item-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-list li .check {
    flex: 0 0 22px;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
}
.widget-list li:active { transform: scale(0.97); background-color: rgba(255, 255, 255, 0.08); }
.widget-list li.done { opacity: 0.45; }
.layout-ios-standby .widget-list li { font-size: var(--tile-text); padding: 5px 8px; gap: 9px; }
.layout-ios-standby .widget-list li .check { flex-basis: 17px; width: 17px; height: 17px; }
.layout-ios-standby .widget-list .empty-state { font-size: var(--tile-text) !important; }

/* Lange Listen/viele Termine: unten weich ausblenden statt hart abschneiden ("da kommt noch mehr") */
.widget-list ul,
.widget-calendar .widget-content {
    --fade-top: 0px;      /* wird per Script gesetzt, wenn oben/unten noch etwas versteckt ist */
    --fade-bottom: 0px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
}
.widget-calendar .widget-content { overflow-y: auto; }
.widget-calendar .widget-content::-webkit-scrollbar { display: none; }
.widget-list li.done .item-text { text-decoration: line-through; }
.widget-list li.done .check { background: var(--accent-green); border-color: var(--accent-green); }
.empty-state {
    color: var(--text-secondary);
    font-weight: 500 !important;
    font-size: 1rem !important;
    cursor: default !important;
    justify-content: center;
}

/* Hinweis, wenn der Pi nicht antwortet */
#status-banner {
    position: fixed;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 69, 58, 0.85);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    z-index: 200;
    display: none;
}
#status-banner.visible { display: block; }

/* Pagination Dots */
.pagination-dots {
    position: fixed;
    bottom: 12px;
    left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 100;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background-color: rgba(255, 255, 255, 0.25); transition: background-color 0.3s; }
.dot.active { background-color: rgba(255, 255, 255, 0.85); }

.page-title {
    position: absolute;
    top: 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* --- NACHTMODUS --- */
#night-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease-in-out; /* Weiches Ein- und Ausblenden */
}

body.night-mode #night-overlay {
    opacity: 1;
    pointer-events: auto; /* Klicks abfangen */
}

/* Nacht-Uhr im Stil von Apples StandBy-Nachtmodus: alles in gedämpftem Rot, sehr dunkel */
#night-clock {
    --night-red: #6e1414;            /* Grundfarbe – heller: z.B. #8f1d1d, dunkler: #4a0d0d */
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--night-red);
    /* wandert langsam (Schutz vor Einbrennen, siehe BURNIN in script.js) */
    transform: translate(var(--night-x), var(--night-y));
    transition: transform 50s linear;   /* sehr langsam, damit man das Wandern nicht bemerkt */
}

#night-date {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.75;
    margin-bottom: -6px;
}

#night-time {
    display: flex;
    align-items: center;
    font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: min(13.5rem, 52vh);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -4px;
}
.night-colon {
    font-size: 0.8em;
    margin: 0 4px;
    padding-bottom: 0.12em;
    opacity: 0.55;
}

#night-alarm {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    opacity: 0.75;
    margin-top: 2px;
}
#night-alarm.visible { display: flex; }
#night-alarm svg { width: 20px; height: 20px; }

/* --- WECKER (SONNENAUFGANG) --- */
#wake-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(to top, #ffecd2 0%, #fcb69f 100%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 20s ease-in-out; /* 20 Sekunden sehr sanfter Sonnenaufgang */
}

body.wake-mode #wake-overlay {
    opacity: 1;
    pointer-events: auto;
}

.wake-time {
    font-size: 8rem;
    font-weight: 800;
    color: #4a2c2a;
    margin-bottom: 2rem;
    text-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.wake-btn {
    padding: 20px 50px;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 50px;
    background: #ffffff;
    color: #fcb69f;
    border: none;
    box-shadow: 0 10px 30px rgba(252, 182, 159, 0.5);
    cursor: pointer;
}
.wake-btn:active {
    transform: scale(0.95);
}


body.wake-mode #wake-overlay {
    display: flex;
    opacity: 1;
}
.wake-time {
    font-size: 10rem;
    font-weight: 100;
    color: #ff9a00; /* Sanftes Amber/Bernstein */
    margin-bottom: 4rem;
    text-shadow: 0 0 40px rgba(255, 154, 0, 0.2); /* Leichtes, weiches Glühen */
}
.wake-btn {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: 300;
    background: transparent;
    border: 1px solid rgba(255, 154, 0, 0.3);
    border-radius: 50px;
    color: rgba(255, 154, 0, 0.8);
    transition: all 0.3s ease;
}
.wake-btn:active {
    background: rgba(255, 154, 0, 0.1);
}
/* Finanzen-Kachel */
.widget-finanzen .widget-content { display: flex; flex-direction: column; gap: 4px; }
.fin-summe { font-size: var(--tile-number); font-weight: 600; line-height: 1.1; color: var(--accent-blue); }
.fin-hint { font-size: var(--tile-small); color: var(--text-secondary); margin-bottom: 4px; }
.fin-row { display: flex; justify-content: space-between; gap: 10px; font-size: var(--tile-small); color: var(--text-secondary); }
.fin-betrag { color: var(--text-primary); font-variant-numeric: tabular-nums; }
