/* ═══════════════════════════════════════════════════════════════════════════════
   ACHIEVEMENTS — teacher management + assign picker
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Create form ──────────────────────────────────────────────────────────── */
.ach-create-box {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; box-shadow: var(--shadow-card);
}
.ach-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ach-form-grid .form-input { max-width: 100%; }
.ach-form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.ach-form-grid-icon { grid-template-columns: 92px 1fr; }
.ach-form-grid-icon .form-input { text-align: center; }
@media (max-width: 540px) {
  .ach-form-grid, .ach-form-grid-icon, .ach-form-grid-3 { grid-template-columns: 1fr; }
  .ach-form-grid-icon .form-input { text-align: left; }
}
/* Secret toggle in the create form */
.ach-secret-row {
  display: flex; align-items: center; gap: 9px; margin: 4px 0 14px;
  font-size: .85rem; font-weight: 600; color: var(--text-1); cursor: pointer;
}
.ach-secret-row input { width: 16px; height: 16px; accent-color: #8b7cff; cursor: pointer; flex-shrink: 0; }
.ach-secret-hint { font-weight: 400; color: var(--text-3); font-size: .78rem; }

/* ── Existing-achievements list ───────────────────────────────────────────── */
.ach-list { display: flex; flex-direction: column; gap: 8px; }
.ach-mgmt-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow-card);
  transition: border-color .15s;
}
.ach-mgmt-card:hover { border-color: var(--border-hi); }
.ach-mgmt-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; width: 34px; text-align: center; }
.ach-mgmt-info { flex: 1; min-width: 0; }
.ach-mgmt-label { font-size: .9rem; font-weight: 700; color: var(--text-1); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ach-mgmt-desc { font-size: .76rem; color: var(--text-3); margin-top: 3px; line-height: 1.4; }
.ach-kind-chip {
  font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.ach-kind-manual { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.ach-kind-auto   { background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.25); }
.ach-kind-secret { background: rgba(139,124,255,.14); color: #8b7cff; border: 1px solid rgba(139,124,255,.3); text-transform: none; letter-spacing: .02em; }
.ach-mgmt-pts {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.15rem; letter-spacing: .04em;
  color: var(--gold); background: rgba(212,160,23,.1); border: 1px solid rgba(212,160,23,.22);
  border-radius: 6px; padding: 2px 10px; flex-shrink: 0; white-space: nowrap;
}
.ach-mgmt-pts.is-zero { color: var(--text-3); background: var(--surface-2); border-color: var(--border); }
.ach-mgmt-delete {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  background: var(--danger-dim); border: 1px solid rgba(200,16,46,.25);
  color: #ff8080; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, color .15s;
}
.ach-mgmt-delete:hover { background: var(--red); color: #fff; }
.ach-cond-note { font-size: .72rem; color: var(--text-2); font-style: italic; margin-top: 2px; }

/* ── Student row assign button ────────────────────────────────────────────── */
.btn-ach {
  flex-shrink: 0; width: 32px; min-height: 32px; padding: 0;
  background: rgba(212,160,23,.1); color: var(--gold);
  border: 1px solid rgba(212,160,23,.25); border-radius: 6px;
  font-size: .95rem; cursor: pointer; transition: background .15s, transform .1s;
  display: flex; align-items: center; justify-content: center;
}
.btn-ach:hover { background: rgba(212,160,23,.22); }
.btn-ach:active { transform: scale(.92); }
.btn-ach.is-prefect { background: var(--gold); border-color: var(--gold); filter: saturate(1.1); }
.btn-ach.is-seedbed { background: #2a9db5; border-color: #2a9db5; filter: saturate(1.05); }
.btn-ach.is-graduated { background: #7c5cd6; border-color: #7c5cd6; filter: saturate(1.05); }
.btn-ach.is-grouped { background: #3f8f5e; border-color: #3f8f5e; filter: saturate(1.05); }
.btn-ach.btn-ach-danger { background: rgba(200,60,60,.12); color: #d35; border-color: rgba(200,60,60,.3); }
.btn-ach.btn-ach-danger:hover { background: rgba(200,60,60,.24); }
.btn-ach-coin .coin-icon { width: 1.2em; height: 1.2em; }

/* Prefect badge + lead-professor designation control */
.prefect-badge { font-size: .8rem; vertical-align: middle; }
.lead-assign { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.lead-assign .form-input { flex: 1; }

/* ── Assign-achievement modal list ────────────────────────────────────────── */
.assign-ach-list { display: flex; flex-direction: column; gap: 8px; }
.assign-ach-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; cursor: pointer;
  text-align: left; transition: border-color .15s, background .15s, transform .12s;
  color: inherit; font-family: inherit;
}
.assign-ach-item:hover:not(:disabled) { border-color: var(--gold); background: var(--surface-3); transform: translateY(-1px); }
.assign-ach-item:active:not(:disabled) { transform: scale(.99); }
.assign-ach-item:disabled { opacity: .5; cursor: not-allowed; }
.assign-ach-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; width: 32px; text-align: center; }
.assign-ach-info { flex: 1; min-width: 0; }
.assign-ach-label { font-size: .88rem; font-weight: 700; color: var(--text-1); }
.assign-ach-desc { font-size: .75rem; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.assign-ach-pts {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; letter-spacing: .04em; color: var(--gold);
  flex-shrink: 0; white-space: nowrap;
}
.assign-ach-have { font-size: .72rem; color: var(--green); font-weight: 700; flex-shrink: 0; }
.assign-ach-empty { font-size: .85rem; color: var(--text-3); font-style: italic; padding: 8px 0; }

/* Group assignment: highlight groups the student already belongs to. */
.assign-ach-item.is-member { border-color: var(--gold); background: var(--surface-3); }

/* Create-group row (manage + assign modals) */
.group-create-row { display: flex; gap: 8px; margin-bottom: 14px; }
.group-create-row .form-input { flex: 1; margin-bottom: 0; }
.group-create-row .btn { flex-shrink: 0; }

/* Points value each achievement gives, shown in the profile row */
.achievement-pts {
  font-family: 'Bebas Neue', sans-serif; font-size: 1rem; letter-spacing: .04em;
  color: var(--gold); flex-shrink: 0; white-space: nowrap;
}
.achievement-card.locked .achievement-pts { color: var(--text-3); }

/* ── SHOP ─────────────────────────────────────────────────────────────────── */
.coin-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; flex-shrink: 0; }

/* El label "Tienda" ocupa su propia fila y su línea (::after de .section-label)
   llena todo el ancho, como los headers de Perfil / Panel Docente. El saldo baja
   a la fila siguiente (con el subtítulo) para no interferir con esa línea. */
.shop-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.shop-title { flex: 1; min-width: 0; margin-bottom: 0; }
.shop-subrow {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.shop-sub { font-size: .82rem; color: var(--text-3); margin: 0; max-width: 540px; }
.shop-balance {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 9px 16px; border-radius: 14px;
  background: rgba(212,160,23,.12); border: 1px solid rgba(212,160,23,.28);
  font-size: .9rem; color: var(--text-2); white-space: nowrap;
}
.shop-balance strong { font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; letter-spacing: .03em; color: var(--gold); }
.shop-balance .coin-icon { font-size: 1.05rem; align-self: center; }

.shop-loading, .shop-empty {
  padding: 40px 16px; text-align: center; color: var(--text-3);
  font-style: italic; background: var(--surface-1);
  border: 1px dashed var(--border); border-radius: 14px;
}

/* ── SHOP LOADING SKELETON + ENTRANCE ─────────────────────────────────────────
   Shimmer placeholders while fetching, then a staggered pop-in on first paint. */
@keyframes skShimmer { to { background-position: 200% 0; } }
.sk {
  position: relative; overflow: hidden; border-radius: 8px;
  background: var(--surface-2);
  background-image: linear-gradient(100deg,
    transparent 30%,
    color-mix(in srgb, var(--text-1) 9%, transparent) 50%,
    transparent 70%);
  background-size: 200% 100%; background-repeat: no-repeat;
  animation: skShimmer 1.25s ease-in-out infinite;
}
.shop-skeleton { animation: shopFadeIn .3s ease both; }
.sk-featured { height: 152px; border-radius: 16px; margin-bottom: 26px; }
.sk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sk-dot { width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; }
.sk-title { width: 150px; height: 18px; }
.sk-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px 12px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
}
.sk-card-prev { width: 54px; height: 54px; border-radius: 50%; align-self: center; }
.sk-line { height: 12px; width: 78%; align-self: center; }
.sk-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.sk-pill { height: 16px; width: 40px; }
.sk-btn { height: 28px; width: 66px; border-radius: 9px; }

/* Entrance: featured fades, cards pop in with a short cascade (one-shot via .shop-enter) */
@keyframes shopFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shopCardIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.shop-enter .shop-section-featured,
.shop-enter .shop-collections { animation: shopFadeIn .5s ease both; }
.shop-enter .shop-grid > *,
.shop-enter .shop-collections > * { animation: shopCardIn .5s cubic-bezier(.22,1,.36,1) both; }
.shop-enter .shop-grid > *:nth-child(1) { animation-delay: .04s; }
.shop-enter .shop-grid > *:nth-child(2) { animation-delay: .09s; }
.shop-enter .shop-grid > *:nth-child(3) { animation-delay: .14s; }
.shop-enter .shop-grid > *:nth-child(4) { animation-delay: .19s; }
.shop-enter .shop-grid > *:nth-child(5) { animation-delay: .24s; }
.shop-enter .shop-grid > *:nth-child(6) { animation-delay: .29s; }
.shop-enter .shop-grid > *:nth-child(7) { animation-delay: .34s; }
.shop-enter .shop-grid > *:nth-child(8) { animation-delay: .39s; }
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  .shop-enter .shop-section-featured, .shop-enter .shop-collections,
  .shop-enter .shop-grid > *, .shop-enter .shop-collections > * { animation: none; }
}

.shop-section { margin-bottom: 30px; }
.shop-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.shop-section-head h3 {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.25rem; letter-spacing: .04em;
  color: var(--text-1); margin: 0;
}
.shop-section-icon { color: var(--gold); display: inline-flex; align-items: center; }
.shop-section-icon svg { width: 1.2rem; height: 1.2rem; }
.shop-section-featured .shop-card { border-color: rgba(212,160,23,.35); }

/* ── FEATURED CAROUSEL (Destacados spotlight) ─────────────────────────────────
   One item at a time, auto-advancing, with a rarity-tinted animated aura. The
   `--feat-accent` custom prop (set per active slide in JS) tints the whole unit. */
.shop-featured-carousel {
  --feat-accent: var(--gold);
  position: relative; border-radius: 18px; overflow: hidden; isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--feat-accent) 42%, var(--border));
  background:
    radial-gradient(130% 160% at 100% 0%, color-mix(in srgb, var(--feat-accent) 20%, transparent), transparent 58%),
    linear-gradient(135deg, var(--surface-2), var(--surface-1) 70%);
  box-shadow: 0 14px 44px -20px color-mix(in srgb, var(--feat-accent) 60%, transparent),
              inset 0 0 0 1px color-mix(in srgb, var(--feat-accent) 10%, transparent);
  transition: border-color .6s ease, box-shadow .6s ease, background .6s ease;
}
.shop-feat-viewport { position: relative; height: 196px; }

.shop-feat-slide {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; gap: 26px; padding: 20px 30px;
  opacity: 0; visibility: hidden; transform: translateX(34px) scale(.985);
  transition: opacity .5s ease, transform .55s cubic-bezier(.2,.7,.2,1), visibility .55s;
}
.shop-feat-slide.is-active { opacity: 1; visibility: visible; transform: none; z-index: 1; }

/* Left: showcase art with rotating aura behind the (enlarged) preview */
.shop-feat-art {
  position: relative; flex: 0 0 auto; width: 156px; height: 156px;
  display: grid; place-items: center;
}
.shop-feat-aura, .shop-feat-rays {
  position: absolute; left: 50%; top: 50%; width: 150px; height: 150px;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: 0;
}
.shop-feat-aura {
  background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--feat-accent) 75%, transparent), transparent 55%);
  filter: blur(14px); opacity: .9;
}
.shop-feat-rays {
  background: radial-gradient(circle, color-mix(in srgb, var(--feat-accent) 34%, transparent), transparent 62%);
  opacity: .55;
}
.shop-feat-prev {
  position: relative; z-index: 1; transform: scale(1.4); filter: drop-shadow(0 6px 14px rgba(0,0,0,.4));
}
.shop-feat-sale { position: absolute; top: 4px; right: 4px; z-index: 2; }

/* Right: rarity tag, name, price + action */
.shop-feat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.shop-feat-tag {
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 11px; border-radius: 999px; white-space: nowrap;
  color: color-mix(in srgb, var(--feat-accent) 85%, var(--text-1));
  background: color-mix(in srgb, var(--feat-accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--feat-accent) 45%, transparent);
}
.shop-feat-name {
  font-family: 'Bebas Neue', sans-serif; font-size: 2rem; line-height: 1.05; letter-spacing: .02em;
  color: var(--text-1); margin: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shop-feat-owned { font-size: .74rem; font-weight: 700; color: var(--green); }
.shop-feat-foot { display: flex; align-items: center; gap: 14px; margin-top: 4px; flex-wrap: wrap; }
.shop-feat-foot .shop-price { font-size: 1.15rem; }
.shop-feat-foot .shop-btn { padding: 9px 20px; font-size: .82rem; }

/* Staggered entrance for the active slide's content */
.shop-feat-slide.is-active .shop-feat-tag  { animation: shopFeatRise .5s .04s both; }
.shop-feat-slide.is-active .shop-feat-name { animation: shopFeatRise .5s .12s both; }
.shop-feat-slide.is-active .shop-feat-owned,
.shop-feat-slide.is-active .shop-feat-foot { animation: shopFeatRise .5s .2s both; }
.shop-feat-slide.is-active .shop-feat-prev { animation: shopFeatPop .6s .04s both; }
@keyframes shopFeatRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shopFeatPop  { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1.4); } }

