@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0d0d0f;
  --bg-card: #16161a;
  --bg-card-hover: #1a1a1f;
  --border: #2a2a2e;
  --text: #e4e4e7;
  --text-muted: #a1a1aa;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --accent-dim: rgba(34, 197, 94, 0.15);
  --danger: #ef4444;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  background-image:
    linear-gradient(rgba(34,197,94,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,197,94,0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ----- Layout ----- */
.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
}

.main {
  flex: 1;
  padding: 2rem;
  padding-right: 1rem;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }
  .main {
    padding: 1rem;
  }
}

/* ----- Header ----- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.logo:hover { text-decoration: none; opacity: 0.9; }
.logo-img {
  height: 36px;
  width: auto;
  display: block;
}
.logo span { color: var(--accent); }

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}
.cart-link:hover {
  background: rgba(34, 197, 94, 0.25);
  text-decoration: none;
}
.cart-link .count {
  background: var(--accent);
  color: var(--bg);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* ----- Sidebar ----- */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
}

@media (max-width: 900px) {
  .sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.nav-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.nav-list li { margin: 0; }
.nav-list a {
  display: block;
  padding: 0.6rem 0.75rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}
.nav-list a:hover {
  color: var(--text);
  background: var(--bg-card-hover);
  text-decoration: none;
}
.nav-list a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ----- Widgets ----- */
.widget {
  background: #1c1c20;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.widget-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.giftcard-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.giftcard-input::placeholder { color: var(--text-muted); }
.giftcard-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.giftcard-hint {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-secondary {
  background: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: #3a3a3e; }
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: var(--bg);
}
.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.server-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.server-status .addr {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}
.server-status .players { font-size: 0.8rem; }

/* ----- Home ----- */
.hero {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(180deg, var(--bg-card) 0%, transparent 100%);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}
.hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--text-muted);
  margin: 0;
  font-size: 1.1rem;
}
.hero .cta {
  margin-top: 1.5rem;
}
.hero .btn { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ----- Hero Home (FireMC / MineCore style) ----- */
.hero-home {
  position: relative;
  padding: 2.5rem 1.5rem 1.5rem;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0f1419 0%, #0d0d0f 50%, #0a0e12 100%);
  opacity: 0.95;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34,197,94,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,197,94,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-center { order: -1; }
}
.hero-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.hero-icon {
  width: 48px;
  height: 48px;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.hero-icon svg {
  width: 100%;
  height: 100%;
}
.hero-icon-discord { color: #5865f2; }
.hero-cta-title {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 0;
}
.hero-copy-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.hero-copy-btn:hover { background: var(--accent-dim); }
.hero-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.hero-logo-link {
  display: block;
  line-height: 0;
}
.hero-mc-logo {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 24px rgba(34,197,94,0.15));
}
.hero-discord-btn {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
}
.hero-discord-btn:hover { text-decoration: none; opacity: 0.9; }
.hero-sale {
  position: relative;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  margin-bottom: -1.5rem;
}
.hero-sale span { opacity: 0.95; }

/* ----- Home welcome (FireMC-style) ----- */
.home-welcome {
  margin-bottom: 2rem;
  padding: 1.5rem 0;
}
.home-welcome-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
  line-height: 1.3;
}
.home-welcome-title strong { color: var(--accent); }
.home-welcome-desc {
  color: var(--text-muted);
  margin: 0 0 1rem;
  max-width: 560px;
}
.home-welcome-cta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}
.home-welcome-cta strong { color: var(--text); }

/* ----- Home featured packages ----- */
.home-featured { margin-bottom: 2rem; }
.home-featured-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.featured-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.featured-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(34,197,94,0.35);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}
.featured-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-icon svg { width: 100%; height: 100%; }
.featured-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  text-align: center;
}
.featured-price {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* ----- Sidebar "Select a category" ----- */
.sidebar-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.nav-categories { margin-bottom: 1rem; }

/* ----- Ranks grid ----- */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

.ranks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.rank-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.rank-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

.rank-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.rank-icon svg { width: 100%; height: 100%; }

.rank-info { flex: 1; min-width: 0; }
.rank-name { font-weight: 600; font-size: 1.1rem; margin: 0 0 0.25rem; }
.rank-price { font-family: var(--font-mono); color: var(--accent); font-size: 1rem; }
.rank-actions { flex-shrink: 0; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.qty-control button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.qty-control button:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* ----- Coins ----- */
.page-subtitle {
  color: var(--text-muted);
  margin: -0.5rem 0 1.5rem;
  font-size: 1rem;
}
.coins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.coin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.coin-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(34, 197, 94, 0.35);
  transform: translateY(-2px);
}
.coin-card-featured {
  border-color: rgba(34, 197, 94, 0.25);
  background: linear-gradient(180deg, rgba(34,197,94,0.06) 0%, var(--bg-card) 100%);
}
.coin-thumb {
  width: 100%;
  max-width: 140px;
  height: 100px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.coin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.coin-card .coin-name { font-weight: 600; margin: 0 0 0.25rem; font-size: 1.05rem; }
.coin-card .coin-price { font-family: var(--font-mono); color: var(--accent); font-size: 1rem; }
.coin-card .btn { margin-top: 0.75rem; width: 100%; }

/* ----- About ----- */
.about-content {
  max-width: 640px;
}
.about-content p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

/* ----- Checkout ----- */
.checkout-section {
  max-width: 560px;
  margin-bottom: 2rem;
}
.checkout-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1rem;
}
.cart-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.cart-summary li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.cart-summary li:last-child { border-bottom: none; }
.cart-summary .total {
  font-weight: 700;
  color: var(--text);
  font-size: 1.1rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.checkout-form .form-group {
  margin-bottom: 1rem;
}
.checkout-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.checkout-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}
.checkout-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.pay-method {
  flex: 1;
  min-width: 160px;
  padding: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.pay-method:hover { border-color: var(--accent); background: var(--accent-dim); }
.pay-method.selected { border-color: var(--accent); background: var(--accent-dim); }
.pay-method { position: relative; }
.pay-method input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.pay-method .icon { font-size: 1.5rem; margin-bottom: 0.35rem; display: block; }
.pay-method .label { font-weight: 600; font-size: 0.9rem; }

.upi-flow {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
}
.upi-flow .qr-wrap {
  text-align: center;
  margin-bottom: 1rem;
}
.upi-flow .qr-wrap img {
  max-width: 220px;
  height: auto;
  border-radius: var(--radius-sm);
}
.upi-flow .upi-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--accent);
  margin-bottom: 1rem;
}
.upi-flow .form-group { margin-bottom: 0.75rem; }
.upi-flow .note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.success-msg, .error-msg {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
.success-msg { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(34, 197, 94, 0.3); }
.error-msg { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.empty-cart {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}
.empty-cart .btn { margin-top: 1rem; }

/* ----- Footer ----- */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
