@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url("assets/fonts/press-start-2p-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: optional;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --night: #0a0614;
  --night-soft: #130a22;
  --violet: #2a1440;
  --violet-light: #4a2670;
  --magenta: #ff5cb8;
  --magenta-deep: #b82e7e;
  --grass: #7fbf3f;
  --lantern: #ffb05c;
  --bone: #e8dfd0;
  --bone-dim: #a89e91;
  --stone: #6d6478;
  --text-dim: #a99fbd;
  --text-faint: #6f6689;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --font-pixel: "Press Start 2P", monospace;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

/* Les classes ci-dessous posent display:grid/flex : sans ça, [hidden] est ignoré. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-pixel);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

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

button {
  font: inherit;
  cursor: pointer;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.4);
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- nav ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: linear-gradient(180deg, rgba(10, 6, 20, 0.95), rgba(10, 6, 20, 0));
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.nav__dim {
  color: var(--magenta);
}

.nav__links {
  display: flex;
  gap: 26px;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.nav__links a:hover {
  color: var(--bone);
}

.nav__actions,
.locale-switch {
  display: flex;
  align-items: center;
}

.nav__actions {
  gap: 12px;
}

.account-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(10, 6, 20, 0.78);
}

.account-panel[hidden] {
  display: none;
}

.account-panel__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.account-panel__meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.account-panel__meta strong,
.account-panel__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
}

.account-panel__meta span {
  color: var(--text-faint);
}

.bury-beta {
  margin-top: 12px;
  color: var(--magenta);
}

.locale-switch {
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(10, 6, 20, 0.78);
}

.locale-switch__btn {
  padding: 6px 7px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-pixel);
  font-size: 0.48rem;
  cursor: pointer;
}

.locale-switch__btn:hover,
.locale-switch__btn.is-active {
  background: var(--magenta);
  color: #14060f;
}

/* ------------------------------------------------------------ buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  line-height: 1.4;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn--sm {
  padding: 9px 14px;
  font-size: 0.6rem;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--magenta);
  color: #2a0a1c;
  box-shadow: 0 4px 0 var(--magenta-deep), 0 14px 30px -12px var(--magenta);
}

.btn--primary:hover:not(:disabled) {
  box-shadow: 0 6px 0 var(--magenta-deep), 0 20px 40px -12px var(--magenta);
}

.btn--ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--bone);
  backdrop-filter: blur(8px);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

/* -------------------------------------------------------------- stage ---- */

.stage {
  position: relative;
  height: min(86vh, 760px);
  min-height: 460px;
  overflow: hidden;
  border-bottom: 2px solid rgba(0, 0, 0, 0.6);
}

.stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  touch-action: pan-y;
}

.stage__label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: rgba(10, 6, 20, 0.85);
  color: var(--bone);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}

/* Panneau de direction : reste lisible tant qu'on longe la porte, hors du chemin du héros. */
.alley-signpost {
  position: absolute;
  z-index: 5;
  top: 18%;
  left: 50%;
  padding: 10px 16px;
  border: 2px solid var(--grass);
  background: rgba(10, 6, 20, 0.94);
  box-shadow: 0 0 0 3px rgba(10, 6, 20, 0.7), 0 0 26px rgba(143, 245, 216, 0.4);
  color: var(--grass);
  font-family: var(--font-pixel);
  font-size: clamp(0.65rem, 1.5vw, 0.9rem);
  letter-spacing: 0.08em;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: alley-signpost 0.24s steps(3) both;
}

@keyframes alley-signpost {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Pastille plantée dans le décor : confirmer avant de sauter à l'autre bout de l'allée. */
.stage__jump {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  padding: 8px 12px;
  border: 2px solid var(--magenta);
  border-radius: 0;
  background: rgba(10, 6, 20, 0.92);
  box-shadow: 0 0 0 2px rgba(10, 6, 20, 0.92), 0 0 18px rgba(255, 61, 168, 0.35);
  color: var(--bone);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  animation: jump-pop 0.16s steps(2) both;
  will-change: transform;
}

.stage__jump::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: var(--jump-tail, 22px);
  background: linear-gradient(180deg, var(--magenta), rgba(255, 61, 168, 0.25));
  transform: translateX(-50%);
}

.stage__jump:hover,
.stage__jump:focus-visible {
  background: var(--magenta);
  color: #14060f;
}

@keyframes jump-pop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.stage__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(70px, 12vh, 120px) clamp(16px, 4vw, 48px) clamp(16px, 3vw, 32px);
  pointer-events: none;
}

