/* ===================================================================== */
/* SHOP (#shop-modal): the CoreCraftia Market in the fantasy look - blue   */
/* frame with leaf corners, wooden banner title, gold wallet pill, 3D tabs */
/* and rarity-tinted item cards. Presentation only: markup is in           */
/* landing.html and the cards are built by inventory.js.                   */
/* ===================================================================== */

body #shop-modal{
  --sh-frame: #2f93ff;
  --sh-wood: linear-gradient(180deg, #d79a58 0%, #b87438 52%, #8d5226 100%);
  --sh-grain: repeating-linear-gradient(92deg, rgba(60, 28, 6, 0) 0 22px, rgba(60, 28, 6, 0.16) 22px 24px);
  --sh-card: linear-gradient(180deg, #0c2144, #081a38);
  --sh-btn: linear-gradient(180deg, #4aa6ff 0%, #2677e6 52%, #1757bd 100%);
  --sh-leaf-tl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%200%29%20scale%281%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --sh-leaf-tr: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%200%29%20scale%28-1%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --sh-leaf-bl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%2070%29%20scale%281%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --sh-leaf-br: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%2070%29%20scale%28-1%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  background:
    radial-gradient(circle at 20% 0%, rgba(73, 168, 255, 0.18), transparent 28%),
    rgba(2, 10, 18, 0.74) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-family: Georgia, "Times New Roman", serif;
}

/* ---- frame ---- */
body #shop-modal .shop-shell{
  margin-top: 34px !important;
  max-height: calc(100% - 38px) !important;
  overflow: visible !important;
  border: 4px solid var(--sh-frame) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 170, 255, 0.22), transparent 60%),
    linear-gradient(180deg, #123c72 0%, #0b2750 52%, #081b38 100%) !important;
  box-shadow: 0 0 0 2px #082f66, 0 18px 44px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(150, 210, 255, 0.35), inset 0 3px 0 rgba(255, 255, 255, 0.08) !important;
}
body #shop-modal .shop-shell::before{ display: none !important; }
body #shop-modal .shop-shell::after{
  content: "" !important;
  position: absolute !important;
  inset: auto !important;
  left: -12px !important;
  top: -12px !important;
  right: auto !important;
  width: calc(100% + 24px) !important;
  height: calc(100% + 24px) !important;
  max-width: none !important;
  z-index: 30;
  border: 0 !important;
  pointer-events: none !important;
  background:
    var(--sh-leaf-tl) left top / 54px 42px no-repeat,
    var(--sh-leaf-tr) right top / 54px 42px no-repeat,
    var(--sh-leaf-bl) left bottom / 54px 42px no-repeat,
    var(--sh-leaf-br) right bottom / 54px 42px no-repeat !important;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

/* ---- wooden banner title ---- */
body #shop-modal .shop-shell-header{ background: none !important; border-bottom: 2px solid rgba(120, 190, 255, 0.3) !important; box-shadow: none !important; }
body #shop-modal .shop-shell-kicker{
  position: relative;
  display: inline-block;
  padding: 6px 40px 8px;
  border: 3px solid #4a2a10;
  border-radius: 12px;
  background: var(--sh-grain), var(--sh-wood);
  box-shadow: 0 4px 0 #2a1608, 0 6px 10px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 224, 170, 0.5);
  color: #fff;
  font: 900 clamp(18px, 2.4vw, 28px)/1.1 Georgia, "Times New Roman", serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  -webkit-text-stroke: 5px #0a1c3c;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(10, 28, 60, 0.9);
}
body #shop-modal .shop-player-avatar{ filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45)); }

/* ---- wallet pill + red X ---- */
body #shop-modal .shop-player-wallet{
  border: 3px solid rgba(120, 190, 255, 0.55) !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #0c2144, #06142c) !important;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.5), 0 3px 0 #061a38 !important;
}
body #shop-modal .shop-player-wallet-label{ color: #8fd2ff; font-weight: 900; }
body #shop-modal .shop-player-wallet-value{ color: #fff; font-family: Georgia, serif; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7); }
body #shop-modal #shop-close{
  border: 3px solid #fff !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #ff6a5c 0%, #d3201a 52%, #a31410 100%) !important;
  box-shadow: 0 0 0 2px #4a1210, 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
  font: 900 22px/1 Georgia, serif !important;
  text-shadow: 0 2px 0 rgba(90, 8, 4, 0.9);
}
body #shop-modal #shop-close:hover{ filter: brightness(1.12); }

