/* Mahlzeit: Rezepte der Fuchtls. Dunkler Kachel-Look wie CleanUp und Trio, Akzent in warmem Orange.
   Wird von Hand gepflegt, nicht generiert. */
/* Schriften liegen selbst auf dem Server (keine Anfrage an Google), Lizenz: SIL Open Font License */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 600 800; font-display: swap }
@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 400 700; font-display: swap }
:root {
  --bg: #1b1714;          /* Grund, dunkles Espresso */
  --surface: #27211d;     /* Karten, Sheets */
  --surface-2: #352d27;   /* Eingaben, Chips */
  --line: #4a3f37;
  --fg: #f6efe9;
  --muted: #b2a497;
  --accent: #ffb86b;      /* Vorschlagen, Speichern: warmes Orange */
  --accent-fg: #2a1406;
  --danger: #ff7b6b;
  --heart: #ff7d8f;
  --c0: #b0603c; --c1: #a07a2c; --c2: #7c5b8f; --c3: #4f7a55; --c4: #a8566f; /* Pfanne & Wok, Nudeln, Eintopf & Curry, Wraps & Snacks, Süßes */
  --i0: #f0a07e; --i1: #e8c070; --i2: #c4a6d8; --i3: #9fcca3; --i4: #f0a0b8; /* Symbolfarben für die schlichten Kacheln */
  --tile: #2a2420;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Figtree", -apple-system, "Segoe UI", system-ui, sans-serif;
  --r: 20px;
  color-scheme: dark;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html { background: var(--bg) }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased }
button, input, textarea, select { font: inherit; color: inherit }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; border: 0; background: none; padding: 0 }
button:disabled { cursor: default; opacity: .5 }
svg { flex: none; display: block }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; text-wrap: balance; margin: 0 }
p { margin: 0 }
.muted { color: var(--muted) }
.small { font-size: 14px }
.center { text-align: center; padding-block: 40px }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) }
.label, form label { display: block; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px }
.label .muted, form label .muted { text-transform: none; letter-spacing: 0; font-weight: 600 }

.c0 { --cat: var(--c0); --ink: var(--i0) } .c1 { --cat: var(--c1); --ink: var(--i1) } .c2 { --cat: var(--c2); --ink: var(--i2) } .c3 { --cat: var(--c3); --ink: var(--i3) } .c4 { --cat: var(--c4); --ink: var(--i4) }

/* Kopf */
.app { max-width: 760px; margin: 0 auto; padding: 14px 16px 120px; display: flex; flex-direction: column; gap: 16px }
.top { display: flex; align-items: center; gap: 12px }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.04em; line-height: 1; margin-right: auto }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; overflow: hidden; flex: none }
.brand .logo svg { width: 100%; height: 100% }
.brand b { color: var(--accent); margin-left: 1px }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none }
.icon-btn.fav-on { color: var(--heart) }

