/*
Tuin Face Pong
File: css/04-market-shop.css

Market, shop grids, head cards, present shop, special heads, paddles, prestige cards, and background inspect hints.
Loaded after style.css and before trophy/mobile override files.
*/

#headGrid,
#shopGrid,
#secretHeadGrid,
#presentHeadGrid,
#specialHeadGrid,
#backgroundGrid,
#mobileBackgroundGrid,
#paddleGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

#prestigeGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.headChoice,
.shopItem,
.secretHeadItem,
.presentHeadItem,
.specialHeadItem,
.backgroundItem,
.mobileBackgroundItem,
.paddleItem,
.prestigeItem {
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.16), rgba(255,255,255,0.04));
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.headChoice:hover,
.shopItem:hover,
.secretHeadItem:hover,
.presentHeadItem:hover,
.specialHeadItem:hover,
.backgroundItem:hover,
.mobileBackgroundItem:hover,
.paddleItem:hover,
.prestigeItem:hover {
  transform: scale(1.05);
  border-color: #ffcc00;
  box-shadow: 0 0 20px rgba(255,204,0,0.45);
}

.headChoice.selected,
.secretHeadItem.selected,
.presentHeadItem.selected,
.specialHeadItem.selected,
.backgroundItem.selected,
.mobileBackgroundItem.selected,
.paddleItem.selected,
.prestigeItem.selected {
  border-color: #00d9ff;
  box-shadow: 0 0 20px rgba(0,217,255,0.55);
}

.headChoice.locked,
.shopItem.locked,
.secretHeadItem.locked,
.presentHeadItem.locked,
.specialHeadItem.locked,
.backgroundItem.locked,
.mobileBackgroundItem.locked,
.paddleItem.locked,
.prestigeItem.locked {
  opacity: 0.58;
  filter: grayscale(0.35);
}

.shopItem.rare,
.headChoice.rare,
.paddleItem.rare {
  border-color: rgba(0,217,255,0.55);
}

.shopItem.legendary,
.headChoice.legendary,
.paddleItem.legendary {
  border-color: rgba(255,204,0,0.85);
  box-shadow: 0 0 16px rgba(255,204,0,0.28);
}

.shopItem.boss-tier,
.headChoice.boss-tier,
.specialHeadItem.boss-tier,
.paddleItem.boss-tier {
  border-color: rgba(255,48,77,0.75);
}

.headChoice img,
.shopItem img,
.secretHeadItem img,
.presentHeadItem img,
.specialHeadItem img,
.backgroundItem img,
.mobileBackgroundItem img,
.paddleItem img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.headChoice span,
.shopItem span,
.secretHeadItem span,
.presentHeadItem span,
.specialHeadItem span,
.backgroundItem span,
.mobileBackgroundItem span,
.paddleItem span,
.prestigeItem span {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
}

.priceTag {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  color: #ffcc00;
  font-size: 13px;
  font-weight: bold;
}

.ownedTag { color: #00d9ff; }

.soundBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,217,255,0.16);
  border: 1px solid rgba(0,217,255,0.55);
  color: #9ff4ff;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  box-shadow: 0 0 10px rgba(0,217,255,0.22);
}

.headChoice .soundBadge,
.shopItem .soundBadge,
.secretHeadItem .soundBadge,
.presentHeadItem .soundBadge,
.specialHeadItem .soundBadge {
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.headChoice.locked .soundBadge,
.shopItem.locked .soundBadge,
.secretHeadItem.locked .soundBadge,
.presentHeadItem.locked .soundBadge,
.specialHeadItem.locked .soundBadge {
  opacity: 0.72;
}

#secretHeadGrid,
#presentHeadGrid,
#specialHeadGrid {
  margin-bottom: 12px;
}

.secretHeadItem,
.presentHeadItem {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(184,0,255,0.14), rgba(0,0,0,0.42)),
    rgba(0,0,0,0.38);
  border-color: rgba(184,0,255,0.36);
}

.secretHeadItem.locked,
.presentHeadItem.locked {
  opacity: 0.86;
  filter: none;
  border-style: dashed;
  border-color: rgba(255,204,0,0.36);
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.10), rgba(0,0,0,0.72)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 6px, transparent 6px 12px),
    rgba(0,0,0,0.64);
}

