/* Grundstellung */
:root { color-scheme: light; box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; padding: 0; font: 14px -apple-system, BlinkMacSystemFont, sans-serif; background: #fff; color: #000; }
img { max-width: 100%; }
[hidden]:not([hidden=until-found i]) { display: none !important; }

/* Schriften liegen neben dieser Datei (Inter und Bricolage Grotesque, SIL Open Font License 1.1, siehe lizenzen.txt). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("schrift/inter-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("schrift/inter-latin-400-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: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("schrift/inter-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("schrift/inter-latin-500-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: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("schrift/inter-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("schrift/inter-latin-600-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 Grotesque"; font-style: normal; font-weight: 600; font-display: swap; src: url("schrift/bricolage-grotesque-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600; font-display: swap; src: url("schrift/bricolage-grotesque-latin-600-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 Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url("schrift/bricolage-grotesque-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url("schrift/bricolage-grotesque-latin-700-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; }

/* Layout: eine schmale Spalte; der einzige "Gegenstand" auf der Seite ist der Los-Zettel, alles andere bleibt flach. */
:root {
  --bg: #EDF2ED;
  --surface: #FFFFFF;
  --ink: #13241C;
  --muted: #53645B;
  --line: #C6D3CA;
  --pine: #1E5C45;
  --pine-ink: #FFFFFF;
  --berry: #A61E38;
  --slip: #FFFBEF;
  --slip-ink: #2A2114;
  --slip-accent: #A61E38;
  --slip-line: #D9CDAE;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1713; --surface: #16231D; --ink: #E7EFE9; --muted: #9DB0A5; --line: #2D3F35;
    --pine: #62C99E; --pine-ink: #0B1611; --berry: #FF8A9E;
    --slip: #F4ECD6; --slip-ink: #2A2114; --slip-accent: #A61E38; --slip-line: #CFC19C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1713; --surface: #16231D; --ink: #E7EFE9; --muted: #9DB0A5; --line: #2D3F35;
  --pine: #62C99E; --pine-ink: #0B1611; --berry: #FF8A9E;
  --slip: #F4ECD6; --slip-ink: #2A2114; --slip-accent: #A61E38; --slip-line: #CFC19C;
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 1.5rem 3rem;
}
.seite { max-width: 34rem; margin-inline: auto; display: flex; flex-direction: column; gap: 1.5rem; }
header { display: flex; flex-direction: column; gap: 0.35rem; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 8vw, 2.75rem); line-height: 1.05; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.2; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; line-height: 1.3; margin: 0; }
p { margin: 0; }
.unter { color: var(--muted); }
.klein { font-size: 0.875rem; color: var(--muted); }

.ansicht { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.feld { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
label, legend { font-weight: 600; }
textarea, select, input[type="text"], input[type="url"] {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.7rem;
  width: 100%; min-width: 0; box-sizing: border-box;
}
textarea { min-height: 9.5rem; resize: vertical; }
textarea.kurz { min-height: 6.5rem; }
select { min-height: 2.75rem; }
::placeholder { color: var(--muted); opacity: 1; }
.zeile { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.zeile select { flex: 1 1 8rem; width: auto; }
.zeile .wort { color: var(--muted); }

button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; box-sizing: border-box;
  padding: 0.65rem 1rem; min-height: 2.75rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: opacity 0.2s;
}
button.haupt { background: var(--pine); color: var(--pine-ink); border-color: var(--pine); }
button.gross { padding: 0.9rem 1.1rem; font-size: 1.05rem; }
button.schlicht { background: transparent; align-self: flex-start; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
:is(button, textarea, select, summary, input):focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; }

details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 0.45rem; }
summary { font-weight: 600; cursor: pointer; padding-block: 0.7rem; }
.regeln { display: flex; flex-direction: column; gap: 1.1rem; padding-top: 0.9rem; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
legend { padding: 0; margin-bottom: 0.15rem; }
ul.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
ul.liste li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.35rem 0; border-bottom: 1px dashed var(--line); }
ul.liste li span { min-width: 0; overflow-wrap: anywhere; }
ul.liste button { padding: 0.25rem 0.75rem; font-size: 0.875rem; flex: none; }
ul.liste li.fehlt span { color: var(--berry); font-weight: 600; }
.haken { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.haken input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--pine); flex: none; }