/* Nav arrows */
.shop-feat-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface-1) 78%, transparent); color: var(--text-2);
  border: 1px solid var(--border); cursor: pointer; opacity: 0;
  transition: opacity .2s, background .15s, color .15s, border-color .15s, transform .15s;
  backdrop-filter: blur(4px);
}
.shop-featured-carousel:hover .shop-feat-nav { opacity: 1; }
.shop-feat-nav:hover { color: var(--text-1); border-color: color-mix(in srgb, var(--feat-accent) 60%, var(--border)); }
.shop-feat-nav svg { width: 18px; height: 18px; }
.shop-feat-nav.shop-feat-prev { left: 10px; }
.shop-feat-nav.shop-feat-next { right: 10px; }
.shop-feat-nav.shop-feat-prev:hover { transform: translateY(-50%) translateX(-2px); }
.shop-feat-nav.shop-feat-next:hover { transform: translateY(-50%) translateX(2px); }

/* Dots */
.shop-feat-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 7px; }
.shop-feat-dot {
  width: 7px; height: 7px; padding: 0; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--text-3) 60%, transparent); border: none;
  transition: width .25s, background .25s;
}
.shop-feat-dot.is-active { width: 20px; background: var(--feat-accent); }

/* Auto-advance progress bar */
.shop-feat-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 3; background: color-mix(in srgb, var(--feat-accent) 16%, transparent); }
.shop-feat-progress-fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--feat-accent), color-mix(in srgb, var(--feat-accent) 45%, #fff));
}
@keyframes shopFeatProgress { from { width: 0; } to { width: 100%; } }