.secretHeadItem.unlocked,
.presentHeadItem.unlocked {
  border-color: rgba(184,0,255,0.78);
  box-shadow:
    0 0 20px rgba(184,0,255,0.28),
    inset 0 0 18px rgba(184,0,255,0.08);
}

.secretHeadItem img,
.presentHeadItem img {
  display: none;
  filter: drop-shadow(0 0 16px rgba(184,0,255,0.45));
}

.secretQuestionMark,
.presentQuestionMark {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffcc00;
  font-size: 58px;
  font-weight: 900;
  text-shadow:
    0 0 12px rgba(255,204,0,0.85),
    0 0 22px rgba(184,0,255,0.55);
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.18), rgba(184,0,255,0.10), rgba(0,0,0,0.62));
  border: 2px solid rgba(255,204,0,0.38);
  box-shadow:
    inset 0 0 20px rgba(255,255,255,0.05),
    0 0 18px rgba(255,204,0,0.20);
}

.secretHeadItem .priceTag,
.presentHeadItem .priceTag {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
  color: #ffcc00;
}

.secretHeadItem.unlocked .priceTag,
.presentHeadItem.unlocked .priceTag {
  color: #00d9ff;
}

/* Special Heads: expensive trophy market styling */
.specialHeadItem {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  isolation: isolate;
  border-color: rgba(255,204,0,0.62);
  background:
    radial-gradient(circle at 50% 30%, rgba(255,204,0,0.22), transparent 34%),
    radial-gradient(circle at 20% 10%, rgba(184,0,255,0.22), transparent 42%),
    linear-gradient(135deg, rgba(255,204,0,0.13), rgba(255,48,77,0.08), rgba(0,0,0,0.52)),
    rgba(0,0,0,0.58);
  box-shadow:
    0 0 20px rgba(255,204,0,0.22),
    0 0 18px rgba(184,0,255,0.18),
    inset 0 0 20px rgba(255,255,255,0.05);
}

.specialHeadItem::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 18px;
  background: conic-gradient(from 0deg, rgba(255,204,0,0.58), rgba(184,0,255,0.34), rgba(255,48,77,0.36), rgba(0,217,255,0.28), rgba(255,204,0,0.58));
  opacity: 0.46;
  filter: blur(8px);
  animation: specialHeadAuraSpin 5.5s linear infinite;
}

.specialHeadItem::after {
  content: "SPECIAL";
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffcc00, #b800ff);
  color: #160b00;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  box-shadow:
    0 0 12px rgba(255,204,0,0.58),
    0 0 12px rgba(184,0,255,0.34);
}

.specialHeadItem:hover {
  transform: translateY(-3px) scale(1.045);
  border-color: #ffcc00;
  box-shadow:
    0 0 30px rgba(255,204,0,0.44),
    0 0 24px rgba(184,0,255,0.30),
    inset 0 0 22px rgba(255,255,255,0.08);
}

.specialHeadItem.locked {
  opacity: 0.92;
  filter: none;
  border-style: solid;
}

.specialHeadItem.unlocked {
  border-color: rgba(255,204,0,0.92);
  box-shadow:
    0 0 28px rgba(255,204,0,0.38),
    0 0 22px rgba(184,0,255,0.28),
    inset 0 0 22px rgba(255,204,0,0.08);
}

.specialHeadItem.selected {
  border-color: #00d9ff;
  box-shadow:
    0 0 34px rgba(0,217,255,0.58),
    0 0 30px rgba(255,204,0,0.48),
    0 0 22px rgba(184,0,255,0.32),
    inset 0 0 26px rgba(255,255,255,0.10);
}

.specialHeadItem img {
  filter:
    drop-shadow(0 0 18px rgba(255,204,0,0.52))
    drop-shadow(0 0 12px rgba(184,0,255,0.38));
  transform-origin: center;
  animation: specialHeadFloat 2.6s ease-in-out infinite alternate;
}

.specialHeadItem span {
  color: #ffcc00;
  text-shadow:
    0 0 10px rgba(255,204,0,0.62),
    0 0 14px rgba(184,0,255,0.32);
}

