/* Food Make, version 2: days, decorations, the saving goal, the end-of-day
   page, the sticker book and the new-sticker pop-up. Loaded after style.css. */

/* A little progress bar, used for the saving goal. */
.bar { display: inline-block; flex: none; width: 96px; height: 18px; border: 3px solid var(--ink); border-radius: 10px; background: #fff; overflow: hidden; }
.bar i { display: block; height: 100%; background: #5ED6B0; }

/* ---------- Restaurant ---------- */
.r-right { align-items: flex-start; gap: 12px; }
.r-book { position: absolute; left: 176px; top: 140px; font-size: 24px; padding: 0 18px; background: #FFE066; }
.r-book .pic { width: 30px; height: 30px; }
.r-shop { background: #FFD08A; }

.piggy { height: auto; min-height: 72px; flex-direction: column; align-items: stretch; justify-content: center; gap: 4px; }
.piggy.has-goal { padding: 6px 14px 8px 12px; }
.piggy > .piggy-top, .piggy > .goal { flex-direction: row; align-items: center; }
.piggy-top { display: flex; gap: 12px; }
.piggy-top > div { display: flex; flex-direction: column; }
.goal { display: flex; gap: 6px; font-size: 15px; line-height: 1; white-space: nowrap; }
.piggy .goal .pic { width: 30px; height: 30px; }
.piggy .goal .pic.star { width: 22px; height: 22px; }
.goal.ready .goal-words { font-family: 'Baloo 2', sans-serif; font-size: 17px; }
.goal.ready .bar i { background: #FFC93C; }

.r-day {
  position: absolute; left: 24px; bottom: 24px; height: 72px; padding: 0 18px; border-radius: 22px; background: #FFF3C4;
  display: flex; align-items: center; gap: 10px;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 24px; line-height: 1; white-space: nowrap;
}
.r-day .pic { width: 46px; height: 46px; }
.r-dots {
  position: absolute; right: 112px; bottom: 24px; height: 72px; padding: 0 18px; border-radius: 22px;
  display: flex; align-items: center; gap: 8px; font-size: 20px; white-space: nowrap;
}
.r-dots i { width: 24px; height: 24px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; }
.r-dots i.full { background: #5ED6B0; }

/* Decorations are buttons: a tap moves one to its next place. */
.r-decor { position: absolute; padding: 0; border: 0; background: none; display: flex; flex-direction: column; justify-content: flex-end; }
.r-decor .pic { width: 100%; }
.r-decor:active { transform: scale(.96); }
.r-disco::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 100px; width: 4px; margin-left: -2px; background: var(--ink); }
.r-disco .pic { height: 119px; }
.r-balloons .pic { height: 176px; }

@keyframes balloon { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes glitter { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.7); } }
@keyframes bulb { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes rain { from { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(12px); opacity: 0; } }
@keyframes sunny { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.d-bob { transform-box: fill-box; transform-origin: 50% 100%; animation: balloon 3s ease-in-out infinite; }
.d-twinkle { transform-box: fill-box; transform-origin: 50% 50%; animation: glitter 1.4s ease-in-out infinite; }
.d-bulb { animation: bulb 1.6s ease-in-out infinite; }
.w-rain { animation: rain 1.1s linear infinite; }
.w-sun { transform-box: fill-box; transform-origin: 50% 50%; animation: sunny 4s ease-in-out infinite; }

/* ---------- Price ---------- */
.p-day { display: flex; align-items: center; gap: 10px; padding: 4px 18px; border: 3px solid var(--ink); border-radius: 20px; background: #FFF3C4; font-weight: 800; font-size: 22px; line-height: 1.1; }
.p-day .pic { width: 40px; height: 40px; }
.p-tip { display: flex; align-items: center; gap: 8px; padding: 6px 18px; border: 4px solid var(--ink); border-radius: 22px; background: #FFE066; font-weight: 800; font-size: 26px; line-height: 1.1; }
.p-tip .pic { width: 34px; height: 34px; }
/* Ghuy's happy dance is a bigger wiggle. */
@keyframes wiggle {
  0%, 100% { transform: translateY(0) rotate(0); }
  12% { transform: translateY(-40px) rotate(-18deg); } 25% { transform: translateY(0) rotate(14deg) scale(1.05, .92); }
  37% { transform: translateY(-64px) rotate(18deg); } 50% { transform: translateY(0) rotate(-14deg) scale(1.05, .92); }
  62% { transform: translateY(-40px) rotate(-18deg); } 75% { transform: translateY(0) rotate(14deg); } 87% { transform: translateY(-64px) rotate(0); }
}
.dance.wiggle { animation: wiggle 1.3s ease-in-out 3; }

/* ---------- End of the day ---------- */
#stage[data-screen="dayend"] { background: #CFE9FF; }
#stage[data-screen="dayend"] .mute { left: 24px; top: 24px; right: auto; bottom: auto; }
.d-wrap { height: 100%; padding: 28px 30px 0; display: flex; gap: 30px; }
.d-left { position: relative; width: 380px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.d-closed { padding: 2px 28px; border: 4px solid var(--ink); border-radius: 20px; background: #FF8FAB; box-shadow: 0 6px 0 var(--ink); font-weight: 800; font-size: 40px; transform: rotate(-4deg); margin-bottom: 8px; }
.d-bubble { padding: 12px 20px; border-radius: 28px 28px 6px 28px; font-size: 26px; text-align: center; }
.d-victoria { width: 290px; height: 382px; }
.d-party { position: absolute; left: -10px; right: -10px; bottom: 6px; display: flex; align-items: flex-end; justify-content: center; }
.d-dancer { margin: 0 -16px; transform-origin: 50% 100%; animation: partydance 1s ease-in-out infinite; }
@keyframes partydance { 0%, 100% { transform: translateY(0) rotate(-7deg); } 50% { transform: translateY(-26px) rotate(7deg); } }
.d-card { flex: 1; min-width: 0; margin-bottom: 28px; padding: 20px 24px; border-radius: 40px; display: flex; flex-direction: column; gap: 10px; }
.d-title { display: flex; align-items: center; justify-content: space-between; }
.d-title h1 { font-weight: 800; font-size: 40px; line-height: 1; }
.d-title .pic { width: 54px; height: 54px; }
.d-row-sold { display: flex; align-items: center; gap: 16px; font-size: 22px; min-height: 60px; }
.d-sold { display: flex; align-items: center; gap: 4px; font-family: 'Baloo 2', sans-serif; font-size: 30px; }
.d-sold .pic { width: 56px; height: 56px; }
.d-line { display: flex; align-items: center; gap: 14px; padding: 8px 16px; border-radius: 18px; background: #F4F0FF; font-size: 24px; }
.d-line .pic { width: 44px; height: 44px; }
.d-line > span:nth-child(2) { flex: 1; }
.d-line b { font-size: 32px; line-height: 1; white-space: nowrap; }
.d-kept { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border: 4px solid var(--ink); border-radius: 20px; background: #FFE066; }
.d-kept .pic { width: 84px; height: 70px; }
.d-kept span.baloo { flex: 1; font-weight: 800; font-size: 34px; line-height: 1; }
.d-kept b { font-size: 56px; line-height: 1; }
.d-best { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.d-best .pic { width: 34px; height: 34px; }
.d-buttons { margin-top: auto; display: flex; gap: 16px; }
.d-buttons .btn { height: 84px; border-radius: 26px; font-size: 30px; }
.d-shop { flex: 1; background: #FFD08A; }
.d-new { flex: 1.4; }

/* ---------- Shop: two shelves ---------- */
.s-wrap { padding: 20px 28px; gap: 10px; }
.s-shelf { font-weight: 800; font-size: 24px; line-height: 1; }
.s-shelf small { margin-left: 8px; font-size: 18px; font-weight: 700; color: var(--soft); }
.s-cards { gap: 14px; }
.s-cards.three { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s-card { height: 212px; padding: 10px 12px; border-radius: 26px; gap: 4px; }
.s-card.s-decor { height: 270px; }
.s-card.goal-card { background: #FFF3C4; }
.s-food { width: 64px; height: 64px; }
.s-card h2 { flex: none; font-size: 22px; text-align: center; }
.s-have { font-size: 19px; }
.s-have .pic { width: 30px; height: 30px; }
.s-buy { width: 100%; max-width: 230px; font-size: 24px; flex: none; }
.s-more { font-size: 18px; }
.s-locked { min-height: 56px; font-size: 22px; }
.s-star { position: absolute; right: 2px; top: 2px; width: 72px; height: 72px; padding: 10px; border: 0; background: none; }
.s-star .pic { width: 52px; height: 52px; }
.s-star:active { transform: scale(.9); }
.s-pics { height: 92px; align-self: flex-start; padding-left: 8px; display: flex; align-items: flex-end; gap: 10px; }
.s-thing { width: 84px; height: 92px; }
.s-thing svg, .s-guest svg { object-fit: contain; }
.s-plus { font-weight: 800; font-size: 30px; padding-bottom: 20px; }
.s-guest { position: relative; width: 62px; height: 79px; }
.s-guest.mystery svg { filter: brightness(0) opacity(.3); }
.s-guest b { position: absolute; left: 0; right: 0; top: 26px; text-align: center; font-size: 36px; line-height: 1; color: #fff; }
.s-brings { font-size: 16px; line-height: 1.1; color: var(--soft); text-align: center; }
.s-saving { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 1; white-space: nowrap; }
.s-news { position: absolute; left: 0; right: 0; bottom: 12px; width: fit-content; margin: 0 auto; padding: 6px 22px; font-size: 24px; white-space: nowrap; box-shadow: 0 6px 0 var(--ink); }
.s-news .pic { width: 46px; height: 46px; }
.s-burst { top: 10px; }

/* ---------- Sticker book ---------- */
#stage[data-screen="book"] { background: #FFD3DF; }
#stage[data-screen="book"] .mute { right: 24px; top: 22px; bottom: auto; }
.b-wrap { height: 100%; padding: 22px 28px; display: flex; flex-direction: column; gap: 14px; }
.b-top { display: flex; align-items: center; gap: 20px; padding-right: 88px; }
.b-top h1 { flex: 1; font-weight: 800; font-size: 44px; line-height: 1; text-align: center; }
.b-count { height: 72px; padding: 0 18px; border-radius: 20px; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 28px; white-space: nowrap; }
.b-count .pic { width: 34px; height: 34px; }
.b-grid { flex: 1; min-height: 0; padding: 12px; border-radius: 36px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; }
.b-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.b-disc { width: 104px; height: 104px; border: 4px dashed #8A7AA3; border-radius: 50%; background: #F1ECF9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.b-disc .pic { width: 66px; height: 66px; filter: grayscale(1) opacity(.35); }
.b-cell.won .b-disc { border: 5px solid var(--ink); background: #FFF3C4; box-shadow: 0 5px 0 var(--ink); }
.b-cell.won .b-disc .pic { filter: none; }
.b-name { font-size: 17px; line-height: 1.1; text-align: center; color: var(--soft); }
.b-cell.won .b-name { color: var(--ink); }

/* ---------- "New sticker!" pop-up: never blocks a tap ---------- */
.toasts { position: absolute; left: 0; right: 0; top: 14px; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 8px 26px 8px 10px; border-radius: 26px; background: #FFE066; display: flex; align-items: center; gap: 12px; animation: toast 4.2s ease-out both; }
.toast .pic { width: 60px; height: 60px; }
.toast > div { display: flex; flex-direction: column; line-height: 1.1; }
.toast b { font-weight: 800; font-size: 26px; }
.toast span { font-size: 18px; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-24px) scale(.8); } 7% { opacity: 1; transform: none; } 88% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Who is playing? ---------- */
#stage[data-screen="who"] { background: #FFE9C7; }
.w-wrap { height: 100%; padding: 28px 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.w-wrap h1 { font-weight: 800; font-size: 56px; line-height: 1; }
.w-wrap h2 { font-weight: 800; font-size: 26px; line-height: 1; }
.w-cards { flex: 1; min-height: 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 18px; align-content: center; }
.w-slot { position: relative; min-height: 0; max-height: 280px; display: flex; flex-direction: column; gap: 8px; }
.w-card {
  flex: 1; min-height: 0; padding: 12px; border: 4px solid var(--ink); border-radius: 32px; background: #fff; box-shadow: 0 6px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.w-card:active:not([disabled]) { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.w-card .pic { flex: 1; min-height: 0; width: 100%; }
.w-name { font-weight: 800; font-size: 30px; line-height: 1; }
.w-add { border-style: dashed; background: #FFF8EA; }
.w-plus { font-weight: 800; font-size: 96px; line-height: .8; }
.w-remove { min-height: 72px; font-size: 22px; }
.w-grown { position: absolute; left: 24px; bottom: 16px; min-width: 72px; height: 72px; padding: 0 12px; border: 0; background: none; color: var(--soft); font-size: 17px; text-decoration: underline; }
.w-done { min-width: 240px; }
.w-new, .w-gate { width: 100%; padding: 20px 24px; border-radius: 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.w-gate { width: 560px; margin-top: 60px; padding: 36px; gap: 28px; background: #fff; }
.w-gate h2 { font-size: 44px; }
.w-gate .btn { min-width: 110px; font-size: 36px; }
.w-row { display: flex; gap: 14px; justify-content: center; }
.w-pick { width: 128px; height: 156px; padding: 8px; border: 4px solid transparent; border-radius: 26px; background: rgba(255, 255, 255, .55); }
.w-pick .pic { width: 100%; height: 100%; }
.w-pick.on { border-color: var(--ink); background: #fff; box-shadow: 0 6px 0 var(--ink); }
.w-colour { width: 76px; height: 76px; border: 4px solid var(--ink); border-radius: 50%; }
.w-colour.on { box-shadow: 0 0 0 5px #fff, 0 0 0 9px var(--ink); }
.w-label { display: flex; align-items: center; gap: 14px; font-weight: 800; font-size: 24px; }
.w-input {
  width: 300px; height: 72px; padding: 0 18px; border: 4px solid var(--ink); border-radius: 20px; background: #fff; color: var(--ink);
  font: 800 30px 'Baloo 2', sans-serif; -webkit-user-select: text; user-select: text; touch-action: manipulation;
}
.w-buttons { display: flex; gap: 18px; }
.w-go { min-width: 260px; font-size: 32px; }
/* In the restaurant: your own picture, to go back to "Who is playing?". */
.r-who { position: absolute; right: 24px; bottom: 108px; width: 72px; height: 72px; padding: 4px; border: 4px solid var(--ink); border-radius: 50%; background: #fff; box-shadow: 0 5px 0 var(--ink); overflow: hidden; }
.r-who .pic { width: 100%; height: 100%; }
.r-who:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
