/* ════════════════════════════════════════════════════
   Sonntagsküche — Design System
   Editorial Kochbuch trifft 70er-Küche
   ════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..900,0..100;1,9..144,300..900,0..100&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

[hidden] { display: none !important; }

:root {
  --bg: #faf6ee;
  --bg-warm: #f4e9d7;
  --paper: #ffffff;
  --tomato: #d4452b;
  --tomato-deep: #a8331e;
  --tomato-bright: #ee5a3a;
  --mustard: #e89923;
  --sage: #7a9261;
  --plum: #8e3d63;
  --espresso: #2d1b10;
  --espresso-soft: #6b4f3f;
  --peach: #f4d5b8;
  --line: rgba(45, 27, 16, 0.12);
  --line-strong: rgba(45, 27, 16, 0.25);
  --shadow-soft: 0 30px 50px -40px rgba(45, 27, 16, 0.25);
  --shadow-lift: 0 36px 60px -28px rgba(45, 27, 16, 0.32);

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html, body {
  background: var(--bg);
  color: var(--espresso);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(232, 153, 35, 0.07), transparent 35%),
    radial-gradient(circle at 88% 82%, rgba(212, 69, 43, 0.05), transparent 40%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.11 0 0 0 0 0.07 0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: auto, auto, 200px 200px;
}

a { color: var(--tomato-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }

/* ───────── Topbar ───────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 246, 238, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  font-variation-settings: "opsz" 32, "SOFT" 60;
  letter-spacing: -0.02em;
  color: var(--espresso);
  text-decoration: none;
}
.brand .star {
  color: var(--tomato);
  display: inline-block;
  animation: spin 12s linear infinite;
}
.brand em {
  font-style: italic;
  color: var(--tomato);
  font-variation-settings: "opsz" 32, "SOFT" 100;
}
@keyframes spin { to { transform: rotate(360deg); } }

.topnav {
  display: flex;
  gap: 32px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.topnav a {
  color: var(--espresso-soft);
  position: relative;
  padding: 6px 0;
}
.topnav a:hover { color: var(--tomato); text-decoration: none; }
.topnav a.active { color: var(--espresso); }
.topnav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--tomato);
}

.stamp {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--espresso-soft);
  border: 1px dashed var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--espresso);
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
.icon-btn:hover { transform: translateY(-2px); background: var(--bg-warm); text-decoration: none; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--espresso);
  padding: 12px 20px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 500;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--tomato); color: #fff5e9; border-color: var(--tomato); }
.btn.primary:hover { background: var(--tomato-deep); border-color: var(--tomato-deep); }
.btn.secondary { background: var(--espresso); color: var(--bg); border-color: var(--espresso); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--tomato); color: #fff5e9; border-color: var(--tomato); }
.btn .plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 400;
}

.btn.large {
  padding: 22px 36px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  text-transform: none;
  font-weight: 400;
  font-variation-settings: "opsz" 32, "SOFT" 50;
  border-radius: 999px;
}

/* ───────── Forms ───────── */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="week"],
select,
textarea {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--paper);
  color: var(--espresso);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--tomato);
  box-shadow: 0 0 0 3px rgba(212, 69, 43, 0.12);
}

label { font-size: 14px; }

/* ───────── Cards ───────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 1px 0 var(--line), var(--shadow-soft);
  margin-bottom: 16px;
}

.card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 32, "SOFT" 40;
  margin-bottom: 12px;
  line-height: 1.05;
}

.card h3 em {
  font-style: italic;
  color: var(--tomato);
  font-variation-settings: "opsz" 32, "SOFT" 100;
  font-weight: 300;
}

/* ───────── Tabs ───────── */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 48px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 0;
}
.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  color: var(--espresso-soft);
  position: relative;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--espresso); }
.tab.active {
  color: var(--espresso);
  border-bottom-color: var(--tomato);
  font-weight: 600;
}
.tab .count {
  background: var(--bg-warm);
  color: var(--espresso);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}
