/* ════════════════════════════════════════
   BENCHMARK — PANELS
   Leaderboard panel, challenge cards,
   shop panel/modal, photo gallery,
   bench detail panel.
════════════════════════════════════════ */

/* ── DETAILS ANIMATION HELPERS ────────── */

#adminNewModal,
#editProfileModal,
#mobShopInner,
#adminNewModal button,
#adminNewModal input {
  font-family: var(--font-primary);
}

details.edit-picker-details > summary {
  transition: border-radius 0.2s ease;
}

details.edit-picker-details[open] > summary {
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

details.edit-picker-details > summary .picker-arrow {
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

details.edit-picker-details[open] > summary .picker-arrow {
  transform: rotate(180deg);
}

details.edit-picker-details > div {
  animation: detailsSlideIn 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── LEADERBOARD PANEL ──────────────────── */

.lb-panel {
  position: fixed;
  top: 54px;
  right: 0;
  bottom: 0;
  width: 320px;
  background: var(--white);
  border-left: var(--border-divider);
  border-top-left-radius: var(--radius-xl);
  border-bottom-left-radius: var(--radius-xl);
  z-index: var(--z-panel);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-panel);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow: hidden;
}

.lb-panel.open {
  transform: translateX(0);
}

@media (max-width: 1024px) {
  .lb-panel {
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-top: none !important;
    transform: translateY(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: var(--z-nav) !important;
  }

  .lb-panel.open {
    transform: translateY(0) !important;
  }

  .lb-pull-tab {
    display: none !important;
  }
}

.lb-pull-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: calc(var(--z-panel) - 1);
  cursor: pointer;
  background: var(--white);
  border: var(--border-divider);
  border-right: none;
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  padding: var(--space-4) var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  box-shadow: -2px 0 12px var(--shadow);
  transition: all 0.2s;
}

.lb-pull-tab:hover {
  background: var(--cream);
  padding-right: var(--space-3);
}

.lb-pull-tab.hidden {
  display: none;
}

.lb-pull-tab-icon {
  font-size: var(--text-md);
}

.lb-pull-tab-label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  color: var(--stone-dark);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.lb-panel-header {
  padding: var(--space-4);
  border-bottom: var(--border-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.lb-panel-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.lb-panel-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--parchment);
  cursor: pointer;
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lb-panel-close:hover {
  background: var(--danger-hover-bg);
  color: white;
}

.lb-panel-tabs {
  display: flex;
  border-bottom: var(--border-divider);
  flex-shrink: 0;
}

.lb-panel-tab {
  flex: 1;
  padding: var(--space-2) 0;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--stone-dark);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.lb-panel-tab.active {
  color: var(--moss);
  border-bottom-color: var(--moss);
}

.lb-panel-content {
  flex: 1;
  overflow-y: auto;
}

.lb-panel-section {
  padding: var(--space-3) var(--space-4);
}

/* ── LEADERBOARD PANEL — DARK MODE ────── */

[data-theme="dark"] #lbPanel {
  background: linear-gradient(160deg, #0a1628 0%, #0f2240 45%, #0a1628 100%) !important;
}

[data-theme="dark"] .lb-panel-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .lb-panel-title,
[data-theme="dark"] .challenge-name {
  color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .lb-panel-close {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .lb-panel-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .lb-panel-tab,
[data-theme="dark"] .lb-sub {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .lb-panel-tab.active {
  color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .lb-panel-content {
  background: transparent;
}

[data-theme="dark"] .lb-panel-section {
  padding: var(--space-4);
}

[data-theme="dark"] .lb-row {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .lb-name {
  color: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] .lb-name:hover,
[data-theme="dark"] .lb-score {
  color: #6bcb77;
}

[data-theme="dark"] .lb-avatar {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
}

/* ── CHALLENGE CARDS ────────────────────── */

.challenge-card {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  border: var(--border-card);
  transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
  animation: challengeCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.challenge-card:nth-child(1) { animation-delay: 0.05s; }
.challenge-card:nth-child(2) { animation-delay: 0.12s; }
.challenge-card:nth-child(3) { animation-delay: 0.19s; }
.challenge-card:nth-child(4) { animation-delay: 0.26s; }
.challenge-card:nth-child(5) { animation-delay: 0.33s; }
.challenge-card:nth-child(6) { animation-delay: 0.40s; }

.challenge-card.completed {
  border-color: var(--moss-b40);
  background: var(--moss-t08);
  box-shadow: 0 4px 20px var(--moss-t15);
}

.challenge-card.claimed-done {
  border-color: rgba(200, 169, 74, 0.4);
  background: rgba(200, 169, 74, 0.08);
  box-shadow: 0 4px 20px rgba(200, 169, 74, 0.15);
}

.challenge-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.challenge-icon {
  font-size: var(--text-2xl);
}

.challenge-name {
  font-weight: var(--weight-extrabold);
  font-size: var(--text-md);
  flex: 1;
  color: var(--bark);
  letter-spacing: 0.2px;
}

.challenge-badge {
  font-size: var(--text-2xs);
  font-weight: var(--weight-extrabold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.challenge-badge.daily {
  background: rgba(71, 206, 255, 0.15);
  color: #0e78a8;
  border: 1px solid rgba(71, 206, 255, 0.3);
}

.challenge-badge.weekly {
  background: rgba(230, 126, 34, 0.15);
  color: #b5611a;
  border: 1px solid rgba(230, 126, 34, 0.3);
}

.challenge-badge.done {
  background: var(--moss-t15);
  color: var(--moss);
  border: 1px solid var(--moss-b30);
}

.challenge-desc {
  font-size: var(--text-base);
  color: var(--stone-dark);
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.challenge-progress {
  height: 6px;
  background: var(--parchment);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.challenge-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--moss), #47ceff);
  border-radius: var(--radius-pill);
  transition: width 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(107, 203, 119, 0.4);
  position: relative;
  overflow: hidden;
}

.challenge-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  animation: shimmerBar 1.8s ease-in-out infinite;
}

.wip-note {
  margin: var(--space-3) var(--space-4) 0;
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 200, 60, 0.10);
  border: 1px solid rgba(255, 200, 60, 0.30);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--stone-dark);
  text-align: center;
}

.chal-hero {
  padding: var(--space-5) var(--space-4) var(--space-2);
  text-align: center;
}

.chal-hero-icon {
  font-size: var(--text-2xl);
  line-height: 1;
  margin-bottom: var(--space-2);
  display: inline-block;
  animation: fireBob 1.8s ease-in-out infinite;
}

.chal-hero-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--bark);
  margin-bottom: var(--space-1);
}

.chal-hero-sub {
  font-size: var(--text-sm);
  color: var(--stone-dark);
}

.chal-jump-btns {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-4);
}

.chal-jump-btn {
  flex: 1;
  padding: var(--space-2) 0;
  border-radius: var(--radius-pill);
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  cursor: pointer;
  border-width: 1.5px;
  border-style: solid;
  transition: opacity 0.2s, transform 0.15s;
}

.chal-jump-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.chal-jump-btn--daily {
  background: rgba(71, 206, 255, 0.12);
  color: #0e78a8;
  border-color: rgba(71, 206, 255, 0.4);
}

.chal-jump-btn--weekly {
  background: rgba(255, 160, 92, 0.12);
  color: #b5611a;
  border-color: rgba(255, 160, 92, 0.4);
}

.chal-divider {
  height: 1px;
  background: var(--parchment);
  margin: 0 var(--space-4);
}

.chal-section-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.chal-section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.chal-section-line {
  flex: 1;
  height: 1px;
  background: var(--parchment);
}

.chal-countdown {
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  opacity: 0.85;
  background: var(--parchment);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
}

.chal-section-title--daily,
.chal-countdown--daily,
.chal-reward-label--daily {
  color: #0e78a8;
}

.chal-section-title--weekly,
.chal-countdown--weekly,
.chal-reward-label--weekly {
  color: #b5611a;
}

.chal-card-body,
.chal-reward-info {
  flex: 1;
}

.chal-prog-wrap {
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
}

.chal-prog-footer {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-1);
}

.chal-pct,
.chal-prog-text {
  font-size: var(--text-xs);
  color: var(--stone-dark);
}

.chal-prog-text {
  font-weight: var(--weight-bold);
}

.chal-prog-text.done {
  color: var(--moss);
}

.challenge-reward-box {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--parchment);
  border: 1px solid var(--stone);
  cursor: pointer;
  transition: background 0.2s;
}

.challenge-reward-box:hover {
  background: var(--cream);
}

.chal-reward-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.chal-reward-emoji {
  font-size: var(--text-2xl);
  flex-shrink: 0;
}

.chal-reward-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 1px;
}

.chal-reward-name {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--bark);
}

.chal-reward-meta {
  font-size: var(--text-xs);
  color: var(--stone-dark);
  margin-top: 1px;
}

.chal-reward-arrow {
  font-size: var(--text-sm);
  color: var(--stone-dark);
}

.chal-claim-btn {
  width: 100%;
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-weight: var(--weight-extrabold);
  font-size: var(--text-md);
  background: linear-gradient(135deg, #6bcb77, #47ceff);
  color: #0a2010;
  box-shadow: 0 4px 16px rgba(107, 203, 119, 0.5);
  animation: claimPulse 1.6s ease-in-out infinite;
}

.chal-claimed-notice {
  margin-top: var(--space-3);
  text-align: center;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--gold);
  animation: goldShine 2s ease-in-out infinite;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: rgba(200, 169, 74, 0.08);
}

/* ── CHALLENGE CARDS — DARK MODE ─────── */

[data-theme="dark"] .challenge-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .challenge-card.completed {
  border-color: rgba(107, 203, 119, 0.5);
  background: rgba(107, 203, 119, 0.1);
  box-shadow: 0 4px 20px rgba(107, 203, 119, 0.2);
}

[data-theme="dark"] .challenge-card.claimed-done {
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(255, 215, 0, 0.07);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.15);
}

