/* Smocza Matematyka — Kram Pani Sowy (screen 'shop', js/screens/shop.js). All selectors start with .screen-shop.
 * Stage 1280 x 800: top bar 0–88; left column 0–320 (the dragon = guide + try-on mannequin);
 * right 320–1280: the stall (browse) or Pani Sowa's counter (payment).
 */

.screen-shop {
  background: #160f1b;
}
.screen-shop .shop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #fff3d6;
}
.screen-shop .shop-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 60% at 14% 62%, rgba(255, 176, 96, 0.2), rgba(255, 176, 96, 0) 70%),
    radial-gradient(ellipse at 60% 30%, #3d2b41 0%, #261b2c 55%, #150e19 100%);
}

/* ---------- top bar ---------- */

.screen-shop .shop-top {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 88px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
  background: linear-gradient(180deg, #120c16, #1d1423);
  border-bottom: 5px solid #c98f2a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  z-index: 7;
}
.screen-shop .shop-back {
  min-height: 72px;
  min-width: 190px;
  background: #fff3d6;
  border-color: #c9a46a;
  color: #3a2614;
  padding: 0 24px 0 18px;
}
.screen-shop .shop-back .btn-label {
  font-size: 26px;
}
.screen-shop .shop-back-ico {
  display: inline-flex;
}
.screen-shop .shop-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 36px;
  font-weight: 800;
  color: #ffe9b0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.screen-shop .shop-title-owl {
  width: 52px;
  height: 60px;
  flex: none;
}
.screen-shop .shop-top-spacer {
  flex: 1;
}
.screen-shop .shop-gold {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 72px;
  padding: 0 22px 0 12px;
  border-radius: 40px;
  border: 0;
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08), 0 0 18px rgba(255, 200, 90, 0.25);
}

/* ---------- left column: the dragon ---------- */

.screen-shop .shop-left {
  position: absolute;
  left: 0;
  top: 88px;
  width: 320px;
  height: 712px;
  z-index: 5;
  background: linear-gradient(180deg, rgba(43, 31, 50, 0.94), rgba(30, 21, 36, 0.97));
  border-right: 3px solid #3e2e48;
}
.screen-shop .shop-spot {
  position: absolute;
  left: -40px;
  top: 250px;
  width: 400px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 196, 120, 0.3), rgba(255, 196, 120, 0));
  pointer-events: none;
}
.screen-shop .shop-rug {
  position: absolute;
  left: 10px;
  top: 532px;
  width: 300px;
  height: 70px;
  pointer-events: none;
}
.screen-shop .shop-guide-box {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 292px;
  height: 566px;
  display: flex;
}
.screen-shop .shop-guide-box .guide {
  flex: 1;
}
.screen-shop .shop-guide .guide-bubble {
  background: #fff8e8;
  border-color: #3a2614;
  color: #2a1d12;
  font-size: 24px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 190, 110, 0.18);
}
.screen-shop .shop-guide .guide-text {
  text-wrap: balance;
  hyphens: manual;
  -webkit-hyphens: manual;
}
.screen-shop .shop-guide.guide-column .guide-bubble::after {
  border-top-color: #3a2614;
}
.screen-shop .shop-guide .guide-repeat {
  background: #f6e3bd;
}
.screen-shop .shop-guide .guide-dragon {
  filter: drop-shadow(0 0 18px rgba(255, 190, 120, 0.22));
}
.screen-shop .shop-buy {
  position: absolute;
  left: 0;
  top: 598px;
  width: 320px;
  height: 114px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen-shop .shop-buy-btn {
  min-width: 264px;
  height: 104px;
  font-size: 38px;
  animation: shop-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.screen-shop .shop-buy-btn .ico {
  width: 46px;
  height: 46px;
}
.screen-shop .shop-short {
  padding: 12px 22px;
  border-radius: 18px;
  background: #fff3d6;
  color: #3a2614;
  border: 3px solid #c9a46a;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  animation: shop-in 0.35s ease both;
}
.screen-shop .shop-help {
  min-width: 264px;
  min-height: 84px;
  font-size: 28px;
}
.screen-shop .shop-help.is-disabled {
  opacity: 0.5;
  filter: grayscale(0.5);
}

@keyframes shop-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- the stall (browse) ---------- */

.screen-shop .shop-stall {
  position: absolute;
  left: 320px;
  top: 88px;
  width: 960px;
  height: 712px;
  z-index: 1;
  transition: opacity 0.3s ease;
}
.screen-shop .shop.is-pay .shop-stall {
  opacity: 0;
  visibility: hidden;
}
.screen-shop .shop-wall {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 40% 45%, rgba(255, 200, 120, 0.22), rgba(255, 200, 120, 0) 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.3)),
    repeating-linear-gradient(90deg, #6f4627 0 116px, #5a361d 116px 120px);
}
.screen-shop .shop-awning {
  position: absolute;
  left: 0;
  top: 0;
  width: 960px;
  height: 80px;
  pointer-events: none;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.35));
}
.screen-shop .shop-awning-svg {
  display: block;
}