.stage__overlay a,
.stage__overlay button,
.stage__overlay label,
.stage__overlay input,
.stage__overlay canvas {
  pointer-events: auto;
}

.stage__intro {
  max-width: 460px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* En balade : l'accroche et la barre disparaissent, le HUD reste lisible. */
body.is-roaming .stage__intro,
body.is-roaming .nav {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

body.is-roaming .stage__hud {
  opacity: 0.42;
}

/* Viser une pastille rend le HUD net sans devoir s'arrêter. */
body.is-roaming .stage__hud:hover,
body.is-roaming .stage__hud:focus-within {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .stage__intro,
  .stage__hud,
  .nav {
    transition: none;
  }
}

.kicker {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  color: var(--magenta);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.8);
}

.stage__title {
  margin-top: 16px;
  font-size: clamp(1.35rem, 3.6vw, 2.4rem);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.85), 0 0 34px rgba(255, 92, 184, 0.35);
}

.stage__sub {
  margin-top: 16px;
  max-width: 380px;
  color: var(--text-dim);
  font-size: 0.95rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.mobile-shortcuts,
.mobile-controls {
  display: none;
}

.stage__hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: opacity 0.4s ease;
}

/* Le quartier courant : une pastille comme les autres, pas une bannière. */
.hud__zone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.hud__zone-code {
  color: var(--magenta);
  letter-spacing: 0.06em;
}

.hud__zone-name {
  max-width: 220px;
  overflow: hidden;
  color: var(--bone);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hud__zone-alley {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(143, 245, 216, 0.16);
  color: var(--grass);
  font-size: 0.5rem;
}

.hud__item {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 6, 20, 0.7);
  backdrop-filter: blur(6px);
}

.hud__item b {
  color: var(--grass);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
}

.hud__keys {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hud__pseudo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px 5px 12px;
  border-color: var(--border-strong);
  cursor: text;
  transition: border-color 0.18s ease;
}

.hud__pseudo:focus-within {
  border-color: var(--magenta);
}

.hud__pseudo-label {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.hud__pseudo-input {
  width: 108px;
  padding: 3px 6px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--magenta);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  outline: none;
}

.hud__pseudo-input::placeholder {
  color: var(--text-faint);
}

.hud__btn {
  border-color: var(--magenta);
  color: var(--bone);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.hud__btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 92, 184, 0.22);
}

.hud__btn--showcase {
  border-color: var(--grass);
  color: var(--grass);
}

body.is-showcase .stage__intro {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.directory-toolbar {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.directory-search {
  max-width: 420px;
}

.directory-count {
  margin-bottom: 14px;
  color: var(--text-faint);
  font-family: var(--font-pixel);
  font-size: 0.5rem;
}

.pilgrim.is-active {
  border-color: var(--magenta);
  background: rgba(255, 92, 184, 0.12);
}

.pilgrim-panel {
  position: absolute;
  right: clamp(16px, 4vw, 48px);
  bottom: 82px;
  z-index: 4;
  width: min(420px, calc(100% - 32px));
  max-height: min(520px, 74%);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(13, 7, 24, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(12px);
}

.pilgrim-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.pilgrim-panel__head h2 {
  margin-top: 8px;
  font-size: 0.9rem;
}

.pilgrim-panel__intro {
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 0.78rem;
}

.pilgrim-panel__close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--bone);
  font-size: 1rem;
}

.pilgrim-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.pilgrim {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
  text-align: left;
}

.pilgrim:hover {
  border-color: var(--magenta);
  background: rgba(255, 92, 184, 0.1);
}

.pilgrim__name {
  overflow: hidden;
  color: var(--bone);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilgrim__offering {
  grid-column: 1;
  color: var(--magenta);
  font-size: 0.73rem;
}

.pilgrim__date {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--text-faint);
  font-size: 0.7rem;
}

/* Le hub est le seul endroit qui explique les quartiers : ici, on peut lire. */
.zone-hub-list {
  display: grid;
  /* Sans ça, une carte pleine d'allées élargit sa colonne au lieu de défiler. */
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.zone-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.zone-card.is-active {
  border-color: var(--magenta);
  background: rgba(255, 92, 184, 0.1);
}

.zone-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.zone-card__code {
  padding: 6px 7px;
  border: 1px solid var(--magenta-deep);
  border-radius: 7px;
  background: rgba(255, 92, 184, 0.14);
  color: var(--magenta);
  font-family: var(--font-pixel);
  font-size: 0.62rem;
}

.zone-card__title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.zone-card__title strong {
  color: var(--bone);
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  font-weight: 400;
}

.zone-card__meta {
  color: var(--text-faint);
  font-size: 0.72rem;
}

.zone-card__go {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--magenta);
  border-radius: 999px;
  color: var(--bone);
  font-family: var(--font-pixel);
  font-size: 0.45rem;
}

.zone-card__head:hover .zone-card__go {
  background: rgba(255, 92, 184, 0.24);
}

.zone-card__pitch {
  margin-top: 9px;
  color: var(--bone-dim);
  font-size: 0.8rem;
}

.zone-card__hint {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 0.75rem;
  line-height: 1.55;
}

.alley-nav {
  min-width: 0;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

/* Une seule ligne qui défile : trois cents allées ne repoussent pas la carte. */
.alley-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--magenta-deep) transparent;
}