[data-theme="dark"] .challenge-icon {
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.25));
}

[data-theme="dark"] .challenge-badge.daily {
  background: rgba(71, 206, 255, 0.2);
  color: #47ceff;
  border-color: rgba(71, 206, 255, 0.3);
}

[data-theme="dark"] .challenge-badge.weekly {
  background: rgba(255, 160, 92, 0.2);
  color: #ffa05c;
  border-color: rgba(255, 160, 92, 0.3);
}

[data-theme="dark"] .challenge-badge.done {
  background: rgba(107, 203, 119, 0.2);
  color: #6bcb77;
  border-color: rgba(107, 203, 119, 0.3);
}

[data-theme="dark"] .challenge-desc {
  color: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .challenge-progress {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .challenge-bar {
  background: linear-gradient(90deg, #6bcb77, #47ceff);
  box-shadow: 0 0 8px rgba(107, 203, 119, 0.6);
}

[data-theme="dark"] .chal-jump-btn--daily {
  background: rgba(71, 206, 255, 0.12);
  color: #47ceff;
  border-color: rgba(71, 206, 255, 0.4);
}

[data-theme="dark"] .chal-jump-btn--weekly {
  background: rgba(255, 160, 92, 0.12);
  color: #ffa05c;
  border-color: rgba(255, 160, 92, 0.4);
}

[data-theme="dark"] .chal-section-line {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .chal-countdown {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .chal-section-title--daily,
[data-theme="dark"] .chal-countdown--daily,
[data-theme="dark"] .chal-reward-label--daily {
  color: #47ceff;
}

[data-theme="dark"] .chal-section-title--weekly,
[data-theme="dark"] .chal-countdown--weekly,
[data-theme="dark"] .chal-reward-label--weekly {
  color: #ffa05c;
}

[data-theme="dark"] .challenge-reward-box {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .challenge-reward-box:hover {
  background: rgba(255, 255, 255, 0.09);
}

[data-theme="dark"] .chal-claimed-notice {
  color: rgba(255, 215, 0, 0.8);
  background: rgba(255, 215, 0, 0.06);
}

/* ── SHOP PANEL ─────────────────────────── */

.coin-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: linear-gradient(135deg, #ffd700, #ffb700);
  color: var(--warn-pill-text);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-base);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(255, 183, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s;
}

.coin-badge:hover {
  transform: scale(1.05);
}

/* -- Avatar borders -- */

.avatar-border-gold {
  border: 3px solid #ffd700 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4) !important;
}

.avatar-border-silver {
  border: 3px solid #c0c0c0 !important;
  box-shadow: 0 0 8px rgba(192, 192, 192, 0.4) !important;
}

.avatar-border-fire {
  border: 3px solid #ff6b35 !important;
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.5) !important;
}

.avatar-border-ice {
  border: 3px solid #47ceff !important;
  box-shadow: 0 0 10px rgba(71, 206, 255, 0.4) !important;
}

.avatar-border-nature {
  border: 3px solid #6bcb77 !important;
  box-shadow: 0 0 10px rgba(107, 203, 119, 0.45) !important;
}

.avatar-border-rainbow {
  padding: 3px !important;
  border: none !important;
  background: none !important;
  animation: none !important;
  overflow: hidden !important;
  position: relative !important;
}

.avatar-border-rainbow::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(#ff6b6b, #ffa500, #ffd700, #6bcb77, #47ceff, #a855f7, #ff6b6b);
  animation: rainbowSpin 2s linear infinite;
  z-index: 0;
}

.avatar-border-rainbow > span {
  position: relative !important;
  z-index: 1 !important;
  animation: none !important;
}

.avatar-border-rainbow img,
.avatar-border-rainbow > div:not(.profile-dropdown) {
  z-index: 1 !important;
  animation: none !important;
  border-radius: 50% !important;
}

/* -- Shop items row -- */

.shop-items-row {
  display: flex;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.shop-item-card,
.shop-modal-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: var(--shop-card-transition, filter 0.2s);
}

.shop-item-card {
  flex: 1;
  border-radius: 0;
  box-shadow: none;
  border-right: 1px solid rgba(0,0,0,0.08);
}

.shop-item-card:last-child {
  border-right: none;
}

.shop-item-card:hover {
  filter: brightness(1.04);
}

.shop-item-hero {
  padding: var(--space-6) var(--space-4) var(--space-5);
  text-align: center;
  position: relative;
  --shop-item-text: var(--white);
}

.shop-item-rarity,
.shop-item-owned,
.shop-modal-rarity,
.shop-modal-owned {
  position: absolute;
  top: var(--shop-badge-top, 8px);
  font-weight: var(--weight-extrabold);
  padding: var(--shop-badge-pad, 2px 7px);
  border-radius: var(--shop-badge-radius, var(--radius-pill));
}

.shop-item-rarity {
  left: 8px;
  font-size: var(--text-2xs);
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--shop-item-text);
}

.shop-item-owned {
  right: 8px;
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.3);
  color: var(--shop-item-text);
}

.shop-item-icon {
  font-size: var(--text-3xl);
  margin: var(--space-3) 0 var(--space-2);
}

.shop-item-name {
  font-family: var(--font-primary);
  font-size: var(--text-md);
  color: var(--shop-item-text);
  margin-bottom: var(--space-1);
}

.shop-item-desc {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-item-price-pill {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-3);
  font-weight: var(--weight-extrabold);
  color: var(--shop-item-text);
  font-size: var(--text-base);
}

.shop-panel-header {
  padding: var(--space-3) var(--space-4) 0;
}

.shop-panel-title {
  font-family: var(--font-primary);
  font-size: var(--text-md);
  color: var(--bark);
}

.shop-coin-badge {
  cursor: default;
}

.shop-panel-footnote {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--stone-dark);
  text-align: center;
  border-top: var(--border-divider);
}

.shop-preview-wrap {
  text-align: center;
  padding: var(--space-3) 0;
}

.shop-preview-pad-top {
  padding: var(--space-4) 0 var(--space-2);
}

.shop-preview-avatar-shell {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}

.shop-preview-avatar-core {
  width: 100%;
  height: 100%;
  font-size: var(--text-xl);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.shop-preview-initials {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--white);
}

.shop-preview-note {
  font-size: var(--text-sm);
  color: var(--stone-dark);
  margin-top: var(--space-2);
}

.shop-preview-note-top4 {
  margin-top: var(--space-1);
}

.shop-preview-bg {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-3) 0;
  height: 60px;
}

.shop-preview-bg-label {
  color: var(--white);
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.shop-preview-emoji-card {
  padding: var(--space-3);
  display: inline-block;
}

.shop-preview-emoji {
  font-size: var(--text-2xl);
}

.shop-preview-tag {
  gap: var(--space-1);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  background: rgba(71, 206, 255, 0.12);
  border: 1px solid rgba(71, 206, 255, 0.3);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

/* ── SHOP ITEM MODAL ────────────────────── */

.shop-item-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-panel);
  background: var(--overlay-scrim);
  animation: rewardFadeOverlay 0.2s forwards;
}

.shop-item-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 320px;
  width: 90%;
  overflow: hidden;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.25);
  animation: shopPopIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
}