.specialHeadItem .priceTag {
  color: #160b00;
  background: linear-gradient(135deg, #ffcc00, #fff2a8);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow:
    0 0 14px rgba(255,204,0,0.46),
    inset 0 0 8px rgba(255,255,255,0.24);
}

.specialHeadItem .priceTag.ownedTag,
.specialHeadItem.unlocked .priceTag {
  color: #001015;
  background: linear-gradient(135deg, #00d9ff, #ffcc00);
}

.specialHeadItem .soundBadge,
.specialHeadItem .fxBadge {
  position: relative;
  z-index: 2;
}

#skinInspectCard.specialInspect {
  background:
    radial-gradient(circle at 22% 18%, rgba(255,204,0,0.22), transparent 38%),
    radial-gradient(circle at 76% 18%, rgba(184,0,255,0.18), transparent 42%),
    linear-gradient(135deg, rgba(255,204,0,0.18), rgba(255,48,77,0.10), rgba(0,217,255,0.08)),
    rgba(0,0,0,0.56);
  border-color: rgba(255,204,0,0.58);
  box-shadow:
    0 22px 56px rgba(0,0,0,0.58),
    0 0 42px rgba(255,204,0,0.32),
    0 0 28px rgba(184,0,255,0.22),
    inset 0 0 26px rgba(255,255,255,0.06);
}

#skinInspectCard.specialInspect #skinInspectImageWrap {
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.30), rgba(184,0,255,0.16), rgba(0,0,0,0.68));
  border-color: rgba(255,204,0,0.34);
}

#skinInspectCard.specialInspect #skinInspectImage {
  filter:
    drop-shadow(0 0 24px rgba(255,204,0,0.62))
    drop-shadow(0 0 18px rgba(184,0,255,0.44));
}

#skinInspectCard.specialInspect #skinInspectName {
  color: #ffcc00;
  text-shadow:
    0 0 16px rgba(255,204,0,0.84),
    0 0 24px rgba(184,0,255,0.42);
}

#skinInspectCard.specialInspect #skinInspectMeta {
  color: #9ff4ff;
}

@keyframes specialHeadAuraSpin {
  to { transform: rotate(360deg); }
}

@keyframes specialHeadFloat {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-4px) scale(1.035); }
}

#presentMarketBox {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 10px 0 14px;
  padding: 14px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,204,0,0.16), rgba(184,0,255,0.12)),
    rgba(0,0,0,0.48);
  border: 2px solid rgba(255,204,0,0.36);
  box-shadow:
    inset 0 0 18px rgba(255,255,255,0.05),
    0 0 20px rgba(255,204,0,0.16);
  text-align: left;
}

#presentPreviewBox {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

#presentBoxIcon {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.26), rgba(184,0,255,0.12), rgba(0,0,0,0.55));
  border: 2px solid rgba(255,204,0,0.45);
  box-shadow: 0 0 18px rgba(255,204,0,0.24);
}

#presentBoxIcon::before {
  content: "";
  width: 34px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffcc00, #ff304d);
  border: 2px solid rgba(255,255,255,0.38);
  box-shadow: 0 0 12px rgba(255,204,0,0.55);
}

#presentBoxIcon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 38px;
  background: #b800ff;
  border-left: 1px solid rgba(255,255,255,0.28);
  border-right: 1px solid rgba(255,255,255,0.28);
}

#presentPreviewBox strong {
  display: block;
  color: #ffcc00;
  font-size: 17px;
  text-shadow: 0 0 10px rgba(255,204,0,0.55);
}

#presentStatusText {
  display: block;
  color: #e7e7e7;
  font-size: 13px;
  line-height: 1.35;
}

#openPresentBtn {
  font-size: 16px;
  padding: 13px 18px;
  background: #b800ff;
  color: #fff;
  box-shadow: 0 0 18px rgba(184,0,255,0.48);
}

#openPresentBtn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.presentHeadItem {
  border-color: rgba(255,204,0,0.42);
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.14), rgba(184,0,255,0.09), rgba(0,0,0,0.54)),
    rgba(0,0,0,0.42);
}

.presentHeadItem.unlocked {
  border-color: rgba(255,204,0,0.86);
  box-shadow:
    0 0 20px rgba(255,204,0,0.28),
    inset 0 0 18px rgba(184,0,255,0.10);
}

