/* 🎯 a question in every market shop + 💎 the hidden treasure (souk-activity.js, 2026-11-18) */
.sa-wrap { position: fixed; inset: 0; z-index: 2600; display: grid; place-items: center; padding: 16px;
  background: rgba(16, 8, 20, .55); backdrop-filter: blur(3px); animation: saIn .25s ease both; }
.sa-wrap.out { animation: saOut .25s ease both; }
@keyframes saIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes saOut { to { opacity: 0; } }
.sa-card { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #fffaf0, #fbefd9); color: #2b1a10; border-radius: 22px; padding: 22px 20px 18px;
  border: 3px solid #e0b450; box-shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 0 0 2px #fff3c4; font-family: Rubik, Arial, sans-serif;
  animation: saPop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes saPop { from { transform: translateY(26px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.sa-x { position: absolute; top: 10px; inset-inline-end: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; z-index: 2;
  background: rgba(43, 26, 16, .1); color: #2b1a10; font-size: 18px; cursor: pointer; }
.sa-x:hover, .sa-x:focus-visible { background: rgba(43, 26, 16, .2); }
.sa-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding-inline-end: 44px; }
.sa-emoji { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 36px;
  background: radial-gradient(circle at 35% 30%, #e2508e, #8e1f55); box-shadow: 0 0 0 4px #f4cf6a, 0 6px 14px rgba(0, 0, 0, .25); }
.sa-kicker { margin: 0; font-size: 14px; font-weight: 700; color: #8e1f55; }
.sa-name { margin: 2px 0 0; font: 22px/1.2 'Secular One', Rubik, sans-serif; color: #2b1a10; }
.sa-q { margin: 6px 0 14px; font-size: 19px; line-height: 1.45; font-weight: 600; }
.sa-opts { display: grid; gap: 9px; }
.sa-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 10px 12px; text-align: start; cursor: pointer;
  font: 600 17px/1.3 Rubik, Arial, sans-serif; color: #2b1a10; background: #fff; border: 2px solid #d9c39a; border-radius: 14px;
  transition: transform .12s, background .2s, border-color .2s; }
.sa-opt:hover:not(:disabled), .sa-opt:focus-visible { border-color: #b8336a; transform: translateY(-1px); }
.sa-opt:disabled { cursor: default; }
.sa-l { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #f4e3c0; font-weight: 800; color: #6a4a1a; }
.sa-opt.picked { border-color: #b8336a; }
.sa-opt.right { background: #1d7a3e; border-color: #135a2c; color: #fff; }
.sa-opt.right .sa-l { background: #fff; color: #1d7a3e; }
.sa-opt.wrong { background: #b3261e; border-color: #8a1c16; color: #fff; }
.sa-opt.wrong .sa-l { background: #fff; color: #b3261e; }
.sa-res { text-align: center; }
.sa-res:empty { display: none; }
.sa-face { font-size: 58px; margin: 12px 0 0; animation: saBounce 1.1s ease both; }
.sa-face.yes { animation: saBounce .9s ease both, saSpin .9s ease both; }
@keyframes saBounce { 0% { transform: scale(.3); } 55% { transform: scale(1.25); } 75% { transform: scale(.92); } 100% { transform: scale(1); } }
@keyframes saSpin { from { rotate: -25deg; } to { rotate: 0deg; } }
.sa-line { margin: 4px 0; font: 21px/1.3 'Secular One', Rubik, sans-serif; color: #8e1f55; }
.sa-right { margin: 4px 0; font-weight: 700; color: #135a2c; }
.sa-xp { display: inline-block; margin: 6px 0; padding: 6px 14px; border-radius: 999px; background: #2b1a10; color: #ffd24a; font-weight: 800; font-size: 17px; }
.sa-xp.big { font-size: 20px; }
.sa-bless { margin: 6px 0 0; color: #5a3a1a; font-size: 16px; }
.sa-guest { margin: 12px 0 0; font-size: 14px; color: #5a3a1a; text-align: center; }
.sa-guest a { color: #8e1f55; font-weight: 700; }
.sa-ok { display: block; width: 100%; margin: 14px 0 0; min-height: 48px; border: 0; border-radius: 14px; cursor: pointer;
  font: 18px 'Secular One', Rubik, sans-serif; color: #fff; background: linear-gradient(180deg, #cc3c80, #9c2f6b); }
.sa-ok:focus-visible { outline: 3px solid #2b1a10; outline-offset: 2px; }
.sa-conf { position: absolute; top: -10px; left: var(--x); width: 9px; height: 14px; border-radius: 2px; pointer-events: none; z-index: 3;
  animation: saFall var(--d) ease-in forwards; }
@keyframes saFall { to { transform: translateY(520px) rotate(var(--r)); opacity: 0; } }

/* 💎 the treasure */
.sa-treasure { width: min(560px, 100%); text-align: center; background: linear-gradient(180deg, #2b1a2e, #1b1022); color: #fff3d6; border-color: #f4cf6a; overflow-x: hidden; }
.sa-treasure .sa-x { background: rgba(255, 255, 255, .14); color: #fff; }
.sa-rays { position: absolute; inset: -40% -40% auto; height: 120%; pointer-events: none; opacity: .35;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 74, .45) 0 8deg, transparent 8deg 22deg); animation: saRot 22s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 62%); mask: radial-gradient(circle, #000 20%, transparent 62%); }
@keyframes saRot { to { transform: rotate(360deg); } }
.sa-treasure .sa-kicker { position: relative; color: #ffd24a; font-size: 16px; }
.sa-tt { position: relative; margin: 4px 44px; font: 28px/1.2 'Secular One', Rubik, sans-serif; color: #fff; text-shadow: 0 2px 12px rgba(255, 210, 74, .45); }
.sa-from { position: relative; margin: 0 0 10px; color: #f4cf6a; }
.sa-pic { position: relative; display: block; width: 100%; padding: 0; border: 4px solid #f4cf6a; border-radius: 14px; overflow: hidden; cursor: zoom-in; background: #000;
  box-shadow: 0 0 30px rgba(255, 210, 74, .45); animation: saGlow 2.4s ease-in-out infinite alternate; }
.sa-pic img { display: block; width: 100%; max-height: 46dvh; object-fit: cover; }
@keyframes saGlow { to { box-shadow: 0 0 46px rgba(255, 210, 74, .75); } }
.sa-story { position: relative; margin: 14px 0 0; padding: 26px 13% 28px; text-align: start; color: #2b1a10; border-radius: 10px;
  background: #f3e3c2 url('/img/parchment.webp') center / cover; font: 18px/1.65 'Frank Ruhl Libre', 'David', serif; }
.sa-story p { margin: 0 0 .7em; }
.sa-story p:last-child { margin: 0; }
.sa-treasure .sa-bless, .sa-treasure .sa-guest { color: #f4e3c0; }
.sa-treasure .sa-guest a { color: #ffd24a; }
.sa-treasure .sa-xp { background: #ffd24a; color: #2b1a10; }
.sa-zoom { position: fixed; inset: 0; z-index: 2700; display: grid; place-items: center; background: rgba(0, 0, 0, .9); padding: 12px; cursor: zoom-out; }
.sa-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.sa-zoom .sa-x { background: rgba(255, 255, 255, .2); color: #fff; }

@media (max-width: 480px) {
  .sa-card { padding: 18px 14px 14px; border-radius: 18px; }
  .sa-q { font-size: 18px; }
  .sa-opt { font-size: 16px; }
  .sa-story { font-size: 17px; padding: 22px 14% 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .sa-wrap, .sa-card, .sa-face, .sa-rays, .sa-pic, .sa-conf { animation: none !important; }
}
html.a11y-still .sa-wrap, html.a11y-still .sa-card, html.a11y-still .sa-face, html.a11y-still .sa-rays, html.a11y-still .sa-pic { animation: none !important; }

/* 🧠 the market's quiz */
.sa-dots { display: flex; gap: 6px; justify-content: center; margin: 0 0 10px; }
.sa-dot { width: 12px; height: 12px; border-radius: 50%; background: #e6d6b6; }
.sa-dot.cur { box-shadow: 0 0 0 3px #b8336a; }
.sa-dot.ok { background: #1d7a3e; }
.sa-dot.no { background: #b3261e; }
.sa-qbody .sa-line { text-align: center; }

/* 🎚️ the person's level in the shops' riddles (owner, 2026-11-18) */
.sa-lvl { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; font-size: 14px; font-weight: 700; color: #7a3f12; }
.sa-lvl.top { color: #8a5a00; }
.sa-steps { display: inline-flex; gap: 3px; direction: ltr; }
.sa-steps i { width: 12px; height: 8px; border-radius: 2px; background: #e6d6bd; border: 1px solid #b89b6c; }
.sa-steps i.on { background: linear-gradient(#f7c948, #d99a1e); border-color: #a8740f; }
.sa-up { font-weight: 800; color: #1d6b3a; margin: 4px 0; }

/* 🧩 the riddle's explanation + 💡 "הידעת?" (owner, 2026-11-19) */
.sa-why { margin: 8px 0 2px; padding: 10px 12px; border-radius: 12px; background: #fff7e6; border: 1px solid #e6c98f; color: #3d2a14; font-size: 15px; line-height: 1.6; text-align: start; }
.sa-fact { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: #eef6ff; border: 1px solid #a9c8ea; color: #17304d; font-size: 15px; line-height: 1.6; text-align: start; display: grid; gap: 4px; }
.sa-fact b { color: #0d4a8a; font-size: 14px; }
.sa-fact[hidden] { display: none; }
.sa-ftxt { min-height: 5.5em; line-height: 1.7; }
.sa-frow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sa-ok.ghost { background: transparent; color: #7a3f12; border: 2px solid #c9a46a; }
.sa-frow .sa-ok { width: auto; flex: 1 1 140px; }

/* ✍️ think first (2026-11-19): type the answer, or wait a few seconds for the 4 options */
.tf { display: grid; gap: 8px; margin: 0 0 12px; }
.tf.over .tf-type { display: none; }
.tf-type { background: #fff; border: 2px dashed #e0b450; border-radius: 14px; padding: 10px 12px; }
.tf-lab { margin: 0 0 7px; font-weight: 700; font-size: 15px; color: #6a4a1a; }
.tf-row { display: flex; gap: 8px; }
.tf-in { flex: 1; min-width: 0; min-height: 46px; padding: 8px 12px; border: 2px solid #8a6a3a; border-radius: 12px; font: 600 17px Rubik, Arial, sans-serif; color: #2b1a10; background: #fffdf7; }
.tf-in:focus-visible { outline: 3px solid #b8336a; outline-offset: 1px; }
.tf-go { flex: none; min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; background: #b8336a; color: #fff; font: 700 16px Rubik, Arial, sans-serif; cursor: pointer; }
.tf-go:disabled, .tf-in:disabled { opacity: .6; cursor: default; }
.tf-say { margin: 0; font-weight: 700; color: #8e1f55; }
.tf-say:empty { display: none; }
.tf-show { min-height: 46px; padding: 8px 12px; border-radius: 12px; border: 2px solid #b8336a; background: #fdeef4; color: #8e1f55; font: 700 16px Rubik, Arial, sans-serif; cursor: pointer; }
.tf-show:disabled { border-style: dashed; border-color: #c9a26a; background: #fbf3e2; color: #6a4a1a; cursor: default; }
.tf-show:not(:disabled):hover, .tf-show:not(:disabled):focus-visible { background: #f9d9e7; }
.sa-typed { margin: 4px 0; font-weight: 700; color: #135a2c; }
.tf { grid-template-columns: minmax(0, 1fr); }
.tf-in { width: 100%; }
.tf-show { white-space: normal; }
.sa-opts[hidden] { display: none; }
/* 🔁 another question / another round (owner, 2026-11-19) */
.sa-row2 { display: flex; gap: 8px; }
.sa-row2 .sa-ok { flex: 1; }
.sa-ok.sa-back { background: transparent; color: #7a3f12; border: 2px solid #c9a46a; }