.shop-item-modal-hero {
  padding: var(--space-5);
  text-align: center;
}

.shop-item-modal-hero-fallback {
  background: var(--cream);
}

.shop-item-modal-icon {
  font-size: var(--text-3xl);
}

.shop-item-modal-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.shop-item-modal-head {
  margin-bottom: var(--space-2);
}

.shop-item-modal-title {
  font-weight: var(--weight-extrabold);
  font-size: var(--text-md);
  color: var(--bark);
}

.shop-item-modal-rarity {
  font-size: var(--text-2xs);
  font-weight: var(--weight-extrabold);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.06);
}

.shop-item-modal-desc {
  font-size: var(--text-base);
  color: var(--stone-dark);
  margin-bottom: var(--space-2);
}

.shop-item-modal-price-row {
  margin-top: var(--space-2);
}

.shop-item-modal-price {
  font-weight: var(--weight-extrabold);
  font-size: var(--text-lg);
  color: var(--warn-pill-text);
}

.shop-item-modal-price-old {
  text-decoration: line-through;
  opacity: 0.45;
  font-size: var(--text-base);
  margin-right: var(--space-1);
}

.shop-item-modal-balance {
  font-size: var(--text-sm);
  color: var(--stone-dark);
}

.shop-item-buy-area {
  margin-top: var(--space-3);
}

