* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); }
[hidden] { display: none !important; }
.shop-page :focus-visible { outline: 2px solid #82ccfa; outline-offset: 3px; }
.home-header nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.home-header .brand { justify-self: start; text-decoration: none; }
.home-header .brand .name { font-weight: 800; font-size: 21px; letter-spacing: .2px; }
.home-header .account-trigger { justify-self: end; }
.home-header .tabs { display: flex; justify-self: center; padding: 4px; gap: 6px; border-radius: 999px; background: var(--panel); font-size: 13px; }
.home-header .tabs a { display: inline-flex; align-items: center; padding: 8px 14px; color: var(--muted); border-radius: 999px; text-decoration: none; }
.home-header .tabs .active { color: #0b1c12; background: var(--green); font-weight: 800; }
.shop-wrap { margin-inline: auto; padding: clamp(24px, 5vw, 56px) 24px 16px; }
.shop-heading { display: flex; gap: 18px; flex-direction: column; align-items: center; text-align: center; }
.shop-heading h1 { font-size: clamp(2.45rem, 6vw, 3.65rem); margin: 0; letter-spacing: -.055em; }
.shop-heading p { margin: 6px 0 0; color: var(--muted); }
.shop-balance { display: flex; align-items: center; gap: 11px; padding: 10px 15px; border: 1px solid #3c5246; border-radius: 8px; background: #151e1a; }
.shop-balance strong, .shop-muted { display: block; }
.shop-balance strong { color: #e7f8eb; font-variant-numeric: tabular-nums; }
.shop-muted, .shop-rules { color: var(--muted); font-size: .8rem; }
.shop-intro { margin-top: 18px; min-width: 0; text-align: center; }
.shop-intro a:not(.shop-btn) { color: var(--green); }
.shop-rules, #shopStatus { text-align: center; }
.shop-intro p, .shop-card p { margin: 8px 0; }
.shop-status { margin: 10px 0; line-height: 1.45; color: #c0f6d6; }
.shop-status:empty, .shop-intro:empty { display: none; }
.shop-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 310px)); gap: 16px; margin-top: 22px; justify-content: center; }
.shop-card {
  --edge: #8b9299; --light: #e6eaeb; --panel-top: #303639; --panel-bottom: #141819;
  min-width: 0; perspective: 950px; cursor: pointer;
}
.shop-card.rare { --edge: #7299c8; --light: #c2dfff; --panel-top: #243d57; --panel-bottom: #141c29; }
.shop-card-head { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 6px; }
.shop-count { color: var(--light); font-size: .8rem; font-weight: 800; }
#shopPaidRows .shop-muted { display: inline; }
.shop-tier { color: var(--light); font-weight: 850; letter-spacing: .075em; text-transform: uppercase; font-size: .72rem; }
.shop-amount { margin: 0; color: var(--light); font-size: clamp(2.1rem, 8vw, 2.8rem); line-height: 1; font-weight: 900; }
.shop-cost { color: var(--light); font-weight: 750; }
.shop-ribbon { position: absolute; top: 53%; left: -8%; width: 116%; padding: 7px 12px; transform: rotate(-7deg);
  background: #070b0eee; border-block: 1px solid #909ea655; color: #fafafa; font-weight: 850; letter-spacing: .06em;
  text-transform: uppercase; font-size: .74rem; pointer-events: none; }
.shop-tilt { transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transition: transform .18s ease-out; }
.shop-turn { display: grid; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.34,.72,.29,1); }
.shop-card.is-flipped .shop-turn { transform: rotateY(180deg); }
.shop-face {
  position: relative; grid-area: 1 / 1; min-height: 340px; display: flex; flex-direction: column;
  align-items: center; padding: 16px; overflow: hidden; border: 1px solid var(--edge); border-radius: 12px;
  background: radial-gradient(ellipse 90% 65% at 45% 34%, var(--panel-top), var(--panel-bottom) 80%);
  box-shadow: inset 0 0 0 4px #14181965; text-align: center; backface-visibility: hidden;
}
.shop-back { transform: rotateY(180deg); }
.shop-face[inert] { pointer-events: none; }
.shop-face-content { flex: 1; display: grid; justify-items: center; align-content: center; gap: 8px; padding-top: 18px; }
.shop-btn { display: inline-grid; place-items: center; max-width: 100%; width: max-content; min-height: 42px;
  padding: 8px 12px; border: 1px solid #466153; border-radius: 6px; background: #202b25; color: var(--ink);
  text-decoration: none; font: inherit; font-size: .84rem; font-weight: 750; text-align: center; cursor: pointer; }
.shop-btn.primary { background: var(--green); color: #0b2114; border-color: var(--green); }
.shop-btn:disabled { opacity: .5; cursor: default; }
.shop-card .shop-btn { z-index: 1; }
.coin {
  --size: 108px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 0 0 auto; width: var(--size); height: var(--size); border-radius: 50%;
  border: 4px solid #a3aeb6; outline: 1px solid #f0f4f59e; outline-offset: -7px;
  color: #202a31; font: 950 italic 54px/.8 system-ui,sans-serif;
  text-shadow: 0 1px #fff8;
  background: repeating-linear-gradient(166deg,#ffffff13 0 1px,#18273014 1px 3px), linear-gradient(135deg,#f2f4f3,#b1bec5 45%,#667580 80%,#b8c4ca);
  box-shadow: inset 0 0 0 4px #49596370, 0 10px 19px #0005;
}
.coin small { font-size: .26em; letter-spacing: .09em; margin-top: .23em; }
.coin-small { --size: 33px; font-size: 18px; border-width: 2px; outline-offset: -4px; }
.rare .coin { border-color: #90b9e4; box-shadow: inset 0 0 0 4px #3b568f80, 0 0 24px #6eabf176, 0 10px 19px #0005; }
.shop-section { margin: 26px 0 10px; padding: 16px; border: 1px solid #394e43; border-radius: 10px; background: #151d19; }
.shop-section h2 { margin: 0 0 10px; font-size: 1.2rem; }
.shop-section h3 { margin: 16px 0 8px; font-size: .98rem; }
.shop-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 12px; padding: 11px 0; border-bottom: 1px solid #324239; overflow-wrap: anywhere; }
.shop-row:last-child { border-bottom: 0; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.shop-row p { margin: 3px 0; }
.shop-wrap .site-footer { margin-top: auto; }
.shop-wrap > section:last-of-type { margin-bottom: 30px; }
@media (max-width: 640px) {
  .home-header nav { grid-template-columns: 1fr auto; }
  .home-header .tabs { grid-row: 2; grid-column: 1/-1; width: 100%; }
  .home-header .brand .name { font-size: 15px; }
  .shop-wrap { padding-inline: 14px; }
  .shop-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .shop-face { padding: 8px; min-height: 320px; }
  .shop-card-head { min-height: 27px; }
  .shop-tier { font-size: .65rem; }
  .shop-card .shop-cost { font-size: .78rem; }
  .shop-card .coin { --size: 83px; font-size: 43px; }
}
@media (max-width: 360px) { .shop-shelf { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .shop-turn, .shop-tilt { transition: none; } }
