/* The store (Toko) over the game: the side board's parchment in a wooden
   frame, with offer cards and green Buy buttons. */

.btn--store { background: linear-gradient(180deg, #8fe07a 0%, var(--leaf) 55%, var(--leaf-dark) 100%); color: #fff; text-shadow: 0 1px 0 var(--ink); }

.store {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.store::backdrop { background: rgba(13, 10, 28, 0.72); }

.store__board {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  padding: 16px 18px 14px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-deep) 100%);
  box-shadow: 0 0 0 5px var(--wood) inset, 0 0 0 7px var(--gold) inset, 0 18px 50px rgba(0, 0, 0, 0.6);
  font-size: 14px;
}

.store__head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.store__title {
  margin: 0;
  color: #fff3cf;
  font: italic 900 26px/1.1 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-transform: uppercase;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}

.store__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(180deg, #ff8a6a 0%, #d62828 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.store__close svg { width: 18px; height: 18px; }
.store__close:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.store__wallet {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 12px 0 8px;
  padding: 10px 12px;
  border: 2px solid rgba(94, 49, 16, 0.45);
  border-radius: 12px;
  background: #fffaf0;
}

.store__balance { display: flex; flex-direction: column; }
.store__label { color: var(--wood); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.store__balance strong { font-size: 20px; font-weight: 900; }
.store__topup { display: inline-grid; place-items: center; text-decoration: none; }
.store__account { flex-basis: 100%; margin: 0; color: var(--wood-dark); font-size: 12px; font-weight: 700; }

.store__notice {
  flex: none;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff3cf;
  font-weight: 700;
}

.store__notice[hidden] { display: none; }
.store__notice--warn { background: #ffe1a8; }
.store__notice--error { background: #ffd0c4; }
.store__notice--done { background: #d9f5c8; }
.store__reload { margin-left: 6px; }

.store__body { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
.store__section + .store__section { margin-top: 14px; }

.store__heading {
  margin: 0 0 2px;
  color: var(--wood-dark);
  font: 900 16px system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.store__note { margin: 0 0 8px; color: var(--wood); font-size: 12px; font-weight: 600; line-height: 1.4; }

.store__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }

.store__offer {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-areas: "icon name" "extra extra" "price price" "buy buy";
  align-items: center;
  gap: 4px 8px;
  padding: 10px;
  border: 2px solid rgba(94, 49, 16, 0.4);
  border-radius: 12px;
  background: #fff7e3;
}

.store__offer--emblem { border-color: var(--ink); background: linear-gradient(180deg, #fff3cf 0%, #ffe3a3 100%); }

.store__icon {
  grid-area: icon;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6dc 0 18%, #ffcf6a 40%, #e08a1a 100%);
}

.store__icon--tokens { background: radial-gradient(circle at 35% 30%, #e8fbff 0 18%, #7fd3f5 45%, #1f7fb8 100%); }
.store__icon--emblem { border-radius: 8px; transform: rotate(45deg) scale(0.82); background: linear-gradient(135deg, #ff8a6a, #b0201e); }

.store__name { grid-area: name; margin: 0; font: 900 14px/1.2 system-ui, sans-serif; }
.store__extra { grid-area: extra; margin: 0; min-height: 15px; color: #1f6e1c; font-size: 11px; font-weight: 800; }
.store__price { grid-area: price; margin: 2px 0 4px; display: flex; flex-direction: column; }
.store__price strong { font-size: 16px; font-weight: 900; }
.store__price span { color: var(--wood); font-size: 11px; font-weight: 700; }
.store__buy { grid-area: buy; width: 100%; height: 32px; }
.store__buy:disabled { filter: grayscale(1); opacity: 0.55; cursor: not-allowed; }

.store__foot { flex: none; margin: 10px 0 0; color: var(--wood); font-size: 11px; font-weight: 600; line-height: 1.4; }

.store__confirm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(30, 15, 5, 0.55);
}

.store__confirm[hidden] { display: none; }

.store__confirm-card {
  width: min(380px, 100%);
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--parchment);
  box-shadow: 0 0 0 3px var(--gold) inset, 0 10px 30px rgba(0, 0, 0, 0.5);
  font-weight: 700;
  line-height: 1.45;
}

.store__confirm-card p { margin: 0 0 12px; }
.store__confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.store__confirm-actions .mini-btn { height: 34px; padding: 0 14px; }

@media (max-width: 640px) {
  .store { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .store__board { max-height: calc(100vh - 16px); padding: 12px 12px 10px; }
  .store__title { font-size: 21px; -webkit-text-stroke-width: 4px; }
  .store__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store__offer { padding: 8px; }
}