.shop-item-active-pill {
  background: rgba(31, 125, 62, 0.1);
  border: 1px solid var(--moss);
  border-radius: var(--radius-pill);
  padding: var(--space-2);
  text-align: center;
  color: var(--moss);
  font-weight: var(--weight-bold);
}

.shop-item-need-pill {
  background: var(--cream);
  border-radius: var(--radius-pill);
  padding: var(--space-2);
  text-align: center;
  color: var(--stone-dark);
  font-size: var(--text-base);
}

.shop-btn-full {
  width: 100%;
}

.shop-item-close-btn,
.shop-modal-close-btn {
  background: rgba(0, 0, 0, 0.15);
  border: none;
  color: var(--white);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: var(--text-base);
}

.shop-item-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
}

/* ── SHOP FULL-SCREEN MODAL ─────────────── */

.shop-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--overlay-scrim-strong);
  animation: rewardFadeOverlay 0.25s forwards;
}

.shop-modal-box {
  width: 800px;
  max-width: 96vw;
  max-height: 94vh;
  background: linear-gradient(160deg, #0a1628, #0f2240, #0a1628);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  animation: shopPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.shop-modal-box .mob-shop-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  flex: none;
  height: 240px;
}

.shop-modal-header {
  padding: var(--space-4) var(--space-5);
  background: #16213e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-modal-heading {
  font-family: var(--font-primary);
  font-size: var(--text-md);
  font-weight: var(--weight-extrabold);
  color: var(--white);
  letter-spacing: 2px;
}

.shop-modal-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.shop-modal-coins {
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  color: #ffd700;
}

.shop-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.shop-modal-card:hover {
  filter: brightness(1.12);
}

.shop-modal-card-inner {
  padding: var(--space-8) var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 220px;
  height: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
  padding-top: var(--space-10);
}

.shop-modal-rarity {
  --shop-badge-top: 10px;
  --shop-badge-pad: 2px 8px;
  --shop-badge-radius: 3px;
  left: 10px;
  font-size: var(--text-2xs);
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.3);
}

