:root {
  --bg: #0f0f0f;
  --card: #161616;
  --card-border: rgba(255, 255, 255, 0.08);
  --btn-bg: #1b1b1b;
  --btn-border: rgba(255, 255, 255, 0.12);
  --text: #f3f4f6;
  --muted: #8a8f98;
  --accent: #ff8c1a;
  --gem-purple: #b938ff;
  --bonus-green: #22c55e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  padding: 20px 24px 64px;
}

.top-bar {
  max-width: 1060px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-pill,
.user-pill {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cart-pill:hover,
.user-pill:hover {
  background: #202020;
  border-color: rgba(255, 255, 255, 0.2);
}

.store-container {
  max-width: 980px;
  margin: 0 auto;
}

/* Header */
.store-header {
  text-align: center;
  padding: 24px 0 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-logo-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.header-logo-wrap:hover {
  transform: scale(1.08);
}

.header-logo-wrap::before {
  content: "";
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(255, 140, 26, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.header-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  image-rendering: pixelated;
  position: relative;
}

.store-heading {
  font-family: "Silkscreen", monospace;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.store-tagline {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
}

.header-ip-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: "Silkscreen", monospace;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.header-ip-btn:hover {
  opacity: 1;
}

.mini-copy-icon {
  width: 13px;
  height: 13px;
}

/* Sections */
.store-section {
  margin-bottom: 34px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-title {
  font-family: "Silkscreen", monospace;
  font-size: 16px;
  font-weight: 700;
}

.section-sub {
  font-size: 12px;
  color: var(--muted);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 36px 0;
}

/* Ranks */
.ranks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  justify-content: center;
  gap: 16px;
}

.rank-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 26px 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rank-art {
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.rank-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  mix-blend-mode: lighten;
}

.rank-name {
  font-family: "Silkscreen", monospace;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px;
}

.rank-name .plus {
  color: var(--accent);
}

.perk-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  margin-bottom: 22px;
}

.perk-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--muted);
}

.perk-list li:last-child {
  border-bottom: none;
}

.perk-list strong {
  font-family: "Silkscreen", monospace;
  font-size: 13px;
  color: var(--text);
}

.price-btn {
  margin-top: auto;
  width: 100%;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: "Silkscreen", monospace;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.price-btn:hover {
  background: #232323;
  border-color: rgba(255, 255, 255, 0.24);
}

.price-btn:active {
  transform: scale(0.98);
}

.rank-btn .accent-price {
  color: var(--accent);
  font-size: 15px;
}

.rank-btn .usd {
  color: var(--accent);
  font-size: 11px;
}

.rank-btn .per {
  color: #cbd5e1;
  font-size: 11px;
}

/* Gems */
.gems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gem-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 28px 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bonus-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bonus-green);
  color: #072210;
  font-family: "Silkscreen", monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
}

.gem-art {
  width: 132px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0 12px;
}

.gem-art svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 14px rgba(185, 56, 255, 0.22));
}

.gem-title-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.gem-old {
  font-family: "Silkscreen", monospace;
  font-size: 12px;
  color: #555963;
  text-decoration: line-through;
}

.gem-amount {
  font-family: "Silkscreen", monospace;
  font-size: 15px;
  color: var(--gem-purple);
  font-weight: 700;
}

.gem-btn {
  font-size: 12px;
}

.gem-btn .usd {
  color: var(--muted);
  font-size: 10px;
  margin-left: 4px;
}

/* Footer */
.store-footer {
  margin-top: 64px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer-domain {
  font-family: "Silkscreen", monospace;
  font-size: 18px;
  font-weight: 700;
}

.footer-disclaimer {
  font-size: 11px;
  color: var(--muted);
}

.footer-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.footer-links a {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

/* Cart Slide-Out Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 60;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: #161616;
  border-left: 1px solid var(--card-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.6);
}

.drawer-backdrop.open .cart-drawer {
  transform: translateX(0);
}

.drawer-items {
  flex: 1;
  max-height: none;
  overflow-y: auto;
}

.drawer-footer {
  margin-top: auto;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 460px;
  background: #181818;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pixel-heading {
  font-family: "Silkscreen", monospace;
  font-size: 18px;
}

.modal-close {
  background: #242424;
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.ign-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.ign-input {
  width: 100%;
  background: #101010;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #121212;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--btn-border);
  background: #1d1d1d;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.qty-btn:hover {
  background: #282828;
}

.qty-val {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.bin-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 4px;
}

.bin-btn:hover {
  background: rgba(248, 113, 113, 0.24);
}

.empty-cart {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 18px 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--card-border);
}

.modal-total {
  font-size: 13px;
  color: var(--muted);
}

.modal-total strong {
  color: var(--text);
}

.checkout-btn {
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: "Silkscreen", monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.policy-body {
  font-size: 13px;
  line-height: 1.6;
  color: #d1d5db;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.policy-body strong {
  color: var(--text);
}

.secret-modal-box {
  max-width: 480px;
}

.secret-body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.secret-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
}

/* Minecraft Username Modal */
.username-modal-box {
  max-width: 600px;
  padding: 0;
  overflow: hidden;
  background: #141414;
}

.username-modal-header {
  position: relative;
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
  text-align: center;
}

.username-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.username-close {
  position: absolute;
  top: 15px;
  right: 16px;
}

.username-modal-body {
  padding: 28px 24px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.edition-toggle {
  display: flex;
  gap: 10px;
}

.edition-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: #1d1d1d;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.edition-btn.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

.username-form {
  display: flex;
  width: 100%;
  max-width: 340px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #1a1a1a;
}

.username-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.continue-btn {
  background: var(--accent);
  color: #111;
  border: none;
  padding: 0 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.continue-btn:hover {
  filter: brightness(1.08);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #1f1f1f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 820px) {
  .ranks-grid,
  .gems-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .ranks-grid,
  .gems-grid {
    grid-template-columns: 1fr;
  }
}
