:root {
  --bg: #0b1017;
  --bg-soft: #111a24;
  --ink: #e6edf3;
  --accent: #3ec6e0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Léger halo pour l'ambiance "souterrain" */
  background-image:
    radial-gradient(circle at 50% 0%, #16202c 0%, #0b1017 55%),
    radial-gradient(circle at 50% 100%, #101a26 0%, transparent 60%);
}

#game {
  width: 100%;
  height: 100%;
}

#game canvas {
  display: block;
  /* Force un rendu net du canvas mis à l'échelle par Phaser FIT */
  image-rendering: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  /* Le glisser-déposer ne doit ni faire défiler la page ni zoomer */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* En portrait, le puzzle (prévu pour le paysage) est masqué par une invite. */
.rotate {
  display: none;
}

@media (orientation: portrait) {
  .rotate {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
    background: var(--bg);
  }

  .rotate__icon {
    font-size: 3.4rem;
    line-height: 1;
  }

  .rotate__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
  }

  .rotate__hint {
    font-size: 1rem;
    color: #8fa3b8;
  }
}

.fallback {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  text-align: center;
  padding: 2rem;
}
