/* Mol-Bhaav! - night market dream: deep violet, Sarojini pink, marigold, mint price tags */
:root { --night: #241338; --moon: #FFF3E0; --itch: #FFC93C; --sheet: #FF4FA0; --coil: #2EE6C5; --bite: #FF4D4D; }

/* Screens: price-tag doodles instead of Bzzz Off's coil */
.screen { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cpath d='M12 20 h22 l8 8 -8 8 h-22 z' fill='%23FF4FA0' fill-opacity='.14'/%3E%3Ctext x='52' y='70' font-size='22' fill='%23FFC93C' fill-opacity='.16'%3E%E2%82%B9%3C/text%3E%3C/svg%3E"),
  radial-gradient(circle at 50% 36%, #4f2a6b 0%, var(--night) 72%); }
.screen.dim { background: radial-gradient(circle at 50% 40%, rgba(79,42,107,.93) 0%, rgba(36,19,56,.97) 70%); }
.mascot svg { animation: swing 1.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes swing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.menu-grid a.ghost { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 10px; font-size: 18px; text-decoration: none; }
.page .day { font-size: 22px; }
.page.boss { background: var(--sheet); color: #fff; }
html, body { background: var(--night); }

/* ---------- The market ---------- */
#play { position: fixed; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 30%, #3d2259, var(--night) 70%); overflow-y: auto; }
.top { width: 100%; max-width: 720px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.wallet { border-color: var(--itch); }
#stall { position: relative; width: 100%; max-width: 720px; margin-top: 12px; border-radius: 22px; overflow: hidden; border: 4px solid var(--night);
  background: linear-gradient(180deg, #5a2a3a 0%, #3a1a2e 55%, #2a1424 100%); box-shadow: 0 12px 40px rgba(0,0,0,.45); }
#stall.arrive { animation: arrive .4s ease-out; }
#stall.leave { animation: leave .35s ease-in forwards; }
#stall.walking .scene { animation: walkaway 1.1s ease-in-out; }
@keyframes arrive { from { transform: translateX(60px); opacity: 0; } }
@keyframes leave { to { transform: translateX(-60px); opacity: 0; } }
@keyframes walkaway { 40% { transform: translateX(-30px) scale(.96); opacity: .6; } }
.awning { height: 46px; background: repeating-linear-gradient(90deg, var(--sheet) 0 34px, var(--moon) 34px 68px); border-bottom: 4px solid var(--night);
  -webkit-mask: radial-gradient(circle at 17px 46px, transparent 14px, #000 15px) 0 0 / 34px 100%; mask: radial-gradient(circle at 17px 46px, transparent 14px, #000 15px) 0 0 / 34px 100%; }
.lights { height: 14px; margin-top: -4px; background: radial-gradient(circle, #FFF4B0 0 3px, transparent 4px) 0 0 / 26px 14px; animation: twinkle 1.2s steps(2) infinite; }
@keyframes twinkle { 50% { filter: brightness(.5); } }
.scene { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 16px 6px; align-items: start; }

#keeper { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
#keeper .face { font-size: 86px; line-height: 1; transition: transform .2s; }
#keeper[data-mood="happy"] .face { transform: scale(1.1) rotate(-6deg); }
#keeper[data-mood="angry"] .face { filter: drop-shadow(0 0 12px rgba(255,77,77,.8)); }
#keeper[data-mood="angry"] .face::after { content: "💢"; }
#keeper.shake .face { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px) rotate(-6deg); } 50% { transform: translateX(7px) rotate(5deg); } 75% { transform: translateX(-4px); } }
#keeper b { font-size: 15px; }
#hearts { font-size: 14px; letter-spacing: 1px; }
.say { position: relative; margin-top: 8px; background: #fff; color: var(--night); border: 3px solid var(--night); border-radius: 18px; padding: 8px 12px; font-weight: 800; font-size: 15px; line-height: 1.35; max-width: 100%; }
.say::before { content: ""; position: absolute; top: -12px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-bottom: 10px solid var(--night); border-top: 0; }
.say.pop { animation: pop .3s cubic-bezier(.3, 1.8, .5, 1); }
#keeper[data-mood="angry"] .say { background: #ffe1e1; }
#keeper[data-mood="happy"] .say { background: #e1fff6; }
.say.you { background: var(--itch); }

.item { position: relative; display: flex; flex-direction: column; align-items: center; }
.tag { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; max-width: 240px; padding: 12px 10px 14px; background: var(--moon); color: var(--night);
  border: 4px solid var(--night); border-radius: 12px 12px 18px 18px; box-shadow: 0 6px 0 var(--night); transform: rotate(2deg); }
.tag::before { content: ""; position: absolute; top: -12px; width: 16px; height: 16px; border-radius: 50%; background: var(--night); }
.tag .icon { font-size: 64px; line-height: 1.1; }
.tag b { font-size: 16px; text-align: center; }
.was { font-size: 13px; font-weight: 700; opacity: .7; }
.now { font-weight: 800; font-size: 15px; }
.now b { font-family: var(--comic); font-size: 30px; letter-spacing: .03em; color: var(--bite); }
.stamp { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); font-family: var(--comic); font-size: 54px; color: #1aa37a; border: 6px solid #1aa37a;
  border-radius: 14px; padding: 2px 16px; background: rgba(255,243,224,.9); display: flex; flex-direction: column; align-items: center; line-height: 1; animation: stamp .35s cubic-bezier(.3, 1.8, .5, 1); }
.stamp small { font-family: var(--body); font-weight: 900; font-size: 15px; margin-top: 2px; }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-14deg) scale(3); opacity: 0; } }

.controls { padding: 6px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.offer { display: flex; gap: 10px; align-items: center; }
.offer input { flex: 1; accent-color: var(--itch); height: 30px; }
.offer > b { font-family: var(--comic); font-size: 30px; letter-spacing: .03em; color: var(--itch); text-shadow: var(--outline); min-width: 84px; text-align: right; }
.offer .big { margin: 0; padding: 8px 20px 10px; min-height: 0; font-size: 22px; }
.offer .big:disabled { opacity: .5; }
.poor { font-weight: 800; font-size: 14px; color: var(--itch); }
.tactics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tactics button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-family: var(--body); font-size: 24px; line-height: 1.1; cursor: pointer;
  color: var(--night); background: var(--coil); border: 3px solid var(--night); border-radius: 14px; box-shadow: 0 4px 0 var(--night); }
.tactics button small { font-size: 11.5px; font-weight: 900; line-height: 1.15; }
.tactics button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--night); }
.tactics button:disabled { opacity: .35; cursor: default; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 800; }
.foot b { font-size: 22px; letter-spacing: 2px; }
.foot .ghost { padding: 6px 14px; min-height: 0; font-size: 15px; }

/* Results: the haul */
.haul { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.haul span { display: flex; flex-direction: column; align-items: center; font-size: 40px; line-height: 1.1; padding: 6px 8px; border-radius: 12px; background: rgba(255,243,224,.08); }
.haul span small { font-size: 13px; font-weight: 900; }
.haul .skipped, .haul .lost { opacity: .35; filter: grayscale(1); }

@media (max-width: 560px) {
  .scene { grid-template-columns: 1fr; gap: 4px; }
  #keeper { flex-direction: column; }
  #keeper .face { font-size: 62px; }
  .tag { max-width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 10px; padding: 8px 10px; transform: none; }
  .tag .icon { font-size: 44px; }
  .tactics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offer > b { font-size: 24px; min-width: 64px; }
  .stamp { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot svg, .lights, #stall.arrive, #stall.leave, #stall.walking .scene, .say.pop, .stamp, #keeper.shake .face { animation: none; }
}