.alley-row:focus-visible {
  outline: 1px solid var(--magenta);
  outline-offset: 3px;
}

.alley-row::-webkit-scrollbar {
  height: 6px;
}

.alley-row::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.alley-row::-webkit-scrollbar-thumb {
  background: var(--magenta-deep);
  border-radius: 999px;
}

.alley-jump {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.alley-jump__label {
  color: var(--text-faint);
  font-size: 0.72rem;
}

.alley-jump__input {
  width: 88px;
  padding: 5px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--bone);
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  outline: none;
}

.alley-jump__input:focus {
  border-color: var(--magenta);
}

.alley-jump__btn {
  padding: 6px 9px;
  border: 1px solid var(--magenta);
  border-radius: 999px;
  background: rgba(255, 92, 184, 0.14);
  color: var(--bone);
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  cursor: pointer;
}

.alley-jump__btn:hover {
  background: rgba(255, 92, 184, 0.3);
}

.alley-chip {
  display: inline-flex;
  flex: 0 0 auto;
  scroll-snap-align: center;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
}

.alley-chip b {
  color: var(--grass);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
}

.alley-chip:hover {
  border-color: var(--grass);
}

.alley-chip.is-full {
  border-color: rgba(255, 176, 92, 0.55);
}

.alley-chip.is-full b {
  color: var(--lantern);
}

/* « Tu es ici » doit rester visible même sur une allée pleine : règle en dernier. */
.alley-chip.is-active {
  border-color: var(--magenta);
  background: rgba(255, 92, 184, 0.16);
  color: var(--bone);
}

.alley-chip--next {
  border-style: dashed;
  color: var(--text-faint);
  cursor: default;
}

.alley-chip--next b {
  color: var(--text-faint);
}

.stage__vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 40%, rgba(5, 2, 10, 0.75) 100%),
    linear-gradient(100deg, rgba(6, 3, 14, 0.78) 0%, rgba(6, 3, 14, 0.3) 30%, transparent 52%);
}

/* ----------------------------------------------------------- sections ---- */

.section {
  width: min(1080px, 100% - 40px);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 110px) 0;
}

.section__head {
  max-width: 660px;
  margin-bottom: 44px;
}

.section__head h2 {
  font-size: clamp(1.05rem, 2.4vw, 1.6rem);
  line-height: 1.5;
}

.section__head p {
  margin-top: 18px;
  color: var(--text-dim);
}

/* -------------------------------------------------------------- steps ---- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(74, 38, 112, 0.28), rgba(255, 255, 255, 0.02));
}

.step__num {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--magenta);
}

.step h3 {
  margin-top: 14px;
  font-size: 0.82rem;
}

.step p {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.quote {
  margin: 40px 0 0;
  padding: 22px 26px;
  border-left: 4px solid var(--magenta);
  background: rgba(255, 92, 184, 0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  line-height: 1.9;
}

/* -------------------------------------------------------------- plots ---- */

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

.plot {
  display: flex;
  flex-direction: column;
  padding: 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.plot:hover {
  transform: translateY(-4px);
  border-color: var(--magenta);
  background: rgba(255, 92, 184, 0.08);
}

.plot__art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 104px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(42, 20, 64, 0.9), rgba(20, 10, 34, 0.9));
  border: 1px solid var(--border);
  overflow: hidden;
}

.plot__art img {
  image-rendering: pixelated;
  transform-origin: bottom center;
  filter: drop-shadow(0 0 12px rgba(255, 92, 184, 0.25));
}

.plot__price {
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  color: var(--grass);
}