.shop-modal-owned {
  --shop-badge-top: 10px;
  --shop-badge-pad: 2px 8px;
  --shop-badge-radius: 3px;
  right: 10px;
  font-size: var(--text-xs);
  background: rgba(31, 125, 62, 0.8);
  color: var(--white);
}

.shop-modal-icon {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.4));
}

.shop-modal-name {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  font-weight: var(--weight-extrabold);
  color: var(--white);
  letter-spacing: 1px;
  margin-bottom: var(--space-2);
}

.shop-modal-desc {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
  margin-bottom: var(--space-4);
}

.shop-modal-price-pill {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-5);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-md);
  color: #ffd700;
}

.shop-promo-row {
  padding: var(--space-3) var(--space-5);
  background: #16213e;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.shop-promo-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
  color: var(--white);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  outline: none;
}

.shop-promo-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  border: none;
  background: rgba(71, 206, 255, 0.18);
  color: #47ceff;
  font-weight: var(--weight-extrabold);
  font-size: var(--text-base);
  cursor: pointer;
  font-family: var(--font-primary);
}

.shop-promo-msg {
  font-size: var(--text-sm);
  color: #6bcb77;
  display: none;
  font-weight: var(--weight-bold);
}

/* ── MOBILE PROMO SHEET ─────────────────── */