.screen-shop .shop-tabs {
  position: absolute;
  left: 24px;
  top: 62px;
  display: flex;
  gap: 24px;
}
.screen-shop .shop-tab {
  position: relative;
  width: 88px;
  height: 72px;
  border-radius: 18px;
  border: 3px solid #c9a46a;
  background: #fff3dc;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}
.screen-shop .shop-tab::before {
  /* the little cord the sign hangs on */
  content: '';
  position: absolute;
  left: 50%;
  top: -12px;
  width: 3px;
  height: 12px;
  margin-left: -1.5px;
  background: #4a2d14;
}
.screen-shop .shop-tab > * {
  pointer-events: none;
}
.screen-shop .shop-tab.is-on {
  background: #ffe08a;
  border-color: #fff6d0;
  transform: translateY(4px);
  box-shadow: 0 0 0 4px var(--gold), 0 6px 14px rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 210, 90, 0.55);
}
.screen-shop .shop-tab:active {
  transform: translateY(3px);
}

.screen-shop .shop-plank {
  position: absolute;
  left: 10px;
  width: 676px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, #b77a3c, #8d5426);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 230, 180, 0.35);
}
.screen-shop .shop-stall.is-empty .shop-plank {
  display: none;
}
.screen-shop .shop-plank-1 {
  top: 352px;
}
.screen-shop .shop-plank-2 {
  top: 576px;
}

