:root {
    --bg: #0f0f13;
    --panel: #1a1a21;
    --panel-2: #22222b;
    --line: #2c2c36;
    --text: #ededf2;
    --muted: #9a9aa6;
    --accent: #4c8dff;
    --accent-2: #5d98ff;
    --gold: #ffc53d;
    --error: #ff8a8d;
    --ok: #6fdc9e;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100dvh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1 { font-size: 30px; margin: 8px 0 4px; }
h2 { font-size: 19px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }

button {
    font: 600 15px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 16px; cursor: pointer;
}
button:active { transform: scale(.98); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--error); }
button:disabled { opacity: .55; }
button.icon { background: none; border: none; font-size: 26px; line-height: 1; padding: 6px 10px; }
button.wide { width: 100%; margin-top: 18px; }

input {
    width: 100%; padding: 12px 14px; border-radius: 12px; font: 16px system-ui, sans-serif;
    background: #14141a; color: var(--text); border: 1px solid var(--line);
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }
input.code { font: 600 20px ui-monospace, Consolas, monospace; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
input.code::placeholder { color: #55555f; font-weight: 400; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.message { min-height: 22px; margin: 12px 0 0; font-size: 14px; text-align: center; }
.message.error { color: var(--error); }
.message.ok { color: var(--ok); }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }

/* ---------- Anmelden ---------- */
.login { max-width: 420px; margin: 0 auto; padding: 36px 20px; text-align: center; }
.login-logo { border-radius: 20px; }
.tabs { display: flex; gap: 6px; background: var(--panel); border-radius: 12px; padding: 4px; margin: 22px 0 12px; }
.tab { flex: 1; background: none; border: none; padding: 10px; color: var(--muted); }
.tab.active { background: var(--panel-2); color: var(--text); }
.login form { text-align: left; }

/* ---------- Kopfzeile, Inhalt ---------- */
.bar {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
    padding: 12px 12px 12px 16px; background: rgba(15, 15, 19, .92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.title { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { max-width: 560px; margin: 0 auto; padding: 16px; }

.list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.item {
    display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
}
.item .main { flex: 1; min-width: 0; }
.item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { color: var(--muted); font-size: 13px; }
.item .badge { color: var(--muted); font-size: 13px; white-space: nowrap; }
.item.pending { border-style: dashed; }
.item .time { font: 600 17px ui-monospace, Consolas, monospace; }
.item .del { background: none; border: none; color: var(--muted); padding: 6px 8px; font-size: 18px; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 26px; font-weight: 700; }

/* ---------- Highlight-Knopf ---------- */
.highlight {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    width: min(64vw, 240px); aspect-ratio: 1; margin: 18px auto 10px; border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #ffd970, var(--gold) 55%, #d99a00);
    border: none; color: #2b1d00; font-size: 20px; font-weight: 800;
    box-shadow: 0 10px 40px rgba(255, 197, 61, .25), inset 0 -6px 0 rgba(0, 0, 0, .12);
}
.highlight .star { font-size: 64px; line-height: 1; }
.highlight.flash { animation: flash .5s ease-out; }
@keyframes flash { 0% { transform: scale(.92); box-shadow: 0 0 0 0 rgba(255, 197, 61, .8); } 100% { transform: scale(1); box-shadow: 0 0 0 40px rgba(255, 197, 61, 0); } }

/* ---------- Uhr ---------- */
.clock { position: fixed; inset: 0; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.clock canvas { width: min(88vw, 62vh); height: auto; aspect-ratio: 1; border-radius: 8px; image-rendering: pixelated; }
.clock-time { font: 700 clamp(40px, 13vw, 84px) ui-monospace, Consolas, monospace; margin-top: 14px; letter-spacing: .02em; }
.clock-date { color: var(--muted); font-size: 16px; }
.clock-hint { color: #8a8a96; font-size: 13px; text-align: center; margin: 8px 0 0; }
.clock-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; background: #1a1a21; }

/* ---------- Dialog, Meldung ---------- */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 20px; width: min(92vw, 420px); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog input { margin: 6px 0 16px; }

.toast {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    background: #2a2a34; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; z-index: 10;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .4); max-width: 90vw; text-align: center;
}