.mob-promo-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  z-index: calc(var(--z-nav) + 1);
  transition: opacity 0.25s;
}

.mob-promo-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-nav) + 2);
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-6) var(--space-5) var(--space-10);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
  animation: sheetUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mob-promo-active {
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: #d4edda;
  border-radius: var(--radius-md);
  color: #155724;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.mob-promo-grab {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 4px;
  margin: 0 auto var(--space-5);
}

.mob-promo-title {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}

.mob-promo-subtitle {
  font-size: var(--text-base);
  color: #888;
  margin-bottom: var(--space-4);
}

.mob-promo-row {
  display: flex;
  gap: var(--space-2);
}

.mob-promo-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: 2px solid #ddd;
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  text-transform: uppercase;
  outline: none;
  font-weight: var(--weight-semibold);
  letter-spacing: 1px;
}

.mob-promo-btn {
  padding: var(--space-3) var(--space-5);
  background: var(--moss);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
  cursor: pointer;
}

.mob-promo-msg {
  display: none;
  margin-top: var(--space-3);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

/* ── PHOTO GALLERY ──────────────────────── */

.photo-split {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  height: 190px;
}

.photo-hero {
  flex: 1.4;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-3xl);
  cursor: pointer;
  flex-shrink: 0;
}

.photo-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-hero-vote {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.photo-count-box {
  flex: 0.6;
  border-radius: var(--radius);
  background: var(--parchment);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  gap: var(--space-1);
}

.photo-count-box:hover {
  background: var(--bark);
}

.photo-count-box:hover .photo-count-num,
.photo-count-box:hover .photo-count-sub {
  color: white;
}

.photo-count-num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--bark);
  line-height: 1;
}

.photo-count-sub {
  font-size: var(--text-sm);
  color: var(--stone-dark);
  font-weight: var(--weight-semibold);
  text-align: center;
  line-height: 1.4;
}

.photo-vote-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--bark);
  padding: 2px var(--space-1);
  border-radius: 6px;
  transition: all 0.15s;
}

.photo-vote-btn:hover {
  background: var(--parchment);
}

.photo-vote-btn.voted {
  color: var(--moss);
}

.photo-vote-btn.downvoted {
  color: #c0392b;
}

.photo-vote-score {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--bark);
  min-width: 18px;
  text-align: center;
}

.photo-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: var(--z-popup);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  box-sizing: border-box;
}

.photo-popup {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 0.2s ease;
}

.photo-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: var(--border-divider);
  flex-shrink: 0;
}

.photo-popup-title {
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
}

.photo-popup-close {
  background: var(--parchment);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-popup-scroll {
  overflow-y: auto;
  flex: 1;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.photo-popup-scroll::-webkit-scrollbar {
  width: 4px;
}

.photo-popup-scroll::-webkit-scrollbar-thumb {
  background: var(--stone);
  border-radius: 4px;
}

.photo-popup-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border-card);
  flex-shrink: 0;
}

.photo-popup-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.photo-popup-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--cream);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: var(--z-max);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.photo-lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius);
  object-fit: contain;
}

.photo-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: white;
  font-size: var(--text-md);
  cursor: pointer;
}