.screen-shop .shop-grid {
  position: absolute;
  left: 24px;
  top: 162px;
  width: 648px;
  height: 424px;
  display: grid;
  grid-template-columns: repeat(3, 200px);
  grid-template-rows: repeat(2, 200px);
  gap: 24px;
}
.screen-shop .shop-card {
  position: relative;
  width: 200px;
  height: 200px;
  padding: 6px 8px 8px;
  border-radius: 22px;
  border: 4px solid #e2c58e;
  background: radial-gradient(ellipse at 50% 35%, #fffdf6, #fbefd6 70%);
  box-shadow: 0 5px 0 rgba(60, 30, 10, 0.45), 0 10px 18px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #3a2614;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: shop-card-in 0.3s ease both;
}
.screen-shop .shop-card > * {
  pointer-events: none;
}
.screen-shop .shop-card:active {
  transform: translateY(3px);
}
.screen-shop .shop-grid.is-quiet .shop-card {
  animation: none;
}
.screen-shop .shop-card:nth-child(2) { animation-delay: 0.03s; }
.screen-shop .shop-card:nth-child(3) { animation-delay: 0.06s; }
.screen-shop .shop-card:nth-child(4) { animation-delay: 0.09s; }
.screen-shop .shop-card:nth-child(5) { animation-delay: 0.12s; }
.screen-shop .shop-card:nth-child(6) { animation-delay: 0.15s; }
@keyframes shop-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.screen-shop .shop-card.is-selected {
  border-color: #fff6d0;
  box-shadow: 0 0 0 5px var(--gold), 0 0 30px rgba(255, 210, 90, 0.7), 0 10px 18px rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}
.screen-shop .shop-card.is-worn {
  border-color: var(--gold);
  background: radial-gradient(ellipse at 50% 35%, #fffbe6, #ffeeb8 75%);
}
.screen-shop .shop-card-pic {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.screen-shop .shop-card-name {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
  hyphens: manual;
}
.screen-shop .shop-tag {
  position: absolute;
  right: -10px;
  top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 10px;
  border-radius: 8px 12px 12px 8px;
  background: #fffdf6;
  border: 3px solid #b9874a;
  box-shadow: 0 3px 0 rgba(60, 30, 10, 0.3);
  transform: rotate(7deg);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 25px;
  font-weight: 700;
  color: #3a2614;
  white-space: nowrap;
}
.screen-shop .shop-tag-hole {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2.5px solid #b9874a;
  background: #e8d4b0;
}
.screen-shop .shop-badge {
  position: absolute;
  right: -8px;
  top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 4px 8px;
  border-radius: 14px;
  background: #fff3dc;
  border: 3px solid #c9a46a;
  font-size: 22px;
  font-weight: 800;
  color: #6b4a10;
  transform: rotate(6deg);
  box-shadow: 0 3px 0 rgba(60, 30, 10, 0.3);
}
.screen-shop .shop-badge.is-worn {
  background: linear-gradient(180deg, #ffe066, #f2b705);
  border-color: #fff3c4;
  color: #3a2614;
}
.screen-shop .shop-badge .ico {
  width: 24px;
  height: 24px;
}
.screen-shop .shop-pic-fallback svg {
  width: 100%;
  height: 100%;
}
.screen-shop .shop-empty {
  grid-column: 1 / span 3;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 26px;
  border: 4px dashed rgba(255, 233, 176, 0.45);
  background: rgba(0, 0, 0, 0.18);
}
.screen-shop .shop-empty-text {
  font-size: 30px;
  font-weight: 800;
  color: #ffe9b0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.screen-shop .shop-pager {
  position: absolute;
  left: 24px;
  top: 610px;
  width: 648px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.screen-shop .shop-arrow {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid #c9a46a;
  background: #fff3d6;
  color: #3a2614;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.4);
  padding: 0;
}
.screen-shop .shop-arrow:active {
  transform: translateY(3px);
}
.screen-shop .shop-arrow.is-hidden {
  visibility: hidden;
}
.screen-shop .shop-sec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.screen-shop .shop-sec-name {
  font-size: 32px;
  font-weight: 800;
  color: #ffe9b0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}
.screen-shop .shop-dots {
  display: flex;
  gap: 12px;
}
.screen-shop .shop-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 233, 176, 0.7);
}
.screen-shop .shop-dot.is-on {
  background: var(--gold);
  border-color: var(--gold);
}

/* ---------- Pani Sowa ---------- */

.screen-shop .shop-owl-slot {
  position: absolute;
  z-index: 3;
  left: 1032px;
  top: 440px;
  width: 220px;
  height: 252px;
  overflow: hidden;
  transition: left 0.45s ease, top 0.45s ease, width 0.45s ease, height 0.45s ease;
}
.screen-shop .shop.is-pay .shop-owl-slot {
  /* behind the counter, >= 24 px from the gold pill above and from her bubble */
  left: 1108px;
  top: 104px;
  width: 152px;
  height: 122px;
}
.screen-shop .shop-owl {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 220 / 252;
  padding: 0;
  border: 0;
  background: transparent;
}
.screen-shop .shop-owl-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.screen-shop .shop-owl .owl-lid {
  transform-box: fill-box;
  transform-origin: 50% 0;
  transform: scaleY(0);
  animation: shop-owl-blink 6s ease-in-out infinite;
}
.screen-shop .shop-owl .owl-lid + .owl-lid {
  animation-delay: 0.02s;
}
@keyframes shop-owl-blink {
  0%, 92%, 100% { transform: scaleY(0); }
  95% { transform: scaleY(1); }
}
.screen-shop .shop-owl .owl-happy {
  opacity: 0;
}
.screen-shop .shop-owl.is-happy .owl-happy {
  opacity: 1;
}
.screen-shop .shop-owl.is-happy .owl-eyes,
.screen-shop .shop-owl.is-happy .owl-lids {
  opacity: 0;
}
.screen-shop .shop-owl .owl-beak-low {
  transform-box: fill-box;
  transform-origin: 50% 0;
}
.screen-shop .shop-owl.is-talking .owl-beak-low {
  animation: shop-owl-talk 0.32s ease-in-out infinite alternate;
}
@keyframes shop-owl-talk {
  from { transform: translateY(0); }
  to { transform: translateY(6px); }
}
.screen-shop .shop-owl .owl-wing-r {
  transform-box: fill-box;
  transform-origin: 30% 6%;
}
.screen-shop .shop-owl.is-waving .owl-wing-r {
  animation: shop-owl-wave 0.55s ease-in-out 3 alternate;
}
@keyframes shop-owl-wave {
  from { transform: rotate(0); }
  to { transform: rotate(-38deg); }
}
.screen-shop .shop-owl .owl-head {
  transform-box: fill-box;
  transform-origin: 50% 90%;
  animation: shop-owl-bob 5s ease-in-out infinite;
}
@keyframes shop-owl-bob {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(-3deg); }
}

.screen-shop .shop-owl-bubble {
  position: absolute;
  z-index: 6;
  left: 1016px;
  top: 300px;
  width: 256px;
  min-height: 84px;
  padding: 12px 16px;
  border-radius: 22px;
  border: 3px solid #3a2614;
  background: #fff8e8;
  color: #2a1d12;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 190, 110, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.45s ease, top 0.45s ease, width 0.45s ease;
}
.screen-shop .shop-owl-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -18px;
  margin-left: -14px;
  border: 14px solid transparent;
  border-top-color: #3a2614;
  border-bottom: 0;
}
.screen-shop .shop-owl-bubble.is-empty {
  visibility: hidden;
}
.screen-shop .shop.is-pay .shop-owl-bubble {
  /* clear of the price tag on the left and of Pani Sowa on the right */
  left: 692px;
  top: 104px;
  width: 388px;
  min-height: 90px;
}
.screen-shop .shop.is-pay .shop-owl-bubble::after {
  left: auto;
  right: -18px;
  bottom: auto;
  top: 50%;
  margin: -14px 0 0;
  border: 14px solid transparent;
  border-left-color: #3a2614;
  border-right: 0;
}
.screen-shop .shop-counter-art {
  position: absolute;
  z-index: 4;
  left: 1004px;
  top: 584px;
  width: 272px;
  height: 220px;
  pointer-events: none;
  filter: drop-shadow(0 -2px 10px rgba(0, 0, 0, 0.35));
}
.screen-shop .shop.is-pay .shop-counter-art {
  display: none;
}

/* ---------- payment: Pani Sowa's counter ---------- */

.screen-shop .shop-pay {
  position: absolute;
  left: 320px;
  top: 88px;
  width: 960px;
  height: 712px;
  z-index: 2;
  display: none;
  background:
    radial-gradient(ellipse 60% 50% at 60% 55%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%),
    repeating-linear-gradient(90deg, #f3e2c0 0 118px, #e9d3a9 118px 120px);
}
.screen-shop .shop.is-pay .shop-pay {
  display: block;
  animation: shop-fade 0.3s ease both;
}
@keyframes shop-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.screen-shop .shop-band {
  position: absolute;
  left: 0;
  top: 0;
  width: 960px;
  height: 138px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  background: linear-gradient(180deg, #6f4627, #5a361d);
}
.screen-shop .shop-band-pic {
  width: 116px;
  height: 116px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fffdf6, #f6e2b8);
  border: 4px solid #e2c58e;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen-shop .shop-band-tag {
  transform: rotate(-4deg);
}
.screen-shop .shop-sill {
  position: absolute;
  left: 0;
  top: 132px;
  width: 960px;
  height: 14px;
  background: linear-gradient(180deg, #c48a48, #8d5426);
  box-shadow: 0 5px 8px rgba(0, 0, 0, 0.3);
}
.screen-shop .shop-purse {
  position: absolute;
  left: 24px;
  top: 152px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.screen-shop .shop-counter {
  position: absolute;
  left: 356px;
  top: 226px;
  transition: left 0.5s ease, top 0.5s ease, transform 0.5s ease;
}
.screen-shop .shop-pay.is-change .shop-purse {
  opacity: 0;
  transform: translateX(-40px);
  pointer-events: none;
}
.screen-shop .shop-pay.is-change .shop-counter {
  left: 24px;
  top: 150px;
  transform: scale(0.8);
  transform-origin: 0 0;
}
.screen-shop .shop-line {
  position: absolute;
  left: 24px;
  top: 406px;
  border-radius: 20px;
  background: rgba(255, 253, 246, 0.82);
  animation: shop-fade 0.4s ease both;
}
.screen-shop .shop-keypad {
  position: absolute;
  left: 620px;
  top: 152px;
  /* the stall's light text colour must not reach the typed digits */
  color: var(--ink);
  animation: shop-slide 0.4s ease both;
}
@keyframes shop-slide {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: none; }
}
/* rung 1 of the change: the place glows amber — what she gave beyond the price, and the line */
.screen-shop .shop-pay.is-mark .shop-counter .money-strip-excess {
  outline: 5px solid var(--err);
  outline-offset: 2px;
  border-radius: 6px;
  animation: shop-err 1s ease-in-out infinite;
}
.screen-shop .shop-pay.is-mark .shop-line {
  box-shadow: 0 0 0 5px var(--err);
}
/* her wrong answer stays readable in amber until the next key (then the field starts afresh) */
.screen-shop .shop-pay.is-mark .shop-keypad .numin-display {
  border-color: var(--err);
  background: var(--err-soft);
}
@keyframes shop-err {
  0%, 100% { outline-color: var(--err); }
  50% { outline-color: rgba(240, 140, 46, 0.35); }
}
.screen-shop .shop-bar {
  /* Cofnij keeps >= 24 px from the Sakiewka's Rozmień above it */
  top: 610px;
  width: 960px;
  height: 100px;
}
.screen-shop .shop-bar .btn-undo {
  background: #fff3d6;
}
.screen-shop .shop-blocker {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
}
.screen-shop .shop-blocker.is-on {
  display: block;
}

/* text size setting: the owl's bubble keeps up with the dragon's */
#stage.text-large .screen-shop .shop-owl-bubble {
  font-size: 26px;
}
#stage.text-xlarge .screen-shop .shop-owl-bubble {
  font-size: 28px;
}
#stage.text-large .screen-shop .shop-card-name,
#stage.text-xlarge .screen-shop .shop-card-name {
  font-size: 23px;
}

/* after a demo the main button glows until she presses it herself */
.screen-shop .shop-bar .btn-main.fx-highlight {
  box-shadow: 0 0 0 5px #fff6d0, 0 0 0 10px var(--gold), 0 6px 0 rgba(42, 34, 56, 0.2);
  animation: shop-press 1.1s ease-in-out infinite;
}
@keyframes shop-press {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
