/* ================================================================
   SECRET SMP — Shop & Admin styles
   Built entirely from the existing design tokens in style.css.
   Loaded by shop.html and admin.html after style.css.
   ================================================================ */

/* ---------- Shop page hero note ---------- */
.shop-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.shop-note a {
  color: var(--cyan-soft);
  border-bottom: 1px solid rgba(125, 211, 252, 0.4);
}

/* ---------- Rank cards ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
  max-width: 1060px;
  margin-inline: auto;
}

.rank-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.8rem 1.6rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), rgba(56, 189, 248, 0.1), transparent 65%),
    linear-gradient(180deg, rgba(17, 28, 58, 0.62), rgba(8, 13, 28, 0.68));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition:
    transform 0.35s var(--ease),
    border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}
.rank-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.7), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}
.rank-card:hover {
  transform: translateY(-6px);
  border-color: rgba(125, 211, 252, 0.45);
  box-shadow:
    0 26px 60px -28px rgba(34, 211, 238, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.rank-card:hover::before {
  opacity: 1;
}

.rank-img {
  width: 92px;
  height: 92px;
  margin: 0 auto 1.1rem;
  object-fit: contain;
  border-radius: 18px;
  filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.35));
  transition: transform 0.35s var(--ease);
}
.rank-card:hover .rank-img {
  transform: translateY(-4px) scale(1.04);
}

.rank-name {
  text-align: center;
  font: 700 1.45rem/1.2 var(--font-display);
  color: var(--text);
}
.rank-price {
  margin: 0.45rem 0 1.2rem;
  text-align: center;
  font: 800 1.7rem/1 var(--font-display);
  background: linear-gradient(180deg, #b7f5ff 0%, #38bdf8 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* "/month" suffix rides along inside the gradient text */
.rank-price-period {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.rank-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  margin-bottom: 1.4rem;
}

.rank-section-title {
  margin-bottom: 0.45rem;
  font: 600 0.66rem/1 var(--font-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #7d93bd;
}
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rank-list li {
  position: relative;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.rank-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}
.rank-list.mono li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #a9d8ff;
}
.rank-list.extras li::before {
  background: #a78bfa;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
}

.rank-buy {
  width: 100%;
}

/* ---------- "Items" image on rank cards ---------- */
.rank-items-img {
  width: 100%;
  max-height: 170px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 24, 0.45);
  padding: 0.5rem;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.rank-card:hover .rank-items-img {
  transform: translateY(-2px) scale(1.015);
  border-color: rgba(125, 211, 252, 0.4);
}

/* ---------- Shop loading / error / empty states ---------- */
.shop-state {
  margin: 2.5rem auto 0;
  max-width: 420px;
  text-align: center;
  color: var(--muted);
}
.shop-state-title {
  font: 700 1.15rem/1.4 var(--font-display);
  color: var(--text);
  margin-bottom: 0.4rem;
}
.shop-state-spinner {
  display: inline-block;
  width: 34px;
  height: 34px;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.18);
  border-top-color: var(--cyan);
  animation: spin 0.9s linear infinite;
}

/* ---------- Gems panel ---------- */
.gem-panel {
  max-width: 620px;
  margin-inline: auto;
  padding: 2.6rem 2.4rem;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  text-align: center;
  background:
    radial-gradient(560px 240px at 50% 0%, rgba(37, 99, 235, 0.22), transparent 62%),
    linear-gradient(180deg, rgba(17, 28, 58, 0.6), rgba(8, 13, 28, 0.7));
  box-shadow: 0 30px 80px -45px rgba(37, 99, 235, 0.6);
}
.gem-display {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1.6rem;
}
.gem-amount {
  font: 800 clamp(2.2rem, 6vw, 3.4rem) / 1 var(--font-display);
  background: linear-gradient(100deg, #7deefc 0%, #38bdf8 55%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(56, 189, 248, 0.3));
}
.gem-unit {
  font: 600 0.72rem/1 var(--font-body);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #8ba3c9;
}

.gem-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan) var(--fill, 25%), rgba(96, 165, 250, 0.18) var(--fill, 25%));
  outline: none;
  cursor: pointer;
}
.gem-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b7f5ff, #38bdf8);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 0 0 6px rgba(56, 189, 248, 0.18),
    0 6px 18px -4px rgba(34, 211, 238, 0.8);
  cursor: grab;
  transition: transform 0.2s var(--ease);
}
.gem-slider::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}
.gem-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b7f5ff, #38bdf8);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 0 0 6px rgba(56, 189, 240, 0.18),
    0 6px 18px -4px rgba(34, 211, 238, 0.8);
  cursor: grab;
}
.gem-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.18);
}
.gem-slider::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--cyan);
}

.gem-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  color: var(--muted-2);
  font: 600 0.72rem/1 var(--font-mono);
}

.gem-price {
  margin: 1.6rem 0 1.8rem;
}
.gem-price-value {
  display: block;
  font: 800 clamp(1.7rem, 4.5vw, 2.3rem) / 1 var(--font-display);
  color: var(--text);
}
.gem-price-note {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted-2);
  font-size: 0.85rem;
}

.gem-buy {
  min-width: 220px;
}
.gem-buy-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- Admin section ---------- */
.admin-section {
  padding-top: calc(var(--nav-h) + 3.5rem);
}

.admin-title {
  margin: 1rem 0 0.4rem;
  font: 800 clamp(1.7rem, 4vw, 2.4rem) / 1.15 var(--font-display);
  color: var(--text);
}
.admin-sub {
  color: var(--muted);
}
.admin-hint {
  margin-top: 0.6rem;
  color: var(--muted-2);
  font-size: 0.88rem;
}