/* Vorschlag: „Was kochen wir heute?“ */
.draw-panel { background: radial-gradient(110% 120% at 100% 0%, #ffb86b1f, transparent 60%), var(--surface); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 18px }
.draw-panel h1 { font-size: clamp(26px, 7vw, 34px); line-height: 1.1; margin: 6px 0 8px }
.draw-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--accent); color: var(--accent-fg); font-weight: 800; font-size: 18px; border-radius: 16px; padding: 17px; box-shadow: 0 8px 24px #ffb86b26 }
.is-drawing .draw-btn svg { animation: spin 1s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }
/* Losbox wie bei Trio: während des Losens rattern die Rezepte oben in der Karte durch */
.reel-wrap { display: grid; gap: 12px }
.reel { display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 14px 16px; border-radius: 18px; background: var(--cat); color: #fff; overflow: hidden; animation: reel-in .14s ease-out }
.reel-icon { width: 56px; height: 56px; border-radius: 16px; background: #ffffff26; display: grid; place-items: center; flex: none }
.reel-text { display: grid; gap: 3px; min-width: 0 }
.reel-text b { font-family: var(--display); font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.reel-text small { font-size: 13px; opacity: .85 }
@keyframes reel-in { from { transform: translateY(45%); opacity: .2 } }
.hero { background: radial-gradient(120% 90% at 85% 0%, #ffffff2e, transparent 60%), var(--cat); border-radius: 26px; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 18px 40px #0007; color: #fff }
.hero.arrived { animation: land .7s cubic-bezier(.2, 1.4, .4, 1) }
@keyframes land { from { transform: translateY(60px) scale(.85); opacity: 0 } }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px }
.hero .eyebrow { color: #fff; background: #0000002e; padding: 6px 10px; border-radius: 99px; white-space: nowrap }
.hero-cat { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; opacity: .9; text-align: right }
.hero-body { text-align: left; display: grid; gap: 6px; padding: 6px 2px; color: inherit }
.hero-icon { width: 72px; height: 72px; border-radius: 20px; background: #ffffff26; display: grid; place-items: center; margin-bottom: 6px }
.hero h1 { font-size: clamp(28px, 8vw, 40px); line-height: 1.05; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto }
.hero-body p { font-size: 15px; opacity: .9 }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.hero-actions button { display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; padding: 13px 10px; font-weight: 700 }
.clear { display: flex; align-items: center; justify-content: center; gap: 6px; align-self: center; color: inherit; opacity: .8; font-size: 14px; font-weight: 600; padding: 2px 10px }
.light { background: #fff; color: #2a1406 }
.ghost { background: #00000030; color: #fff }

/* Suche und Kategorien */
.search { position: relative; display: flex; align-items: center }
.search > svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none }
.search input { padding-left: 42px; padding-right: 44px; background: var(--surface); border-radius: 99px }
.search input::-webkit-search-cancel-button { display: none }
.search-x { position: absolute; right: 6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted) }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: -4px -16px 0; padding-inline: 16px; scrollbar-width: none }
.chips::-webkit-scrollbar { display: none }
.chips button { flex: none; display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 99px; background: var(--surface); font-size: 14px; font-weight: 600; white-space: nowrap }
.chips button svg { color: var(--cat) }
.chips button b { font-size: 13px; opacity: .65; font-variant-numeric: tabular-nums }
.chips button.on { background: var(--fg); color: var(--bg) }
.chips button.on[class*="c"] { background: var(--cat); color: #fff }
.chips button.on svg { color: currentColor }
.chips .fav-chip svg { color: var(--heart) }
.chips .fav-chip.on { background: var(--heart); color: #3a0710 }

/* Liste */
.list { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) }
.list-bar { display: flex; align-items: center; gap: 10px }
.add-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px 8px 11px; border-radius: 99px; background: var(--accent); color: var(--accent-fg); font-size: 14px; font-weight: 800; flex: none }
.sort { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 0 auto; font-size: 14px; font-weight: 600; color: var(--muted); min-width: 0; flex: 0 1 auto }
.sort-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.sort select { min-width: 0; max-width: 100%; text-overflow: ellipsis; background: var(--surface); color: var(--fg); border: 0; border-radius: 10px; padding: 7px 10px; font-weight: 600 }
.grid-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 10px 0 -2px; color: var(--fg) }
.grid-head:first-child { margin-top: 0 }
.grid-head svg { color: var(--ink) }

/* Kacheln */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)) } }
.tile { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 18px; background: radial-gradient(100% 80% at 100% 0%, #ffffff1f, transparent 60%), var(--cat); color: #fff; padding: 12px 11px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left; transition: transform .15s, opacity .2s, box-shadow .15s }
.tile:active { transform: scale(.96) }
.tile:disabled { opacity: 1 }
.tile-title { font-weight: 700; font-size: 14px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto }
.tile small { font-size: 12px; opacity: .75; margin-top: 2px }
.tile-text { display: grid }
.tile-fav { position: absolute; top: 10px; right: 10px; color: #fff; opacity: .9 }
.empty { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 40px 16px; color: var(--muted) }
.empty h3 { color: var(--fg); font-size: 20px; overflow-wrap: anywhere }

/* Rezeptansicht zum Kochen */
.recipe { gap: 18px }
.recipe-top { position: sticky; top: 0; z-index: 2; margin: -14px -16px 0; padding: 14px 16px 8px; background: linear-gradient(var(--bg) 70%, transparent) }
.grow { flex: 1 }
.recipe-hero { background: radial-gradient(120% 90% at 85% 0%, #ffffff2e, transparent 60%), var(--cat); border-radius: 26px; padding: 20px 18px; color: #fff; display: grid; gap: 6px; box-shadow: 0 18px 40px #0006 }
.recipe-hero .eyebrow { color: #fff; opacity: .85 }
.recipe-hero h1 { font-size: clamp(30px, 8.5vw, 44px); line-height: 1.04; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px }
.facts span { display: flex; align-items: center; gap: 6px; background: #00000030; padding: 6px 10px; border-radius: 99px; font-size: 14px; font-weight: 600 }
.callout { background: var(--surface); border-left: 4px solid var(--accent); border-radius: 6px 14px 14px 6px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere }
.toggle-row { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface); border-radius: 16px; padding: 12px 14px }
.toggle-row > svg { color: var(--accent) }
.toggle-row > span:not(.switch) { display: grid; flex: 1; min-width: 0 }
.toggle-row small { font-size: 13px; color: var(--muted) }
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--line); flex: none; transition: background .2s }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--fg); transition: transform .2s }
[aria-checked="true"] .switch { background: var(--accent) }
[aria-checked="true"] .switch::after { transform: translateX(18px); background: var(--accent-fg) }
.block { background: var(--surface); border-radius: var(--r); padding: 18px 16px; display: grid; gap: 10px }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.block-head h2 { font-size: 22px }
.chip-btn { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--surface-2); font-size: 14px; font-weight: 700 }
.group + .group { margin-top: 6px }
.group-title { font-family: var(--body); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 4px 0 2px }
.checks, .steps-list { list-style: none; margin: 0; padding: 0; display: grid }
.checks button, .steps-list button { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 9px 2px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere }
.checks li:last-child button { border-bottom: 0 }
.box { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; margin-top: 1px; transition: background .15s, border-color .15s }
.on > .box { background: var(--accent); border-color: var(--accent); color: var(--accent-fg) }
.checks .on > span:last-child, .steps-list .on > span:last-child { color: var(--muted); text-decoration: line-through; text-decoration-color: #b2a49780 }
.steps-list { gap: 4px }
.steps-list button { border: 0; padding: 10px 2px; gap: 14px; font-size: 17px; line-height: 1.45 }
.num { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-family: var(--display); font-weight: 800; color: var(--accent) }
.steps-list .on .num { background: var(--accent); color: var(--accent-fg) }

/* Sheets */
.overlay { position: fixed; inset: 0; z-index: 10; background: #0c0806b3; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s }
@keyframes fade { from { opacity: 0 } }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom, 0px)); animation: up .32s cubic-bezier(.2, .9, .3, 1) }
@keyframes up { from { transform: translateY(100%) } }
@media (min-width: 700px) { .overlay { align-items: center } .sheet { border-radius: 26px; padding-bottom: 24px } }
.grabber { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 10px }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px }
.sheet-head h2 { font-size: 24px; line-height: 1.15; margin-top: 4px; overflow-wrap: anywhere }
.sheet-head .icon-btn { background: var(--surface-2) }
.note { margin-bottom: 6px; white-space: pre-wrap; overflow-wrap: anywhere }
.actions { display: grid; gap: 10px; margin-top: 20px }
.primary, .secondary, .danger { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border-radius: 14px; padding: 15px; font-weight: 700 }
.primary { background: var(--accent); color: var(--accent-fg) }
.secondary { background: var(--surface-2) }
.danger { background: var(--danger); color: #2a0703 }
.text-danger { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--danger); padding: 10px; font-weight: 600 }
.confirm { display: grid; gap: 8px; background: #ff7b6b1a; border-radius: 14px; padding: 12px; text-align: center; overflow-wrap: anywhere }
.menu { display: grid; gap: 6px }
.menu button { display: flex; align-items: center; gap: 12px; padding: 15px 14px; border-radius: 14px; background: var(--surface-2); font-weight: 600; text-align: left }
.steps { padding-left: 22px; display: grid; gap: 6px; margin: 4px 0 14px }

/* Formulare */
input, textarea { width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; padding: 14px; font-size: 16px }
input:focus, textarea:focus { outline: none; border-color: var(--accent) }
textarea { min-height: 90px; resize: vertical }
::placeholder { color: var(--muted) }
form .primary { margin-top: 22px }
.cat-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.cat-pick button { aspect-ratio: 4 / 3; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; align-content: center; gap: 6px; padding: 4px; font-size: 13px; font-weight: 600; line-height: 1.15; text-align: center }
.cat-pick button svg { color: var(--cat) }
.cat-pick button.on { background: var(--cat); color: #fff; box-shadow: 0 0 0 2px var(--fg) }
.cat-pick button.on svg { color: #fff }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.cat-pick { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) }
.groups { display: grid; gap: 10px }
.group-edit { display: grid; gap: 6px; background: var(--bg); border-radius: 16px; padding: 8px }
.group-edit-head { display: flex; gap: 6px }
.group-edit input { padding: 11px 12px; font-weight: 700 }
.group-edit textarea { min-height: 110px }
.group-x { width: 46px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); color: var(--muted) }
.add-group { margin-top: 10px; padding: 12px; font-size: 15px }

/* Meldungen */
.error { color: var(--danger); margin-top: 8px; white-space: pre-wrap }
.banner { background: #ff7b6b1a; border-radius: 14px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center; margin: 0 }
.banner button { font-weight: 700; color: var(--fg); flex: none }
.toast { display: flex; align-items: center; gap: 14px; position: fixed; z-index: 20; left: 16px; right: 16px; width: fit-content; margin: 0 auto; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); font-weight: 700; padding: 12px 18px; border-radius: 99px; box-shadow: 0 10px 30px #0008; animation: fade .2s; max-width: 520px; text-align: left }

.toast button { font-weight: 800; color: inherit; text-decoration: underline; text-underline-offset: 3px; flex: none }
.once { text-align: left }
.once span { display: grid }
.once small { font-size: 12.5px; font-weight: 600; color: var(--muted) }

/* Anmeldung */
.login { max-width: 440px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 28px }
.login-card { background: var(--surface); border-radius: 26px; padding: 22px; display: grid; gap: 4px }
.login-card h1 { font-size: 30px; line-height: 1.1; margin-top: 18px }
.login-card .primary { margin-top: 16px }
.login-hint { margin-top: 10px }
.login-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.login-tiles span { aspect-ratio: 2 / 1; border-radius: 14px; background: var(--cat); display: grid; place-items: center; color: #fff }

.login-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)) }
.login-tiles span { aspect-ratio: 1 }

/* Schlichte Variante: alle Kacheln gleich, nur das Symbol trägt die Kategoriefarbe */
.plain .tile { background: var(--tile); color: var(--fg) }
.plain .tile > svg, .plain .chips button svg, .plain .cat-pick button svg { color: var(--ink) }
.plain .tile-fav { color: var(--heart) }
.plain .chips button.on[class*="c"] { background: var(--fg); color: var(--bg) }
.plain .chips button.on[class*="c"] svg { color: var(--cat) }
.plain .cat-pick button.on { background: var(--line); color: var(--fg) }
.plain .cat-pick button.on svg { color: var(--ink) }
.plain .hero, .plain .recipe-hero { background: var(--tile); color: var(--fg); box-shadow: 0 0 0 1.5px var(--line), 0 18px 40px #0007 }
.plain .hero .eyebrow { background: var(--surface-2); color: var(--accent) }
.plain .recipe-hero .eyebrow { color: var(--ink) }
.plain .hero-cat svg, .plain .hero-icon, .plain .recipe-hero .hero-icon { color: var(--ink) }
.plain .hero-icon { background: var(--surface-2) }
.plain .facts span { background: var(--surface-2) }
.plain .reel { background: var(--surface-2); color: var(--fg) }
.plain .reel-icon { color: var(--ink); background: var(--surface) }
.plain .ghost { background: var(--surface-2); color: var(--fg) }
.plain .login-tiles span { background: var(--surface-2); color: var(--ink) }

@media (max-width: 360px) {
  .top { gap: 8px }
  .brand { font-size: 25px; gap: 8px }
  .brand .logo { width: 30px; height: 30px }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important } }