.presentQuestionMark {
  color: #fff;
  background:
    radial-gradient(circle at center, rgba(184,0,255,0.22), rgba(255,204,0,0.12), rgba(0,0,0,0.62));
  border-color: rgba(184,0,255,0.52);
  text-shadow:
    0 0 12px rgba(255,255,255,0.82),
    0 0 22px rgba(184,0,255,0.75),
    0 0 30px rgba(255,204,0,0.38);
}

#presentOpenOverlay {
  z-index: 340;
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.20), rgba(184,0,255,0.18) 34%, rgba(0,0,0,0.88) 100%);
}

#presentOpenPanel {
  width: min(620px, 94vw);
  max-height: 92vh;
  overflow: auto;
  text-align: center;
  padding: 28px;
  border-radius: 26px;
  border: 3px solid #ffcc00;
  background:
    radial-gradient(circle at top, rgba(255,204,0,0.18), rgba(0,0,0,0.68)),
    rgba(5,5,5,0.92);
  box-shadow:
    0 0 50px rgba(255,204,0,0.55),
    0 0 36px rgba(184,0,255,0.38),
    inset 0 0 28px rgba(255,255,255,0.06);
}

#presentBoxAnimation {
  position: relative;
  width: 170px;
  height: 150px;
  margin: 0 auto 12px;
  animation: presentShake 0.85s ease-in-out infinite;
}

#presentBody {
  position: absolute;
  left: 30px;
  bottom: 0;
  width: 110px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  border-radius: 16px;
  background:
    linear-gradient(90deg, transparent 42%, #b800ff 42%, #b800ff 58%, transparent 58%),
    linear-gradient(135deg, #ffcc00, #ff304d 72%, #b800ff);
  border: 3px solid rgba(255,255,255,0.32);
  filter: drop-shadow(0 0 18px rgba(255,204,0,0.55));
  z-index: 2;
}

#presentBody::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 42px;
  height: 12px;
  background: #b800ff;
  border-top: 1px solid rgba(255,255,255,0.28);
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

#presentBody::after {
  content: "?";
  position: absolute;
  color: #fff;
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(255,255,255,0.85),
    0 0 18px rgba(184,0,255,0.75);
}

#presentLid {
  position: absolute;
  left: 20px;
  top: 26px;
  width: 130px;
  height: 30px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, transparent 43%, #b800ff 43%, #b800ff 57%, transparent 57%),
    linear-gradient(90deg, #ffcc00, #ff304d, #ffcc00);
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 0 18px rgba(255,204,0,0.45);
  z-index: 3;
  animation: presentLidPop 1.35s ease-in-out infinite;
}

#presentGlow {
  position: absolute;
  inset: 26px 16px 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,204,0,0.48), rgba(184,0,255,0.22), transparent 70%);
  filter: blur(6px);
  animation: presentGlowPulse 0.9s ease-in-out infinite alternate;
  z-index: 1;
}

#presentOpenTitle {
  margin: 8px 0 6px;
  color: #ffcc00;
  font-size: 38px;
  text-shadow:
    0 0 14px rgba(255,204,0,0.75),
    0 0 24px rgba(184,0,255,0.45);
}

#presentOpenText {
  color: #e8e8e8;
  font-size: 17px;
  margin: 0 0 14px;
}

#presentRewardImage {
  width: min(180px, 54vw);
  height: min(180px, 54vw);
  object-fit: contain;
  display: none;
  margin: 0 auto 16px;
  filter:
    drop-shadow(0 0 22px rgba(255,204,0,0.58))
    drop-shadow(0 0 16px rgba(184,0,255,0.38));
  animation: presentRewardRise 0.55s ease-out both;
}

#presentOpenButtons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

#presentOpenAgainBtn {
  background: #b800ff;
  color: #fff;
  box-shadow: 0 0 18px rgba(184,0,255,0.50);
}

@keyframes presentShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-4deg) scale(1.02); }
  40% { transform: rotate(4deg) scale(1.04); }
  60% { transform: rotate(-3deg) scale(1.02); }
  80% { transform: rotate(3deg) scale(1.03); }
}

@keyframes presentLidPop {
  0%, 42%, 100% { transform: translateY(0) rotate(0deg); }
  58% { transform: translateY(-18px) rotate(-8deg); }
  74% { transform: translateY(-9px) rotate(5deg); }
}

