:root {
  --bg: #0f1117;
  --card: #171a23;
  --border: #262b38;
  --text: #e7e9ee;
  --muted: #8b90a0;
  --accent: #7c5cff;
  --accent2: #22d3ee;
  --danger: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(160deg, #0f1117, #131722);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.nav .brand { font-weight: 700; font-size: 1.2rem; }
.nav .brand span { color: var(--accent); }
.nav .links { display: flex; gap: 16px; align-items: center; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}

h1, h2, h3 { margin-top: 0; }

.muted { color: var(--muted); }

.banner {
  background: rgba(124,92,255,0.12);
  border: 1px solid rgba(124,92,255,0.4);
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.banner.warn { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); }

form { display: flex; flex-direction: column; gap: 14px; }
label { font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; display: block; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=url], textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: #0f1117;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
}
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 160px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

button, .btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
}
button:hover, .btn:hover { opacity: 0.9; text-decoration: none; }
.btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }

.error { color: var(--danger); font-size: 0.9rem; }

.timer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.timer-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #12151d; border: 1px solid var(--border); border-radius: 10px;
}
.timer-item .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 10px; }
.timer-item .meta { font-size: 0.8rem; color: var(--muted); }
.timer-item .actions { display: flex; gap: 8px; }
.timer-item.expired { opacity: 0.55; }

/* Kalender */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day-label { text-align: center; font-size: 0.75rem; color: var(--muted); padding-bottom: 4px; }
.cal-cell {
  min-height: 80px; background: #12151d; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px; font-size: 0.75rem;
}
.cal-cell.empty { background: transparent; border: none; }
.cal-cell .num { color: var(--muted); margin-bottom: 4px; }
.cal-cell .ev { display: block; padding: 2px 5px; border-radius: 5px; margin-bottom: 2px; color: white; font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Public countdown page */
.public-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px;
}
.countdown { font-size: clamp(2.2rem, 8vw, 5rem); font-weight: 800; letter-spacing: 2px; margin: 20px 0; }
.countdown .unit { font-size: 0.35em; color: var(--muted); display: block; font-weight: 500; }
.share-box { display: flex; gap: 8px; margin-top: 20px; max-width: 420px; width: 100%; }
.share-box input { flex: 1; }
.action-reveal {
  margin-top: 24px; font-size: 1.3rem; padding: 20px; border-radius: 12px;
  background: rgba(124,92,255,0.12); border: 1px solid rgba(124,92,255,0.4);
}

/* ---------- Themes ---------- */
html[data-theme="light"] {
  --bg: #f4f5f8;
  --card: #ffffff;
  --border: #e2e4ea;
  --text: #1a1c23;
  --muted: #6b7080;
  --accent: #6d4cf0;
  --accent2: #0891b2;
}
html[data-theme="light"] body { background: linear-gradient(160deg, #f4f5f8, #eef0f6); }
html[data-theme="light"] input, html[data-theme="light"] textarea, html[data-theme="light"] select { background: #f7f8fb; color: var(--text); }
html[data-theme="light"] .timer-item, html[data-theme="light"] .cal-cell { background: #f7f8fb; }

html[data-theme="sunset"] {
  --bg: #1a0f1e;
  --card: #2a1530;
  --border: #4a2350;
  --text: #fdf0ff;
  --muted: #c9a3d4;
  --accent: #ff6b6b;
  --accent2: #ffa94d;
}
html[data-theme="sunset"] body { background: linear-gradient(160deg, #1a0f1e, #3b1424, #522617); }

html[data-theme="ocean"] {
  --bg: #071b2b;
  --card: #0d2c42;
  --border: #164863;
  --text: #e6f6ff;
  --muted: #8fb8cf;
  --accent: #00b4d8;
  --accent2: #48cae4;
}
html[data-theme="ocean"] body { background: linear-gradient(160deg, #051620, #072a3d, #0a3a52); }

html[data-theme="matrix"] {
  --bg: #000000;
  --card: #05100a;
  --border: #0f3d1f;
  --text: #b8ffcb;
  --muted: #4f9a68;
  --accent: #00ff66;
  --accent2: #00cc55;
}
html[data-theme="matrix"] body { background: #000000; }
html[data-theme="matrix"] .card, html[data-theme="matrix"] .timer-item, html[data-theme="matrix"] .cal-cell { box-shadow: 0 0 18px rgba(0,255,102,0.06); }

html[data-theme="midnight"] {
  --bg: #0b0620;
  --card: #16103a;
  --border: #2a1f5c;
  --text: #ece7ff;
  --muted: #9b8fd1;
  --accent: #a78bfa;
  --accent2: #f472b6;
}
html[data-theme="midnight"] body { background: linear-gradient(160deg, #0b0620, #180f3d); }

/* ---------- Eigene Hintergründe (Bild/GIF/Video) ---------- */
.bg-media {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  z-index: -2;
}
.bg-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(10, 11, 16, 0.55);
  z-index: -1;
}
html[data-theme="light"] .bg-overlay { background: rgba(255,255,255,0.55); }