.plot__name {
  margin-top: 10px;
  font-size: 0.75rem;
}

.plot__pitch {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 0.86rem;
  min-height: 46px;
}

.plot__perks {
  margin: 14px 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  font-size: 0.84rem;
  color: var(--text-dim);
}

.plot__perks li::before {
  content: "† ";
  color: var(--magenta);
}

.plot__btn {
  margin-top: auto;
  width: 100%;
}

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

/* Un seul rythme vertical pour tout le formulaire, au lieu de marges au cas par cas. */
.form {
  display: grid;
  gap: clamp(22px, 3vw, 32px);
  padding: clamp(22px, 3.4vw, 38px);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, rgba(74, 38, 112, 0.25), rgba(255, 255, 255, 0.02));
}

/* Choisir un quartier puis une offre, ce sont deux décisions : on les sépare.
   Le trait porte sur un conteneur, sinon le `<legend>` du fieldset s'y plante. */
.form__block {
  padding-top: clamp(20px, 2.6vw, 28px);
  border-top: 1px solid var(--border-strong);
}

.form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 18px;
}

.field {
  display: block;
  flex: 1 1 220px;
}

.field--narrow {
  flex: 0 1 130px;
}

.field__label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.field__input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(6, 3, 12, 0.7);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.field__input:focus {
  border-color: var(--magenta);
}

.tiers {
  margin: 0;
  padding: 0;
  border: none;
}

.tiers__options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tier-option {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.84rem;
  transition: all 0.18s ease;
}

.tier-option:hover {
  color: var(--bone);
  border-color: var(--magenta);
}

.tiers__help {
  max-width: 62ch;
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 0.84rem;
  line-height: 1.6;
}

/* L'aide vient après les pastilles dans « Offre » : elle a besoin d'air au-dessus. */
.tiers__options + .tiers__help {
  margin-top: 12px;
}

.zone-option {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.zone-option__code {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

.zone-option__name {
  font-size: 0.82rem;
}

/* Infobulle rétro : bordure franche, ombre décalée, aucune rondeur. */
.zone-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 5;
  display: none;
  width: max-content;
  max-width: 300px;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  transform: translateX(-50%);
  border: 2px solid var(--magenta);
  background: #16081f;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.85);
  color: var(--bone);
  text-align: left;
  white-space: normal;
  pointer-events: none;
}

.zone-option:hover .zone-tip,
.zone-option:focus-visible .zone-tip {
  display: flex;
}

.zone-tip__head {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--magenta);
}

.zone-tip__pitch {
  font-size: 0.82rem;
  color: var(--bone);
}

.zone-tip__hint {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.zone-hint {
  margin: 16px 0 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--magenta-deep);
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.6;
}

.tier-option.is-active {
  background: var(--magenta);
  border-color: var(--magenta);
  color: #2a0a1c;
  font-weight: 600;
}

/* Offre + monument à gauche, la pierre choisie à droite. */
.offer-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 30px);
  align-items: stretch;
}

.offer-row__fields {
  display: grid;
  align-content: start;
  gap: clamp(20px, 2.6vw, 28px);
  flex: 1 1 320px;
  min-width: 0;
}

.tier-option--asset {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
}

.tier-option__sprite {
  width: 30px;
  height: 32px;
  object-fit: contain;
  object-position: bottom center;
  image-rendering: pixelated;
}

.tier-option--effect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.tier-option__effect {
  width: 18px;
  height: 18px;
  background: var(--effect-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--effect-color) 70%, transparent);
  clip-path: polygon(50% 0, 72% 27%, 100% 48%, 68% 62%, 50% 100%, 34% 67%, 0 52%, 30% 31%);
  animation: effect-option-pulse 1.4s steps(3) infinite;
}

.tier-option__effect--lightning {
  clip-path: polygon(53% 0, 100% 0, 68% 38%, 94% 38%, 26% 100%, 42% 56%, 10% 56%);
}

.tier-option__effect--aureole {
  height: 9px;
  margin: 5px 0;
  border: 2px solid var(--effect-color);
  border-radius: 50%;
  background: none;
  clip-path: none;
}

.tier-option__effect--specters {
  border-radius: 50% 50% 42% 42%;
  clip-path: polygon(18% 0, 82% 0, 100% 54%, 76% 100%, 52% 74%, 28% 100%, 0 54%);
}

.tier-option--effect.is-active {
  box-shadow: 0 0 16px color-mix(in srgb, var(--effect-color) 65%, transparent);
}

