/* Joy — thème « gamer » : fond nuit, néons violet / cyan / magenta, titres façon HUD. */

:root {
  color-scheme: dark;
  --bg: #07080f;
  --panel: #10131f;
  --panel-2: #1a1f33;
  --line: #272d49;
  --text: #eef0fa;
  --muted: #9aa2c2;
  --accent: #9d8cff;
  --cyan: #6ee7ff;
  --pink: #ff5fd2;
  --gold: #ffd21f;
  --danger: #ff4d5e;
  --p1: #5ad1ff;
  --p2: #ffb454;
  --ok: #5fd38d;
  --neon: linear-gradient(135deg, #7df9ff 0%, #9d8cff 52%, #ff6bd6 100%);
  --display: "Bahnschrift", "DIN Alternate", "Avenir Next Condensed", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --glass: rgba(14, 17, 29, 0.74);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  background: var(--bg);
  scrollbar-color: #343b60 transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--body);
  line-height: 1.5;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* Le décor : trois halos de néon et une grille qui s'efface vers le bas. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    radial-gradient(60vw 55vh at 10% -10%, rgba(139, 92, 246, 0.26), transparent 70%),
    radial-gradient(50vw 45vh at 98% -5%, rgba(255, 79, 216, 0.16), transparent 70%),
    radial-gradient(70vw 50vh at 50% 112%, rgba(94, 231, 255, 0.12), transparent 70%);
}
body::after {
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: radial-gradient(120% 75% at 50% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(120% 75% at 50% 0%, #000 10%, transparent 75%);
}

::selection { background: rgba(157, 140, 255, 0.45); color: #fff; }

button { font: inherit; color: inherit; cursor: pointer; }

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

h1, h2 { font-family: var(--display); text-wrap: balance; }

#app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
#app:has(> .topbar) { max-width: 940px; }

/* ---------- En-tête ---------- */

.hub-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin: 4px 0 14px;
  padding: 22px 26px;
  border-radius: 24px;
  border: 1px solid rgba(157, 140, 255, 0.32);
  background:
    linear-gradient(120deg, rgba(157, 140, 255, 0.2), rgba(255, 95, 210, 0.07) 48%, rgba(110, 231, 255, 0.1)),
    var(--panel);
  box-shadow: 0 24px 60px -34px rgba(139, 92, 246, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.hub-head::before { /* bandes obliques, comme sur une jaquette */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255, 255, 255, 0.028) 22px 24px);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
  mask-image: linear-gradient(90deg, transparent 30%, #000);
  pointer-events: none;
}
.hub-head::after { /* liseré lumineux en bas */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--accent), var(--pink), transparent);
  opacity: 0.8;
}
.hub-head > * { position: relative; }
.hub-head .logo {
  width: 76px;
  height: 76px;
  flex: none;
  filter: drop-shadow(0 0 20px rgba(157, 140, 255, 0.65));
  animation: logo-float 5s ease-in-out infinite;
}
@keyframes logo-float { 50% { transform: translateY(-4px) rotate(-4deg); } }
.hub-title { flex: 1; min-width: 200px; }
.hub-head h1 {
  margin: 0;
  width: fit-content;
  font-size: clamp(2.2rem, 7vw, 3.3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--neon);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(157, 140, 255, 0.45));
}
.hub-head p { margin: 8px 0 0; color: var(--muted); text-wrap: balance; }
.hub-side { display: flex; align-items: center; gap: 10px; }
.logo-mini { width: 22px; height: 22px; vertical-align: -5px; margin-right: 6px; }

.coins {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 31, 0.5);
  background: rgba(255, 210, 31, 0.1);
  color: #ffe27a;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 0 22px -6px rgba(255, 210, 31, 0.6), inset 0 0 12px rgba(255, 210, 31, 0.08);
}

/* ---------- Onglets ---------- */

.tabs {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: 0 14px 34px -20px #000;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tab[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, rgba(157, 140, 255, 0.34), rgba(255, 95, 210, 0.2));
  box-shadow: inset 0 0 0 1px rgba(157, 140, 255, 0.6), 0 0 20px -4px rgba(157, 140, 255, 0.55);
}
.tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 10px var(--pink);
  animation: dot-pulse 1.6s ease-in-out infinite;
}
@keyframes dot-pulse { 50% { transform: scale(1.5); opacity: 0.55; } }

.lang {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}
.lang:hover { border-color: var(--accent); }

/* ---------- Textes, titres, champs ---------- */

.shop-note { margin: 0 0 18px; max-width: 78ch; color: var(--muted); font-size: 0.95rem; }
.shop-title,
.comments h2,
.bb-guide-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.shop-title::before,
.comments h2::before,
.bb-guide-title::before {
  content: "";
  flex: none;
  width: 4px;
  height: 1.05em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--accent), var(--pink));
  box-shadow: 0 0 10px rgba(157, 140, 255, 0.8);
}
.shop-title { margin: 34px 0 14px; }

