/* Wamfunzy — design tokens
   Direction: void-dark storefront with a faceted "gem cut" signature.
   Palette pulls from MLBB's own world: obsidian arena, violet spell-glow, amber diamond currency.
*/

:root {
  /* Color */
  --void: #0B0E14;
  --panel: #141926;
  --panel-raised: #1B2233;
  --line: #2A3245;
  --line-soft: #1F2636;
  --violet: #7C5CFF;
  --violet-bright: #9B7FFF;
  --violet-dim: #4D3B9E;
  --amber: #FFB84D;
  --amber-bright: #FFD68A;
  --amber-dim: #B8842F;
  --green: #3DDC97;
  --red: #FF6B6B;
  --text: #F4F6FB;
  --text-dim: #9AA3B8;
  --text-faint: #5C6478;

  /* Type */
  --font-display: 'Rajdhani', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --max-width: 1180px;
  --facet-cut: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow-violet: 0 0 32px rgba(124, 92, 255, 0.25);
  --shadow-glow-amber: 0 0 32px rgba(255, 184, 77, 0.2);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--void);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 92, 255, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(255, 184, 77, 0.08), transparent);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

::selection {
  background: var(--violet);
  color: white;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 14, 20, 0.85);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: opacity 0.18s ease;
}

.logo:hover { opacity: 0.85; }

.logo .mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.logo .brand-name {
  background: linear-gradient(135deg, var(--text) 30%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 30px;
  font-size: 14px;
  color: var(--text-dim);
}

.nav-links a {
  position: relative;
  padding-bottom: 2px;
  transition: color 0.18s ease;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--amber);
  transition: right 0.25s var(--ease);
}

.nav-links a:hover::after { right: 0; }

/* ---------- Hero ---------- */

.hero {
  padding: 88px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  animation: fade-up 0.6s var(--ease) both;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--amber);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 50px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0;
  margin: 0 0 22px;
  animation: fade-up 0.6s var(--ease) 0.08s both;
}

.hero h1 .accent {
  color: var(--violet-bright);
}

.hero p.lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 0 36px;
  animation: fade-up 0.6s var(--ease) 0.16s both;
}

.hero-stats {
  display: flex;
  gap: 36px;
  animation: fade-up 0.6s var(--ease) 0.24s both;
}

.hero-stat .num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
}

.hero-stat .label {
  font-size: 11.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}

.hero-bg-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.circuit-bg {
  width: 100%;
  height: 100%;
}

.hero-mascot {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--amber-dim);
  box-shadow: var(--shadow-glow-amber), 0 0 60px rgba(61, 184, 255, 0.2);
  position: relative;
  z-index: 1;
  animation: float-gem 6s ease-in-out infinite;
}

.hero-mascot-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 184, 77, 0.18), transparent 70%);
  filter: blur(10px);
}

.logo-mascot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--amber-dim);
  flex-shrink: 0;
}

/* ---------- Game selector tabs ---------- */

.game-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.game-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
  font-family: inherit;
}

.game-tab .game-icon {
  width: 40px;
  height: 40px;
}

.game-tab .game-icon-custom {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.game-tab-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.game-tab-label {
  font-size: 11px;
  color: var(--text-faint);
}

.game-tab:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
}

.game-tab.active {
  border-color: var(--amber);
  background: var(--panel-raised);
  box-shadow: 0 0 0 1px var(--amber), var(--shadow-glow-amber);
}

#gemGridContainer .gem-grid-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes float-gem {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- Faceted gem card (signature element) ---------- */

.gem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gem-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 26px 22px;
  cursor: pointer;
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
  clip-path: polygon(
    var(--facet-cut) 0%, 100% 0%, 100% calc(100% - var(--facet-cut)),
    calc(100% - var(--facet-cut)) 100%, 0% 100%, 0% var(--facet-cut)
  );
}

.gem-card:hover {
  border-color: var(--violet);
  background: var(--panel-raised);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.gem-card.selected {
  border-color: var(--amber);
  background: var(--panel-raised);
  box-shadow: 0 0 0 1px var(--amber), var(--shadow-glow-amber);
}

.gem-card.has-bonus::after {
  content: 'BONUS';
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--green);
  background: rgba(61, 220, 151, 0.1);
  padding: 3px 7px;
  border-radius: 3px;
}

.gem-card .diamond-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  transition: transform 0.22s var(--ease);
}

.gem-card:hover .diamond-icon {
  transform: scale(1.08) rotate(-4deg);
}

.gem-card .gem-amount {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: 0.2px;
}

.gem-card .gem-bonus {
  font-size: 11.5px;
  color: var(--green);
  margin-bottom: 14px;
  height: 15px;
  font-weight: 500;
}

.gem-card .gem-price {
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--amber);
  font-weight: 600;
}

.gem-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Section ---------- */

.section {
  padding: 56px 0;
}