/* Decorative motion only when the user allows it */
@media (prefers-reduced-motion: no-preference) {
  .shop-feat-slide.is-active .shop-feat-aura { animation: shopFeatSpin 9s linear infinite; }
  .shop-feat-slide.is-active .shop-feat-rays { animation: shopFeatPulse 3.2s ease-in-out infinite; }
}
@keyframes shopFeatSpin  { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes shopFeatPulse { 0%, 100% { opacity: .4; transform: translate(-50%, -50%) scale(.9); } 50% { opacity: .68; transform: translate(-50%, -50%) scale(1.08); } }

@media (max-width: 560px) {
  .shop-feat-viewport { height: 290px; }
  .shop-feat-slide { flex-direction: column; justify-content: center; text-align: center; gap: 12px; padding: 22px 18px 30px; }
  .shop-feat-info { align-items: center; }
  .shop-feat-art { width: 120px; height: 120px; }
  .shop-feat-name { white-space: normal; font-size: 1.7rem; }
  .shop-feat-foot { justify-content: center; }
}

.shop-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* Product card: --rc is the rarity color (set by the rarity-* classes below);
   it tints the top wash and powers the hover glow, so a legendary literally
   radiates gold while a common stays sober. */
.shop-card {
  --rc: var(--border-hi);
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 16px 12px 12px; text-align: center;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rc) 8%, transparent), transparent 52%),
    var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 13px); box-shadow: var(--shadow-card);
  transition: transform .25s var(--ease-out), border-color .2s, box-shadow .3s var(--ease-out);
}
/* Shine sweep across the card on hover (contained by inset:0 + inherited radius) */
.shop-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.07) 50%, transparent 58%);
  background-size: 260% 100%; background-position: 140% 0; background-repeat: no-repeat;
  transition: background-position .7s var(--ease-out);
}
.shop-card:hover::after { background-position: -40% 0; }
.shop-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), 0 12px 30px rgba(0,0,0,.25), 0 0 26px -6px color-mix(in srgb, var(--rc) 45%, transparent);
}
.shop-card.is-owned { border-color: color-mix(in srgb, var(--gold) 30%, var(--border)); }