/* ---- sidebar tabs ---- */
body #shop-modal .shop-sidebar-card{ background: none !important; border: 0 !important; box-shadow: none !important; }
body #shop-modal .shop-tab{
  border: 3px solid #0b2c5e !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #1b5fb8 0%, #123f86 52%, #0c2c62 100%) !important;
  box-shadow: 0 3px 0 #061a38, inset 0 2px 0 rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
  font-family: Georgia, serif !important;
  font-weight: 900 !important;
  text-shadow: 0 2px 0 rgba(0, 20, 60, 0.85);
  transition: filter 120ms ease, transform 120ms ease;
}
body #shop-modal .shop-tab:hover:not(:disabled){ filter: brightness(1.15); transform: translateY(-1px); }
body #shop-modal .shop-tab.active{
  background: var(--sh-btn) !important;
  box-shadow: 0 3px 0 #061a38, 0 0 0 2px #8fd2ff, inset 0 3px 0 rgba(255, 255, 255, 0.45) !important;
}
body #shop-modal .shop-tab b{
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(3, 14, 32, 0.7);
  color: #fff;
}
body #shop-modal .shop-tab-locked{ filter: grayscale(0.5) brightness(0.8); }

/* ---- item cards: scenic top, dark info panel, rarity-tinted frame ---- */
body #shop-modal #shop-grid{ scrollbar-color: #2f93ff rgba(0, 0, 0, 0.25); scrollbar-width: thin; }
body #shop-modal #shop-grid .shop-item,
body #shop-modal #shop-grid .shop-item[data-rarity]{
  border-width: 3px !important;
  border-style: solid !important;
  border-color: var(--shop-rarity-color, #4aa8ff) !important;
  border-radius: 16px !important;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(4, 14, 32, 0.15) 46%, #081a38 62%, #06122a 100%),
    radial-gradient(ellipse at 50% 36%, color-mix(in srgb, var(--shop-rarity-color, #8a8f98) 45%, transparent), transparent 62%),
    linear-gradient(180deg, #2f6f3c 0%, #1d4a3a 40%, #0c2144 100%) !important;
  box-shadow: 0 4px 0 #061a38, 0 0 14px var(--shop-rarity-glow, rgba(138, 143, 152, 0.25)), inset 0 0 0 2px rgba(0, 0, 0, 0.35) !important;
  padding-bottom: 12px !important;
  transition: transform 120ms ease, filter 120ms ease;
}
body #shop-modal #shop-grid .shop-item:hover{ transform: translateY(-3px) !important; filter: brightness(1.1); }
body #shop-modal .shop-item .name{ color: #fff; font-family: Georgia, serif; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75); }
body #shop-modal .shop-item .price{ color: #ffe9a0; font-family: Georgia, serif; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75); }
body #shop-modal .shop-item .shop-card-subtitle{ color: #bcdcff; font-weight: 800; }
body #shop-modal .shop-buy{
  border: 3px solid #0b2c5e !important;
  border-radius: 12px !important;
  background: var(--sh-btn) !important;
  box-shadow: 0 3px 0 #061a38, inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
  font-family: Georgia, serif !important;
  font-weight: 900 !important;
  text-shadow: 0 2px 0 rgba(0, 20, 60, 0.85);
  transition: filter 120ms ease, transform 120ms ease;
}
body #shop-modal .shop-buy:hover:not(:disabled){ filter: brightness(1.12); transform: translateY(-1px); }
body #shop-modal .shop-buy:active:not(:disabled){ transform: translateY(2px); }
body #shop-modal .shop-buy:disabled{ filter: grayscale(0.8) brightness(0.7); }
body #shop-modal button:focus-visible{ outline: 3px solid #ffe27a; outline-offset: 2px; }

@media (max-width: 720px){
  body #shop-modal .shop-shell::after{ left: -8px !important; top: -8px !important; width: calc(100% + 16px) !important; height: calc(100% + 16px) !important; }
  body #shop-modal .shop-shell-kicker{ padding: 4px 22px 6px; font-size: 16px; -webkit-text-stroke-width: 4px; }
}
@media (prefers-reduced-motion: reduce){
  body #shop-modal .shop-item, body #shop-modal .shop-tab, body #shop-modal .shop-buy{ transition: none; }
}