.section-head {
  margin-bottom: 28px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--violet-bright);
  margin-bottom: 8px;
  font-weight: 600;
}

.section h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.1px;
}

/* ---------- Order form ---------- */

.order-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
}

.field input, .field textarea {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 15px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.field input:focus, .field textarea:focus {
  border-color: var(--violet);
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.field input.error {
  border-color: var(--red);
}

.field-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
  display: none;
}

.field-error.show { display: block; }

.order-summary {
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s var(--ease);
}

.order-summary .label {
  color: var(--text-dim);
  font-size: 13px;
}

.order-summary .value {
  font-family: var(--font-mono);
  font-size: 21px;
  color: var(--amber);
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.18s var(--ease), transform 0.15s var(--ease), box-shadow 0.18s var(--ease);
  font-family: inherit;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--violet-bright));
  color: white;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.3);
}

.btn-primary:hover {
  opacity: 0.94;
  box-shadow: 0 6px 22px rgba(124, 92, 255, 0.4);
}

.btn-primary:disabled {
  background: var(--text-faint);
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--text-dim); background: var(--panel-raised); }

.btn-full { width: 100%; }

.btn-sm {
  padding: 9px 16px;
  font-size: 13px;
}

.btn-danger {
  background: rgba(255, 107, 107, 0.12);
  color: var(--red);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.btn-success {
  background: rgba(61, 220, 151, 0.12);
  color: var(--green);
  border: 1px solid rgba(61, 220, 151, 0.3);
}

/* ---------- Steps indicator ---------- */

.steps {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}

.step {
  flex: 1;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  position: relative;
}

.step.active, .step.done {
  background: var(--violet);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 64px;
  color: var(--text-faint);
  font-size: 13px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---------- Confirmation page ---------- */

.confirm-card {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  box-shadow: var(--shadow-md);
  animation: fade-up 0.5s var(--ease) both;
}

.confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}

.confirm-code {
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--amber);
  background: var(--void);
  border: 1px dashed var(--amber-dim);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  margin: 24px 0;
  display: inline-block;
}

.confirm-steps {
  text-align: left;
  background: var(--void);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 14px;
  color: var(--text-dim);
}

.confirm-steps li { margin-bottom: 8px; }

/* ---------- Status badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-pending { background: rgba(255, 184, 77, 0.12); color: var(--amber); }
.badge-pending::before { background: var(--amber); }

.badge-confirmed { background: rgba(124, 92, 255, 0.12); color: var(--violet); }
.badge-confirmed::before { background: var(--violet); }

.badge-delivered { background: rgba(61, 220, 151, 0.12); color: var(--green); }
.badge-delivered::before { background: var(--green); }

.badge-rejected { background: rgba(255, 107, 107, 0.12); color: var(--red); }
.badge-rejected::before { background: var(--red); }

/* ---------- Admin layout ---------- */

.admin-shell {
  min-height: 100vh;
  display: flex;
}

.admin-topbar {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.admin-topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1320px;
}

.admin-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.admin-tab {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-tab.active {
  color: var(--text);
  border-bottom-color: var(--violet);
}

.admin-tab .count {
  background: var(--panel-raised);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.data-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover { background: var(--panel-raised); }
.data-table tr { transition: background 0.15s ease; }

.mono { font-family: var(--font-mono); font-size: 13px; }

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-faint);
}

.empty-state .empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.4;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 40px 32px;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: var(--red);
}

.alert-success {
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.3);
  color: var(--green);
}

.pkg-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.pkg-row:last-child { border-bottom: none; }

.pkg-row input {
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  width: 100%;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--line);
  border-radius: 999px;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

.toggle.on { background: var(--green); }

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.toggle.on::after { transform: translateX(18px); }

.game-pkg-section {
  margin-top: 28px;
}

.game-pkg-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.game-pkg-header .game-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.game-pkg-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

.game-pkg-sub {
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- Site customization ---------- */

.customize-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.color-field {
  margin-bottom: 16px;
}

.color-field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-row input[type="color"] {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--void);
  cursor: pointer;
  padding: 2px;
}

.color-hex-input {
  flex: 1;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.upload-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
}

.upload-box-inline {
  margin: 14px 0;
  padding: 14px 16px;
}

.upload-box-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-box-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.upload-box-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.upload-preview {
  flex-shrink: 0;
  background: var(--void);
  border: 1px solid var(--line);
}

.upload-preview-round {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.upload-preview-wide {
  width: 120px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}

.upload-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-faint);
  text-align: center;
}

.upload-box-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero { padding: 56px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 34px; }
  .hero::before { width: 320px; height: 320px; top: -120px; right: -100px; }
  .section { padding: 40px 0; }
  .form-row { grid-template-columns: 1fr; }
  .pkg-row { grid-template-columns: 1fr; }
  .admin-main { padding: 20px 16px; }
  .customize-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