.stone-preview {
  flex: 0 1 210px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.stone-preview__art {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 150px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(42, 20, 64, 0.9), rgba(20, 10, 34, 0.9));
  overflow: hidden;
}

/** Le monument est rendu par le moteur du cimetière, pas imité en CSS. */
.stone-preview__fx {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.stone-preview__art img {
  position: relative;
  z-index: 1;
  image-rendering: pixelated;
  transform-origin: bottom center;
  filter: drop-shadow(0 0 10px rgba(220, 214, 228, 0.22));
}

@keyframes effect-option-pulse {
  50% { opacity: 0.55; transform: translateY(-1px); }
}

.stone-preview__caption {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.stone-preview__caption strong {
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  color: var(--grass);
}

.stone-preview__caption span {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.legal-consent input {
  width: 16px;
  height: 16px;
  margin: 4px 0 0;
  accent-color: var(--magenta);
}

.legal-consent a {
  color: var(--bone);
  text-decoration: underline;
  text-decoration-color: var(--magenta);
  text-underline-offset: 3px;
}

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-top: clamp(20px, 2.6vw, 28px);
  border-top: 1px solid var(--border);
}

.form__note {
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ------------------------------------------------------------- recent ---- */

.recent {
  display: grid;
  gap: 8px;
}

.burial {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto 2fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--bone);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.burial:hover {
  transform: translateX(4px);
  border-color: var(--magenta);
  background: rgba(255, 92, 184, 0.08);
}

.burial__name {
  font-family: var(--font-pixel);
  font-size: 0.66rem;
}

/* Le statut vit dans la cellule du nom, sinon il ajouterait une 5ᵉ colonne. */
.burial__status {
  margin-left: 10px;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.42rem;
  vertical-align: middle;
  color: var(--lantern);
}

.burial__status[data-status="private"] {
  color: var(--text-dim);
}

.burial__status[data-status="rejected"] {
  color: var(--magenta);
}

.burial__dates {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--text-faint);
}

.burial__epitaph {
  color: var(--text-dim);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.burial__plot {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-faint);
  white-space: nowrap;
}

/* -------------------------------------------------------------- pager ---- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
}

.pager--top {
  margin-top: 0;
  margin-bottom: 14px;
}

.pager__page {
  min-width: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  transition: all 0.18s ease;
}

.pager__page:hover:not(:disabled) {
  color: var(--bone);
  border-color: var(--magenta);
}

.pager__page.is-active {
  background: var(--magenta);
  border-color: var(--magenta);
  color: #2a0a1c;
}

.pager__page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pager__gap {
  padding: 0 2px;
  color: var(--text-faint);
  font-family: var(--font-pixel);
  font-size: 0.5rem;
}

/* -------------------------------------------------------------- modal ---- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 2, 8, 0.82);
  backdrop-filter: blur(6px);
  animation: fade 0.2s ease both;
}

.tomb {
  position: relative;
  width: min(440px, 100%);
  min-width: 0;
  max-height: 88vh;
  overflow-y: auto;
  padding: 46px 34px 28px;
  text-align: center;
  border: 2px solid #5d5569;
  border-radius: 190px 190px 14px 14px;
  /* Granit clair : le texte gravé est sombre, il lui faut un fond pâle. */
  background: linear-gradient(180deg, #cfc8d8 0%, #b9b1c6 46%, #a49bb4 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), inset 0 -6px 24px rgba(0, 0, 0, 0.28),
    0 40px 80px -20px #000;
  animation: rise 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Fiche accolée au héros : pas de voile, la scène reste visible et jouable. */
.modal--docked {
  pointer-events: none;
}

.modal--docked .modal__backdrop {
  background: transparent;
  backdrop-filter: none;
}

.modal--docked .tomb {
  position: absolute;
  width: min(360px, 34vw);
  max-height: min(72vh, 620px);
  padding: 34px 24px 20px;
  border-radius: 150px 150px 12px 12px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), inset 0 -6px 24px rgba(0, 0, 0, 0.28),
    0 24px 48px -16px #000;
  pointer-events: auto;
  animation: rise 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }
}

.tomb__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(20, 16, 26, 0.55);
  color: var(--bone);
  font-size: 1.2rem;
  line-height: 1;
}

.tomb__close:hover {
  background: rgba(20, 16, 26, 0.8);
}

.tomb__rip,
.tomb__name,
.tomb__dates,
.tomb__cause,
.tomb__epitaph {
  color: #14101a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.tomb__rip {
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  letter-spacing: 0.22em;
}

