* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf6f1;
  --card: #ffffff;
  --ink: #322a24;
  --muted: #857a6f;
  --line: #ece5dc;
  --accent: #ec6a45;
  --accent-dark: #c24e2b;
  --accent-soft: #fdeee6;
  --accent-border: #f7d4c4;
  --yes: #23a55a;
  --maybe: #e9950c;
  --no: #cfc7bd;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(80, 55, 35, 0.08);
}

body {
  font-family: ui-rounded, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(60rem 30rem at 110% -10%, #ffe5d7 0%, transparent 60%),
    radial-gradient(50rem 25rem at -20% 0%, #e4f4e7 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ---------- Logo ---------- */
.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #f59e4c 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(236, 106, 69, 0.35);
}

/* ---------- Startseite ---------- */
.hero {
  text-align: center;
  padding: 2rem 0 2.25rem;
}
.hero .logo.big {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 2.4rem;
  margin: 0 auto 1rem;
  box-shadow: 0 12px 28px rgba(236, 106, 69, 0.4);
  transform: rotate(-4deg);
}
.hero h1 { font-size: 2.3rem; letter-spacing: -0.02em; }
.hero p { color: var(--muted); margin-top: 0.4rem; font-size: 1.05rem; }

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}
.option-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
  padding: 2rem 1.75rem;
  margin-bottom: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.option-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(80, 55, 35, 0.13);
}
.option-card .sub { margin-bottom: 1rem; }
.opt-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}
.opt-icon.create { background: var(--accent-soft); }
.opt-icon.join { background: #e4f4e7; }
.opt-action { margin-top: auto; width: 100%; text-decoration: none; }
.btn-wide { width: 100%; max-width: 280px; }
.join-row { display: flex; gap: 0.6rem; justify-content: center; }
.join-row input {
  max-width: 200px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ---------- Kopf ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-decoration: none;
  color: inherit;
  width: fit-content;
}
.brand h1 { font-size: 1.35rem; letter-spacing: -0.01em; }
.brand span { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); }

/* ---------- Karten ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.card h2 { font-size: 1.25rem; margin-bottom: 0.35rem; letter-spacing: -0.01em; }
.card .sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.25rem; }

/* ---------- Formulare ---------- */
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
input[type="text"], input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  font: inherit;
  background: #fffdfb;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(236, 106, 69, 0.16);
}
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 1.1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.row > .fit { flex: 0 0 auto; min-width: 0; }

button {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: transform 0.06s, background 0.15s, box-shadow 0.15s;
}
button:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #f59e4c 100%);
  color: #fff;
  padding: 0.7rem 1.4rem;
  box-shadow: 0 6px 16px rgba(236, 106, 69, 0.3);
}
.btn-primary:hover { box-shadow: 0 8px 20px rgba(236, 106, 69, 0.45); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: #f3ede5;
  color: var(--ink);
  padding: 0.7rem 1.1rem;
}
.btn-ghost:hover { background: #eae2d7; }

/* ---------- Kalender auf der Erstellen-Seite ---------- */
.cal {
  max-width: 360px;
  background: #fffdfb;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
}
.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.cal-head strong { font-size: 1rem; }
.cal-head button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f3ede5;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}
.cal-head button:hover { background: #eae2d7; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-grid .dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.25rem;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 10px;
  background: transparent;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.cal-day:hover:not(:disabled):not(.sel) { background: var(--accent-soft); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent-border); }
