/* ruudel – Gestaltung
   Idee: Schnittmenge. Drei Farben für drei Menschen, Kobaltblau für das, worauf sich alle einigen.
   Schrift: Bricolage Grotesque (OFL), lokal eingebunden – keine Verbindung zu fremden Servern. */

@font-face {
  font-family: "Bricolage";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(fonts/bricolage-grotesque-latin-standard-normal.woff2) format("woff2-variations"), url(fonts/bricolage-grotesque-latin-standard-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(fonts/bricolage-grotesque-latin-ext-standard-normal.woff2) format("woff2-variations"), url(fonts/bricolage-grotesque-latin-ext-standard-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #f5f6fb;
  --surface: #ffffff;
  --ink: #141a33;
  --muted: #5a6283;
  --line: #dde2f0;
  --line-strong: #c3cbe2;
  --cobalt: #2d4bf0;
  --cobalt-deep: #1f36c4;
  --cobalt-tint: #e4e8ff;
  --pink: #ff5c9d;
  --pink-tint: #ffd9e8;
  --sun: #ffc93c;
  --sun-tint: #ffefbf;
  --peri-tint: #d9dfff;
  --yes: var(--cobalt);
  --yes-bg: var(--cobalt-tint);
  --maybe: #9a6a00;
  --maybe-bg: var(--sun-tint);
  --no: #9ba1b8;
  --danger: #c4273f;
  --r-xl: 24px;
  --r-m: 14px;
  --r-s: 10px;
  --font: "Bricolage", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  font-optical-sizing: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-bottom: 64px; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }
a { color: var(--cobalt); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--cobalt-deep); }
h1, h2, h3 { line-height: 1.08; margin: 0 0 .6rem; font-weight: 750; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.025em; font-stretch: 85%; }
h2 { font-size: 1.45rem; letter-spacing: -0.015em; font-stretch: 90%; }
h3 { font-size: 1.1rem; margin-top: 1.4rem; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--sun); color: var(--ink); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 99px; z-index: 10; }
.skip:focus { left: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- Kopf & Fuß ---------- */
.site-header { padding: 22px 0 10px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 32px; }
.brand-mark circle { mix-blend-mode: multiply; stroke: var(--ink); stroke-width: 2; }
.brand-mark .m1 { fill: var(--pink); }
.brand-mark .m2 { fill: var(--sun); }
.brand-mark .m3 { fill: #8b9cff; }
.brand-word { font-weight: 800; font-size: 1.7rem; letter-spacing: -0.04em; font-stretch: 80%; }
.header-nav { display: flex; gap: 6px; }
.header-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 14px; border-radius: 99px; }
.header-nav a:hover { background: var(--surface); color: var(--ink); }

.site-footer { padding: 28px 0 36px; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1.5px solid var(--line); padding-top: 22px; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.footer-claim { margin: 0; color: var(--ink); font-weight: 600; }

/* ---------- Startseite ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px 40px; align-items: center; padding: 28px 0 40px; }
.hero h1 { font-size: clamp(3rem, 9vw, 6.2rem); line-height: .92; font-weight: 800; font-stretch: 75%; letter-spacing: -0.02em; margin-bottom: 1.4rem; }
.lead { font-size: 1.2rem; line-height: 1.5; max-width: 34em; color: #2b3255; }
.promises { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-weight: 600; font-size: .98rem; }
.promises li { display: flex; align-items: center; gap: 8px; }
.promises li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cobalt); }
.promises li:nth-child(2)::before { background: var(--pink); }
.promises li:nth-child(3)::before { background: var(--sun); }
.promises li:nth-child(4)::before { background: var(--ink); }
.venn { width: 100%; max-width: 420px; justify-self: end; overflow: visible; }
.venn-fills circle { mix-blend-mode: multiply; }
.venn-1 { fill: var(--pink-tint); }
.venn-2 { fill: var(--sun-tint); }
.venn-3 { fill: var(--peri-tint); }
.venn-core { fill: var(--cobalt); }
.venn-lines circle { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.venn-name { font: 700 22px var(--font); fill: var(--ink); }
.venn-core-label { font: 800 26px var(--font); fill: #fff; font-stretch: 80%; }
.venn-core-small { font-size: 15px; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .venn-core { animation: core-in .9s cubic-bezier(.2, .8, .2, 1) .25s both; transform-origin: 230px 190px; }
  .venn-core-label { animation: fade-in .4s ease .9s both; }
  @keyframes core-in { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 12px; }
  .venn { max-width: 280px; justify-self: center; grid-row: 1; }
}

/* ---------- Flächen & Formulare ---------- */
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-xl); padding: 30px; margin: 0 0 22px; }
@media (max-width: 560px) { .card { padding: 20px 16px; border-radius: 18px; } .wrap { padding: 0 14px; } }
.create-form { border: 2px solid var(--ink); }