@keyframes presentGlowPulse {
  from { opacity: 0.45; transform: scale(0.92); }
  to { opacity: 0.90; transform: scale(1.08); }
}

@keyframes presentRewardRise {
  from { opacity: 0; transform: translateY(22px) scale(0.72); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#marketTabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(86px, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
  padding: 10px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(0,217,255,0.08), rgba(255,204,0,0.06)),
    rgba(0,0,0,0.44);
  border: 2px solid rgba(255,204,0,0.24);
  box-shadow:
    inset 0 0 18px rgba(255,255,255,0.04),
    0 0 18px rgba(0,0,0,0.25);
}

.marketTab {
  position: relative;
  min-height: 42px;
  padding: 10px 6px;
  border-radius: 13px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.10), transparent 52%),
    rgba(0,0,0,0.58);
  color: #e8e8e8;
  border: 2px solid rgba(255,255,255,0.14);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: inset 0 0 14px rgba(255,255,255,0.035);
}

.marketTab::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
  transform: translateX(-130%);
  opacity: 0;
  pointer-events: none;
}

.marketTab:hover {
  color: #fff;
  border-color: rgba(0,217,255,0.50);
  box-shadow:
    0 0 16px rgba(0,217,255,0.22),
    inset 0 0 14px rgba(255,255,255,0.04);
}

.marketTab:hover::after {
  animation: marketTabShine 0.9s ease-out both;
}

.marketTab[data-market-tab="backgrounds"] {
  font-size: 10px;
  letter-spacing: 0;
}

.marketTab.active {
  color: #160b00;
  background: linear-gradient(135deg, #ffcc00, #00d9ff);
  border-color: rgba(255,204,0,0.88);
  box-shadow:
    0 0 22px rgba(255,204,0,0.42),
    0 0 18px rgba(0,217,255,0.28),
    inset 0 0 12px rgba(255,255,255,0.20);
}

.marketPage {
  display: none;
  animation: marketPageIn 0.16s ease-out both;
}

.marketPage.active {
  display: block;
}

.marketPageHeader {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 18px;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(0,217,255,0.09), rgba(255,204,0,0.06)),
    rgba(0,0,0,0.38);
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 0 16px rgba(255,255,255,0.035);
}

.marketPageHeader .shopSubTitle {
  margin-top: 0;
}

.marketPageHeader p {
  margin: 0 !important;
  color: #d8d8d8 !important;
  font-size: 13px;
  line-height: 1.3;
}

.marketPager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 7px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,204,0,0.28);
}

.marketPager button {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #00d9ff;
  color: #001015;
  box-shadow: 0 0 12px rgba(0,217,255,0.28);
}

.marketPager button:disabled {
  opacity: 0.38;
  filter: grayscale(0.55);
  cursor: not-allowed;
}

.marketPageText {
  min-width: 54px;
  color: #ffcc00;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 8px rgba(255,204,0,0.45);
}

@keyframes marketTabShine {
  0% { transform: translateX(-130%); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateX(130%); opacity: 0; }
}

@keyframes marketPageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.shopSubTitle {
  margin: 28px 0 8px;
  color: #00d9ff;
  font-size: 28px;
  text-shadow: 0 0 12px rgba(0,217,255,0.55);
}

.backgroundItem img {
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
}

#paddleGrid {
  margin-top: 12px;
}

.paddleItem {
  min-height: 150px;
}

.paddleItem img {
  width: 150px;
  height: 48px;
  max-width: 100%;
  object-fit: contain;
  margin-top: 18px;
  margin-bottom: 18px;
  padding: 6px 10px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255,204,0,0.10), rgba(0,217,255,0.08)),
    rgba(0,0,0,0.48);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    inset 0 0 12px rgba(255,255,255,0.05),
    0 0 12px rgba(0,0,0,0.35);
}

.paddleItem.selected img {
  border-color: rgba(0,217,255,0.70);
  box-shadow:
    0 0 18px rgba(0,217,255,0.38),
    inset 0 0 12px rgba(255,255,255,0.06);
}

.defaultPaddleItem {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: rgba(0,217,255,0.42);
  background:
    radial-gradient(circle at 50% 30%, rgba(0,217,255,0.22), transparent 36%),
    radial-gradient(circle at 20% 10%, rgba(255,204,0,0.16), transparent 42%),
    linear-gradient(135deg, rgba(0,217,255,0.13), rgba(255,204,0,0.08), rgba(0,0,0,0.55)),
    rgba(0,0,0,0.50);
}

