  :root {
    --blue-deep: #0a1628;
    --blue-mid: #1a3a6b;
    --blue-bright: #2563eb;
    --blue-sky: #60a5fa;
    --blue-light: #dbeafe;
    --blue-pale: #eff6ff;
    --white: #ffffff;
    --text: #0f172a;
    --text-soft: #64748b;
    --card-shadow: 0 20px 60px rgba(10,22,40,0.18), 0 4px 16px rgba(10,22,40,0.10);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { overflow-x: hidden; max-width: 100vw; }
  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--blue-deep);
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center;
    overflow-x: hidden; position: relative;
    touch-action: manipulation;
  }
  body::before {
    content: ''; position: fixed; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.25) 0%, transparent 70%);
    top: -150px; left: -150px; pointer-events: none; z-index: 0;
  }
  body::after {
    content: ''; position: fixed; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(96,165,250,0.15) 0%, transparent 70%);
    bottom: -100px; right: -100px; pointer-events: none; z-index: 0;
  }

  header {
    width: 100%; max-width: 480px; padding: 28px 24px 0;
    display: flex; align-items: center; justify-content: space-between;
    position: relative; z-index: 1;
  }
  .logo { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 600; color: var(--white); letter-spacing: -0.02em; display: flex; align-items: center; gap: 6px; }
  .logo-wrap { min-width: 0; max-width: 65%; }
  .logo-icon { height: 1.6rem; width: auto; display: inline-block; flex-shrink: 0; }
  .logo-hl { color: var(--blue-sky); }
  .logo-wordmark { color: var(--white); }
  .logo-sub { font-size: 0.72rem; color: rgba(255,255,255,0.35); font-weight: 300; letter-spacing: 0.04em; margin-top: 2px; margin-bottom: 6px; }
  .counter { font-size: 0.8rem; color: var(--blue-sky); background: rgba(96,165,250,0.12); border: 1px solid rgba(96,165,250,0.25); padding: 5px 12px; border-radius: 20px; letter-spacing: 0.05em; white-space: nowrap; flex-shrink: 0; }

  .filter-bar {
    width: 100%; max-width: 480px; padding: 12px 24px 0;
    display: flex; flex-wrap: wrap; gap: 7px;
    position: relative; z-index: 1;
  }
  .filter-btn {
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.55); border-radius: 20px; padding: 5px 13px;
    font-size: 0.76rem; font-family: 'DM Sans', sans-serif; cursor: pointer;
    transition: all 0.2s; white-space: nowrap;
  }
  .filter-btn.active { background: var(--blue-bright); border-color: var(--blue-bright); color: white; }
  .filter-btn:hover:not(.active) { background: rgba(255,255,255,0.12); color: white; }
  .filter-btn--surprise { background: rgba(96,165,250,0.13); border-color: rgba(96,165,250,0.35); color: var(--blue-sky); }
  .filter-btn--surprise:hover { background: rgba(96,165,250,0.22); color: white; }

  .stack-area {
    flex: 1; width: 100%; max-width: 480px;
    display: flex; align-items: center; justify-content: center;
    position: relative; padding: 20px 24px; min-height: 480px; z-index: 1;
  }
  .card-stack { position: relative; width: 100%; max-width: 400px; height: 460px; }
  .recipe-card {
    position: absolute; width: 100%; height: 100%;
    background: var(--white); border-radius: 24px;
    box-shadow: var(--card-shadow); cursor: grab;
    user-select: none; overflow: hidden; will-change: transform;
    transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
    touch-action: none;
  }
  .recipe-card:active { cursor: grabbing; }
  .recipe-card.back-1 { transform: translateY(12px) scale(0.96); z-index: 1; }
  .recipe-card.back-2 { transform: translateY(22px) scale(0.92); z-index: 0; }
  .recipe-card.active { z-index: 10; }
  .recipe-card.swiping-right .stamp-like { opacity: 1 !important; }
  .recipe-card.swiping-left  .stamp-nope { opacity: 1 !important; }

  .card-hero {
    height: 170px; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; flex-shrink: 0;
  }
  .card-emoji { font-size: 4.5rem; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.1)); z-index: 2; }
  .card-category-badge {
    position: absolute; top: 12px; right: 12px;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(8px);
    border-radius: 20px; padding: 4px 12px;
    font-size: 0.7rem; font-weight: 500; color: var(--blue-mid);
    letter-spacing: 0.04em; text-transform: uppercase;
  }
  .card-time-badge {
    position: absolute; top: 12px; left: 12px;
    background: rgba(249,115,22,0.9); backdrop-filter: blur(8px);
    border-radius: 20px; padding: 4px 10px;
    font-size: 0.7rem; font-weight: 500; color: white;
  }
  .card-tap-hint {
    position: absolute; bottom: 10px; right: 12px;
    font-size: 0.63rem; color: rgba(0,0,0,0.4);
    background: rgba(255,255,255,0.6); border-radius: 10px;
    padding: 2px 8px; pointer-events: none;
  }
  .stamp-like, .stamp-nope {
    position: absolute; top: 20px; padding: 6px 16px; border-radius: 8px;
    font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 600;
    opacity: 0; transition: opacity 0.1s; z-index: 20; pointer-events: none;
  }
  .stamp-like { left: 20px; color: #16a34a; border: 3px solid #16a34a; transform: rotate(-12deg); }
  .stamp-nope { right: 20px; color: #dc2626; border: 3px solid #dc2626; transform: rotate(12deg); }

  .card-body { padding: 16px 20px 14px; overflow-y: auto; height: calc(100% - 170px); }
  .card-title { font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 600; color: var(--text); margin-bottom: 8px; letter-spacing: -0.02em; line-height: 1.2; }
  .card-desc { font-size: 0.83rem; color: var(--text-soft); line-height: 1.55; margin-bottom: 12px; font-weight: 300; }
  .ingredients-label { font-size: 0.68rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue-bright); margin-bottom: 7px; }
  .ingredients-list { display: flex; flex-wrap: wrap; gap: 5px; }
  .ingredient-tag { background: var(--blue-pale); border: 1px solid var(--blue-light); color: var(--blue-mid); border-radius: 8px; padding: 3px 9px; font-size: 0.74rem; }
  .ingredient-tag.pantry { color: #94a3b8; }

  .actions {
    width: 100%; max-width: 400px;
    display: flex; align-items: center; justify-content: center;
    gap: 20px; padding: 0 24px 24px; position: relative; z-index: 1;
  }
  .btn { border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); font-size: 1.5rem; }
  .btn:hover  { transform: scale(1.12); }
  .btn:active { transform: scale(0.95); }
  .btn-nope { width: 60px; height: 60px; background: #fff; color: #dc2626; box-shadow: 0 4px 20px rgba(220,38,38,0.25); }
  .btn-like { width: 72px; height: 72px; background: var(--blue-bright); color: #fff; font-size: 1.7rem; box-shadow: 0 6px 24px rgba(37,99,235,0.45); }
  .btn-skip { width: 52px; height: 52px; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); font-size: 1.2rem; border: 1px solid rgba(255,255,255,0.15); }

  .liked-section { width: 100%; max-width: 480px; padding: 0 24px 28px; position: relative; z-index: 1; }
  .liked-label { font-size: 0.68rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.3); margin-bottom: 8px; }
  .liked-chips { display: flex; flex-wrap: wrap; gap: 7px; }
  .liked-chip {
    background: rgba(37,99,235,0.2); border: 1px solid rgba(96,165,250,0.3);
    color: var(--blue-sky); border-radius: 20px; padding: 5px 12px;
    font-size: 0.8rem; display: flex; align-items: center; gap: 5px;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer; transition: background 0.15s;
  }
  .liked-chip:hover { background: rgba(37,99,235,0.35); }
  .liked-chip-remove {
    background: none; border: none; color: rgba(96,165,250,0.4);
    cursor: pointer; font-size: 0.78rem; padding: 0 0 1px; line-height: 1;
    margin-left: 3px; transition: color 0.15s; font-family: inherit; flex-shrink: 0;
  }
  .liked-chip-remove:hover { color: #ef4444; }

  .done-state {
    display: none; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 40px 24px; flex: 1;
    width: 100%; max-width: 480px; position: relative; z-index: 1;
  }
  .done-state.visible { display: flex; }
  .done-emoji { font-size: 4rem; margin-bottom: 16px; }
  .done-title { font-family: 'Fraunces', serif; font-size: 1.8rem; color: var(--white); margin-bottom: 8px; }
  .done-sub { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-bottom: 28px; font-weight: 300; }
  .btn-restart { background: var(--blue-bright); color: white; border: none; border-radius: 14px; padding: 14px 32px; font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 6px 20px rgba(37,99,235,0.4); }
  .btn-restart:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(37,99,235,0.5); }
  .liked-summary { margin-top: 28px; width: 100%; }
  .liked-summary-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); margin-bottom: 10px; }

  @keyframes swipeRight { to { transform: translateX(140%) rotate(25deg); opacity: 0; } }
  @keyframes swipeLeft  { to { transform: translateX(-140%) rotate(-25deg); opacity: 0; } }
  @keyframes popIn { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  .fly-right { animation: swipeRight 0.35s ease forwards; }
  .fly-left  { animation: swipeLeft  0.35s ease forwards; }

  .bg-salat  { background: linear-gradient(135deg, #ecfccb 0%, #d9f99d 100%); }
  .bg-suppe  { background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%); }
  .bg-pfanne { background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%); }
  .bg-ofen   { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
  .bg-pasta  { background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); }

  /* ── DETAIL OVERLAY ── */
  .detail-overlay {
    position: fixed; inset: 0;
    background: var(--blue-deep);
    z-index: 100;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
  }
  .detail-overlay.open { transform: translateY(0); }

  .detail-hero {
    height: 210px; flex-shrink: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
  }
  .detail-hero-emoji { font-size: 4.5rem; margin-bottom: 10px; }
  .detail-hero-title {
    font-family: 'Fraunces', serif; font-size: 1.45rem; font-weight: 600;
    color: var(--white); text-align: center; padding: 0 60px;
    letter-spacing: -0.02em; line-height: 1.2;
  }
  .detail-back {
    position: absolute; top: 16px; left: 16px;
    background: rgba(10,22,40,0.60); border: 1.5px solid rgba(255,255,255,0.5);
    color: #fff; border-radius: 50%; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: background 0.2s;
    backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  }
  .detail-back:hover { background: rgba(10,22,40,0.82); }
  .detail-meta { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; }
  .detail-badge {
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
    color: white; border-radius: 20px; padding: 4px 10px;
    font-size: 0.72rem; backdrop-filter: blur(8px);
  }
  .detail-badge.orange { background: rgba(249,115,22,0.85); border-color: transparent; }

  .detail-body {
    flex: 1; overflow-y: auto; padding: 0 20px 48px;
    -webkit-overflow-scrolling: touch;
  }
  .detail-body::-webkit-scrollbar { width: 3px; }
  .detail-body::-webkit-scrollbar-track { background: transparent; }
  .detail-body::-webkit-scrollbar-thumb { background: rgba(96,165,250,0.3); border-radius: 2px; }

  .detail-section-title {
    font-size: 0.68rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--blue-sky);
    margin: 22px 0 12px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(96,165,250,0.2);
  }

  .detail-ingredients-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .detail-ingredient {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 2px;
  }
  .detail-ingredient-amount { font-size: 0.75rem; font-weight: 500; color: var(--blue-sky); }
  .detail-ingredient-name { font-size: 0.83rem; color: rgba(255,255,255,0.85); font-weight: 300; }
  .detail-ingredient.pantry { background: rgba(255,255,255,0.025); border-color: rgba(255,255,255,0.06); }
  .detail-ingredient.pantry .detail-ingredient-amount { color: rgba(96,165,250,0.4); }
  .detail-ingredient.pantry .detail-ingredient-name { color: rgba(255,255,255,0.3); }

  .detail-steps { display: flex; flex-direction: column; gap: 14px; }
  .detail-step { display: flex; gap: 14px; align-items: flex-start; }
  .step-number {
    flex-shrink: 0; width: 28px; height: 28px;
    background: var(--blue-bright); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 500; margin-top: 2px;
  }
  .step-content { flex: 1; }
  .step-text { font-size: 0.88rem; color: rgba(255,255,255,0.85); line-height: 1.6; font-weight: 300; }
  .step-ingredient-hint { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
  .step-hint-tag {
    background: rgba(37,99,235,0.2); border: 1px solid rgba(96,165,250,0.25);
    color: var(--blue-sky); border-radius: 8px; padding: 2px 8px; font-size: 0.68rem;
  }

  .detail-tip {
    margin-top: 20px;
    background: rgba(96,165,250,0.07); border: 1px solid rgba(96,165,250,0.18);
    border-radius: 14px; padding: 14px 16px;
    display: flex; gap: 10px; align-items: flex-start;
  }
  .detail-tip-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
  .detail-tip-text { font-size: 0.83rem; color: rgba(255,255,255,0.6); line-height: 1.55; font-weight: 300; }

  /* ── FOOTER ── */
  .site-footer {
    width: 100%; max-width: 480px;
    padding: 12px 24px 32px;
    display: flex; align-items: center; justify-content: center;
    gap: 6px; flex-wrap: wrap;
    position: relative; z-index: 1;
  }
  .footer-link {
    font-size: 0.7rem; color: rgba(255,255,255,0.3);
    background: none; border: none; cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-weight: 400;
    text-decoration: underline; text-underline-offset: 2px;
    transition: color 0.2s; padding: 0;
  }
  .footer-link:hover { color: rgba(255,255,255,0.6); }
  .footer-dot { font-size: 0.65rem; color: rgba(255,255,255,0.2); }

  /* ── MODAL ── */
  .modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(5, 10, 22, 0.85);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .modal-backdrop.open { opacity: 1; pointer-events: all; }
  .modal-sheet {
    width: 100%; max-width: 480px;
    background: #111d35;
    border-radius: 24px 24px 0 0;
    border-top: 1px solid rgba(96,165,250,0.15);
    padding: 0 0 40px;
    max-height: 85vh;
    display: flex; flex-direction: column;
    transform: translateY(40px);
    transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  }
  .modal-backdrop.open .modal-sheet { transform: translateY(0); }
  .modal-handle {
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.15); border-radius: 2px;
    margin: 14px auto 0;
    flex-shrink: 0;
  }
  .modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px 10px; flex-shrink: 0;
  }
  .modal-title {
    font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 600;
    color: var(--white); letter-spacing: -0.02em;
  }
  .modal-close {
    background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.5);
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: background 0.2s;
  }
  .modal-close:hover { background: rgba(255,255,255,0.15); }
  .modal-body {
    overflow-y: auto; padding: 4px 22px 0;
    font-size: 0.84rem; color: rgba(255,255,255,0.65);
    line-height: 1.65; font-weight: 300;
    -webkit-overflow-scrolling: touch;
  }
  .modal-body::-webkit-scrollbar { width: 3px; }
  .modal-body::-webkit-scrollbar-thumb { background: rgba(96,165,250,0.25); border-radius: 2px; }
  .modal-body h3 {
    font-family: 'DM Sans', sans-serif; font-size: 0.7rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.09em;
    color: var(--blue-sky); margin: 18px 0 6px;
  }
  .modal-body h3:first-child { margin-top: 6px; }
  .modal-body p { margin-bottom: 10px; }
  .modal-body a { color: var(--blue-sky); text-decoration: none; }
  .modal-body a:hover { text-decoration: underline; }
  .modal-body strong { color: rgba(255,255,255,0.85); font-weight: 500; }