.tab.active .count { background: var(--tomato); color: #fff5e9; }

/* ───────── Tables ───────── */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--espresso-soft);
  font-weight: 500;
}
td { font-size: 14px; }

/* ───────── Banners ───────── */
.banner {
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.banner.warn { background: rgba(232, 153, 35, 0.1); border-color: rgba(232, 153, 35, 0.4); }
.banner.error { background: rgba(212, 69, 43, 0.1); border-color: rgba(212, 69, 43, 0.4); }
.banner.info { background: rgba(122, 146, 97, 0.1); border-color: rgba(122, 146, 97, 0.4); }

/* ───────── Badges & Pills ───────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-warm);
  color: var(--espresso);
  border: 1px solid rgba(45, 27, 16, 0.06);
  font-family: var(--font-body);
  letter-spacing: 0;
}
.badge.offer {
  background: var(--mustard);
  color: var(--espresso);
  font-weight: 600;
  transform: rotate(-1deg);
  box-shadow: 0 4px 12px -4px rgba(232, 153, 35, 0.5);
}
.badge.match-low { background: rgba(212, 69, 43, 0.1); border-color: rgba(212, 69, 43, 0.3); color: var(--tomato-deep); }
.badge.match-mid { background: rgba(232, 153, 35, 0.15); border-color: rgba(232, 153, 35, 0.4); color: #8b5a18; }
.badge.match-high { background: rgba(122, 146, 97, 0.15); border-color: rgba(122, 146, 97, 0.4); color: #4a6535; }

.pin-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sage);
  background: rgba(122, 146, 97, 0.12);
  border: 1px solid rgba(122, 146, 97, 0.4);
  padding: 6px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.pin-badge::before { content: "● "; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--espresso);
}
.user-chip .user-emoji { font-size: 16px; }
.user-chip .user-name { font-weight: 500; }
.user-chip .user-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-warm);
  color: var(--espresso-soft);
}
.user-chip .user-role.super { background: rgba(212, 69, 43, 0.12); color: var(--tomato); }
.user-chip .user-role.parent { background: rgba(232, 153, 35, 0.15); color: var(--mustard); }
.user-chip .user-role.child { background: rgba(122, 146, 97, 0.15); color: var(--sage); }

/* ───────── Spinner ───────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(212, 69, 43, 0.25);
  border-top-color: var(--tomato);
  border-radius: 50%;
  animation: spinround 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spinround { to { transform: rotate(360deg); } }

/* ───────── Modal ───────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(45, 27, 16, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fade-back 0.2s ease;
}
@keyframes fade-back { from { opacity: 0; } }
.modal {
  background: var(--paper);
  border-radius: 22px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 50px 100px -30px rgba(45, 27, 16, 0.5);
  animation: pop-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes pop-in { from { opacity: 0; transform: scale(0.96) translateY(10px); } }
.modal h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 60, "SOFT" 40;
  margin-bottom: 18px;
  line-height: 1;
}
.modal h2 em {
  font-style: italic;
  color: var(--tomato);
  font-variation-settings: "opsz" 60, "SOFT" 100;
  font-weight: 300;
}

.form-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: center;
}

/* ───────── Day cards (week display) ───────── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.day-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 12px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, border-color 0.25s;
}
.day-card:hover:not(.disabled):not(.locked) {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 16px 30px -16px rgba(45, 27, 16, 0.25);
  border-color: var(--tomato);
}
.day-card.has-dish { background: var(--peach); border-color: rgba(212, 69, 43, 0.25); }
.day-card.disabled { background: rgba(45, 27, 16, 0.04); opacity: 0.55; cursor: not-allowed; }
.day-card.disabled .day-emoji { filter: grayscale(0.7); }
.day-card.selected {
  background: var(--tomato);
  color: #fff5e9;
  transform: translateY(-6px) rotate(2deg) scale(1.03);
  box-shadow: 0 20px 40px -16px rgba(212, 69, 43, 0.5);
  border-color: var(--tomato-deep);
}
.day-card .day-name {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}
.day-card .day-date {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  margin: 4px 0 12px;
  font-variation-settings: "opsz" 32, "SOFT" 30;
}
.day-card .day-emoji {
  font-size: 32px;
  line-height: 1;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.day-card .dish-name {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;
  min-height: 32px;
}
.day-card .dish-name.empty {
  font-style: italic;
  opacity: 0.6;
  font-weight: 400;
}
.day-card .ribbon {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  background: var(--sage);
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.day-card.disabled .ribbon { background: var(--espresso-soft); }
.day-card.selected .ribbon { background: #fff5e9; color: var(--tomato); }

/* ───────── Game buttons (kid view) ───────── */
.game-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 24px 0;
}
.game-btn {
  position: relative;
  border: none;
  border-radius: 28px;
  padding: 36px 28px 32px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 30px 60px -40px rgba(45, 27, 16, 0.4);
  color: #fff5e9;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 280px;
  font-family: inherit;
}
.game-btn:hover {
  transform: translateY(-6px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 50px 80px -40px rgba(45, 27, 16, 0.5);
}
.game-btn:hover .game-emoji { transform: scale(1.1) rotate(-8deg); }
.game-btn:disabled { background: #ccc !important; cursor: not-allowed; transform: none; }

.game-btn.wheel { background: linear-gradient(155deg, var(--tomato) 0%, var(--tomato-deep) 100%); }
.game-btn.memory { background: linear-gradient(155deg, var(--mustard) 0%, #c47619 100%); }
.game-btn.slot { background: linear-gradient(155deg, var(--sage) 0%, #5a7245 100%); }
.game-btn.angeln { background: linear-gradient(155deg, #ffd966 0%, #d4a429 100%); color: #5a3d1a; }

.game-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: 0.4;
  pointer-events: none;
}
.game-btn .game-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  opacity: 0.75;
}
.game-btn .game-emoji {
  font-size: 80px;
  line-height: 1;
  align-self: center;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.game-btn .game-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 60, "SOFT" 50;
}
.game-btn .game-name em {
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "opsz" 60, "SOFT" 100;
  opacity: 0.85;
}
.game-btn .game-desc { font-size: 13px; opacity: 0.85; line-height: 1.4; }
.game-btn .play-pill {
  margin-top: auto;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.18);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.game-btn .play-pill::after { content: "→"; font-family: var(--font-body); }

/* ───────── Game stage (full-screen game) ───────── */
.game-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 60vh;
  padding: 24px;
}

/* ───────── Recipe cards (admin) ───────── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.recipe-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}
.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 50px -25px rgba(45, 27, 16, 0.25);
  border-color: var(--tomato);
}
.recipe-card.inactive {
  opacity: 0.65;
  background: rgba(45, 27, 16, 0.04);
  border-style: dashed;
}
.recipe-card .dish-state-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--espresso);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 1;
}
.meta-link {
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
}
.meta-link:hover { color: var(--tomato); }
.recipe-card .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.recipe-card .emoji {
  font-size: 52px;
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.recipe-card:hover .emoji { transform: rotate(-6deg) scale(1.05); }
.recipe-card .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--espresso-soft);
  letter-spacing: 0.06em;
}
.recipe-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 32, "SOFT" 40;
  margin: 0;
}
.recipe-card .specs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--espresso-soft);
  letter-spacing: 0.04em;
}
.recipe-card .specs span { display: inline-flex; align-items: center; gap: 4px; }
.recipe-card .ingredient-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.recipe-card .ingredient-pill {
  background: var(--bg-warm);
  color: var(--espresso);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(45, 27, 16, 0.06);
}
.recipe-card .ingredient-pill.more {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--espresso-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.recipe-card .actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.recipe-card:hover .actions { opacity: 1; }
.recipe-card .actions button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--espresso);
}
.recipe-card .actions button:hover { background: var(--tomato); color: var(--bg); border-color: var(--tomato); }

.recipe-card.add {
  background: transparent;
  border: 2px dashed var(--line-strong);
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}
.recipe-card.add:hover {
  background: rgba(212, 69, 43, 0.04);
  border-color: var(--tomato);
}
.recipe-card.add .add-icon {
  font-size: 48px;
  color: var(--tomato);
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1;
}
.recipe-card.add p {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 14, "SOFT" 80;
  font-size: 13px;
  color: var(--espresso-soft);
}
.recipe-card.add .ai-tag {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--mustard);
  color: var(--espresso);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

/* ───────── Animations ───────── */
.fade-in { animation: fadein 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.fade-in.d1 { animation-delay: 0.05s; }
.fade-in.d2 { animation-delay: 0.15s; }
.fade-in.d3 { animation-delay: 0.25s; }
.fade-in.d4 { animation-delay: 0.35s; }
.fade-in.d5 { animation-delay: 0.45s; }
.fade-in.d6 { animation-delay: 0.55s; }
.fade-in.d7 { animation-delay: 0.65s; }
@keyframes fadein { from { opacity: 0; transform: translateY(12px); } }

/* ───────── Utility ───────── */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.right { justify-content: flex-end; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tomato);
}
.kicker::before { content: ""; width: 24px; height: 1px; background: var(--tomato); }
.title-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.95;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.title-display em {
  font-style: italic;
  color: var(--tomato);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-weight: 300;
}

/* ───────── Hamburger button (mobile-only) ───────── */
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  font-size: 20px;
  color: var(--espresso);
  padding: 0;
  flex-shrink: 0;
}
.hamburger:hover { background: var(--bg-warm); }
.hamburger .ham-x { display: none; }
body.mobile-nav-open .hamburger .ham-bars { display: none; }
body.mobile-nav-open .hamburger .ham-x { display: inline; }

/* ───────── Tablet (≤ 900px) ───────── */
@media (max-width: 900px) {
  /* Topbar */
  .topbar {
    padding: 12px 16px;
    gap: 8px;
    flex-wrap: nowrap;
    /* Mobile: kein Glas-Effekt — der erzeugt einen Stacking-Context, der das Nav-Drawer blurry macht */
    backdrop-filter: none;
    background: var(--bg);
  }
  .brand { font-size: 18px; gap: 8px; }
  .stamp { display: none; }
  .user-chip .user-role { display: none; } /* save space — role nicht so wichtig auf mobile */
  .user-chip { padding: 4px 10px 4px 6px; font-size: 12px; }
  .user-chip .user-emoji { font-size: 14px; }

  /* Hamburger einblenden */
  .hamburger { display: inline-flex; }

  /* Topnav → Slide-Down-Drawer */
  .topnav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    background: var(--paper);
    padding: 76px 20px 28px;
    box-shadow: 0 30px 60px -20px rgba(45, 27, 16, 0.4);
    z-index: 50;
    border-bottom: 1px solid var(--line);
    text-transform: none;
    letter-spacing: 0;
    font-size: 16px;
    animation: drawer-down 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  body.mobile-nav-open .topnav { display: flex; }
  /* Wenn das Drawer offen ist, Topbar (samt eingebettetem Drawer) über das Backdrop heben */
  body.mobile-nav-open .topbar { z-index: 60; background: var(--paper); }
  @keyframes drawer-down {
    from { opacity: 0; transform: translateY(-8px); }
  }
  body.mobile-nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(45, 27, 16, 0.45);
    /* KEIN backdrop-filter — sonst blurry-Konflikt mit dem Topbar-Stacking-Context */
    z-index: 40;
    animation: fade-back 0.2s ease;
  }
  .topnav a {
    padding: 14px 14px;
    border-radius: 12px;
    color: var(--espresso);
    font-weight: 500;
    font-size: 17px;
  }
  .topnav a:hover, .topnav a.active {
    background: var(--bg-warm);
    color: var(--espresso);
  }
  .topnav a.active { color: var(--tomato); }
  .topnav a.active::after { display: none; } /* no underline-pill in drawer */

  /* Tabs — horizontal scroll mit Hint-Gradient rechts */
  .tabs {
    padding: 0 16px;
    position: relative;
    scrollbar-width: thin;
  }
  .tab { padding: 14px 16px; font-size: 11px; min-height: 44px; }
  .tab:first-child { padding-left: 4px; }

  /* Buttons: 44px Touch-Target Minimum */
  .btn {
    padding: 12px 18px;
    min-height: 44px;
  }
  .btn.large { padding: 18px 28px; font-size: 18px; }

  /* Inputs: 16px font-size verhindert iOS-Zoom beim Fokus */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  input[type="week"],
  select,
  textarea {
    font-size: 16px;
    padding: 12px 14px;
    min-height: 44px;
  }

  /* Layout */
  .week-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .game-buttons { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .game-btn { min-height: 200px; padding: 28px 24px; }
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .modal { padding: 24px; border-radius: 18px; }
  .modal-backdrop { padding: 16px; }
  .modal h2 { font-size: 26px; }
  .recipe-grid { grid-template-columns: 1fr; gap: 14px; }

  /* Recipe-Card-Action-Buttons immer sichtbar + größer fürs Tippen */
  .recipe-card .actions {
    opacity: 1;
    top: 12px;
    right: 12px;
  }
  .recipe-card .actions button {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }

  /* Banners eng am Rand */
  .banner { padding: 12px 14px; font-size: 13px; }

  /* Cards: weniger Padding */
  .card { padding: 22px 18px; border-radius: 18px; }
  .card h3 { font-size: 22px; }

  /* User-chip in header braucht weniger Platz */
  #topbar-right { gap: 8px !important; }
}

/* ───────── Phone (≤ 560px) — noch kompakter ───────── */
@media (max-width: 560px) {
  .topbar { padding: 10px 12px; }
  .brand { font-size: 16px; }
  .brand .star { font-size: 14px; }

  /* User-chip auf den reinen Avatar runter */
  .user-chip .user-name { display: none; }
  .user-chip {
    padding: 4px;
    width: 36px;
    height: 36px;
    justify-content: center;
  }
  .user-chip .user-emoji { font-size: 16px; }

  /* Logout-Button als reines Icon */
  #btn-logout {
    padding: 0;
    width: 40px;
    height: 40px;
    min-height: 40px;
    justify-content: center;
    font-size: 0;
  }
  #btn-logout::before {
    content: "⎋";
    font-size: 18px;
  }

  /* Hamburger kleiner */
  .hamburger { width: 40px; height: 40px; font-size: 18px; }

  /* Tabs noch enger gepackt */
  .tab { padding: 12px 12px; font-size: 10px; }
  .tab .count { font-size: 9px; padding: 1px 6px; }

  /* Tables: schmaler padding */
  th, td { padding: 8px 8px; font-size: 13px; }
  th { font-size: 10px; }

  /* Game-Buttons single column */
  .game-buttons { grid-template-columns: 1fr; }
  .game-btn { min-height: 160px; padding: 24px 20px; }
  .game-btn .game-emoji { font-size: 64px; }
  .game-btn .game-name { font-size: 28px; }

  /* Week-Grid einreihig */
  .week-grid { grid-template-columns: repeat(2, 1fr); }

  /* Cards padding noch kleiner */
  .card { padding: 18px 14px; border-radius: 16px; }
  .card h3 { font-size: 20px; }

  /* Modal: full-width im wahrsten Sinne */
  .modal-backdrop { padding: 8px; }
  .modal { padding: 20px 16px; border-radius: 14px; }
  .modal h2 { font-size: 22px; }
}