.defaultPaddleItem::before {
  content: "DEFAULT";
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00d9ff, #ffcc00);
  color: #001015;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  box-shadow:
    0 0 12px rgba(0,217,255,0.48),
    0 0 10px rgba(255,204,0,0.34);
}

.defaultPaddleItem::after {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: conic-gradient(from 0deg, transparent, rgba(0,217,255,0.34), transparent, rgba(255,204,0,0.26), transparent);
  opacity: 0.42;
  animation: defaultPaddleAuraSpin 5.8s linear infinite;
}

.defaultPaddleItem:hover {
  border-color: #00d9ff;
  box-shadow:
    0 0 24px rgba(0,217,255,0.42),
    0 0 18px rgba(255,204,0,0.26),
    inset 0 0 18px rgba(255,255,255,0.06);
}

.defaultPaddleItem.selected {
  border-color: #00d9ff;
  box-shadow:
    0 0 28px rgba(0,217,255,0.62),
    0 0 22px rgba(255,204,0,0.38),
    inset 0 0 22px rgba(0,217,255,0.10);
}

.defaultPaddlePreview {
  position: relative;
  width: 150px;
  height: 48px;
  max-width: 100%;
  margin: 18px auto;
  padding: 6px 10px;
  border-radius: 14px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.16), transparent 54%),
    linear-gradient(90deg, rgba(255,204,0,0.08), rgba(0,217,255,0.13)),
    rgba(0,0,0,0.48);
  border: 1px solid rgba(0,217,255,0.36);
  box-shadow:
    inset 0 0 14px rgba(255,255,255,0.06),
    0 0 14px rgba(0,217,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.defaultPaddlePreview::before,
.defaultPaddlePreview::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,204,0,0.46);
  filter: blur(1px);
  opacity: 0.65;
}

.defaultPaddlePreview::before { top: 9px; }
.defaultPaddlePreview::after { bottom: 9px; }

.defaultPaddleBeam {
  position: relative;
  width: 110px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffcc00, #00d9ff, #ffffff, #00d9ff, #ffcc00);
  box-shadow:
    0 0 18px rgba(0,217,255,0.78),
    0 0 22px rgba(255,204,0,0.42),
    inset 0 0 8px rgba(255,255,255,0.45);
  animation: defaultPaddlePulse 1.25s ease-in-out infinite alternate;
}

.defaultPaddleBeam::before {
  content: "";
  position: absolute;
  inset: -11px -18px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(0,217,255,0.32), transparent 68%);
  filter: blur(5px);
  z-index: -1;
}

.defaultPaddleBeam::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 26px;
  border-radius: 999px;
  background: rgba(255,255,255,0.62);
  filter: blur(3px);
  animation: defaultPaddleShine 1.8s ease-in-out infinite;
}

@keyframes defaultPaddlePulse {
  from { transform: scaleX(0.94); filter: brightness(1); }
  to { transform: scaleX(1.04); filter: brightness(1.22); }
}

@keyframes defaultPaddleShine {
  0% { left: -32px; opacity: 0; }
  25% { opacity: 0.9; }
  100% { left: 116px; opacity: 0; }
}

@keyframes defaultPaddleAuraSpin {
  to { transform: rotate(360deg); }
}

.shopEmptyNote {
  grid-column: 1 / -1;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0,0,0,0.45);
  border: 2px dashed rgba(255,204,0,0.38);
  color: #ddd;
  font-size: 14px;
}

.prestigeItem {
  min-height: 150px;
  display: grid;
  grid-template-columns: 74px 1fr;
  grid-template-rows: auto auto auto;
  gap: 4px 12px;
  text-align: left;
  align-items: center;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(255,204,0,0.12), rgba(0,217,255,0.06)),
    rgba(0,0,0,0.38);
}

.prestigeItem:hover {
  transform: translateY(-2px) scale(1.015);
}

.prestigeItem.selected {
  border-color: #ffcc00;
  box-shadow:
    0 0 22px rgba(255,204,0,0.45),
    inset 0 0 18px rgba(255,204,0,0.10);
}