.shop-card-prev {
  width: 100%; min-height: 64px;
  display: flex; align-items: center; justify-content: center;
}
.shop-card-name {
  font-size: .82rem; font-weight: 600; color: var(--text-1);
  width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shop-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; width: 100%; margin-top: 2px;
}

.shop-badge-sale {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--red); color: #fff; font-size: .66rem; font-weight: 800;
  padding: 2px 7px; border-radius: 20px; letter-spacing: .02em;
}
.shop-card-owned {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: #1a1408; font-size: .62rem; font-weight: 900;
}

.shop-price { display: inline-flex; align-items: center; gap: 3px; font-size: .82rem; font-weight: 700; color: var(--text-1); }
.shop-price .coin-icon { font-size: .82rem; }
.shop-price-old { color: var(--text-3); text-decoration: line-through; font-weight: 500; font-size: .74rem; margin-right: 2px; }
.shop-price-free { color: var(--text-3); font-weight: 600; font-style: italic; }
/* Already purchased: price is irrelevant — muted + struck through */
.shop-price-owned { color: var(--text-3); font-weight: 500; text-decoration: line-through; opacity: .7; }
.shop-price-owned .coin-icon { opacity: .55; }

.shop-btn {
  border: none; border-radius: 10px; padding: 6px 12px;
  font-size: .76rem; font-weight: 700; cursor: pointer;
  transition: background .15s ease, box-shadow .25s var(--ease-out), border-color .15s ease, opacity .15s ease, transform .15s var(--ease-out), filter .15s;
}
.shop-btn:active:not(:disabled) { transform: scale(.96); }
.shop-btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
/* Buy = the app's primary action color (red gradient), matching .btn-primary */
.shop-btn-buy { background: var(--grad-red); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.16); }
.shop-btn-buy:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.16), var(--shadow-red); filter: brightness(1.08); transform: translateY(-1px); }
/* Equip = neutral/secondary (ghost), like .btn-ghost */
.shop-btn-equip { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.shop-btn-equip:hover { border-color: var(--border-hi); color: var(--text-1); background: var(--surface-2); }
/* Equipped = non-interactive confirmation state (same box as the buttons) */
.shop-btn-equipped,
.shop-btn-equipped:disabled {
  background: var(--green-dim); border: 1px solid rgba(34,197,94,.3); color: var(--green);
  opacity: 1; cursor: default; box-shadow: none;
}
.shop-owned-tag { font-size: .74rem; font-weight: 600; color: var(--text-3); }

/* Card previews */
.shop-prev-ava {
  width: 50px; height: 50px; border-radius: 50%; font-size: 1.9rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 2px solid var(--border); overflow: hidden;
}
.shop-prev-ava.sm { width: 32px; height: 32px; font-size: 1.2rem; border-width: 1px; }
.shop-card-prev .profile-avatar { width: 46px; height: 46px; font-size: 1.7rem; }
.shop-card-prev .profile-avatar-wrap[class*="frame-"] { padding: 3px; }
.shop-prev-pcard {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
}
/* Zero-specificity defaults: any .pframe-* (gradient/solid border + background)
   overrides these, so profile frames preview correctly. Plain "Sin marco" keeps them. */
:where(.shop-prev-pcard) { background: var(--surface-1); border: 1px solid var(--border); }
.shop-prev-lines { display: flex; flex-direction: column; gap: 4px; }
.shop-prev-lines span { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); }
.shop-prev-lines span:first-child { width: 44px; }
.shop-prev-lines span:last-child  { width: 28px; }
.shop-prev-title {
  font-size: .78rem; font-weight: 700; color: var(--text-1);
  padding: 5px 12px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.shop-prev-motto { font-size: .78rem; font-style: italic; color: var(--text-2); padding: 0 6px; line-height: 1.3; }
.shop-prev-attr { font-size: 1.2rem; font-weight: 800; color: var(--gold); }
.shop-prev-attr.shop-prev-reset { color: #2a9db5; }
.shop-prev-attr.shop-prev-petxp { color: #d6822b; }

.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--red); font: inherit; font-weight: 700; text-decoration: underline;
}

/* ── SHOP MANAGEMENT (teacher) ────────────────────────────────────────────── */
.shop-manage-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 22px;
}
.shop-manage-count { font-size: .82rem; color: var(--text-3); font-weight: 600; }