.field { margin-bottom: 18px; }
.field label, legend { display: block; font-weight: 650; margin-bottom: 6px; }
.req, .opt { font-weight: 400; color: var(--muted); font-size: .88rem; margin-left: 6px; }
input[type=text], input:not([type]), input[type=url], input[type=date], input[type=time], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: inherit;
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-s);
  padding: 10px 13px;
  min-height: 46px;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #8d94b0; }
input:focus, textarea:focus, select:focus { border-color: var(--cobalt); background: #fff; outline: none; box-shadow: 0 0 0 4px rgba(45, 75, 240, .16); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.hint { color: var(--muted); font-size: .92rem; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--cobalt); flex: none; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.options-editor { margin: 10px 0 18px; padding: 18px; background: var(--cobalt-tint); border-radius: var(--r-m); }
.options-editor legend { float: left; width: 100%; font-size: 1.15rem; font-weight: 750; margin-bottom: 4px; }
.options-editor .hint { clear: both; color: #3d4570; }
.options-editor input { background: #fff; border-color: #b8c2f0; }
.option-row { display: grid; grid-template-columns: minmax(140px, 1.3fr) minmax(90px, .8fr) auto minmax(90px, .8fr) auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.option-row .dash { color: var(--muted); }
.option-row input { min-width: 0; }
@media (max-width: 640px) {
  .option-row { grid-template-columns: 1fr auto 1fr; grid-template-areas: "date date date" "start dash end" "copy . remove"; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1.5px solid #c9d1f7; }
  .option-row input[type=date] { grid-area: date; }
  .option-row input[name$="[start]"] { grid-area: start; }
  .option-row .dash { grid-area: dash; }
  .option-row input[name$="[end]"] { grid-area: end; }
  .option-row [data-copy-row] { grid-area: copy; justify-self: start; }
  .option-row [data-remove-row] { grid-area: remove; justify-self: end; }
  .options-editor { padding: 14px 12px; }
}
.settings { margin: 6px 0 20px; }
.settings summary { cursor: pointer; font-weight: 650; color: var(--cobalt); margin-bottom: 14px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 22px; }
.form-actions .hint { margin: 0; }

/* ---------- Schaltflächen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 11px 22px;
  font: 650 1rem/1.2 var(--font);
  border-radius: 99px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn-primary { background: var(--cobalt); color: #fff; box-shadow: 0 3px 0 var(--ink); border-color: var(--ink); }
.btn-primary:hover { background: var(--cobalt-deep); color: #fff; }
.btn-primary:active { box-shadow: 0 1px 0 var(--ink); transform: translateY(2px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--sun); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f0b8c2; }
.btn-danger:hover { background: #fdecef; color: var(--danger); }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: .9rem; box-shadow: none; }
.icon-btn { min-height: 42px; padding: 0 12px; border: 1.5px solid #b8c2f0; background: #fff; border-radius: var(--r-s); color: var(--ink); font: 600 .85rem var(--font); cursor: pointer; white-space: nowrap; }
.icon-btn:hover { border-color: var(--ink); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .82rem; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--danger); }

/* ---------- Hinweise ---------- */
.alert { border-radius: var(--r-m); padding: 16px 20px; margin: 0 0 22px; }
.alert ul { margin: 0; padding-left: 20px; }
.alert p:last-child { margin-bottom: 0; }
.alert-error { background: #fdecef; color: #8a1a2c; border: 1.5px solid #f3bcc6; }
.alert-success { background: var(--cobalt-tint); color: #18227a; border: 1.5px solid #c2cbff; }
.alert-info { background: var(--sun-tint); color: #5c4300; border: 1.5px solid #f6dc8f; }
.copy-field { display: flex; gap: 8px; margin: 10px 0; }
.copy-field input { flex: 1; min-width: 0; font-size: .95rem; background: #fff; }

/* ---------- Umfrage-Kopf ---------- */
.kicker { color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.poll-head { padding: 14px 0 22px; }
.poll-head h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-stretch: 78%; letter-spacing: -0.03em; line-height: .98; }
.meta { list-style: none; padding: 0; margin: 4px 0 12px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.meta-label { color: var(--muted); margin-right: 4px; }
.description { max-width: 44em; color: #2b3255; }
.admin-flag { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; font-size: .88rem; font-weight: 600; padding: 6px 14px; border-radius: 99px; margin: 0 0 10px; }
.admin-flag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }

.final-banner { background: var(--cobalt); color: #fff; border-radius: var(--r-xl); padding: 28px 30px; margin-bottom: 22px; border: 2px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.final-title { font-size: 1.1rem; font-stretch: 100%; font-weight: 600; color: var(--sun); margin-bottom: 6px; letter-spacing: 0; }
.final-date { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; font-stretch: 78%; line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 14px; }
.final-banner p { color: #e4e8ff; }
.final-banner .final-date { color: #fff; }
.cal-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

/* ---------- Ergebnistabelle ---------- */
.matrix-scroll { position: relative; overflow-x: auto; margin: 0 -4px 12px; padding: 0 4px 6px; -webkit-overflow-scrolling: touch; }
.matrix { border-collapse: separate; border-spacing: 4px 0; min-width: 100%; font-size: .97rem; }
.matrix th, .matrix td { padding: 8px 4px; text-align: center; }
.matrix .name-col { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 150px; max-width: 220px; font-weight: 600; padding-left: 2px; padding-right: 12px; border-bottom: 1.5px solid var(--line); }
.matrix thead .name-col { color: var(--muted); font-weight: 500; font-size: .9rem; vertical-align: bottom; border-bottom: 0; }
.opt-col { min-width: 84px; vertical-align: bottom; line-height: 1.1; padding: 12px 6px 10px !important; border-radius: 16px 16px 0 0; }
.opt-col > span { display: block; }
.opt-month { font-size: .85rem; color: var(--muted); font-weight: 600; }
.opt-day { font-size: 2.1rem; font-weight: 800; font-stretch: 75%; color: var(--ink); line-height: 1; letter-spacing: -0.03em; }
.opt-wd { font-size: .85rem; color: var(--muted); font-weight: 600; }
.opt-time { font-size: .86rem; font-weight: 650; margin-top: 5px; white-space: nowrap; }
.badge { display: inline-block !important; margin-top: 7px; background: var(--cobalt); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.badge-soft { background: var(--pink); color: #fff; }
.matrix .is-best { background: #fff0f6; }
.matrix .is-final { background: var(--cobalt-tint); }
.pname { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: inline; }

.ans { font-weight: 800; font-size: 1.05rem; border-radius: 10px; }
.matrix td.ans { padding: 10px 4px; }
.ans-y, .matrix td.ans-y { color: #fff; background: var(--cobalt); }
.ans-m, .matrix td.ans-m { color: var(--ink); background: var(--sun); }
.ans-n, .matrix td.ans-n { color: var(--no); background: var(--paper); }
.matrix td.ans.is-final { box-shadow: inset 0 0 0 3px var(--ink); }
.matrix tbody tr + tr td.ans { border-top: 4px solid var(--surface); }

.vote-row .name-col { border-bottom: 0; }
.vote-row td, .vote-row th { padding-top: 14px; }
.vote-row input[name=name] { min-width: 130px; background: #fff; border-color: var(--ink); }
.answer { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.answer-opt { display: block; position: relative; cursor: pointer; }
.answer-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.answer-opt span[aria-hidden] { display: block; padding: 5px 4px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: #fff; font-weight: 800; color: #a6acc4; min-height: 34px; transition: background-color .12s, border-color .12s, color .12s; }
.answer-opt:hover span[aria-hidden] { border-color: var(--ink); color: var(--ink); }
.answer-opt input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 1px; }
.answer-y input:checked + span { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.answer-m input:checked + span { background: var(--sun); border-color: #e6b020; color: var(--ink); }
.answer-n input:checked + span { background: #6f7694; border-color: #6f7694; color: #fff; }

.sum-row th, .sum-row td { padding-top: 14px; border-top: 2px solid var(--ink); }
.sum-row .name-col { border-bottom: 0; }
.sum-row td strong { font-size: 1.4rem; font-weight: 800; font-stretch: 80%; }
.sum-row td.is-best { background: transparent; }
.sum-row td.is-best strong { color: var(--pink); }
.sum-maybe { color: var(--maybe); font-size: .9rem; font-weight: 700; }
.finalize-row .name-col { border-bottom: 0; }
.legend { color: var(--muted); font-size: .88rem; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.legend span { display: inline-block; min-width: 32px; text-align: center; border-radius: 8px; font-weight: 800; padding: 2px 5px; }
.empty { color: var(--muted); }

/* ---------- Kalender, Verwaltung ---------- */
.cal-box { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-box h2 { color: #fff; }
.cal-box p, .cal-box .hint { color: #c4c9e0; }
.cal-box a { color: var(--sun); }
.cal-box .btn-ghost { background: transparent; color: #fff; border-color: #4a5278; }
.cal-box .btn-ghost:hover { border-color: #fff; color: #fff; }
.cal-box .btn-primary { background: var(--sun); color: var(--ink); border-color: var(--sun); box-shadow: none; }
.cal-box .btn-primary:hover { background: #ffd666; color: var(--ink); }
.cal-box input { background: #222a4b; border-color: #4a5278; color: #fff; }
.cal-manual { margin: 10px 0 14px; }
.cal-manual summary { cursor: pointer; color: #fff; font-weight: 600; }
.link-cal-form { margin-top: 4px; }
.share-card { border: 2px solid var(--ink); box-shadow: 0 5px 0 var(--cobalt); }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.control-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 12px; }
.control-grid form .hint { margin-top: 8px; margin-bottom: 0; }
.danger-zone { background: transparent; border-style: dashed; }
.danger-zone h2 { font-size: 1.2rem; }

/* ---------- Meine Umfragen ---------- */
.my-polls-list { list-style: none; padding: 0; margin: 0 0 8px; }
.my-polls-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1.5px solid var(--line); }
.my-polls-list li a { font-weight: 650; color: var(--ink); }
.tag { font-size: .8rem; font-weight: 600; color: var(--cobalt); background: var(--cobalt-tint); padding: 2px 10px; border-radius: 99px; }
.my-polls-list .link-btn { margin-left: auto; }

/* ---------- Textseiten ---------- */
.prose { max-width: 780px; }
.prose h1 { font-stretch: 80%; }
.prose h2 { margin-top: 1.8rem; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.message-card { max-width: 640px; margin-top: 24px; }

@media (max-width: 560px) {
  .matrix .name-col { min-width: 112px; max-width: 140px; }
  .vote-row input[name=name] { min-width: 96px; }
  .opt-col { min-width: 72px; }
  .header-nav a { padding: 6px 8px; font-size: .88rem; }
  .site-header .wrap { flex-wrap: nowrap; }
  .brand-word { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .site-header nav, .site-footer, .cal-box, .danger-zone, .form-actions, .vote-row, .venn { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}