.admin-login {
  display: flex;
  justify-content: center;
  padding-top: 3rem;
}
.admin-login-card {
  width: min(420px, 100%);
  padding: 2.4rem 2.2rem;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(480px 220px at 50% 0%, rgba(37, 99, 235, 0.2), transparent 62%),
    linear-gradient(180deg, rgba(17, 28, 58, 0.6), rgba(8, 13, 28, 0.7));
  text-align: center;
}
.admin-login-card .eyebrow {
  margin-bottom: 1rem;
}
.admin-sub {
  margin-bottom: 1.6rem;
}
.admin-input-row {
  display: flex;
  gap: 0.6rem;
}
.admin-input-row .admin-input {
  flex: 1;
}

/* Full-width login submit (username + password stacked layout) */
.admin-submit {
  width: 100%;
  margin-top: 1.5rem;
}

.admin-label {
  display: block;
  margin: 1.1rem 0 0.45rem;
  font: 600 0.66rem/1 var(--font-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7d93bd;
}
.admin-input,
.admin-textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 24, 0.6);
  color: var(--text);
  font: 500 0.95rem/1.5 var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-textarea {
  resize: vertical;
  min-height: 90px;
}
.admin-input:focus,
.admin-textarea:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.admin-input::placeholder,
.admin-textarea::placeholder {
  color: var(--muted-2);
}

.admin-form-error {
  margin-top: 0.9rem;
  color: #fda4af;
  font-size: 0.88rem;
}
.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #be123c);
  border: 1px solid rgba(244, 63, 94, 0.4);
}
.btn-danger:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 34px -14px rgba(244, 63, 94, 0.6);
}

/* ---------- Admin head + list ---------- */
.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.4rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.admin-head-actions {
  display: flex;
  gap: 0.7rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.admin-state {
  padding: 2.2rem;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  text-align: center;
  color: var(--muted);
}

.admin-rank-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 26, 52, 0.55), rgba(8, 13, 28, 0.6));
  transition: border-color 0.25s, transform 0.25s var(--ease), opacity 0.25s;
}
.admin-rank-row:hover {
  border-color: rgba(125, 211, 252, 0.4);
}
.admin-rank-row.is-dragging {
  opacity: 0.45;
  border-style: dashed;
}

.admin-drag-handle {
  cursor: grab;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  color: var(--muted-2);
  font-size: 1.05rem;
  user-select: none;
  transition: color 0.2s, background 0.2s;
}
.admin-drag-handle:hover {
  color: var(--cyan-soft);
  background: rgba(56, 189, 248, 0.08);
}

.admin-rank-img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(5, 10, 24, 0.5);
  border: 1px solid var(--line);
  flex: none;
}

.admin-rank-main {
  flex: 1;
  min-width: 0;
}
.admin-rank-main strong {
  display: block;
  font: 700 1.05rem/1.3 var(--font-display);
  color: var(--text);
}
.admin-rank-price {
  color: var(--cyan-soft);
  font: 600 0.9rem/1.4 var(--font-body);
}
.admin-rank-meta {
  color: var(--muted-2);
  font-size: 0.8rem;
}

.admin-rank-actions {
  display: flex;
  gap: 0.55rem;
  flex: none;
}

/* ---------- Modal ---------- */
/* The hidden attribute must always win over any display rule in this
   stylesheet (e.g. .modal-backdrop's flex) or the global img rule —
   otherwise dialogs are visible when the page loads. */
[hidden] {
  display: none !important;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-card {
  width: min(720px, 100%);
  max-height: min(86vh, 780px);
  overflow-y: auto;
  padding: 1.9rem 2rem;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0b1430, #070d1f);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
}
.modal-card--sm {
  width: min(460px, 100%);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.modal-title {
  font: 700 1.3rem/1.2 var(--font-display);
  color: var(--text);
}
.modal-x {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.modal-x:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.08);
}
.confirm-text {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

/* ---------- Admin grid / upload ---------- */
.admin-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.6rem;
}
.admin-upload {
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
  background: rgba(56, 189, 248, 0.03);
}
.admin-upload-preview {
  width: 96px;
  height: 96px;
  margin: 0 auto 0.6rem;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(5, 10, 24, 0.5);
  border: 1px solid var(--line);
}
.admin-upload-input {
  width: 100%;
  color: var(--muted);
  font-size: 0.85rem;
}
.admin-upload-input::file-selector-button {
  margin-right: 0.7rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--cyan-soft);
  font: 600 0.75rem/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.admin-upload-input::file-selector-button:hover {
  background: rgba(56, 189, 248, 0.16);
}
.admin-upload-hint {
  margin-top: 0.5rem;
  color: var(--muted-2);
  font-size: 0.78rem;
}
.admin-upload-hint--muted {
  color: var(--cyan-soft);
}

/* ---------- Static-deploy notice (admin page on Netlify) ---------- */
.admin-static-notice {
  margin-top: 1.4rem;
  padding: 1.3rem 1.4rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(56, 189, 248, 0.05);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: left;
}
.admin-static-notice .shop-state-title {
  margin-bottom: 0.4rem;
}
.admin-static-steps {
  margin: 0.8rem 0 0;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.admin-static-steps strong {
  color: var(--cyan-soft);
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .admin-grid2 {
    grid-template-columns: 1fr;
  }
  .gem-panel {
    padding: 2rem 1.4rem;
  }
  .admin-rank-row {
    flex-wrap: wrap;
  }
  .admin-rank-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .admin-input-row {
    flex-direction: column;
  }
  .admin-input-row .btn {
    width: 100%;
  }
}