.cal-day.sel {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 10px rgba(236, 106, 69, 0.38);
}
.cal-day:disabled { color: #d8d0c5; cursor: default; }

/* ---------- Liste der gewählten Tage ---------- */
.sel-list {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sel-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: #fbf6f0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
}
.sel-row .d { font-weight: 700; font-size: 0.92rem; min-width: 145px; }
.time-input {
  width: 64px !important;
  padding: 0.32rem 0.3rem !important;
  background: #fff !important;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.time-input.invalid {
  border-color: #cf3345 !important;
  box-shadow: 0 0 0 3px rgba(207, 51, 69, 0.15) !important;
  color: #cf3345;
}
kbd {
  background: #f3ede5;
  border: 1px solid #ddd4c8;
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 0.35rem;
  font-family: inherit;
  font-size: 0.85em;
  font-weight: 700;
}
.time-slot { display: inline-flex; align-items: center; gap: 0.25rem; }
.mini-x {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eee7de;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1;
  display: grid;
  place-items: center;
}
.mini-x:hover { background: #f6d5d5; color: #cf3345; }
.mini-x.day-x { margin-left: auto; }
.mini-add {
  background: var(--accent-soft);
  border: 1px dashed var(--accent-border);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}
.mini-add:hover { background: #fbdfd0; }

.msg { margin-top: 0.9rem; font-size: 0.9rem; font-weight: 600; }
.msg.error { color: #cf3345; }
.msg.ok { color: var(--yes); }

/* ---------- Link teilen ---------- */
.share {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: #fbf6f0;
  border: 1.5px dashed var(--accent-border);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  margin-top: 0.75rem;
}
.share code {
  flex: 1;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Abstimmungstabelle ---------- */
.poll-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.poll-head h2 { margin-bottom: 0; }
.code-pill {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}
.code-pill:hover { background: #fbdfd0; }

.table-scroll { overflow-x: auto; padding-bottom: 0.25rem; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; }
.grid th, .grid td {
  padding: 0.55rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.grid th.name-col, .grid td.name-col {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 2;
  min-width: 150px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--line);
  font-weight: 600;
}
.grid thead th { border-bottom: 2px solid var(--line); vertical-align: bottom; padding-bottom: 0.6rem; }
.date-head { min-width: 76px; }
.date-head .dcard {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 58px;
  padding: 0.45rem 0.55rem 0.4rem;
  background: linear-gradient(180deg, #fffdfb 0%, #f9f1e9 100%);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.date-head .dow { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-dark); }
.date-head .day { font-size: 1.3rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.date-head .mon { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.date-head .time {
  display: table;
  margin: 6px auto 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
}

.mark { font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
.mark.yes { color: var(--yes); }
.mark.maybe { color: var(--maybe); font-size: 0.9rem; }
.mark.no { color: var(--no); }

.legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.9rem 0 0.25rem;
}
.legend .mark { font-size: 0.9rem; }

/* Antwort-Zeile: Kreuz-Buttons */
tr.entry td { background: #fbf6f0; border-top: 2px solid var(--line); }
tr.entry td.name-col { background: #fbf6f0; }
tr.entry input[type="text"] { min-width: 130px; padding: 0.45rem 0.6rem; }

.toggle {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  color: #c6bcb0;
  display: inline-grid;
  place-items: center;
  transition: all 0.12s;
}
.toggle:hover { border-color: var(--yes); color: var(--yes); }
.toggle.yes {
  background: var(--yes);
  border-color: var(--yes);
  color: #fff;
  box-shadow: 0 4px 12px rgba(35, 165, 90, 0.35);
}
.toggle.yes:hover { border-color: var(--yes); color: #fff; }
.toggle.maybe {
  background: #f5a623;
  border-color: #f5a623;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.35);
}
.toggle.maybe:hover { border-color: #f5a623; color: #fff; }

.entry-actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.hint { font-size: 0.83rem; color: var(--muted); }

.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: #f3ede5;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.empty { color: var(--muted); font-style: italic; padding: 1rem 0; }

footer { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 2rem; }

/* ---------- Mobil ---------- */
@media (max-width: 720px) {
  .option-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .wrap { padding: 1.25rem 0.85rem 3rem; }
  .card { padding: 1.15rem; }
  .hero { padding: 1.25rem 0 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .option-card { padding: 1.5rem 1.15rem; }
  .brand { margin-bottom: 1.25rem; }
  .brand h1 { font-size: 1.15rem; }
  .cal { max-width: 100%; }
  .sel-row .d { min-width: 100%; }
  .grid th.name-col, .grid td.name-col { min-width: 104px; max-width: 140px; font-size: 0.9rem; }
  .grid th, .grid td { padding: 0.45rem 0.4rem; }
  .date-head { min-width: 62px; }
  .date-head .dcard { min-width: 48px; padding: 0.35rem 0.4rem 0.3rem; }
  .date-head .day { font-size: 1.1rem; }
  .toggle { width: 38px; height: 38px; }
  tr.entry input[type="text"] { min-width: 92px; width: 100%; }
  .join-row { flex-direction: column; align-items: stretch; }
  .join-row input { max-width: none; }
  .entry-actions .btn-primary { width: 100%; }
}
