:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-elevated: #1a1a24;
  --blue: #a855f7;
  --blue-bright: #c084fc;
  --blue-glow: rgba(168, 85, 247, 0.35);
  --text: #f0f0f5;
  --text-muted: #8b8b9a;
  --border: rgba(255,255,255,0.08);
  --radius: 16px;
  --font: 'Inter', system-ui, sans-serif;
  --pixel: 'Press Start 2P', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 16px var(--blue-glow);
}
.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-card);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
  }
  .nav-links.open { display: flex; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  font-family: inherit;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 4px 20px var(--blue-glow);
}

.btn-primary:hover { background: var(--blue-bright); color: white; }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--blue); color: var(--text); }

/* Page shell */
.page {
  padding: 6.5rem 1.25rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.page-center {
  text-align: center;
}

/* Hero / Store header style */
.store-hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
}

.store-hero .logo-big {
  width: 72px; height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #c084fc, #6b21a8);
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
  color: white;
  box-shadow: 0 0 40px var(--blue-glow);
}

.store-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

.store-hero p {
  color: var(--text-muted);
  font-size: 1rem;
}

.store-hero .ip-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  color: var(--blue-bright);
  font-size: 0.95rem;
}

/* Rank feature card - like Master+ */
.rank-feature {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  background: linear-gradient(135deg, #1a6bff 0%, #0d4ecc 50%, #a855f7 100%);
  border-radius: 20px;
  padding: 1.75rem 2rem;
  margin: 0 auto 2.5rem;
  max-width: 900px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.3);
}

.rank-feature-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rank-feature-content .sub {
  opacity: 0.9;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.rank-feature-content ul {
  list-style: none;
  font-size: 0.95rem;
}

.rank-feature-content li {
  margin-bottom: 0.25rem;
  opacity: 0.95;
}

.rank-feature-art {
  font-size: 6rem;
  line-height: 1;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35));
}

@media (max-width: 700px) {
  .rank-feature {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .rank-feature-art { font-size: 4rem; order: -1; }
  .rank-feature-content ul { text-align: left; display: inline-block; }
}

/* Section titles */
.section-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 1.25rem;
  color: var(--text);
}

/* Product / key cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.key-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.key-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-3px);
}

.key-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.key-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.key-price {
  color: var(--blue-bright);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.qty-row {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.qty-btn {
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.qty-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.shard-card, .pack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.shard-card:hover, .pack-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-3px);
}

.pack-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.pack-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-grow: 1;
  margin-bottom: 1rem;
}

.pack-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Library pages */
.lib-header {
  text-align: center;
  margin-bottom: 2rem;
}

.lib-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.lib-header p { color: var(--text-muted); }

.upload-box {
  background: var(--bg-card);
  border: 1px dashed rgba(168, 85, 247, 0.35);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.upload-box h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.upload-box input[type="text"],
.upload-box input[type="file"],
.upload-box textarea,
.upload-box select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.upload-box label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Home hero */
.home-hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 1.25rem 3rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.18) 0%, transparent 55%),
    var(--bg);
}

.home-hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.home-hero h1 span { color: var(--blue-bright); }

.home-hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 480px;
  margin-bottom: 1.75rem;
}

.hero-btns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem;
  text-align: center;
}

.feature .icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.feature h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.feature p { color: var(--text-muted); font-size: 0.88rem; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer .logo {
  justify-content: center;
  margin-bottom: 0.5rem;
}

.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--blue-bright); }

/* Join page */
.join-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.join-card .ip {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue-bright);
  margin: 1rem 0;
  word-break: break-all;
}

/* Empty state */
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  z-index: 200;
  transition: transform 0.3s;
  font-size: 0.9rem;
}

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


.key-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 0.5rem;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
}

.rank-feature-art img {
  width: min(220px, 40vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,0.4));
}

.store-hero .logo-big img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 40px var(--blue-glow);
}
