:root {
  --bg: #0b0a14;
  --bg-card: #16131f;
  --bg-card-hover: #1e1a2c;
  --border: #2e2745;
  --text: #f3f1fa;
  --text-dim: #a89fc4;
  --violet: #a970ff;      /* couleur principale (titre, marque, prix) */
  --violet-deep: #7c3aed; /* variante plus foncee (hover, contours) */
  --cyan: #6ee7f0;        /* accent secondaire (yeux du robot, prix) */
  --magenta: #ff3d9a;     /* accent d'alerte (badge de stock) */
  --purple-twitch: #9147ff; /* couleur officielle du bouton Twitch, deja proche du theme */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(169, 112, 255, 0.16), transparent 60%),
    radial-gradient(ellipse 700px 400px at 100% 0%, rgba(110, 231, 240, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Header --- */

.topbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(11, 10, 20, 0.9);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--violet);
  text-shadow: 0 0 14px rgba(169, 112, 255, 0.55);
}

.topnav {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.nav-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.nav-link.active,
.nav-link:hover {
  color: var(--text);
  border-bottom-color: var(--violet);
}

.btn-twitch {
  background: var(--purple-twitch);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: 0 0 16px rgba(145, 71, 255, 0.45);
}

.btn-twitch:hover { filter: brightness(1.12); }

.account {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-logout:hover { color: var(--text); border-color: var(--text-dim); }

.brand { cursor: pointer; }

/* --- Main --- */

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem 2rem 4rem; }

/* --- Onglets principaux (Boutique / YouTube / Discord / TikTok) --- */

.hub-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hub-tile {
  width: 132px;
  height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: inherit;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease,
    box-shadow 0.15s ease, color 0.15s ease;
}

.hub-tile:hover {
  transform: translateY(-3px);
  border-color: var(--violet-deep);
  background: var(--bg-card-hover);
  color: var(--text);
  box-shadow: 0 0 22px rgba(124, 58, 237, 0.28);
}

.hub-tile.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  color: #fff;
  box-shadow: 0 0 26px rgba(169, 112, 255, 0.45);
  transform: translateY(-3px);
}

.hub-tile-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background 0.15s ease;
}

.hub-tile-icon svg { width: 30px; height: 30px; display: block; }

.icon-boutique { background: rgba(169, 112, 255, 0.16); }
.icon-boutique svg { fill: var(--violet); }

.icon-youtube { background: rgba(255, 0, 0, 0.14); }
.icon-youtube svg { fill: #ff0000; }

.icon-discord { background: rgba(88, 101, 242, 0.16); }
.icon-discord svg { fill: #5865f2; }

.icon-tiktok { background: rgba(255, 255, 255, 0.12); }
.icon-tiktok svg { fill: #ffffff; }

.hub-tile.active .hub-tile-icon { background: rgba(255, 255, 255, 0.28); }
.hub-tile.active .icon-boutique svg,
.hub-tile.active .icon-youtube svg,
.hub-tile.active .icon-discord svg { fill: #fff; }

.hub-tile-label { letter-spacing: 0.02em; }

@media (max-width: 560px) {
  .hub-tile { width: 100px; height: 100px; font-size: 0.75rem; gap: 0.35rem; }
  .hub-tile-icon { width: 44px; height: 44px; }
  .hub-tile-icon svg { width: 24px; height: 24px; }
}

.shop-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.shop-header h1 {
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  color: var(--violet);
  text-shadow: 0 0 16px rgba(169, 112, 255, 0.5);
  margin: 0;
}

.conversion-badge {
  background: linear-gradient(135deg, var(--cyan), #38bdf8);
  color: #0b0a14;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.live-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
}

.live-banner.is-live {
  border-color: var(--magenta);
  color: var(--text);
}

.live-banner .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6b6b76;
  flex: none;
}

.live-banner.is-live .dot {
  background: var(--magenta);
  box-shadow: 0 0 8px rgba(255, 61, 154, 0.7);
}

.info-modal-content ul {
  margin: 0.6rem 0;
  padding-left: 1.1rem;
  line-height: 1.6;
}

.info-modal-content .modal-note {
  margin-top: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: rgba(255, 61, 154, 0.1);
  border: 1px solid rgba(255, 61, 154, 0.4);
  color: var(--text);
  font-size: 0.85rem;
}

.info-modal-content .btn-twitch {
  display: inline-block;
  margin-top: 0.8rem;
  text-decoration: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 0.8rem;
}

.tabs { display: flex; gap: 1.2rem; }

.tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}

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

.categories { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.chip.active {
  background: var(--violet-deep);
  border-color: var(--violet);
  color: #fff;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.sort-label { color: var(--text-dim); font-size: 0.85rem; }

.sort-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.sort-btn.active { border-color: var(--cyan); color: var(--cyan); }

/* --- Grid & cards --- */

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

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: var(--violet-deep);
  box-shadow: 0 0 22px rgba(124, 58, 237, 0.28);
}

.card .cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: #1b1728;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.card .stock-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--magenta);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  min-width: 1.4rem;
  text-align: center;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(255, 61, 154, 0.5);
}

.card.soldout .stock-badge {
  background: #4a4459;
  box-shadow: none;
}

.card.soldout .cover { filter: grayscale(0.6) brightness(0.5); }

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(11, 10, 20, 0.72);
  border: 1px solid rgba(169, 112, 255, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.12s ease, transform 0.12s ease;
}

.play-button:hover {
  background: var(--violet-deep);
  transform: translate(-50%, -50%) scale(1.08);
}

/* --- Fenetre bande-annonce --- */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 12, 0.82);
  backdrop-filter: blur(2px);
}

.video-modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--violet-deep);
  border-radius: 12px;
  padding: 1rem;
  width: 100%;
  max-width: 860px;
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.35);
}