.shop-mcard { gap: 8px; }
.shop-mcard.is-hidden { opacity: .62; }
.shop-mbadges {
  position: absolute; top: 7px; left: 7px; right: 7px; z-index: 2;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.shop-mbadge {
  font-size: .62rem; font-weight: 800; letter-spacing: .02em;
  padding: 2px 6px; border-radius: 20px; line-height: 1.3;
}
.mb-hidden { background: var(--surface-3); color: var(--text-2); }
.mb-feat   { background: rgba(212,160,23,.2); color: var(--gold); }
.mb-sale   { background: var(--red); color: #fff; }
.shop-mcard-price { font-size: .8rem; }
.shop-mcard-actions { display: flex; align-items: center; gap: 5px; width: 100%; }
.shop-mbtn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-1);
  border-radius: 8px; padding: 5px 8px; font-size: .82rem; cursor: pointer;
  line-height: 1; transition: filter .15s ease, background .15s ease;
}
.shop-mbtn:hover { filter: brightness(1.08); }
.shop-mbtn.on { background: rgba(212,160,23,.18); border-color: rgba(212,160,23,.4); color: var(--gold); }
.shop-mbtn-edit { flex: 1; font-size: .76rem; font-weight: 700; }

/* Shop item modal form */
.shop-form-preview {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px; margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  min-height: 90px; justify-content: center;
}
.shop-form-preview .shop-card-prev { min-height: 56px; }
/* Two-column header: tipo/nombre/precio | rareza/colección/rebaja. The variable
   type-dependent fields and the toggles stay full-width below. */
