/* The free "Mon frigo" tool and the QR welcome line of the recipe page. Builds on home.css tokens. */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h-section { font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.h-section small { font-family: var(--body); font-size: 15px; font-weight: 600; color: var(--mute); letter-spacing: 0; margin-left: 6px; }
.text-btn { background: none; border: 0; padding: 6px 0; color: var(--mute); font: 600 14px var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.text-btn:hover { color: var(--tomato); }
button.btn { border: 0; cursor: pointer; }
button.btn-outline { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }
body.has-dialog { overflow: hidden; }

/* ---------- Public recipe page (rest in recipe.css) ---------- */
.qr-hello { display: flex; align-items: center; gap: 12px; margin-top: 0; background: var(--basil-soft); color: var(--basil); border-radius: 20px; padding: 10px 16px; font-weight: 700; }
.qr-hello img { width: 44px; height: 44px; object-fit: contain; }

/* ---------- Fridge: hero and pantry ---------- */
.fridge-hero { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: end; padding: 10px 0 0; }
.fridge-hero > div { padding-bottom: 56px; }
.fridge-h1 { font-size: clamp(44px, 5.6vw, 78px); line-height: .96; letter-spacing: -0.05em; }
.fridge-h1 em { display: block; font-size: 1.12em; }
.fridge-hero .lead { margin: 22px 0 0; }
.fridge-chef { width: 300px; height: 360px; object-fit: contain; animation: bounce 2.8s ease-in-out infinite; transform-origin: bottom center; }
.fridge-panel { position: relative; z-index: 1; margin-top: -24px; }
.fridge-card { background: var(--card); border: 1.5px solid var(--rule); border-radius: 36px; padding: 32px; box-shadow: 0 24px 50px -36px rgba(27,26,23,.4); }
.fridge-card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.count { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; margin-left: 6px; border-radius: 17px; background: var(--tomato); color: #fff; font-size: 17px; vertical-align: middle; }
.add-form { display: flex; gap: 12px; margin-top: 20px; }
.add-form input { flex: 1; min-width: 0; border: 2px solid var(--rule); border-radius: 30px; padding: 15px 22px; font: 500 17px var(--body); background: var(--paper); color: var(--ink); }
.add-form input:focus { outline: none; border-color: var(--tomato); background: #fff; }
.form-error { margin: 10px 0 0; color: var(--tomato-deep); font-weight: 700; }
.chips-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; padding: 0; }
.chip-item { display: inline-flex; align-items: center; gap: 4px; background: var(--basil-soft); color: var(--basil); border-radius: 22px; padding: 8px 8px 8px 16px; font-weight: 700; animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
.chip-x { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(30,74,56,.12); color: var(--basil); font-size: 18px; line-height: 1; cursor: pointer; }
.chip-x:hover { background: var(--basil); color: #fff; }
.empty-hint { margin: 18px 0 0; color: var(--mute); }
.suggest { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--rule); }
.suggest-label { margin: 0 0 10px; color: var(--mute); font-size: 13px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.suggest-list { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest-chip { border: 1.5px solid var(--rule); background: var(--paper); border-radius: 18px; padding: 7px 13px; font: 600 14px var(--body); color: var(--ink-2); cursor: pointer; transition: transform .2s cubic-bezier(.3,1.6,.5,1), border-color .2s; }
.suggest-chip:hover { border-color: var(--tomato); color: var(--tomato); transform: translateY(-2px) rotate(-2deg); }

/* ---------- Results header, tabs ---------- */
.results { padding: 70px 0 100px; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; }
.results-head h2 { font-size: clamp(32px, 4vw, 48px); }
.mode-tabs { display: inline-flex; background: var(--flour); border-radius: 30px; padding: 5px; gap: 4px; }
.mode-tab { border: 0; background: transparent; border-radius: 26px; padding: 12px 20px; font: 700 16px var(--display); color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s, transform .2s cubic-bezier(.3,1.6,.5,1); }
.mode-tab:hover { transform: translateY(-1px); }
.mode-tab.is-active { background: var(--ink); color: #fff; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filter { border: 1.5px solid var(--rule); background: #fff; border-radius: 20px; padding: 8px 14px; font: 700 14px var(--body); color: var(--ink-2); cursor: pointer; }
.filter span { color: var(--mute); margin-left: 4px; }
.filter.is-active { background: var(--tomato); border-color: var(--tomato); color: #fff; }
.filter.is-active span { color: rgba(255,255,255,.8); }

/* ---------- Recipe cards ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.r-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--rule); border-radius: 28px; overflow: hidden; transition: transform .3s cubic-bezier(.3,1.6,.5,1), box-shadow .3s; animation: rise .5s cubic-bezier(.2,.9,.3,1.2) both; animation-delay: calc(var(--i) * 40ms); }
.r-card:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 22px 40px -26px rgba(27,26,23,.45); }
.cover { aspect-ratio: 4 / 3; background: var(--peach); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.is-empty { display: grid; place-items: center; }
.cover.is-empty img { width: 55%; height: 80%; object-fit: contain; }
.ready-badge { position: absolute; top: 14px; left: 14px; border-radius: 16px; padding: 6px 12px; font-size: 13px; font-weight: 800; box-shadow: 0 6px 14px -8px rgba(27,26,23,.5); }
.ready-badge.is-ready { background: var(--basil); color: #fff; }
.ready-badge.is-almost { background: var(--saffron); color: var(--ink); }
.r-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.r-body h3 { font-size: 21px; line-height: 1.12; letter-spacing: -0.02em; }
.r-meta { margin: 0; color: var(--mute); font-size: 14px; font-weight: 600; }
.score { display: flex; align-items: center; gap: 10px; }
.score-track { flex: 1; height: 8px; border-radius: 4px; background: var(--flour); overflow: hidden; }
.score-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--saffron), var(--tomato)); transition: width .6s cubic-bezier(.2,.9,.3,1); }
.score-text { font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.missing { margin: 0; font-size: 14px; color: var(--ink-2); }
.missing span { color: var(--tomato-deep); font-weight: 700; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0; color: var(--mute); text-align: center; font-weight: 600; }
.empty-state img { width: 160px; height: 190px; object-fit: contain; }

/* ---------- Tournament ---------- */
.tourney-intro { display: flex; align-items: center; gap: 36px; background: var(--peach); border-radius: 36px; padding: 36px 40px; }
.tourney-intro img { width: 150px; height: 150px; object-fit: contain; animation: bounce 2.4s ease-in-out infinite; flex: none; }
.tourney-intro h3 { font-size: 34px; letter-spacing: -0.03em; }
.tourney-intro p { margin: 8px 0 16px; color: var(--ink-2); max-width: 620px; }
.size-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.size-chip { border: 2px solid var(--ink); background: transparent; border-radius: 20px; padding: 7px 14px; font: 700 14px var(--body); cursor: pointer; }
.size-chip.is-active { background: var(--ink); color: #fff; }
.tourney { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.tourney-top { text-align: center; }
.round-label { margin: 0 0 10px; font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -0.03em; }
.round-dots { display: flex; justify-content: center; gap: 8px; }
.round-dots .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rule); transition: background .3s, transform .3s; }
.round-dots .is-done { background: var(--basil); }
.round-dots .is-current { background: var(--tomato); transform: scale(1.3); }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 26px; width: min(900px, 100%); }
.duel-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0 0 20px; border: 2px solid var(--rule); background: #fff; border-radius: 30px; overflow: hidden; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: transform .3s cubic-bezier(.3,1.6,.5,1), border-color .2s, box-shadow .3s, opacity .3s; }
.duel-left { animation: slide-l .5s cubic-bezier(.2,.9,.3,1.2) both; }
.duel-right { animation: slide-r .5s cubic-bezier(.2,.9,.3,1.2) both; }
.duel-card:hover { transform: translateY(-6px) rotate(-1deg); border-color: var(--tomato); box-shadow: 0 24px 40px -26px rgba(239,74,42,.6); }
.duel-right:hover { transform: translateY(-6px) rotate(1deg); }
.duel-cover { aspect-ratio: 4 / 3; }
.duel-title { padding: 10px 20px 0; font-family: var(--display); font-weight: 800; font-size: 23px; line-height: 1.1; letter-spacing: -0.02em; }
.duel-score { padding: 0 20px; color: var(--mute); font-weight: 600; font-size: 14px; }
.duel-cta { margin: 6px 20px 0; align-self: flex-start; background: var(--tomato); color: #fff; border-radius: 18px; padding: 8px 14px; font-weight: 800; font-size: 14px; }
.vs { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: var(--saffron); font-family: var(--display); font-weight: 800; font-size: 26px; transform: rotate(-8deg); animation: vs-pulse 1.4s ease-in-out infinite; box-shadow: 0 10px 0 -3px #C9861A; }
.duel.is-picked .duel-card { pointer-events: none; }
.duel.is-picked .duel-card:not(.is-winner) { opacity: 0; transform: scale(.85) rotate(-10deg) translateY(30px); }
.duel.is-picked .is-winner { transform: scale(1.06) rotate(-1.5deg); border-color: var(--basil); box-shadow: 0 0 0 6px var(--basil-soft); }
.duel.is-picked .vs { opacity: 0; transform: scale(.4); transition: all .3s; }

/* ---------- Wheel ---------- */
.wheel-zone { display: grid; grid-template-columns: minmax(0, 520px) 1fr; gap: 50px; align-items: center; }
.wheel-stage { position: relative; width: min(520px, 100%); aspect-ratio: 1; margin: 110px auto 0; }
.wheel { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 26px 30px rgba(27,26,23,.25)); }
.wheel-rotor { transform-box: fill-box; transform-origin: center; }
.wheel-rim { fill: none; stroke: var(--ink); stroke-width: 8; }
.wheel-label { font: 700 13px var(--body); }
.wheel-empty { font: 700 20px var(--display); fill: var(--mute); }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 6px solid var(--paper); background: var(--ink); color: #fff; font: 800 19px var(--display); cursor: pointer; box-shadow: 0 10px 24px -8px rgba(27,26,23,.6); transition: transform .2s cubic-bezier(.3,1.6,.5,1), background .2s; }
.wheel-hub:hover:not([disabled]) { transform: scale(1.07) rotate(-4deg); background: var(--tomato); }
.wheel-hub[disabled] { cursor: default; opacity: .9; }
.wheel-pointer { position: absolute; left: 50%; top: -6px; width: 0; height: 0; margin-left: -14px; border: 14px solid transparent; border-top: 22px solid var(--ink); z-index: 2; }
/* Chef You stands on top of the wheel and "runs" on it like a hamster. */
.wheel-runner { position: absolute; left: 50%; bottom: calc(100% - 4px); width: 150px; margin-left: -75px; z-index: 3; transform-origin: 50% 100%; animation: idle 2.4s ease-in-out infinite; }
.wheel-runner img { width: 150px; height: 156px; object-fit: contain; transform-origin: 50% 100%; }
.wheel-runner.is-running { animation: none; }
.wheel-runner.is-running img { animation: run .26s ease-in-out infinite alternate; }
.wheel-runner.is-slowing img { animation-duration: .5s; }
.wheel-runner.is-cheering img { animation: cheer .6s cubic-bezier(.3,1.6,.5,1); }
.dust { position: absolute; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--flour); opacity: 0; }
.dust-1 { left: 18px; } .dust-2 { left: 4px; width: 12px; height: 12px; } .dust-3 { left: 30px; width: 10px; height: 10px; }
.is-running .dust { animation: dust .5s ease-out infinite; }
.is-running .dust-2 { animation-delay: .17s; } .is-running .dust-3 { animation-delay: .34s; }
.is-slowing .dust { animation-duration: .9s; }
.wheel-side h3 { font-size: 38px; letter-spacing: -0.03em; }
.wheel-side > p { color: var(--ink-2); margin: 10px 0 18px; }
.wheel-legend { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.wheel-legend li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.wheel-legend li::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 4px; background: var(--c); border: 1px solid rgba(27,26,23,.12); }

/* ---------- Winner dialog ---------- */
.winner { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(27,26,23,.55); backdrop-filter: blur(4px); animation: fade .25s ease-out; }
.winner[hidden] { display: none; }
.winner-card { position: relative; width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--paper); border-radius: 36px; padding: 110px 30px 28px; text-align: center; animation: pop-in .55s cubic-bezier(.3,1.6,.5,1); margin-top: 60px; overflow: visible; }
.winner-chef { position: absolute; left: 50%; top: -96px; width: 170px; height: 206px; margin-left: -85px; object-fit: contain; animation: jump 1s cubic-bezier(.3,1.6,.5,1) infinite alternate; }
.winner-card h2 { font-size: clamp(28px, 4vw, 38px); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 16px; }
.winner-cover { border-radius: 24px; aspect-ratio: 16 / 10; }
.winner-score { margin: 10px 0 0; color: var(--ink-2); font-weight: 700; }
.winner-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.winner-app { margin: 16px 0 0; font-size: 14px; color: var(--mute); }
.winner-app a { color: var(--tomato); font-weight: 700; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }

/* ---------- Motion ---------- */
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-l { from { transform: translateX(-60px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-r { from { transform: translateX(60px) rotate(6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes vs-pulse { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(6deg) scale(1.12); } }
@keyframes idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes run { from { transform: translateY(0) rotate(-7deg) scaleY(.96); } to { transform: translateY(-16px) rotate(7deg) scaleY(1.03); } }
@keyframes cheer { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-40px) scale(1.1) rotate(-8deg); } 100% { transform: translateY(0) scale(1); } }
@keyframes dust { 0% { opacity: .9; transform: translate(0, 0) scale(.6); } 100% { opacity: 0; transform: translate(-34px, -10px) scale(1.4); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { transform: scale(.7) translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes jump { from { transform: translateY(0); } to { transform: translateY(-18px) rotate(3deg); } }
@keyframes fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--drift), 105vh) rotate(var(--spin)); opacity: .9; } }

/* ---------- Tablet / phone ---------- */
@media (max-width: 1040px) {
  .wheel-zone { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 680px) {
  .fridge-hero { grid-template-columns: minmax(0, 1fr); }
  .fridge-chef { display: none; }
  .fridge-panel { margin-top: 0; }
  .fridge-card { padding: 22px 18px; border-radius: 28px; }
  .add-form { flex-direction: column; }
  .results { padding-top: 50px; }
  .mode-tabs { width: 100%; }
  .mode-tab { flex: 1; padding: 11px 6px; font-size: 14px; }
  .tourney-intro { flex-direction: column; text-align: center; padding: 28px 22px; }
  .size-pick { justify-content: center; }
  .duel { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .vs { margin: -30px auto; position: relative; z-index: 2; width: 60px; height: 60px; font-size: 21px; }
  .duel-title { font-size: 19px; }
  .wheel-stage { margin-top: 100px; }
  .wheel-runner { width: 110px; margin-left: -55px; }
  .wheel-runner img { width: 110px; height: 116px; }
  .wheel-hub { width: 84px; height: 84px; margin: -42px 0 0 -42px; font-size: 15px; }
  .wheel-label { font-size: 12px; }
}