.fehler { color: var(--berry); font-weight: 600; }
.fremd { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* Lose verteilen: zwei Wege, eine Auslosung */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.tabs button[aria-selected="true"] { background: var(--pine); color: var(--pine-ink); border-color: var(--pine); }
.schritt { display: flex; flex-direction: column; gap: 0.7rem; padding-top: 1rem; border-top: 1px solid var(--line); min-width: 0; }
ul.sendeliste li { padding: 0.5rem 0; }
ul.sendeliste li:last-child { border-bottom: 0; }
#adrDetails { border-bottom: 0; }
ul.sendeliste .wer { display: flex; flex-direction: column; gap: 0.1rem; }
ul.sendeliste .name { font-weight: 600; }
ul.sendeliste .stand { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
ul.sendeliste li.fertig .stand { color: var(--pine); font-weight: 600; }
ul.sendeliste button { padding: 0.5rem 0.8rem; font-size: 0.925rem; }
.handkopie { display: flex; flex-direction: column; gap: 0.5rem; }

.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.6rem; }
.raster button { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; text-align: left; padding: 0.75rem 0.85rem; min-width: 0; }
.raster .name { font-size: 1.05rem; overflow-wrap: anywhere; }
.raster .stand { font-size: 0.8rem; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.raster button.gesehen .stand { color: var(--pine); font-weight: 600; }
.raster button.oft .stand { color: var(--berry); }

.frage { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.frage p { font-size: 1.2rem; overflow-wrap: anywhere; }
.frage p.klein { font-size: 0.95rem; color: var(--berry); font-weight: 600; }
.frage:focus { outline: none; }

.zettel {
  background: var(--slip); color: var(--slip-ink);
  border: 1px solid var(--slip-line); border-top: 3px dashed var(--slip-line);
  border-radius: 2px 2px 10px 10px; padding: 1.4rem 1.25rem 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem; min-width: 0;
  box-shadow: 0 10px 24px -14px rgba(20, 30, 24, 0.55);
  transform: rotate(-0.6deg);
}
.zettel .fuer { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; overflow-wrap: anywhere; }
.zettel .du { font-size: 1.05rem; }
.zettel .losname { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 11vw, 3.6rem); line-height: 1.05; color: var(--slip-accent); overflow-wrap: anywhere; text-wrap: balance; }
.zettel .klein { color: inherit; }
.zettel button { align-self: flex-start; margin-top: 0.6rem; background: var(--slip-ink); color: var(--slip); border-color: var(--slip-ink); }
.zettel button:focus-visible { outline-color: var(--slip-accent); }
.uhr { height: 4px; background: var(--slip-line); border-radius: 2px; overflow: hidden; margin-top: 0.4rem; }
.uhr i { display: block; height: 100%; width: 100%; background: var(--slip-accent); transform-origin: left; }
.uhr.laeuft i { animation: ablauf 20s linear forwards; }
@keyframes ablauf { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .uhr.laeuft i { animation: none; } .zettel { transform: none; } }
/* Handy quer: wenig Höhe, deshalb der Name auf dem Zettel kleiner, damit Los und Knopf zusammen ins Bild passen. */
@media (orientation: landscape) and (max-height: 480px) { .zettel .losname { font-size: clamp(1.6rem, 6vw, 2.2rem); } }

.fuss { display: flex; flex-direction: column; gap: 0.75rem; padding-top: 0.5rem; }
.nachfrage { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem 0; border-top: 1px solid var(--line); }