.profile-name input,
.code-row input,
.comment-form textarea {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 8, 15, 0.65);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.profile-name input:focus,
.code-row input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(157, 140, 255, 0.25);
}
input::placeholder, textarea::placeholder { color: #666e90; }
.profile-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 320px;
  margin-bottom: 16px;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--muted);
}
.profile-name input { font-family: var(--body); font-size: 1rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.code-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.code-row input { flex: 1; min-width: 200px; }
.code-row input[readonly] { font-family: var(--mono); font-size: 0.85rem; color: var(--cyan); }

/* ---------- Boutons ---------- */

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 22px;
  background: var(--neon);
  color: #0b1020;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 8px 22px -10px rgba(157, 140, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(157, 140, 255, 1), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled,
.btn:disabled:hover {
  background: var(--panel-2);
  color: var(--muted);
  cursor: default;
  filter: none;
  transform: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn.danger { background: linear-gradient(135deg, #ff7a6b, var(--danger)); color: #fff; box-shadow: 0 8px 22px -10px rgba(255, 77, 94, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3); }

.back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.back:hover { color: var(--text); border-color: var(--accent); box-shadow: 0 0 16px -4px rgba(157, 140, 255, 0.7); }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
}
.seg {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.seg:hover { color: var(--text); }
.seg[aria-pressed="true"] { background: var(--neon); color: #0b1020; font-weight: 600; box-shadow: 0 0 16px -4px rgba(157, 140, 255, 0.9); }
.seg:disabled { color: var(--muted); cursor: default; opacity: 0.6; }

.fusion-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.fusion-pick { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text); }
.fusion-pick:hover:not(:disabled) { border-color: var(--accent); background: rgba(157, 140, 255, 0.14); }
.fusion-pick[aria-pressed="true"] { border-color: transparent; }

.hud { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pill {
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}
.pill.p1 { color: var(--p1); }
.pill.p2 { color: var(--p2); }
.pill.active { border-color: currentColor; background: var(--panel-2); font-weight: 600; box-shadow: 0 0 16px -6px currentColor; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-size: 0.74rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- Cartes (jeux, succès, couleurs, coffres) ---------- */

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

.game-card {
  --c: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 45%), var(--panel);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 16px 34px -26px #000;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
/* Chaque carte a sa couleur de néon. */
.hub-grid > .game-card:nth-child(5n + 1) { --c: #6ee7ff; }
.hub-grid > .game-card:nth-child(5n + 2) { --c: #9d8cff; }
.hub-grid > .game-card:nth-child(5n + 3) { --c: #ff6bd6; }
.hub-grid > .game-card:nth-child(5n + 4) { --c: #ffb454; }
.hub-grid > .game-card:nth-child(5n + 5) { --c: #5fd38d; }
.game-card::before { /* liseré de couleur en haut de la carte */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c), transparent 85%);
  opacity: 0.85;
}
a.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--c);
  box-shadow: 0 22px 44px -22px var(--c), 0 0 0 1px var(--c);
}
a.game-card:not(.is-mystery)::after { /* le bouton « jouer » qui apparaît au survol */
  content: "▶";
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding-left: 2px;
  border-radius: 50%;
  background: var(--c);
  color: #0b1020;
  font-size: 0.8rem;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 0 22px -2px var(--c);
}
a.game-card:not(.is-mystery):hover::after { opacity: 1; transform: scale(1); }
.game-card .icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 4px;
  border-radius: 18px;
  font-size: 2.2rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.05);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--c) 40%, transparent);
  box-shadow: inset 0 0 20px color-mix(in srgb, var(--c) 22%, transparent);
}
.game-card h2 { margin: 6px 0 0; font-size: 1.3rem; font-weight: 700; letter-spacing: 0.03em; }
.game-card p { margin: 0; color: var(--muted); font-size: 0.95rem; flex: 1; }

.game-card.is-mystery {
  align-items: center;
  text-align: center;
  border-style: dashed;
  border-color: #3a4168;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 12px, transparent 12px 24px), var(--panel);
}
.game-card.is-mystery::before { display: none; }
.game-card.is-mystery .mystery { width: 96px; height: 96px; }
.mystery { filter: drop-shadow(0 0 14px rgba(157, 140, 255, 0.6)); }

.shop-card { align-items: flex-start; }
.shop-card.is-on { --c: var(--ok); border-color: var(--ok); box-shadow: 0 0 26px -12px var(--ok), 0 16px 34px -26px #000; }
.shop-card.is-todo .icon { opacity: 0.5; filter: grayscale(0.6); }
.shop-card .btn { margin-top: 10px; }
.shop-got { color: var(--ok); border-color: rgba(95, 211, 141, 0.45); background: rgba(95, 211, 141, 0.1); }
.shop-on { margin-top: 10px; padding: 9px 16px; font-size: 0.9rem; color: var(--ok); border-color: rgba(95, 211, 141, 0.45); background: rgba(95, 211, 141, 0.1); }
.shop-ball {
  position: relative;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  border: 3px solid #15171b;
  /* les deux yeux */
  background-image: radial-gradient(circle at 33% 38%, #15171b 4px, transparent 5px),
    radial-gradient(circle at 67% 38%, #15171b 4px, transparent 5px);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 8px 22px -8px rgba(0, 0, 0, 0.8);
}
.shop-ball::after { /* le sourire */
  content: "";
  position: absolute;
  left: 26%;
  right: 26%;
  top: 46%;
  height: 26%;
  border: 3px solid #15171b;
  border-top: 0;
  border-radius: 0 0 999px 999px;
}

.ratings { margin-top: 8px; }
.rating { font-size: 0.85rem; color: var(--muted); }
.rating strong { font-weight: 600; color: var(--text); }
/* Sur les cartes : le nom de la note au-dessus, les étoiles et le détail sur une ligne. */
.game-card .ratings { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.game-card .rating strong {
  display: block;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.rate-box { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rate-lines .rating:last-child { display: none; } /* ma note est déjà au-dessus, sur les boutons */
.stars { color: var(--gold); letter-spacing: 1px; text-shadow: 0 0 10px rgba(255, 210, 31, 0.55); }
.stars.off { color: #343b5e; text-shadow: none; }
.rate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 22px;
  padding: 10px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--muted);
  font-size: 0.9rem;
}
.rate-title { font-family: var(--display); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text); }
.rate-stars { display: flex; align-items: center; gap: 2px; }
.rate-zero { border: 1px solid var(--line); margin-right: 8px; font-size: 0.85rem; }
.rate-zero[aria-pressed="true"] { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: none; }
.rate-star { border: 0; background: transparent; padding: 2px 4px; font-size: 1.6rem; line-height: 1; color: #343b5e; transition: transform 0.12s ease, color 0.12s ease; }
.rate-star:hover { color: var(--muted); transform: scale(1.2); }
.rate-star.is-on { color: var(--gold); text-shadow: 0 0 14px rgba(255, 210, 31, 0.7); }

/* ---------- Panneaux (Gacha, Fusion, cartes de joueur, offres) ---------- */

.gacha {
  --g: 157, 140, 255;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px;
  border-radius: 22px;
  background: radial-gradient(120% 150% at 0% 0%, rgba(var(--g), 0.2), transparent 58%), var(--panel);
  border: 1px solid rgba(var(--g), 0.5);
  box-shadow: 0 22px 50px -32px rgba(var(--g), 1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.gacha > .mystery { width: 96px; height: 96px; flex: none; }
.gacha-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.gacha h2 { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.gacha p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.gacha .gacha-prize, .gacha-prize { min-height: 1.5em; color: var(--ok); font-weight: 600; }
.fusion { --g: 255, 180, 84; margin-top: 16px; }
.fusion-icon {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 22px;
  font-size: 3.2rem;
  line-height: 1;
  background: rgba(var(--g, 157, 140, 255), 0.12);
  border: 1px solid rgba(var(--g, 157, 140, 255), 0.35);
  box-shadow: inset 0 0 26px rgba(var(--g, 157, 140, 255), 0.2);
}
@media (max-width: 480px) {
  .gacha { flex-direction: column; text-align: center; }
  .gacha-body { align-items: center; }
}

.friends { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.profile-links { margin-top: 20px; }
.profile-links a { color: var(--cyan); }
.profile-card { align-items: flex-start; }
.profile-card .shop-ball { flex: none; }
.profile-card h2 { text-transform: none; letter-spacing: 0.02em; }
.profile-records { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.95rem; }
.profile-records li { margin: 3px 0; }
.profile-records li::marker { color: var(--accent); }
.profile-records strong { color: var(--text); }

.ladder { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ladder-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.ladder-row.is-me {
  border-color: rgba(157, 140, 255, 0.7);
  background: linear-gradient(90deg, rgba(157, 140, 255, 0.22), transparent 70%), var(--panel);
  box-shadow: 0 0 24px -12px var(--accent);
}
.ladder-rank { width: 2em; text-align: center; font-family: var(--display); font-size: 1.15rem; font-weight: 700; }
.ladder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ladder-score { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Rangées de boutons ---------- */

.dev-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-state { justify-content: flex-start; margin-bottom: 8px; }

/* ---------- Messages ---------- */

.toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 14px;
  background: rgba(16, 20, 34, 0.92);
  border: 1px solid var(--ok);
  font-weight: 600;
  text-align: center;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 26px -8px var(--ok);
  animation: toast-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.95); } }

/* ---------- Commentaires ---------- */

.comments { max-width: 560px; margin: 30px auto 0; }
.comments h2 { margin: 0 0 12px; font-size: 1rem; }
.comment-form { display: flex; align-items: flex-end; gap: 8px; }
.comment-form textarea { flex: 1; min-width: 0; resize: vertical; }
.comment-list { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.comment { padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.comment-head { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--muted); }
.comment-head strong { color: var(--text); }
.comment-remove { margin-left: auto; border: 0; background: transparent; color: var(--muted); padding: 2px 6px; border-radius: 8px; }
.comment-remove:hover { background: var(--danger); color: #fff; }
.comment p { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.comment-empty { margin: 12px 0 0; color: var(--muted); font-size: 0.9rem; }

/* ---------- Écran de jeu ---------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 16px;
}
.topbar h1 { margin: 0; font-size: 1.4rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; flex: 1; min-width: 0; }

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.help {
  margin: 18px auto 0;
  max-width: 520px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  min-height: 84px;
}
.result strong { font-family: var(--display); font-size: 1.25rem; letter-spacing: 0.04em; }
.result .note { color: var(--ok); }

/* Les écrans de jeu : un cadre lumineux, comme une borne d'arcade. */
.mt-wrap, .pf-wrap, .g3-wrap, .bb-screen {
  border: 1px solid rgba(157, 140, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(157, 140, 255, 0.08), 0 26px 70px -28px rgba(139, 92, 246, 0.95);
}

/* ---------- Météores ---------- */

.mt-wrap {
  position: relative;
  width: min(100%, 420px, calc((100dvh - 290px) * 0.75));
  min-width: 240px;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
}
.mt-canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  background: rgba(7, 8, 15, 0.82);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }
.overlay h2 { margin: 0; font-size: 1.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.overlay p { margin: 0; color: var(--muted); }

.pads {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: min(100%, 420px);
}
.pad-group { display: flex; gap: 8px; }
.pad {
  width: 64px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1c2136, var(--panel));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 0 #05060b;
  font-size: 1.3rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.pad.p1 { color: var(--p1); }
.pad.p2 { color: var(--p2); }
.pad:active, .pad.is-down {
  background: var(--panel-2);
  border-color: currentColor;
  box-shadow: 0 0 18px -4px currentColor, 0 1px 0 #05060b;
  transform: translateY(3px);
}

/* ---------- L'Aventure de Joy ---------- */

.pf-wrap {
  position: relative;
  width: min(100%, 720px, max(300px, calc((100dvh - 250px) * 16 / 9)));
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
}
.pf-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.pad.jump { width: auto; min-width: 64px; padding: 0 18px; font-size: 1rem; font-weight: 600; }
.pads.compact .pad-group { gap: 4px; }
.pads.compact .pad { width: 48px; min-width: 0; padding: 0; font-size: 1.1rem; }

/* ---------- Joy 3D ---------- */

.g3-wrap {
  position: relative;
  width: min(100%, 800px, max(300px, calc((100dvh - 250px) * 16 / 9)));
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #9fd6ff;
}
.g3-canvas { display: block; width: 100%; height: 100%; touch-action: none; }

@media (max-width: 600px) and (orientation: portrait) {
  .g3-wrap { width: 100%; aspect-ratio: 1 / 1; }
}

.stick {
  position: relative;
  width: 112px;
  height: 112px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle, #1c2136, var(--panel));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.6);
  touch-action: none;
}
.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: var(--p1);
  box-shadow: 0 0 18px -2px var(--p1);
  pointer-events: none;
}
.pad.big { height: 84px; min-width: 104px; border-radius: 42px; }
.stick-knob.p2 { background: var(--p2); box-shadow: 0 0 18px -2px var(--p2); }

/* Écran partagé à deux joueurs */
.g3-wrap .overlay { z-index: 2; }
.g3-wrap.split-v::after,
.g3-wrap.split-h::after {
  content: "";
  position: absolute;
  background: var(--bg);
  pointer-events: none;
}
.g3-wrap.split-v::after { top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; }
.g3-wrap.split-h::after { left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; }
.g3-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(14, 18, 32, 0.75);
  font-size: 0.8rem;
  font-weight: 700;
  pointer-events: none;
}
.g3-tag.t1 { color: var(--p1); }
.g3-tag.t2 { color: var(--p2); }
.g3-wrap.split-v .g3-tag.t2 { left: calc(50% + 10px); }
.g3-wrap.split-h .g3-tag.t2 { top: calc(50% + 10px); }

@media (max-width: 600px) and (orientation: portrait) {
  .g3-wrap.duo { aspect-ratio: 4 / 5; }
}

.pads.duo .pad-group { align-items: center; gap: 6px; }
.pads.duo .stick { width: 84px; height: 84px; }
.pads.duo .stick-knob { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
.pads.duo .pad.big { width: 58px; min-width: 0; height: 58px; padding: 0; border-radius: 50%; font-size: 1.2rem; }

/* ---------- Block Boy ---------- */

.bb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.bb-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bb-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 150px;
  padding: 9px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent), var(--panel);
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.bb-mode:hover { border-color: var(--accent); box-shadow: 0 0 20px -8px var(--accent); transform: translateY(-2px); }
.bb-mode span { color: var(--muted); font-size: 0.82rem; }
.bb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(100%, 900px, max(300px, calc((100dvh - 320px) * 16 / 9)));
}
.bb-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #15171b;
}
.bb-stage:fullscreen { width: 100%; height: 100%; background: #000; }
.bb-stage:fullscreen .bb-screen { height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; background: #000; box-shadow: none; }
.bb-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: none;
  outline: none;
}
#bb-full[hidden] { display: none; }
#bb-full {
  position: absolute;
  top: 8px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: rgba(21, 23, 27, 0.6);
}
#bb-full:hover { background: rgba(21, 23, 27, 0.8); }
.bb-hint { margin: 0; max-width: 900px; text-align: center; color: var(--muted); font-size: 0.85rem; }
.bb-guide-title { margin: 8px 0 0; font-size: 1rem; }
.bb-bar .back { background: transparent; }
.bb-pads { align-items: flex-end; width: min(100%, 520px); }
.bb-side { display: flex; flex-direction: column; gap: 8px; width: 150px; flex: none; }
.bb-utils { display: flex; gap: 6px; }
.bb-utils .bb-pad { flex: 1; width: auto; height: 36px; border-radius: 10px; font-size: 1rem; }
.bb-dpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bb-acts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.bb-pad { width: auto; height: 50px; padding: 0; font-size: 1.15rem; color: var(--text); }
.bb-pad.bb-up { grid-column: 2; }
.bb-pad.bb-up + .bb-pad { grid-column: 1; }
.bb-pad.bb-jump { grid-column: 1 / -1; font-size: 0.95rem; font-weight: 600; color: var(--p1); }
.bb:not(.playing) .bb-pads { display: none; }
.bb-hint-touch { display: none; }
.bb-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px 18px;
  width: min(100%, 900px);
}
.bb-block { display: flex; align-items: center; gap: 10px; }
.bb-block canvas, .bb-block img { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.bb-block strong { display: block; font-size: 0.95rem; }
.bb-block span { color: var(--muted); font-size: 0.85rem; }

@media (hover: hover) and (pointer: fine) {
  .pads { display: none; }
}

/* ---------- Écrans tactiles ---------- */

@media (pointer: coarse) {
  a.game-card:hover { transform: none; border-color: var(--line); box-shadow: 0 16px 34px -26px #000; }
  a.game-card.is-mystery:hover { border-color: #3a4168; }
  a.game-card:not(.is-mystery)::after { opacity: 0.9; transform: none; }
  .pr-card:hover { transform: none; }
  .bb-hint-touch { display: block; }
  .bb.playing .bb-modes { display: none; } /* toute la place pour le jeu ; « Quitter » du menu pause les ramène */
}

/* Les boutons tactiles posés par-dessus le jeu, dans les coins du bas. */
.bb-stage:fullscreen .pads {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 4;
  width: auto;
  opacity: 0.72;
  pointer-events: none;
}
.bb-stage:fullscreen .pads > * { pointer-events: auto; }

/* Petits écrans : l'en-tête se resserre, les onglets défilent sur une ligne. */
@media (max-width: 700px) {
  .hub-head { padding: 16px 18px; border-radius: 20px; gap: 12px 14px; }
  .hub-head .logo { width: 56px; height: 56px; }
  .hub-title { min-width: 0; }
  .hub-side { width: 100%; justify-content: space-between; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; top: 6px; margin-bottom: 18px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; }
  .game-card { padding: 18px; }
}

/* Téléphone tenu à l'horizontale : le jeu prend toute la hauteur, les boutons passent par-dessus. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 540px) {
  #app, #app:has(> .topbar) {
    max-width: none;
    padding: 6px max(10px, env(safe-area-inset-right)) 12px max(10px, env(safe-area-inset-left));
  }
  .topbar { margin-bottom: 6px; gap: 6px 10px; }
  .topbar h1 { font-size: 1rem; }
  .back { padding: 2px 10px; font-size: 0.9rem; }
  .seg { padding: 2px 12px; font-size: 0.9rem; }
  .stage { position: relative; gap: 6px; }
  .pill { padding: 2px 10px; font-size: 0.8rem; }

  .pf-wrap, .g3-wrap { width: min(100%, calc((100dvh - 56px) * 16 / 9)); }
  .mt-wrap { width: calc((100dvh - 90px) * 0.75); min-width: 180px; }
  .pr-grid, .cq-board { width: min(100%, max(240px, calc(100dvh - 96px))); }
  .result { min-height: 0; }
  .bb { gap: 6px; }
  .bb.playing .bb-stage { width: min(100%, calc((100dvh - 56px) * 16 / 9)); }

  /* Le score se pose en haut de l'image. */
  .game-aventure .hud, .game-joy3d .hud {
    position: absolute;
    top: 6px;
    left: 50%;
    z-index: 3;
    transform: translateX(-50%);
    flex-wrap: nowrap;
    white-space: nowrap;
    opacity: 0.9;
    pointer-events: none;
  }

  .pads {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 4;
    width: auto;
    opacity: 0.72;
    pointer-events: none;
  }
  .pads > * { pointer-events: auto; }
}

/* ---------- Paires ---------- */

.pr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: min(100%, 440px, calc(100dvh - 300px));
  min-width: 240px;
}
.pr-card {
  aspect-ratio: 1;
  padding: 0;
  border-radius: 14px;
  border: 1px solid #343b66;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 6px, transparent 6px 12px),
    linear-gradient(135deg, #2a2f5c, #1b1f3d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 14px -8px #000;
  font-size: clamp(1.5rem, 8vw, 2.5rem);
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pr-card:hover { transform: scale(1.04); border-color: var(--accent); }
.pr-card .face {
  display: inline-block;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pr-card.is-open, .pr-card.is-found { background: #2e3a66; }
.pr-card.is-open { border-color: var(--cyan); box-shadow: 0 0 20px -6px var(--cyan); }
.pr-card.is-open .face, .pr-card.is-found .face { opacity: 1; transform: scale(1); }
.pr-card.is-found { border-color: var(--ok); opacity: 0.75; box-shadow: 0 0 18px -8px var(--ok); }

/* ---------- Cinq d'affilée ---------- */

.cq-board {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  width: min(100%, 520px, calc(100dvh - 300px));
  min-width: 260px;
  aspect-ratio: 1;
  padding: 6px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d6b47a, #bb9558);
  box-shadow: 0 0 0 4px rgba(157, 140, 255, 0.08), 0 26px 60px -28px rgba(0, 0, 0, 0.9), inset 0 0 0 2px rgba(107, 81, 39, 0.5);
}
.cq-cell {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(#6b5127, #6b5127) center / 100% 1px no-repeat,
    linear-gradient(#6b5127, #6b5127) center / 1px 100% no-repeat;
}
.cq-cell::after {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.15s ease;
}
.cq-cell.s1::after { transform: scale(1); background: radial-gradient(circle at 35% 30%, #555, #0c0c0c 70%); }
.cq-cell.s2::after { transform: scale(1); background: radial-gradient(circle at 35% 30%, #fff, #cfcfcf 75%); }
.cq-cell.last::after { box-shadow: 0 0 0 2px #e5484d; }
.cq-cell.win::after { box-shadow: 0 0 0 3px var(--ok); }

.dot {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  vertical-align: -0.05em;
  margin-right: 6px;
  border: 1px solid #888;
}
.dot.s1 { background: #111; }
.dot.s2 { background: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .hub-head .logo, .tab-dot, .toast { animation: none; }
}

/* ---------- Slop (Game Engine) ---------- */
.slop-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  max-width: 620px;
  margin: 14px auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.slop-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--panel);
  font-size: clamp(0.85rem, 4.4vw, 1.7rem);
  line-height: 1;
  overflow: hidden;
}
.slop-cell.is-wall { background: var(--line); }
.slop-cell.is-closed { opacity: 0.45; }
/* un jeu codé, dans son cadre isolé */
.slop-code-holder { max-width: 640px; margin: 14px auto; }
.slop-code-frame { display: block; width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.slop-code-load { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.slop-code-load select, .slop-code-load input { font: inherit; color: var(--text, inherit); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; max-width: 100%; }
.slop-code-load input { flex: 1 1 220px; }
.slop-code-source { max-width: 640px; margin: 10px auto; color: var(--muted); font-size: 0.85rem; }
.slop-code-source pre { max-height: 360px; overflow: auto; padding: 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-size: 0.78rem; white-space: pre; }
/* une case habillée par un sprite du joueur, et la grille posée sur son décor de fond */
.slop-cell.has-skin { background-size: contain; background-repeat: no-repeat; background-position: center; image-rendering: pixelated; }
.slop-grid.has-bg { background-size: cover; background-position: center; border-radius: 6px; }
.slop-grid.has-bg .slop-cell { background-color: transparent; }
.slop-grid.has-bg .slop-cell.is-wall { background-color: rgba(10, 12, 24, 0.72); }
.slop-skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; margin: 8px 0 14px; }
.slop-skin { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.slop-skin select { font: inherit; color: var(--text, inherit); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 100%; }
.slop-skin select:disabled { opacity: 0.45; }
.slop-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.slop-status { min-height: 1.5em; margin: 8px 0; text-align: center; color: var(--ok); font-weight: 600; }
.slop-card .dev-actions { margin-top: 10px; }

/* ---------- Cinématiques (Gacha, Fusion) ---------- */
.cine {
  --glow: #7c9cff;
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #1f1a52 0%, #04050b 70%);
  cursor: pointer;
  animation: cine-in 0.25s ease-out;
}
.cine-rays {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 170vmax;
  height: 170vmax;
  margin: -85vmax 0 0 -85vmax;
  background: repeating-conic-gradient(var(--glow) 0 5deg, transparent 5deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 55%);
  mask-image: radial-gradient(circle, #000 0, transparent 55%);
  opacity: 0.22;
  pointer-events: none;
  animation: cine-spin 10s linear infinite, cine-rays-in 1.8s ease-in;
}
.cine.is-reveal .cine-rays { opacity: 0.45; }
.cine-stage { position: relative; width: 240px; min-height: 240px; display: grid; place-items: center; }
.cine-box {
  width: 128px;
  height: 128px;
  animation: cine-shake 0.32s ease-in-out infinite, cine-charge 1.9s ease-in forwards;
}
.cine-a, .cine-b, .cine-core { position: absolute; font-size: 4rem; line-height: 1; }
.cine-a { animation: cine-merge-a 2.1s ease-in forwards; }
.cine-b { animation: cine-merge-b 2.1s ease-in forwards; }
.cine-core { font-size: 3rem; animation: cine-core 2.1s ease-in forwards; }
.cine.is-reveal .cine-box, .cine.is-reveal .cine-a, .cine.is-reveal .cine-b, .cine.is-reveal .cine-core { display: none; }
.cine-prize { display: none; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cine.is-reveal .cine-prize { display: flex; animation: cine-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.cine-prize strong {
  font-family: var(--display);
  font-size: 2.2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--glow);
  text-shadow: 0 0 24px var(--glow);
}
.cine-prize span:last-child { color: var(--text); font-weight: 600; }
.cine-icon { font-size: 6rem; line-height: 1; filter: drop-shadow(0 0 30px var(--glow)); }
.cine-ball { transform: scale(1.7); margin: 28px; box-shadow: 0 0 40px var(--glow); }
.cine-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cine.is-reveal .cine-flash { animation: cine-flash 0.7s ease-out; }
.cine-skip { position: relative; margin: 0; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; }
.cine.is-reveal .cine-skip { display: none; }
.cine-close { position: relative; display: none; }
.cine.is-reveal .cine-close { display: inline-block; animation: cine-in 0.5s 0.3s both; }

@keyframes cine-in { from { opacity: 0; } }
@keyframes cine-spin { to { transform: rotate(360deg); } }
@keyframes cine-rays-in { from { opacity: 0; } }
@keyframes cine-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes cine-charge { to { scale: 1.4; filter: brightness(2.4) drop-shadow(0 0 44px var(--glow)); } }
@keyframes cine-flash { from { opacity: 0.95; } to { opacity: 0; } }
@keyframes cine-pop { from { transform: scale(0.2); opacity: 0; } }
@keyframes cine-merge-a {
  from { transform: rotate(0deg) translateX(130px) rotate(0deg); }
  to { transform: rotate(900deg) translateX(0) rotate(-900deg) scale(0.3); }
}
@keyframes cine-merge-b {
  from { transform: rotate(180deg) translateX(130px) rotate(-180deg); }
  to { transform: rotate(1080deg) translateX(0) rotate(-1080deg) scale(0.3); }
}
@keyframes cine-core {
  from { opacity: 0.15; scale: 0.6; }
  to { opacity: 1; scale: 1.7; filter: brightness(2.2) drop-shadow(0 0 40px var(--glow)); }
}
@media (prefers-reduced-motion: reduce) {
  .cine, .cine * { animation: none !important; }
}

/* ---------- Slop : la mini IA ---------- */
.slop-chat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  box-shadow: 0 20px 44px -32px rgba(139, 92, 246, 0.9);
}
.slop-log { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; padding: 4px; margin-bottom: 10px; }
.slop-msg {
  max-width: 88%;
  align-self: flex-start;
  padding: 9px 14px;
  border-radius: 16px 16px 16px 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.slop-msg.is-me { align-self: flex-end; border: 0; border-radius: 16px 16px 4px 16px; background: var(--neon); color: #0b1020; }
.slop-msg .slop-grid { width: 276px; max-width: 100%; margin: 8px 0; gap: 1px; }
.slop-msg .slop-cell { font-size: 0.8rem; border-radius: 2px; background: var(--bg); }
.slop-msg .slop-cell.is-wall { background: var(--line); }
.slop-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.slop-chat .code-row { margin-bottom: 0; }
/* L'encart « Décrivez un jeu » de l'accueil, et la note d'un jeu modèle. */
.home-ask { margin-bottom: 26px; padding: 20px; }
.home-ask h2 { margin: 0 0 6px; font-size: 1.35rem; }
.home-ask .shop-note { margin-bottom: 14px; }
.home-ask .code-row { margin-bottom: 10px; }
.home-ask .slop-chips { margin-bottom: 0; }
.slop-base { margin: 14px 0; }
.slop-base .shop-note { margin-bottom: 12px; }
.slop-base .btn { display: inline-block; text-decoration: none; }

/* ---------- Coffres ---------- */
.chest { --c: var(--gold); align-items: center; text-align: center; }
.chest .mystery { width: 96px; height: 96px; }
.chest.is-on .mystery { animation: cine-shake 0.6s ease-in-out infinite; filter: drop-shadow(0 0 18px var(--ok)); }
.chest.is-empty { border-style: dashed; opacity: 0.6; box-shadow: none; }
.chest.is-empty::before { display: none; }
.chest .seg { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .chest.is-on .mystery { animation: none; }
}

/* ---------- Cinématique d'ouverture des coffres ---------- */
.cine-chest .cine-stage { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-height: 340px; }
.cine-chest .cine-box {
  animation: cine-drop 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) both, cine-shake 0.3s ease-in-out 1.3s infinite, cine-charge 1.1s ease-in 1.3s forwards;
}
.cine-key, .cine-lock { position: absolute; left: 50%; bottom: 40px; margin-left: -24px; font-size: 3rem; line-height: 1; }
.cine-key { animation: cine-key 2.3s ease-in-out both; }
.cine-lock { animation: cine-lock 2.3s ease-in both; }
.cine.is-reveal .cine-key, .cine.is-reveal .cine-lock { display: none; }
/* le coffre reste visible, ouvert, sous le lot qui en sort */
.cine-chest.is-reveal .cine-box { display: block; width: 96px; height: 96px; animation: cine-lid 0.5s ease-out both; }
.cine-chest.is-reveal .cine-prize { order: -1; animation: cine-rise 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.cine-beam {
  position: absolute;
  left: 50%;
  bottom: 70px;
  width: 300px;
  height: 380px;
  margin-left: -150px;
  background: linear-gradient(to top, var(--glow), transparent 85%);
  clip-path: polygon(38% 100%, 62% 100%, 100% 0, 0 0);
  opacity: 0;
  pointer-events: none;
}
.cine.is-reveal .cine-beam { opacity: 0.5; animation: cine-beam 0.7s ease-out; }
.cine-spark { position: absolute; font-size: 1.8rem; opacity: 0; pointer-events: none; }
.cine-spark-1 { left: -20px; top: 60px; }
.cine-spark-2 { right: -24px; top: 20px; }
.cine-spark-3 { right: 0; bottom: 110px; }
.cine.is-reveal .cine-spark { animation: cine-spark 1.6s ease-in-out infinite; }
.cine.is-reveal .cine-spark-2 { animation-delay: 0.5s; }
.cine.is-reveal .cine-spark-3 { animation-delay: 1s; }

@keyframes cine-drop { from { transform: translateY(-80vh); } }
@keyframes cine-key {
  0%, 25% { transform: translate(170px, -90px) rotate(-120deg); opacity: 0; }
  55% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  70% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  88% { transform: rotate(90deg); opacity: 1; }
  100% { transform: rotate(90deg) scale(0.6); opacity: 0; }
}
@keyframes cine-lock {
  0%, 22% { transform: scale(0); opacity: 0; }
  30%, 50% { transform: rotate(0deg); opacity: 1; }
  56% { transform: rotate(-16deg); }
  62% { transform: rotate(16deg); }
  68% { transform: rotate(-16deg); }
  74% { transform: rotate(0deg); opacity: 1; }
  100% { transform: translateY(110px) rotate(50deg); opacity: 0; }
}
@keyframes cine-lid { from { transform: scale(1.5) rotate(0deg); } 40% { transform: scale(0.8, 1.15) rotate(-10deg); } to { transform: rotate(-6deg); } }
@keyframes cine-rise { from { transform: translateY(150px) scale(0.1); opacity: 0; } }
@keyframes cine-beam { from { opacity: 0; transform: scaleY(0.2); transform-origin: bottom; } }
@keyframes cine-spark { 0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(40deg); } }

/* ---------- Pass de saison ---------- */
.pass-head { margin-bottom: 16px; }
.gacha.pass-head { --g: 255, 210, 31; }
.pass-head .gacha-body { flex: 1; }
.pass-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(6, 8, 15, 0.7);
  border: 1px solid var(--line);
  overflow: hidden;
}
.pass-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--accent) 45%, var(--gold));
  box-shadow: 0 0 16px rgba(255, 210, 31, 0.6);
}
.pass-list { margin: 0; padding: 0; list-style: none; }
.pass-row { display: grid; grid-template-columns: 48px 1fr 1fr; gap: 8px; margin-bottom: 8px; align-items: stretch; }
.pass-titles { margin-bottom: 6px; color: var(--muted); font-family: var(--display); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.pass-tier {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
}
.pass-tier.is-reached { background: var(--neon); border-color: transparent; color: #0b1020; box-shadow: 0 0 18px -4px var(--accent); }
.pass-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.pass-cell.is-premium { border-color: rgba(255, 210, 31, 0.3); background: linear-gradient(135deg, rgba(255, 210, 31, 0.1), transparent 60%), var(--panel); }
.pass-cell.is-ready { border-color: var(--ok); box-shadow: 0 0 20px -8px var(--ok); }
.pass-cell.is-claimed { opacity: 0.5; }
.pass-cell .btn { padding: 6px 14px; font-size: 0.85rem; }

/* Fusion à trois : le troisième jeu de la spirale */
.cine-c { position: absolute; font-size: 4rem; line-height: 1; animation: cine-merge-c 2.1s ease-in forwards; }
.cine.is-reveal .cine-c { display: none; }
@keyframes cine-merge-c {
  from { transform: rotate(90deg) translateX(130px) rotate(-90deg); }
  to { transform: rotate(990deg) translateX(0) rotate(-990deg) scale(0.3); }
}

/* ---------- Slop Studio : images, sprites, modèles 3D, sons, musiques ---------- */
.studio { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; max-width: 100%; }
.studio-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  image-rendering: pixelated;
  /* un damier discret pour voir la transparence des sprites */
  background: repeating-conic-gradient(#232a45 0% 25%, #1b2138 0% 50%) 50% / 20px 20px;
}
.studio-photo { width: 512px; max-width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: #131830; }
.studio-3d { image-rendering: auto; background: radial-gradient(circle at 50% 40%, #2b345c, #131830); }
.studio-audio { width: 280px; max-width: 100%; }
.studio-note { color: var(--muted); font-size: 0.85rem; }

/* ---------- Lunettes gaming et HUB (js/world.js) ---------- */
/* Joy est l'interface des lunettes. Lunettes retirées, le HUB se déploie par-dessus depuis le bouton du bord droit. */

.toasts { z-index: 60; }
html.glasses-off { overflow: hidden; }
html.glasses-off .toasts { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 84px); }

.glasses-btn {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 7px 8px 9px;
  transform: translateY(-50%);
  border: 1px solid rgba(110, 231, 255, 0.55);
  border-right: 0;
  border-radius: 16px 0 0 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 22px -6px rgba(110, 231, 255, 0.8);
  transition: padding 0.15s, box-shadow 0.15s;
}
.glasses-btn:hover { padding-right: 12px; box-shadow: 0 0 26px -2px rgba(110, 231, 255, 0.95); }
.glasses-icon { font-size: 1.35rem; line-height: 1; }
.glasses-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.glasses-btn kbd {
  min-width: 20px;
  padding: 0 4px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font: 600 0.7rem/1.5 var(--mono);
  text-align: center;
}
@media (pointer: coarse) { .glasses-btn kbd { display: none; } }
html.glasses-off .glasses-btn { background: var(--neon); border-color: transparent; }
html.glasses-off .glasses-btn kbd { color: var(--text); }

.glasses-hint {
  position: fixed;
  right: 62px;
  top: 50%;
  z-index: 46;
  max-width: min(320px, calc(100vw - 90px));
  padding: 12px 16px;
  transform: translateY(-50%);
  border-radius: 14px;
  border: 1px solid var(--cyan);
  background: rgba(16, 20, 34, 0.95);
  box-shadow: 0 0 26px -8px rgba(110, 231, 255, 0.9);
  font-weight: 600;
  cursor: pointer;
}

.world {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  visibility: hidden;
  clip-path: circle(0% at 100% 50%);
  transition: clip-path 0.55s cubic-bezier(0.6, 0, 0.3, 1), visibility 0s 0.55s;
  -webkit-user-select: none;
  user-select: none;
}
html.glasses-off .world {
  visibility: visible;
  clip-path: circle(150% at 100% 50%);
  transition: clip-path 0.55s cubic-bezier(0.6, 0, 0.3, 1), visibility 0s;
}
.world-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.world-canvas:active { cursor: grabbing; }

.world-top {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.world-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 16px;
  border-radius: 14px;
  border: 1px solid rgba(157, 140, 255, 0.4);
  background: var(--glass);
}
.world-title strong {
  font: 700 1.5rem/1 var(--display);
  letter-spacing: 0.12em;
  background: var(--neon);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.world-dim-name { color: var(--muted); font-size: 0.9rem; }

.world-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  pointer-events: none;
}
.world-bottom > * { pointer-events: auto; }
.world-bottom .segmented { background: var(--glass); }
.world-btn {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  font-weight: 600;
}
.world-btn:hover, .world-btn[aria-expanded="true"] { border-color: var(--accent); }
.world-help {
  flex-basis: 100%;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}
@media (pointer: coarse) { .world-help { display: none; } }

.world-notice {
  position: absolute;
  left: 50%;
  top: 40%;
  width: min(420px, calc(100% - 48px));
  margin: 0;
  transform: translate(-50%, -50%);
  text-align: center;
  font-weight: 600;
  pointer-events: none;
}
.world-notice:empty { display: none; }

.world-skins {
  position: absolute;
  left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 92px);
  width: min(430px, calc(100% - 32px));
  padding: 14px 16px 16px;
  transform: translateX(-50%);
  border-radius: 18px;
  border: 1px solid rgba(157, 140, 255, 0.45);
  background: rgba(14, 17, 29, 0.92);
  box-shadow: 0 20px 50px -20px #000;
}
.world-skins[hidden] { display: none; }
.world-skins h2 { margin: 0 0 10px; font-size: 1rem; letter-spacing: 0.04em; }
.world-skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.world-skin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.85rem;
}
.world-skin:hover { border-color: var(--accent); }
.world-skin[aria-pressed="true"] { border-color: var(--cyan); box-shadow: 0 0 16px -6px var(--cyan); }
.world-skin-dot { width: 34px; height: 34px; border-radius: 50%; border: 3px solid; }

/* Le manche posé sous le doigt ou la souris. */
.world-stick {
  position: absolute;
  width: 112px;
  height: 112px;
  margin: -56px 0 0 -56px;
  border-radius: 50%;
  border: 2px solid rgba(110, 231, 255, 0.4);
  background: rgba(110, 231, 255, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.world-stick.is-on { opacity: 1; }
.world-stick span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(110, 231, 255, 0.55);
}

/* Le nom de la dimension, en grand, au moment d'en changer. */
.world-flash {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 clamp(5rem, 22vw, 13rem)/1 var(--display);
  color: #fff;
  text-shadow: 0 0 40px var(--accent), 0 0 90px var(--pink);
  background: radial-gradient(circle, rgba(157, 140, 255, 0.35), transparent 65%);
  opacity: 0;
  pointer-events: none;
}
.world-flash.is-on { animation: world-flash 0.7s ease-out; }
@keyframes world-flash {
  0% { opacity: 0; transform: scale(0.6); }
  25% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

@media (prefers-reduced-motion: reduce) {
  .world, html.glasses-off .world { transition: none; }
  .world-flash.is-on { animation-duration: 0.01s; }
}

/* Les boutons de réglage de la vue (zoom, rotation, recentrage). */
.world-cam .seg { min-width: 38px; padding-left: 10px; padding-right: 10px; font-size: 1.05rem; line-height: 1.3; }

/* ---------- Chat (js/chat.js) : dans le HUB et dans l'onglet Chat ---------- */

.chat-log { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chat-msg { overflow-wrap: anywhere; }
.chat-msg b { color: var(--cyan); font-weight: 600; }
.chat-msg time { margin-left: 8px; color: var(--muted); font-size: 0.75rem; }
.chat-form { display: flex; gap: 8px; }
.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
.chat-form input:focus { border-color: var(--cyan); outline: none; }
.chat-form button {
  padding: 9px 16px;
  border-radius: 12px;
  border: 0;
  background: var(--neon);
  color: #0b1020;
  font-weight: 600;
}

/* L'onglet Chat de Joy. */
.chat-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.chat-page .chat-log { min-height: 180px; max-height: min(52vh, 460px); overflow-y: auto; padding-right: 6px; }
.chat-empty { margin: 0; color: var(--muted); }
.chat-clear {
  align-self: flex-start;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
}
.chat-clear:hover { border-color: var(--danger); color: var(--text); }

/* Le chat du HUB, dans le coin en bas à gauche. */
.world-chat {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 96px);
  width: min(330px, calc(100% - 90px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.world-chat .chat-log { justify-content: flex-end; max-height: 190px; overflow: hidden; font-size: 0.9rem; }
.world-chat .chat-msg {
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(14, 17, 29, 0.72);
}
.world-chat .chat-form { pointer-events: auto; }
.world-chat .chat-form input { padding: 7px 12px; background: var(--glass); }
.world-chat .chat-form button { padding: 7px 12px; }

.world-bubble {
  position: absolute;
  max-width: min(260px, 70vw);
  padding: 8px 14px;
  transform: translate(-50%, -100%);
  border-radius: 16px;
  background: #fff;
  color: #14172a;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow: 0 6px 20px -6px #000;
  pointer-events: none;
}
.world-bubble[hidden] { display: none; }
.world-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -7px;
  border: 7px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

/* Le panneau des émotes (même allure que celui des skins). */
.world-emote-icon { font-size: 1.6rem; line-height: 1.2; }
.world-skin kbd {
  min-width: 20px;
  padding: 0 4px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font: 600 0.7rem/1.5 var(--mono);
}
@media (pointer: coarse) { .world-skin kbd { display: none; } }

/* ---------- Vie du HUB (js/hub-life.js) : action, menu radial, mini-jeux, construction ---------- */

.world-skins { max-height: min(62vh, 520px); overflow-y: auto; }
.world-skins h2:not(:first-child) { margin-top: 14px; }
.world-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.world-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.85rem;
}
.world-chip:hover:not(:disabled) { border-color: var(--accent); }
.world-chip[aria-pressed="true"] { border-color: var(--cyan); box-shadow: 0 0 14px -6px var(--cyan); }
.world-chip:disabled { color: var(--muted); cursor: help; opacity: 0.75; }
.world-color {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  line-height: 1;
}
.world-color[aria-pressed="true"] { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(110, 231, 255, 0.35); }

/* L'action possible à cet endroit (touche F). */
.world-act {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 8px;
  border-radius: 999px;
  border: 0;
  background: var(--neon);
  color: #0b1020;
  font-weight: 700;
  box-shadow: 0 0 22px -6px var(--accent);
}
.world-act[hidden] { display: none; }
.world-act kbd {
  min-width: 24px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(11, 16, 32, 0.85);
  color: #fff;
  font: 700 0.8rem/1.5 var(--mono);
  text-align: center;
}

.world-bubble.is-other { background: #dff6ff; }
.world-bubble.is-other::after { border-top-color: #dff6ff; }

/* Le menu radial des lunettes. */
.world-radial {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 8, 15, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.world-radial[hidden] { display: none; }
.world-radial-ring { position: relative; width: min(340px, 86vw); aspect-ratio: 1; }
.world-radial-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: 50%;
  border: 1px solid rgba(157, 140, 255, 0.5);
  background: rgba(16, 19, 31, 0.94);
  transform: rotate(var(--a)) translateX(min(128px, 32vw)) rotate(calc(-1 * var(--a)));
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.world-radial-item span { font-size: 1.6rem; line-height: 1; }
.world-radial-item small { font-size: 0.62rem; line-height: 1.1; color: var(--muted); text-align: center; }
.world-radial-item:hover, .world-radial-item:focus-visible { border-color: var(--cyan); background: var(--panel-2); box-shadow: 0 0 24px -4px var(--cyan); }
.world-radial-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--neon);
  font-size: 1.8rem;
  pointer-events: none;
}

/* Les mini-jeux : la borne et le compteur en haut de l'écran. */
.world-game {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: rgba(14, 17, 29, 0.9);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.world-game[hidden] { display: none; }
.world-game button { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: 0.8rem; font-weight: 600; }
.world-game-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: left;
}
.world-game-card:hover { border-color: var(--gold); }
.world-game-card span { color: var(--muted); font-size: 0.85rem; }
.world-game-card small { color: var(--cyan); font-size: 0.78rem; }

/* Construire. */
.world-build-help { margin: 0 0 10px; color: var(--muted); font-size: 0.85rem; }
.world-build .chat-form { margin-bottom: 12px; }
