:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #281943;
  background: #fffaf0;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.shell { width: min(100% - 24px, 42rem); margin-inline: auto; }
.shop-header { padding-block-start: .55rem; }
h1, h2, h3, p { margin: 0; }
h1 { margin: .55rem 0 .75rem; font-size: clamp(1.7rem, 5vw, 2.5rem); line-height: 1.08; }
h2 { font-size: clamp(1.3rem, 4vw, 1.85rem); line-height: 1.15; }
h3 { font-size: 1.05rem; }

.shop-back, .shop-primary, .shop-listen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: .5rem .85rem;
  border: 2px solid #6b47a2;
  border-radius: .8rem;
  font: 760 1rem/1.2 system-ui, sans-serif;
  text-decoration: none;
  touch-action: manipulation;
}
.shop-back, .shop-listen { color: #402174; background: #fff; }
.shop-primary { color: #fff; background: #56339b; }
button { cursor: pointer; }
:is(button, a, summary):focus-visible { outline: 3px solid #6b35c3; outline-offset: 3px; }

.shop-panel {
  display: grid;
  gap: .65rem;
  margin-bottom: 1.7rem;
  padding: clamp(.55rem, 2.5vw, 1.15rem);
  border: 1px solid #e3d6f1;
  border-radius: 1.1rem;
  background: #fff;
}
.shop-progress { color: #63449c; font-weight: 780; }
.shop-instruction { max-width: 39ch; font-size: clamp(1.13rem, 3.2vw, 1.4rem); line-height: 1.35; }
.shop-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; }
.shop-prompt .shop-instruction { flex: 1 1 15rem; }
.shop-audio-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.shop-balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.3rem), 1fr)); gap: .5rem; }
.shop-balance {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .26rem;
  padding: .45rem;
  border: 1px solid #e2c47a;
  border-radius: .75rem;
  background: #fff5d5;
  text-align: center;
}
.shop-target { border-style: dashed; border-color: #9c7bc3; background: #f7efff; }
.shop-balance-label { font-size: clamp(.88rem, 2.5vw, 1.02rem); line-height: 1.2; }
.shop-coins {
  --coin-size: clamp(1.14rem, 5vw, 1.62rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 3px;
  inline-size: fit-content;
  max-inline-size: calc(4 * var(--coin-size) + 9px);
}
.shop-coin {
  display: block;
  flex: none;
  width: var(--coin-size, 1.05rem);
  aspect-ratio: 1;
  border: 2px solid #9a5d00;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff4ad, #edac22);
  box-shadow: inset 0 0 0 1px #fff3a7;
}
.shop-coin[data-empty] { border-style: dashed; border-color: #79658c; background: #fffaf9; box-shadow: none; }

.shop-shelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
  margin: 0;
  padding: .45rem .35rem;
  border: 1px solid #ddcfee;
  border-radius: .8rem;
  background: #f8f2ff;
  list-style: none;
}
.shop-product { display: grid; min-width: 0; justify-items: center; align-content: start; gap: .18rem; text-align: center; }
.shop-product-name { font-size: clamp(.9rem, 2.7vw, 1.03rem); font-weight: 780; }
.shop-price { display: flex; align-items: center; justify-content: center; gap: .24rem; min-width: 2.65rem; font-weight: 850; }

.shop-item-icon { position: relative; display: block; width: clamp(2.15rem, 7vw, 2.9rem); aspect-ratio: 1; }
.shop-item-stickers::before {
  content: "★";
  position: absolute;
  inset: 5% 13%;
  display: grid;
  place-items: center;
  border: 2px solid #6949a0;
  border-radius: 18%;
  color: #884a00;
  background: #ddc8fc;
  font-size: clamp(1.1rem, 3.5vw, 1.45rem);
  transform: rotate(-8deg);
}
.shop-item-stickers::after {
  content: "";
  position: absolute;
  inset: auto 12% 4% auto;
  width: 24%;
  aspect-ratio: 1;
  border: 1px solid #6949a0;
  border-radius: 55% 0;
  background: #fff9ff;
  transform: rotate(-8deg);
}
.shop-item-pencils i {
  position: absolute;
  inset: 28% auto auto 7%;
  width: 88%;
  height: 22%;
  border-radius: 12% 0 0 12%;
  background: linear-gradient(90deg, #a44370 14%, #f8c13a 14% 75%, #a77748 75% 90%, #513020 90%);
  clip-path: polygon(0 0, 76% 0, 100% 50%, 76% 100%, 0 100%);
  transform: rotate(-41deg);
}
.shop-item-pencils i + i { inset: 58% auto auto 7%; background: linear-gradient(90deg, #7950ab 14%, #268d83 14% 75%, #a77748 75% 90%, #513020 90%); }
.shop-item-notebook::before {
  content: "";
  position: absolute;
  inset: 4% 12%;
  border: 2px solid #2e635e;
  border-left: 5px solid #50337d;
  border-radius: 12%;
  background: linear-gradient(168deg, #94d8c6, #49a99b);
  box-shadow: inset 0 -4px 0 #fff7dd;
  transform: rotate(7deg);
}

.shop-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.shop-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.28rem, 2vw, .65rem);
  min-width: 0;
  min-height: 6rem;
  padding: .5rem .35rem;
  border: 2px solid #b598d8;
  border-radius: .9rem;
  color: inherit;
  background: #fbf8ff;
  touch-action: manipulation;
}
.shop-choice .shop-product { min-width: 3.25rem; }
.shop-plus { color: #6b479a; font-size: 1.3rem; font-weight: 850; }
.shop-choice[aria-pressed="true"] { border-color: #6238a8; background: #efe3ff; box-shadow: inset 0 0 0 1px #6238a8; }
.shop-feedback { outline-offset: .15rem; color: #5a3787; font-weight: 780; }
.shop-feedback:empty { margin-block: -.65rem 0; }
[data-success="true"] .shop-feedback { color: #176253; }

.shop-outcome { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: .65rem; }
.shop-outcome-groups { display: flex; flex-wrap: wrap; gap: .45rem; width: 100%; }
.shop-payment, .shop-remainder {
  display: grid;
  gap: .35rem;
  align-content: start;
  padding: .45rem .55rem;
  border: 1px solid #e2c47a;
  border-radius: .65rem;
  background: #fffaeb;
}
.shop-payment { flex: 1 1 11rem; }
.shop-remainder { flex: 1 0 8rem; border-color: #9c7bc3; background: #f7efff; }
.shop-payment-items { display: flex; flex-wrap: wrap; gap: .4rem .7rem; }
.shop-payment-item { display: grid; gap: .25rem; }

.shop-transfer-visual { display: flex; justify-content: center; align-items: center; gap: clamp(1rem, 8vw, 3rem); padding: .65rem; border-radius: .85rem; background: #f3edfd; }
.shop-cubes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
.shop-cube { width: clamp(1.48rem, 6vw, 2rem); aspect-ratio: 1; border: 2px solid #623a9a; border-radius: 17%; background: linear-gradient(148deg, #dcc1ff 35%, #ac82e4 35% 77%, #875fbf 77%); box-shadow: 0 2px 0 #623a9a; }
.shop-box { position: relative; display: grid; place-items: end center; width: clamp(3.2rem, 13vw, 5rem); aspect-ratio: 1; }
.shop-box::before { content: ""; position: absolute; inset: 22% 0 auto; height: 46%; border: 2px solid #966121; border-radius: 2px; background: #94632c; transform: perspective(35px) rotateX(38deg); }
.shop-box span { position: relative; width: 96%; height: 44%; border: 2px solid #966121; border-radius: 0 0 .3rem .3rem; background: #e6b66f; }
.shop-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.shop-adult summary { min-height: 44px; align-content: center; cursor: pointer; font-weight: 700; }

@media (max-width: 390px) {
  .shop-choices { grid-template-columns: minmax(0, 1fr); }
  .shop-choice { min-height: 5.2rem; }
}

html[data-visual-fit="narrow"] .shop-choices { grid-template-columns: minmax(0, 1fr); }