.tomb__name {
  margin-top: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
}

.tomb__dates {
  margin-top: 10px;
  font-family: var(--font-pixel);
  font-size: 0.62rem;
}

.tomb__divider {
  width: 60px;
  height: 3px;
  margin: 20px auto;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.tomb__label {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  color: rgba(18, 14, 24, 0.92);
  margin-top: 18px;
}

.tomb__cause {
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

.tomb__epitaph {
  margin-top: 6px;
  font-size: 0.95rem;
  font-style: italic;
}

.tomb__author {
  margin-top: 18px;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: rgba(18, 14, 24, 0.88);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.tomb-owner {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(24, 19, 30, 0.34);
  border-radius: 12px;
  background: rgba(20, 16, 26, 0.09);
}

/** Ce que l'édition change vraiment : sans le dire, on croit pouvoir déplacer
 * sa tombe ou changer son monument, alors que seule l'inscription bouge. */
.grave-edit__note {
  margin: 10px 0 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(24, 19, 30, 0.68);
}

.tomb-owner__head,
.tomb-owner__actions,
.grave-edit__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tomb-owner__head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.tomb-owner__head .tomb__label {
  margin: 0;
}

.tomb-status {
  padding: 5px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: #7b5519;
  background: rgba(255, 176, 92, 0.18);
}

.tomb-status[data-status="public"] {
  color: #215f48;
  background: rgba(127, 191, 63, 0.18);
}

.tomb-status[data-status="private"] {
  color: #54476b;
  background: rgba(109, 100, 120, 0.18);
}

.tomb-status[data-status="rejected"] {
  color: #8a284c;
  background: rgba(255, 92, 184, 0.14);
}

.tomb-owner .btn--danger {
  border-color: rgba(138, 40, 76, 0.55);
  background: rgba(138, 40, 76, 0.12);
  color: #681b39;
}

.grave-edit {
  display: grid;
  gap: 12px;
}

.grave-edit .field__label {
  color: rgba(18, 14, 24, 0.72);
}

.grave-edit .field__input {
  border-color: rgba(18, 14, 24, 0.3);
  background: rgba(255, 255, 255, 0.48);
  color: #18131e;
}

.tomb__offerings {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(24, 19, 30, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.28);
}

.tomb__offerings .tomb__label {
  margin-top: 0;
}

.tomb__offer-counts {
  margin-top: 8px;
  color: rgba(18, 14, 24, 0.9);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.offering-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.offering-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 4px 7px;
  border: 1px solid rgba(24, 19, 30, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  color: #14101a;
  font-size: 0.7rem;
  font-weight: 600;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.offering-option:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.72);
}

.offering-option.is-mine {
  border-color: #7b174d;
  background: rgba(255, 92, 184, 0.42);
  box-shadow: inset 0 0 0 1px rgba(123, 23, 77, 0.4);
}

.offering-option kbd {
  padding: 2px 4px;
  border: 1px solid rgba(24, 19, 30, 0.34);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.5);
  color: #14101a;
  font-size: 0.52rem;
}

/**
 * Les quatre objets ont des hauteurs différentes (une bougie est haute, un
 * galet est plat) : ils s'alignent donc par le bas, sur une ligne de sol
 * commune, exactement comme le canvas les pose sur la tombe.
 */
.offering-option__icon {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.offering-option__icon img {
  display: block;
  image-rendering: pixelated;
}

.tomb__offer-last {
  margin-top: 11px;
  color: rgba(18, 14, 24, 0.86);
  font-size: 0.73rem;
  font-style: italic;
}

.tomb__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.28);
}

/* L'adresse pousse les deux actions ensemble à droite plutôt que de les écarter. */
.tomb__plot {
  flex: 1;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: rgba(18, 14, 24, 0.9);
}

.tomb__foot .btn--ghost {
  border-color: rgba(0, 0, 0, 0.5);
  background: rgba(20, 16, 26, 0.88);
  color: #f2ece2;
}

/* ------------------------------------------------------------- footer ---- */

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  width: min(1080px, 100% - 40px);
  margin: 0 auto;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-faint);
}

.footer__credit {
  margin-top: 6px;
}

.footer__credit a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__legal {
  display: flex;
  gap: 14px;
  margin-top: 12px;
}