/* ── PHOTO GALLERY — DARK MODE ──────────── */

[data-theme="dark"] .photo-vote-btn {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .photo-vote-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .photo-vote-btn.voted {
  color: #6bcb77;
}

[data-theme="dark"] .photo-vote-btn.downvoted {
  color: #ff8080;
}

[data-theme="dark"] .photo-vote-score {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .photo-hero-vote {
  background: rgba(0, 0, 0, 0.72);
}

/* ── BENCH DETAIL PANEL ─────────────────── */

.panel-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}

.panel-loc {
  font-size: var(--text-base);
  color: var(--stone-dark);
  margin-bottom: 2px;
}

.panel-owner {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: var(--text-base);
  color: var(--stone-dark);
  margin-bottom: var(--space-1);
}

.panel-coords {
  font-size: var(--text-sm);
  color: var(--stone);
  font-style: italic;
  margin-bottom: var(--space-3);
}

.panel-desc {
  font-size: var(--text-md);
  color: var(--bark-light);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.panel-rating-box {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.avg-num {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: 1;
}

.avg-sub {
  font-size: var(--text-sm);
  color: var(--stone-dark);
  margin-top: 2px;
}

.panel-star {
  font-size: var(--text-2xl);
  cursor: pointer;
  color: var(--stone);
  transition: all 0.15s;
  user-select: none;
}

.panel-star:hover {
  transform: scale(1.2);
}

.panel-star.filled {
  color: var(--gold);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-divider);
}

.panel-report-clear-btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  margin-left: auto;
}

.panel-checkin-cta-btn {
  margin: var(--space-3) 0 var(--space-4);
}

.panel-checkin-signin-msg {
  font-size: var(--text-base);
  color: var(--stone-dark);
  padding: var(--space-2) 0 var(--space-4);
  text-align: center;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-1);
  padding-top: var(--space-1);
}

.panel-title-name {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.panel-owner-row {
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: var(--border-divider);
  margin-bottom: var(--space-2);
}

.panel-owner-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  cursor: pointer;
  overflow: hidden;
}

.panel-owner-avatar-fallback {
  background: var(--moss);
  color: var(--white);
}

.panel-owner-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.panel-owner-meta {
  flex: 1;
  min-width: 0;
}

.panel-owner-name {
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
  cursor: pointer;
}

.panel-owner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.panel-owner-tag {
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: rgba(31, 125, 62, 0.12);
  color: var(--moss);
  border: 1px solid rgba(31, 125, 62, 0.2);
  font-weight: var(--weight-semibold);
}

.panel-tags-row {
  margin-bottom: var(--space-3);
}

.panel-stars-tight {
  gap: 2px;
}

.reported-banner {
  background: var(--reported-bg);
  border: 1px solid var(--reported-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--red);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── KEYFRAMES ───────────────────────────── */

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

@keyframes challengeCardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shimmerBar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes claimPulse {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(107, 203, 119, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 6px 24px rgba(107, 203, 119, 0.7);
    transform: scale(1.03);
  }
}

@keyframes goldShine {
  0%, 100% { box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3); }
  50%       { box-shadow: 0 6px 28px rgba(255, 215, 0, 0.6); }
}

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

@keyframes shopSlideDown {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
}

@keyframes rewardPopIn {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(30px);
  }
  70%  { transform: scale(1.05) translateY(-4px); }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes rewardFadeOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes coinFloat {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
  30% {
    transform: translateY(-20px) scale(1.8) rotate(-10deg);
    opacity: 1;
  }
  60% {
    transform: translateY(-55px) scale(1.5) rotate(6deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(0.8) rotate(-5deg);
    opacity: 0;
  }
}

@keyframes coinPopRight {
  0% {
    transform: translateX(0) scale(0.5) rotate(0deg);
    opacity: 0;
  }
  25% {
    transform: translateX(24px) scale(1.8) rotate(12deg);
    opacity: 1;
  }
  65% {
    transform: translateX(65px) scale(1.3) rotate(-8deg);
    opacity: 1;
  }
  100% {
    transform: translateX(110px) scale(0.7) rotate(5deg);
    opacity: 0;
  }
}

@keyframes shopPopIn {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes popIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