.video-modal-content h3 {
  margin: 0 0 0.7rem;
  color: var(--violet);
  padding-right: 2rem;
}

.video-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.video-modal-close:hover { color: var(--text); }

.video-modal-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.video-modal-embed iframe,
.video-modal-embed video {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal-embed .fallback-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--cyan);
}

.card .info { padding: 0.6rem 0.8rem 0.8rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }

.card .title { font-weight: 700; color: var(--violet); font-size: 0.95rem; line-height: 1.2; }

.card .category-tag {
  align-self: flex-start;
  background: #241e38;
  color: var(--text-dim);
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card .cost {
  font-weight: 700;
  color: var(--cyan);
}

.card .cost .unit { color: var(--text-dim); font-weight: 400; font-size: 0.75rem; }

.card.soldout .cost { color: var(--text-dim); }

.buy-btn {
  margin-top: auto;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  color: #fff;
  transition: filter 0.12s ease, opacity 0.12s ease;
}

.buy-btn:hover:not(:disabled) { filter: brightness(1.12); }

.buy-btn:disabled {
  cursor: not-allowed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.buy-btn.insufficient {
  background: #241e38;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
}

.buy-btn.insufficient:hover { color: var(--cyan); border-color: var(--cyan); }

.balance-chip {
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.empty-msg { color: var(--text-dim); margin-top: 2rem; }

/* --- Mes cles --- */

.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.key-row .key-game { font-weight: 700; color: var(--violet); }

.key-row .key-date { color: var(--text-dim); font-size: 0.8rem; }

.key-row .key-value {
  font-family: "Courier New", monospace;
  background: #0b0a14;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  letter-spacing: 0.03em;
  color: var(--cyan);
}

/* --- Onglets reseaux sociaux --- */

.social-description {
  color: var(--text-dim);
  max-width: 640px;
  line-height: 1.5;
  margin-bottom: 1.2rem;
  white-space: pre-line;
}

.youtube-embed-wrap {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.youtube-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.social-card {
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.social-card-image {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.social-card h2 {
  margin: 0;
  color: var(--violet);
  font-size: 1.2rem;
}

.social-card .social-description { margin-bottom: 0.4rem; }

.social-card .btn-twitch {
  align-self: flex-start;
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.6rem 2rem 2.2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.6;
}

.site-footer p { margin: 0.25rem auto; max-width: 720px; }

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--violet-deep);
  color: var(--text);
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 20;
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.35);
}