.shop-form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 560px) { .shop-form-cols { grid-template-columns: 1fr; gap: 0; } }
.shop-form-col { min-width: 0; }
/* Inputs fill their container (columns + the full-width variable fields below),
   overriding .form-input's 320px cap; special grids keep their own sizing. */
.shop-form-col .customize-row .form-input,
#sfKindFields .customize-row .form-input { max-width: none; }
.shop-form-toggles { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0 4px; }
.shop-form-check { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--text-1); cursor: pointer; }
.shop-form-check input { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }
.shop-form-minis { display: flex; gap: 10px; margin-top: 4px; }
.shop-form-mini { display: flex; flex-direction: column; gap: 3px; font-size: .72rem; color: var(--text-3); flex: 1; }
.shop-form-mini .form-input { max-width: 100%; padding: 6px 8px; }
.shop-form-kind-label {
  flex: 1; padding: 9px 12px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .85rem; font-weight: 700; color: var(--text-2);
}
.shop-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.shop-section-head-row { justify-content: space-between; }
.shop-section-head-row > span { display: inline-flex; align-items: center; gap: 8px; }
.shop-section-head-row h3 { font-family: 'Bebas Neue', sans-serif; font-size: 1.25rem; letter-spacing: .04em; color: var(--text-1); margin: 0; }

/* ── SHOP COLLECTIONS (combos) ────────────────────────────────────────────── */
.shop-collections {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.shop-collection {
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--gold) 6%, transparent), transparent 45%),
    var(--surface-1);
  border: 1px solid color-mix(in srgb, var(--gold) 26%, var(--border));
  border-radius: var(--radius-lg, 17px); box-shadow: var(--shadow-card);
  transition: transform .25s var(--ease-out), border-color .2s, box-shadow .3s var(--ease-out);
}
.shop-collection.is-clickable:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--gold) 55%, var(--border));
  box-shadow: var(--shadow-card), 0 12px 32px rgba(0,0,0,.26), 0 0 26px -8px var(--gold);
}
.shop-collection-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-collection-name { font-family: 'Bebas Neue', sans-serif; font-size: 1.15rem; letter-spacing: .03em; color: var(--text-1); }
/* En la cabecera de la colección el badge de rebaja es inline (a la derecha del
   nombre), no flotante: .shop-collection no es contenedor posicionado y un
   position:absolute se escaparía a la esquina de la pantalla. */
.shop-collection-head .shop-badge-sale { position: static; }
.shop-collection-items {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px; background: var(--surface-2); border-radius: 12px;
}
.shop-collection-item { display: flex; align-items: center; justify-content: center; min-height: 50px; position: relative; }
.shop-collection-item.owned::after {
  content: "✓"; position: absolute; top: -4px; right: -4px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--gold); color: #1a1408; font-size: .56rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.shop-collection-item.owned { opacity: .5; }