.prestigeItem.locked {
  opacity: 0.72;
  filter: grayscale(0.28);
}

.prestigeIcon {
  grid-row: 1 / 4;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: bold;
  color: #111;
  background: radial-gradient(circle, #ffcc00, #7a4a00);
  box-shadow: 0 0 20px rgba(255,204,0,0.45);
  overflow: hidden;
}

.prestigeIcon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.prestigeIcon.has-image {
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.20), rgba(0,0,0,0.60));
  border: 2px solid rgba(255,204,0,0.55);
}

.prestigeItem.selected .prestigeIcon {
  box-shadow:
    0 0 22px rgba(255,204,0,0.70),
    0 0 34px rgba(0,217,255,0.30);
}

.prestigeItem span {
  margin-top: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.15;
}

.prestigeItem em {
  display: block;
  margin-top: 0;
  color: #cfcfcf;
  font-size: 12px;
  line-height: 1.25;
  font-style: normal;
}

.prestigeItem small {
  display: inline-block;
  width: fit-content;
  margin-top: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.54);
  color: #00d9ff;
  font-size: 12px;
  font-weight: bold;
}

.prestigeItem.locked small {
  color: #ffcc00;
}

.prestigeItem.selected small {
  color: #ffcc00;
}

#prestigeNote {
  margin-top: 16px;
  color: #aaa;
  font-size: 13px;
}

#prestigeBackBtn {
  margin-top: 20px;
  font-size: 20px;
  padding: 13px 26px;
}

/* Background right-click preview inspect styling */
.backgroundItem {
  position: relative;
  overflow: hidden;
}

.inspectHintBadge {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.74);
  border: 1px solid rgba(0,217,255,0.48);
  color: #9ff4ff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0,217,255,0.20);
}

