* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --bg: #0e0e12;
  --panel: #16161c;
  --line: rgba(255, 255, 255, 0.08);
  --txt: #e8e8ec;
  --muted: #8a8a94;
  --accent: #7c5cff;
}
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--txt);
  background:
    radial-gradient(1200px 720px at 50% -6%, #38236f 0%, rgba(56, 35, 111, 0) 60%),
    radial-gradient(900px 520px at 88% 112%, #1f1442 0%, rgba(31, 20, 66, 0) 55%),
    linear-gradient(180deg, #130f20 0%, #0e0d14 45%, #09090c 100%);
  background-color: var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
}
.brand {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-decoration: none;
}
.logo {
  position: absolute;
  left: 16px;
  top: 13px;
  display: flex;
  align-items: center;
}
.logo img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: block;
}
.login-pill {
  position: absolute;
  right: 16px;
  top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--txt);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.login-pill:hover { background: rgba(255, 255, 255, 0.04); }
.login-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.login-head {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  image-rendering: pixelated;
}
.login-pill.connected {
  border-color: rgba(124, 92, 255, 0.5);
}

/* Fenêtre de connexion Minecraft */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.auth-overlay.show { display: flex; }
.auth-modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 26px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.auth-modal h3 { font-size: 18px; margin-bottom: 10px; }
.auth-status { font-size: 14px; color: var(--txt); margin-bottom: 14px; }
.code-box {
  font-family: ui-monospace, monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.35);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  user-select: all;
}
.auth-open { margin-bottom: 14px; }
.auth-warn { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.auth-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.auth-cancel {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}
.auth-cancel:hover { color: var(--txt); }

/* ---------- Barre de navigation ---------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  flex-wrap: wrap;
}
.nav-link {
  padding: 9px 16px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.12s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--txt); }
.nav-link.active { background: rgba(124, 92, 255, 0.14); color: var(--accent); }
.nav-link.nav-panel { color: var(--accent); border: 1px solid rgba(124, 92, 255, 0.4); }
.nav-link.nav-panel:hover { background: rgba(124, 92, 255, 0.14); }

/* ---------- Contenu ---------- */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 22px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--txt);
}
.hero-text {
  font-size: 16px;
  line-height: 1.75;
  color: var(--txt);
  margin-bottom: 18px;
}
.hero-text .soft { color: var(--muted); }
.panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 30px 34px;
  margin-bottom: 30px;
}
.btn-accent {
  display: inline-block;
  padding: 14px 40px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-accent:hover { filter: brightness(1.12); }
.note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 14px;
}

/* ---------- Boutique ---------- */
.shop-main { max-width: 1000px; }
.shop-top {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-bottom: 22px;
}
.shop-top h1 { font-size: 26px; font-weight: 700; }
.cart-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 15px; border: 1px solid var(--line); background: transparent;
  color: var(--txt); border-radius: 8px; cursor: pointer; font-size: 14px;
}
.cart-btn:hover { background: rgba(255,255,255,0.04); }
.cart-badge {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 18px; text-align: center;
}
.shop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; width: 100%; }
.grade-col {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 18px; display: flex; flex-direction: column; text-align: center;
}
.grade-name { font-size: 19px; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.grade-adv {
  list-style: none; text-align: left; font-size: 13px; color: var(--txt);
  display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; flex: 1;
}
.grade-adv li { padding-left: 20px; position: relative; line-height: 1.4; }
.grade-adv li::before { content: '✔'; position: absolute; left: 0; color: var(--accent); }
.grade-price { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.grade-add {
  padding: 11px; border: none; border-radius: 8px; background: var(--accent);
  color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; transition: filter .15s;
}
.grade-add:hover { filter: brightness(1.12); }
@media (max-width: 820px) { .shop-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .shop-grid { grid-template-columns: 1fr; } }

/* Panier */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.cart-overlay.show { display: flex; }
.cart-modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; max-width: 420px; width: 100%;
}
.cart-modal h3 { font-size: 18px; margin-bottom: 16px; }
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cart-row .rm { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.cart-row .rm:hover { color: #ff8a8a; }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; margin: 16px 0; }
.cart-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 14px 0; }
.cart-code {
  font-family: ui-monospace, monospace; font-size: 15px; word-break: break-all;
  background: rgba(124,92,255,0.1); border: 1px solid rgba(124,92,255,0.35);
  border-radius: 10px; padding: 12px; margin-top: 12px; color: var(--accent); user-select: all;
}

/* ---------- Timeline (Histoire) ---------- */
.timeline {
  position: relative;
  width: 100%;
  margin: 14px auto 0;
  padding: 6px 0 10px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.45;
  transform: translateX(-50%);
}
.tl-item {
  position: relative;
  width: 50%;
  padding: 12px 32px;
  box-sizing: border-box;
}
.tl-item:nth-child(odd) { left: 0; }
.tl-item:nth-child(even) { left: 50%; }
.tl-dot {
  position: absolute;
  top: 26px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.tl-item:nth-child(odd) .tl-dot { right: -6px; }
.tl-item:nth-child(even) .tl-dot { left: -6px; }
.tl-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  text-align: left;
}
.tl-date {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 7px;
  margin-bottom: 12px;
}
.tl-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.tl-card p { font-size: 14px; line-height: 1.65; color: var(--txt); }
.tl-card p + p { margin-top: 10px; }
.tl-card strong { color: var(--accent); }
@media (max-width: 640px) {
  .timeline::before { left: 18px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; left: 0; padding: 10px 0 10px 44px; }
  .tl-item .tl-dot,
  .tl-item:nth-child(odd) .tl-dot,
  .tl-item:nth-child(even) .tl-dot { left: 12px; right: auto; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--txt);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
footer {
  padding: 22px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  header {
    flex-direction: column;
    height: auto;
    gap: 10px;
    padding: 14px 0;
  }
  .brand { font-size: 24px; }
  .login-pill {
    position: static;
    right: auto;
    top: auto;
  }
  .logo {
    position: static;
    left: auto;
    top: auto;
  }
  .navbar { gap: 2px; padding: 8px 6px; }
  .nav-link { padding: 8px 12px; font-size: 13px; }
  main { padding: 34px 16px 60px; }
  .panel { padding: 24px 20px 26px; }
  .hero-text { font-size: 15px; }
  .btn-accent { padding: 13px 34px; }
}