.footer__legal a,
.footer__legal-btn {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Le bouton Contact ouvre une modal au lieu de naviguer : même rendu qu'un lien. */
.footer__legal-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* --------------------------------------------------------- auth modal ---- */

.auth-modal {
  width: min(430px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--night-soft);
  color: var(--bone);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.auth-modal::backdrop {
  background: rgba(5, 2, 12, 0.78);
  backdrop-filter: blur(5px);
}

.auth-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}

.auth-modal h2 {
  margin: 10px 0 0;
}

.auth-modal__lead {
  margin: 14px 0 22px;
  color: var(--text-dim);
}

.auth-providers {
  display: grid;
  gap: 10px;
}

.auth-provider {
  width: 100%;
  justify-content: center;
}

/* Le shell (fond, bordure, backdrop) reste celui de .auth-modal ; seul le
 * formulaire repasse en aligné à gauche, plus lisible qu'au centre. */
.contact-modal form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.contact-modal__submit {
  justify-self: center;
  margin-top: 4px;
}

.auth-provider__mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #1f1f1f;
  font-weight: 800;
}

/* -------------------------------------------------------------- toast ---- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(19, 10, 34, 0.96);
  font-size: 0.86rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------- responsive ---- */

@media (max-width: 820px) {
  .nav__links {
    display: none;
  }

  .stage {
    height: min(78vh, 620px);
  }

  .stage__sub {
    display: none;
  }

  .hud__keys {
    display: none;
  }

  .burial {
    grid-template-columns: 1fr auto;
    row-gap: 6px;
  }

  .burial__epitaph {
    grid-column: 1 / -1;
    white-space: normal;
  }
}