.backgroundItem:hover .inspectHintBadge {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 700px) {
  #marketTabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 10px;
    margin: 12px 0 16px;
  }

  .marketTab {
    min-width: 0;
    min-height: 40px;
    white-space: normal;
    font-size: 11px;
  }

  .marketPageHeader {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    justify-content: stretch;
    gap: 10px;
    padding: 14px;
    margin: 0 0 14px;
    text-align: left;
  }

  .marketPageHeader > div,
  .marketPageHeader .shopSubTitle,
  .marketPageHeader p {
    min-width: 0;
    max-width: 100%;
  }

  .marketPageHeader .shopSubTitle {
    margin: 0 0 6px;
    font-size: 28px;
    line-height: 1.08;
  }

  .marketPageHeader p {
    font-size: 14px;
    line-height: 1.32;
  }

  .marketPager {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
    gap: 8px;
    padding: 7px;
    border-radius: 18px;
  }

  .marketPager button {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 36px;
    padding: 8px 6px;
    font-size: 11px;
  }

  .marketPageText {
    min-width: 0;
    width: 56px;
    align-self: center;
    font-size: 13px;
  }

  /* Mobile Market grids stay 3x3. Paging decides which 9 cards are visible. */
  #shopOverlay #headGrid,
  #shopOverlay #shopGrid,
  #shopOverlay #secretHeadGrid,
  #shopOverlay #presentHeadGrid,
  #shopOverlay #specialHeadGrid,
  #shopOverlay #backgroundGrid,
  #shopOverlay #mobileBackgroundGrid,
  #shopOverlay #paddleGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  #shopOverlay .headChoice,
  #shopOverlay .shopItem,
  #shopOverlay .secretHeadItem,
  #shopOverlay .presentHeadItem,
  #shopOverlay .specialHeadItem,
  #shopOverlay .backgroundItem,
  #shopOverlay .mobileBackgroundItem,
  #shopOverlay .paddleItem {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    min-width: 0;
    max-width: 100%;
    padding: 10px 7px;
    box-sizing: border-box;
  }

  /* Mobile Secret/Present cards: compact 3x3 layout without ugly tall wrapping. */
  #shopOverlay .secretHeadItem,
  #shopOverlay .presentHeadItem {
    min-height: 154px;
    padding: 8px 5px;
    border-radius: 14px;
  }

  #shopOverlay .secretQuestionMark,
  #shopOverlay .presentQuestionMark {
    width: 70px;
    height: 70px;
    min-height: 70px;
    border-radius: 14px;
    font-size: 42px;
    margin: 0 auto 6px;
  }

  #shopOverlay .headChoice img,
  #shopOverlay .shopItem img,
  #shopOverlay .secretHeadItem img,
  #shopOverlay .presentHeadItem img,
  #shopOverlay .specialHeadItem img,
  #shopOverlay .backgroundItem img,
  #shopOverlay .mobileBackgroundItem img {
    width: auto;
    height: auto;
    max-width: 82px;
    max-height: 92px;
    margin: 0 auto 8px;
    object-fit: contain;
  }

  #shopOverlay .headChoice span,
  #shopOverlay .shopItem span,
  #shopOverlay .secretHeadItem span,
  #shopOverlay .presentHeadItem span,
  #shopOverlay .specialHeadItem span,
  #shopOverlay .backgroundItem span,
  #shopOverlay .mobileBackgroundItem span,
  #shopOverlay .paddleItem span {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 12px;
  }

  #shopOverlay .priceTag,
  #shopOverlay .ownedTag,
  #shopOverlay .soundBadge {
    align-self: center;
    margin-left: auto;
    margin-right: auto;
  }

  #shopOverlay .secretHeadItem .priceTag,
  #shopOverlay .presentHeadItem .priceTag {
    margin-top: 5px;
    padding: 3px 5px;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.12;
    white-space: normal;
    overflow-wrap: normal;
  }

  #shopOverlay .secretHeadItem .soundBadge,
  #shopOverlay .presentHeadItem .soundBadge {
    margin-top: 5px;
    padding: 3px 6px;
    font-size: 9px;
  }

  #shopOverlay #secretHeadGrid,
  #shopOverlay #presentHeadGrid {
    padding-bottom: 20px;
  }

  #presentMarketBox {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    text-align: left;
  }

  #presentPreviewBox {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    width: 100%;
    min-width: 0;
  }

  #presentPreviewBox strong,
  #presentStatusText {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  #openPresentBtn {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
  }

  #prestigeGrid {
    grid-template-columns: minmax(0, 1fr);
  }

  .prestigeItem {
    grid-template-columns: 74px minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 430px) {
  #shopOverlay #headGrid,
  #shopOverlay #shopGrid,
  #shopOverlay #secretHeadGrid,
  #shopOverlay #presentHeadGrid,
  #shopOverlay #specialHeadGrid,
  #shopOverlay #backgroundGrid,
  #shopOverlay #mobileBackgroundGrid,
  #shopOverlay #paddleGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  #shopOverlay .headChoice,
  #shopOverlay .shopItem,
  #shopOverlay .secretHeadItem,
  #shopOverlay .presentHeadItem,
  #shopOverlay .specialHeadItem,
  #shopOverlay .backgroundItem,
  #shopOverlay .mobileBackgroundItem,
  #shopOverlay .paddleItem {
    padding: 9px 5px;
  }

  #shopOverlay .headChoice img,
  #shopOverlay .shopItem img,
  #shopOverlay .secretHeadItem img,
  #shopOverlay .presentHeadItem img,
  #shopOverlay .specialHeadItem img,
  #shopOverlay .backgroundItem img,
  #shopOverlay .mobileBackgroundItem img {
    max-width: 76px;
    max-height: 88px;
  }

  #shopOverlay .secretHeadItem,
  #shopOverlay .presentHeadItem {
    min-height: 144px;
    padding: 7px 4px;
  }

  #shopOverlay .secretQuestionMark,
  #shopOverlay .presentQuestionMark {
    width: 62px;
    height: 62px;
    min-height: 62px;
    font-size: 36px;
    margin-bottom: 5px;
  }

  #shopOverlay .secretHeadItem .priceTag,
  #shopOverlay .presentHeadItem .priceTag {
    font-size: 10px;
    line-height: 1.08;
    padding: 3px 4px;
  }

  #shopOverlay .headChoice span,
  #shopOverlay .shopItem span,
  #shopOverlay .secretHeadItem span,
  #shopOverlay .presentHeadItem span,
  #shopOverlay .specialHeadItem span,
  #shopOverlay .backgroundItem span,
  #shopOverlay .mobileBackgroundItem span,
  #shopOverlay .paddleItem span {
    font-size: 11px;
  }
}
