:root {
  --bg: #050607;
  --bg-elevated: rgba(15, 16, 20, 0.96);
  --fg: #f5f5f5;
  --muted: #8f95a3;
  --accent: #f5b300;
  --accent-soft: rgba(245, 179, 0, 0.15);
  --accent-2: #22c55e;
  --accent-3: #f97316;
  --border-subtle: rgba(255, 255, 255, 0.04);
  --blur-lg: 28px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.6);
  --transition-fast: 160ms cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition-med: 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Reset */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", sans-serif;
  background: radial-gradient(circle at top, #14151a 0, #050607 45%, #000 100%);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* pas de scroll plein écran */
}

/* Background */

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

.blob {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(32px);
  opacity: 0.7;
  mix-blend-mode: screen;
}

.blob-1 {
  top: -80px;
  left: -80px;
  background: radial-gradient(circle at 30% 30%, #f97316, #451a03);
}

.blob-2 {
  bottom: -120px;
  right: -60px;
  background: radial-gradient(circle at 70% 40%, #22c55e, #052e16);
}

.blob-3 {
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 50%, #facc15, #3b2600);
  opacity: 0.35;
}

.grain {
  position: absolute;
  inset: -40px;
  background-image: url("https://grainy-gradients.vercel.app/noise.svg");
  mix-blend-mode: soft-light;
  opacity: 0.75;
}

/* Shell */

.shell {
  position: relative;
  z-index: 1;
  margin: 10px;
  border-radius: 24px;
  background: radial-gradient(circle at top left, #111827, #020617 52%, #000 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.85);
  padding: 14px 14px 10px;
  width: min(960px, 100%);
  height: min(620px, 100vh - 20px); /* plein écran mobile dans l’iframe */
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(22px);
}

/* Hero */

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
}

.hero-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-orb {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: conic-gradient(
    from 210deg,
    #f97316,
    #facc15,
    #22c55e,
    #f97316,
    #f97316
  );
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 4px rgba(250, 204, 21, 0.25),
    0 12px 22px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}

.logo-orb::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: radial-gradient(circle at 25% 10%, #fff7ed, #111827 58%);
  opacity: 0.5;
}

.logo-orb-core {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #f9fafb, #f97316);
  box-shadow:
    0 0 18px rgba(249, 115, 22, 0.9),
    0 0 40px rgba(250, 204, 21, 0.8);
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.25ch;
}

.title span:first-child {
  font-weight: 650;
}

.title-sub {
  font-weight: 500;
  color: var(--accent);
}

.subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.pill {
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-pill {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(22, 163, 74, 0.07);
}

.live-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.count-pill {
  color: var(--muted);
}

/* Grid */

.grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 0 6px;
  overflow: hidden;
}

/* Card */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 10px 9px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.92)
  );
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.72);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-fast),
    background var(--transition-med),
    outline-color var(--transition-fast);
  outline: 1px solid transparent;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(
    circle at top,
    rgba(250, 204, 21, 0.25),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 220ms ease-out;
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.tag {
  font-size: 0.62rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.tag-legacy {
  border-color: rgba(148, 163, 184, 0.45);
}

.tag-minecraft {
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
  background: radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.18), transparent);
}

.tag-ui {
  border-color: rgba(234, 179, 8, 0.5);
  color: #eab308;
}

.tag-school {
  border-color: rgba(96, 165, 250, 0.5);
  color: #bfdbfe;
}

.tag-tool {
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
}

.tag-fun {
  border-color: rgba(244, 114, 182, 0.5);
  color: #f472b6;
}

.tag-social {
  border-color: rgba(129, 140, 248, 0.6);
  color: #c7d2fe;
}

.tag-game {
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.tag-portal {
  border-color: rgba(45, 212, 191, 0.55);
  color: #a5f3fc;
}

.tag-special {
  border-color: rgba(250, 204, 21, 0.6);
  color: #fed7aa;
}

.tag-audio {
  border-color: rgba(94, 234, 212, 0.6);
  color: #a5f3fc;
}

.accent-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #f9fafb, var(--accent));
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.95);
  opacity: 0.5;
}

.card-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.card-desc {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
}

.card-link {
  margin-top: 3px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: rgba(248, 250, 252, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-link::after {
  content: "↗";
  font-size: 0.7rem;
  transform: translateY(-0.5px);
}

/* Card interactions */

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.26);
  outline-color: rgba(250, 204, 21, 0.6);
  background: linear-gradient(
      135deg,
      rgba(250, 204, 21, 0.04),
      transparent 40%
    ),
    linear-gradient(135deg, #020617, #020617);
}

.card:hover::before,
.card:focus-visible::before {
  opacity: 1;
}

.card:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.85);
}

/* Footer */

.footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.view-toggle {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  color: var(--muted);
  font-size: 0.68rem;
  padding: 4px 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  outline: none;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.view-toggle::before {
  content: "▦";
  font-size: 0.68rem;
}

.view-toggle:hover {
  background: rgba(30, 64, 175, 0.1);
  border-color: rgba(250, 204, 21, 0.5);
  color: var(--fg);
  transform: translateY(-1px);
}

.view-toggle:active {
  transform: translateY(0);
}

/* Compact mode */

.shell.compact .grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.shell.compact .card {
  padding: 8px 8px 7px;
  gap: 3px;
}

.shell.compact .card-desc {
  display: none;
}

/* Responsiveness */

@media (max-width: 900px) {
  .shell {
    border-radius: 20px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shell.compact .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    padding: 0;
  }

  .shell {
    margin: 6px;
    height: calc(100vh - 12px);
    padding: 10px 10px 8px;
  }

  .hero {
    align-items: flex-start;
  }

  .hero-main {
    gap: 8px;
  }

  .logo-orb {
    width: 40px;
    height: 40px;
  }

  .logo-orb-core {
    width: 16px;
    height: 16px;
  }

  .title {
    font-size: 1.25rem;
  }

  .subtitle {
    font-size: 0.7rem;
  }

  .hero-meta {
    display: none;
  }

  .grid {
    padding-top: 6px;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shell.compact .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: 8px 8px 7px;
  }

  .card-title {
    font-size: 0.78rem;
  }

  .card-desc {
    font-size: 0.66rem;
  }

  .footer {
    padding-top: 2px;
  }
}