@media (max-width: 820px) and (pointer: coarse), (max-height: 500px) and (pointer: coarse) {
  :root {
    /*
     * Hauteur réelle du bloc de commandes : zone du joystick (132px) plus son
     * rembourrage bas. C'est cette valeur qui doit border la barre de
     * raccourcis — quand elle était plus basse que le bloc, la barre passait
     * par-dessus les commandes et leur volait les appuis.
     */
    --mobile-controls-clearance: calc(142px + env(safe-area-inset-bottom));
    --mobile-hud-clearance: calc(216px + env(safe-area-inset-bottom));
  }

  .nav {
    gap: 8px;
    padding: 8px 10px;
  }

  .nav__brand {
    font-size: 0.58rem;
  }

  .nav__actions {
    gap: 5px;
  }

  .nav__links,
  .nav__actions > .btn {
    display: none;
  }

  .account-panel {
    gap: 4px;
    padding: 2px;
  }

  .account-panel__avatar,
  .account-panel__meta {
    display: none;
  }

  .account-panel .btn {
    padding: 7px 8px;
    font-size: 0.48rem;
  }

  .stage {
    height: 100svh;
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .stage__intro {
    display: none;
  }

  .stage__overlay {
    padding: 52px 10px var(--mobile-hud-clearance);
  }

  .stage__hud {
    gap: 6px;
  }

  .hud__pseudo,
  .hud__count,
  .hud__keys {
    display: none;
  }

  .hud__item {
    min-height: 44px;
    padding: 8px 10px;
  }

  .hud__zone,
  #my-grave-btn,
  #pilgrim-btn {
    display: inline-flex;
  }

  .mobile-shortcuts {
    position: absolute;
    right: 12px;
    bottom: var(--mobile-controls-clearance);
    left: 12px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .mobile-hint {
    display: block;
    width: 100%;
    color: var(--bone);
    font-size: 0.72rem;
    text-align: center;
    text-shadow: 0 2px 4px #000;
    pointer-events: none;
  }

  /* L'intro et les liens de la barre disparaissent au doigt : ces deux raccourcis les remplacent. */
  .mobile-links {
    display: flex;
    justify-content: center;
    gap: 8px;
  }

  .mobile-links__link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(19, 10, 34, 0.92);
    color: var(--bone);
    font-family: var(--font-pixel);
    font-size: 0.52rem;
    text-decoration: none;
  }

  /*
   * Le pavé directionnel faisait 355x166 sur toute la largeur : c'est sa taille
   * qui le faisait passer sous la barre de raccourcis. Le joystick naît sous le
   * pouce, donc il ne réserve plus qu'une zone de saisie transparente, et le
   * seul élément opaque restant est le bouton de lecture, calé dans le coin
   * opposé. Plus rien à faire se croiser.
   */
  .mobile-controls {
    position: absolute;
    right: 10px;
    bottom: 0;
    left: 10px;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    /* La zone morte du conteneur laisse passer les taps vers le canvas. */
    pointer-events: none;
  }

  /* Invisible, mais c'est elle qui reçoit le pouce. */
  .joystick {
    flex: 1;
    max-width: 58%;
    height: 132px;
    pointer-events: auto;
    touch-action: none;
  }

  /*
   * `fixed` : la manette est posée aux coordonnées du pointeur, qui sont
   * relatives à la fenêtre et non à la zone de saisie. Les marges négatives la
   * centrent sur le point touché.
   */
  .joystick__base {
    position: fixed;
    width: 112px;
    height: 112px;
    margin: -56px 0 0 -56px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    background: rgba(19, 10, 34, 0.5);
    pointer-events: none;
  }

  .joystick__nub {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    background: rgba(58, 30, 84, 0.95);
    transform: translate(-50%, -50%);
  }

  .mobile-controls__read {
    width: min(42%, 164px);
    min-height: 56px;
    padding: 10px 8px;
    border: 2px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(19, 10, 34, 0.86);
    color: var(--bone);
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    pointer-events: auto;
  }

  .mobile-controls__read:disabled {
    color: var(--text-faint);
    opacity: 0.82;
  }

  /* Panneaux et toasts passent au-dessus du dock, sinon les boutons les avalent. */
  .pilgrim-panel {
    right: 10px;
    bottom: var(--mobile-hud-clearance);
    left: 10px;
    z-index: 7;
    width: auto;
    max-height: min(420px, 56svh);
  }

  .toast {
    bottom: var(--mobile-hud-clearance);
    z-index: 95;
  }

  .modal {
    align-items: end;
    padding: 0;
  }

  .tomb {
    width: 100%;
    max-height: min(88svh, 720px);
    overflow-y: auto;
    padding: 48px 20px calc(20px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .tomb button,
  .tomb input {
    min-height: 44px;
  }

  .tomb__close {
    width: 44px;
    height: 44px;
    top: 4px;
    right: 8px;
  }
}

/*
 * Ergonomie tactile, sans borne de largeur : une tablette de 1024px a un doigt
 * comme un téléphone, et les blocs ci-dessus s'arrêtent à 820px.
 */
@media (pointer: coarse) {
  /*
   * 16px pile : en dessous, Safari iOS zoome à la mise au point du champ et ne
   * dézoome jamais. Sur le formulaire d'inhumation ça casse le tunnel d'achat.
   */
  .field__input,
  .hud__pseudo-input,
  input[type="text"],
  input[type="email"],
  input[type="search"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px;
  }

  /*
   * 44px : la cible minimale recommandée par Apple comme par Google. Ne sont
   * visés que les contrôles autonomes — un lien au fil d'une phrase (`Terms` et
   * `Privacy` dans la case de consentement, le crédit du pack en pied de page)
   * garde la hauteur de sa ligne, sinon la phrase se disloque.
   */
  .btn--sm,
  .pager__page,
  .locale-switch__btn,
  .tier-option,
  .footer__legal a,
  .footer__legal-btn {
    min-height: 44px;
  }

  .locale-switch__btn {
    min-width: 44px;
    padding: 6px 10px;
  }

  .pager__page {
    min-width: 44px;
  }

  /* Les pastilles de quartier et les liens du pied de page sont du texte : sans
   * passage en flex, `min-height` allonge la boîte sans recentrer le libellé. */
  .tier-option,
  .footer__legal a,
  .footer__legal-btn {
    display: inline-flex;
    align-items: center;
  }

  /* « Terms » ne fait que 39px de large : trois pixels de chaque côté suffisent
   * à passer la barre sans écarter visiblement la rangée. */
  .footer__legal a,
  .footer__legal-btn {
    padding: 0 3px;
  }

  /* Le logo est un lien vers #top. On l'épaissit autant que la barre le permet :
   * viser 44px ferait déborder une barre haute de 49px. */
  .nav__brand {
    padding: 6px 2px;
  }
}

@media (max-width: 480px) and (pointer: fine) {
  .modal {
    padding: 12px;
  }

  .tomb {
    width: calc(100vw - 24px);
    padding: 46px 20px 24px;
  }
}

@media (max-width: 480px) {
  .nav__actions {
    gap: 6px;
  }

  .nav__actions > .btn {
    display: none;
  }

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

  .tomb__foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .hud__zone-name {
    max-width: 92px;
  }

  /* Pas de survol au doigt : l'infobulle laisse la place à #zone-hint. */
  .zone-tip {
    display: none !important;
  }

  .zone-option__name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
